@ghostlytools/cli 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +16 -11
  2. package/dist/assets/{api-CHD8_kcJ.js → api-BIg0Msax.js} +2 -2
  3. package/dist/assets/{api-CMohP9Pw.js → api-d2aXkbM5.js} +341 -114
  4. package/dist/assets/api-d2aXkbM5.js.map +1 -0
  5. package/dist/assets/{apiKit-CfwVtBcw.js → apiKit-Ba_t7MZO.js} +4 -4
  6. package/dist/assets/apiKit-Ba_t7MZO.js.map +1 -0
  7. package/dist/assets/{apps-733nXRBy.js → apps-B_F3gEI4.js} +1 -1
  8. package/dist/assets/{apps-LG-QOIxs.js → apps-CJo1MmSY.js} +17 -16
  9. package/dist/assets/apps-CJo1MmSY.js.map +1 -0
  10. package/dist/assets/{arkade-C8x3Efyj.js → arkade-DTne0O3Q.js} +12 -5
  11. package/dist/assets/arkade-DTne0O3Q.js.map +1 -0
  12. package/dist/assets/{backup-CfJenOQo.js → backup-BY88aZr5.js} +11 -8
  13. package/dist/assets/backup-BY88aZr5.js.map +1 -0
  14. package/dist/assets/{backup-nCbNWJ7-.js → backup-CqpDAZZG.js} +1 -1
  15. package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
  16. package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
  17. package/dist/assets/{blobFiles-1wUBd8ZD.js → blobFiles-B1lX6iGy.js} +3 -3
  18. package/dist/assets/{blobFiles-1wUBd8ZD.js.map → blobFiles-B1lX6iGy.js.map} +1 -1
  19. package/dist/assets/{buttons-BC0stvPg.js → buttons-B5EnA2nh.js} +23 -6
  20. package/dist/assets/buttons-B5EnA2nh.js.map +1 -0
  21. package/dist/assets/buttons-azvbN6xn.js +2 -0
  22. package/dist/assets/{daemonProof-CWTVNUmr.js → daemonProof-Dx3N_DLC.js} +19 -37
  23. package/dist/assets/daemonProof-Dx3N_DLC.js.map +1 -0
  24. package/dist/assets/{endpoint-Cl3cgAYl.js → endpoint-BdaeBw2L.js} +3 -3
  25. package/dist/assets/endpoint-BdaeBw2L.js.map +1 -0
  26. package/dist/assets/{envelope-BbvUBjc5.js → envelope-BU-BB1wR.js} +2 -2
  27. package/dist/assets/{envelope-BbvUBjc5.js.map → envelope-BU-BB1wR.js.map} +1 -1
  28. package/dist/assets/{errors-BLSPp0tK.js → errors-DI6Z3jTH.js} +26 -1
  29. package/dist/assets/errors-DI6Z3jTH.js.map +1 -0
  30. package/dist/assets/{fileBytes-gTd_8l-P.js → fileBytes-BMlLVdfg.js} +1 -1
  31. package/dist/assets/{fileBytes-uRqLyxa0.js → fileBytes-D0CYuRwZ.js} +2 -2
  32. package/dist/assets/{fileBytes-uRqLyxa0.js.map → fileBytes-D0CYuRwZ.js.map} +1 -1
  33. package/dist/assets/{fileBytes-B8eTZfAT.js → fileBytes-D85lBh-Q.js} +3 -3
  34. package/dist/assets/{fileBytes-B8eTZfAT.js.map → fileBytes-D85lBh-Q.js.map} +1 -1
  35. package/dist/assets/fileBytesIdb-Dn9levD1.js +2 -0
  36. package/dist/assets/{fileBytesIdb-BIFKtgln.js → fileBytesIdb-LAhH7kY2.js} +7 -7
  37. package/dist/assets/fileBytesIdb-LAhH7kY2.js.map +1 -0
  38. package/dist/assets/{fileBytesOpfs-ChrHcCVV.js → fileBytesOpfs-DjBBghvq.js} +3 -3
  39. package/dist/assets/{fileBytesOpfs-ChrHcCVV.js.map → fileBytesOpfs-DjBBghvq.js.map} +1 -1
  40. package/dist/assets/{ghostly_iroh_web-BsAEFIjl.js → ghostly_iroh_web-BXCsSxxo.js} +29 -29
  41. package/dist/assets/{ghostly_iroh_web-BsAEFIjl.js.map → ghostly_iroh_web-BXCsSxxo.js.map} +1 -1
  42. package/dist/assets/ghostly_iroh_web_bg.wasm +0 -0
  43. package/dist/assets/{groupFiles-Bmo-SkVQ.js → groupFiles-D9k6fyhf.js} +61 -17
  44. package/dist/assets/groupFiles-D9k6fyhf.js.map +1 -0
  45. package/dist/assets/{host-DxDRCRKD.js → host-DrL7FPG4.js} +125 -47
  46. package/dist/assets/host-DrL7FPG4.js.map +1 -0
  47. package/dist/assets/{hyperdhtRelay-CZfsPfT9.js → hyperdhtRelay-C-BsT6_V.js} +2 -2
  48. package/dist/assets/{hyperdhtRelay-CZfsPfT9.js.map → hyperdhtRelay-C-BsT6_V.js.map} +1 -1
  49. package/dist/assets/{idb-BJARz3Qi.js → idb-CWvq4HKc.js} +25 -3
  50. package/dist/assets/{idb-BJARz3Qi.js.map → idb-CWvq4HKc.js.map} +1 -1
  51. package/dist/assets/{irohWeb-BUvaADop.js → irohWeb-DdHXEwgj.js} +3 -3
  52. package/dist/assets/{irohWeb-BUvaADop.js.map → irohWeb-DdHXEwgj.js.map} +1 -1
  53. package/dist/assets/{main-BIXIs84L.js → main-xeoX7yLM.js} +160 -50
  54. package/dist/assets/main-xeoX7yLM.js.map +1 -0
  55. package/dist/assets/{mainline-HQVJ5ukA.js → mainline-CEqGvRYJ.js} +46 -16
  56. package/dist/assets/mainline-CEqGvRYJ.js.map +1 -0
  57. package/dist/assets/{networkReason-CKBiFTwt.js → networkReason-RGRU5xoa.js} +3 -3
  58. package/dist/assets/{networkReason-CKBiFTwt.js.map → networkReason-RGRU5xoa.js.map} +1 -1
  59. package/dist/assets/{nwc-Dm4RSvvF.js → nwc-s5xHLqNf.js} +3 -3
  60. package/dist/assets/{nwc-Dm4RSvvF.js.map → nwc-s5xHLqNf.js.map} +1 -1
  61. package/dist/assets/{nwcProvider-yQdL-DfC.js → nwcProvider-CfAFO5Fr.js} +2 -2
  62. package/dist/assets/{nwcProvider-yQdL-DfC.js.map → nwcProvider-CfAFO5Fr.js.map} +1 -1
  63. package/dist/assets/{profiles-BehWURA9.js → profiles-gZdQPyaz.js} +74 -13
  64. package/dist/assets/profiles-gZdQPyaz.js.map +1 -0
  65. package/dist/assets/{registry-CHVZ0Jzl.js → registry-BUhSjM-J.js} +1 -1
  66. package/dist/assets/{registry-C9f2Ogff.js → registry-CVUdD4bJ.js} +3 -3
  67. package/dist/assets/{registry-C9f2Ogff.js.map → registry-CVUdD4bJ.js.map} +1 -1
  68. package/dist/assets/{resolve-Cqj1jjK2.js → resolve-uZECJ3f7.js} +2 -2
  69. package/dist/assets/{resolve-Cqj1jjK2.js.map → resolve-uZECJ3f7.js.map} +1 -1
  70. package/dist/assets/{restoredRows-DGuKtIBz.js → restoredRows-D6WZUA2U.js} +2 -2
  71. package/dist/assets/{restoredRows-DGuKtIBz.js.map → restoredRows-D6WZUA2U.js.map} +1 -1
  72. package/dist/assets/{server-CcAs54Yb.js → server-DOtUKoYR.js} +776 -248
  73. package/dist/assets/server-DOtUKoYR.js.map +1 -0
  74. package/dist/assets/{src-BLHey3Q1.js → src-Dd_7Ew1X.js} +459 -129
  75. package/dist/assets/src-Dd_7Ew1X.js.map +1 -0
  76. package/dist/assets/{usdt-DMKpMhdM.js → usdt-C2Anx8p7.js} +3 -3
  77. package/dist/assets/{usdt-DMKpMhdM.js.map → usdt-C2Anx8p7.js.map} +1 -1
  78. package/dist/assets/{words-DUlvkoUT.js → words-DoLU6p8H.js} +4 -4
  79. package/dist/assets/words-DoLU6p8H.js.map +1 -0
  80. package/dist/ghostly.mjs +1 -1
  81. package/package.json +1 -1
  82. package/dist/assets/api-CMohP9Pw.js.map +0 -1
  83. package/dist/assets/apiKit-CfwVtBcw.js.map +0 -1
  84. package/dist/assets/apps-LG-QOIxs.js.map +0 -1
  85. package/dist/assets/arkade-C8x3Efyj.js.map +0 -1
  86. package/dist/assets/backup-CfJenOQo.js.map +0 -1
  87. package/dist/assets/buttons-BC0stvPg.js.map +0 -1
  88. package/dist/assets/buttons-BDKeKyKw.js +0 -2
  89. package/dist/assets/daemonProof-CWTVNUmr.js.map +0 -1
  90. package/dist/assets/endpoint-Cl3cgAYl.js.map +0 -1
  91. package/dist/assets/errors-BLSPp0tK.js.map +0 -1
  92. package/dist/assets/fileBytesIdb-BIFKtgln.js.map +0 -1
  93. package/dist/assets/fileBytesIdb-BVVr_rWX.js +0 -2
  94. package/dist/assets/groupFiles-Bmo-SkVQ.js.map +0 -1
  95. package/dist/assets/host-DxDRCRKD.js.map +0 -1
  96. package/dist/assets/main-BIXIs84L.js.map +0 -1
  97. package/dist/assets/mainline-HQVJ5ukA.js.map +0 -1
  98. package/dist/assets/profiles-BehWURA9.js.map +0 -1
  99. package/dist/assets/server-CcAs54Yb.js.map +0 -1
  100. package/dist/assets/src-BLHey3Q1.js.map +0 -1
  101. package/dist/assets/words-DUlvkoUT.js.map +0 -1
@@ -183,6 +183,24 @@ function trimEndOf(text, chars) {
183
183
  while (end > 0 && chars.includes(text[end - 1])) end--;
184
184
  return end === text.length ? text : text.slice(0, end);
185
185
  }
186
+ /** What a token is copied with before it: quotes, guillemets, brackets, a backtick. */
187
+ var PASTE_OPENERS = "\"'“‘«‹<[({`";
188
+ /** What a token is copied with after it: those closed, and a sentence's marks. */
189
+ var PASTE_CLOSERS = "\"'”’»›>])}`.,!?;:…";
190
+ var PASTE_SPACES = " \n\r\xA0 ";
191
+ /**
192
+ * The token in what someone copied with the words around it: an invite, a group's link or a device code from the end
193
+ * of "Join us: <https://…#ghostly1…>!", "« ghostly1… »" or "code: ghostly1…". The last word, without the quotes,
194
+ * brackets and marks before and after it. Readers try it only once the paste itself did not read, so a bare token
195
+ * reads as it always did and a token with a character lost is still refused as one.
196
+ */
197
+ function unwrapPasted(text) {
198
+ const words = trimEndOf(text.trim(), PASTE_CLOSERS + PASTE_SPACES).split(/\s+/);
199
+ const last = words[words.length - 1] ?? "";
200
+ let start = 0;
201
+ while (start < last.length && PASTE_OPENERS.includes(last[start])) start++;
202
+ return trimEndOf(last.slice(start), PASTE_CLOSERS);
203
+ }
186
204
  //#endregion
187
205
  //#region ../core/src/avatar.ts
188
206
  /**
@@ -631,6 +649,10 @@ function withRequestOptions(transport, extra) {
631
649
  if (transport.networkChanged) wrapped.networkChanged = () => transport.networkChanged();
632
650
  if (transport.readAnsweredAt) wrapped.readAnsweredAt = (pubKeyZ32) => transport.readAnsweredAt(pubKeyZ32);
633
651
  if (transport.readHeldBackFor) wrapped.readHeldBackFor = (pubKeyZ32) => transport.readHeldBackFor(pubKeyZ32);
652
+ if (transport.publishHeld) wrapped.publishHeld = (pubKeyZ32, options) => transport.publishHeld(pubKeyZ32, {
653
+ ...options,
654
+ ...extra
655
+ });
634
656
  if (transport.onServerTime) wrapped.onServerTime = (listener) => transport.onServerTime(listener);
635
657
  if (transport.configure) wrapped.configure = (options) => transport.configure(options);
636
658
  if (transport.turnRead) wrapped.turnRead = (pubKeyZ32, options) => transport.turnRead(pubKeyZ32, options);
@@ -1368,6 +1390,12 @@ var RelayTransport = class {
1368
1390
  if (!pending || !await pending) throw error;
1369
1391
  }
1370
1392
  }
1393
+ /** `PkarrTransport.publishHeld`: `publishDated`'s check before signing, for a payload signed elsewhere in this process. */
1394
+ publishHeld(pubKeyZ32, options = {}) {
1395
+ if (this.relays.length === 0) return null;
1396
+ const held = this.publishWait(pubKeyZ32, asker(options, true));
1397
+ return held ? new DiscoveryBudgetError(held.wait, `Publish held back on every relay: ${held.reasons.join("; ")}`) : null;
1398
+ }
1371
1399
  /**
1372
1400
  * How long until some relay takes a publish of this asker, and why each holds it back; null when one would now. Walks the relays as `put` does,
1373
1401
  * without asking any: a relay the budget holds back gets its refused `take` (the asker's write then waits first in
@@ -1796,6 +1824,10 @@ var RelayTransport = class {
1796
1824
  readAnsweredAt(pubKeyZ32) {
1797
1825
  return this.readAt.get(pubKeyZ32);
1798
1826
  }
1827
+ /** The last read of this key was answered 404 (`HEDGE_MISSING_MS`): a relay takes seconds to say so. */
1828
+ lastReadMissing(pubKeyZ32) {
1829
+ return this.missing.has(pubKeyZ32);
1830
+ }
1799
1831
  readHeldBackFor(pubKeyZ32) {
1800
1832
  const held = this.heldBack.get(pubKeyZ32);
1801
1833
  const left = held === void 0 ? 0 : held.until - Date.now();
@@ -3312,11 +3344,14 @@ function readSlashForm(code) {
3312
3344
  function readInviteCode(input) {
3313
3345
  const reading = readInviteForm(input);
3314
3346
  if (reading.ok) return reading;
3315
- const bare = trimEndOf(input.trim(), ".,)!");
3316
- if (bare !== input.trim()) {
3317
- const again = readInviteForm(bare);
3318
- if (again.ok) return again;
3319
- }
3347
+ return pastedAgain(input, reading, readInviteForm);
3348
+ }
3349
+ /** `reading` of `input`, or the reading of the token in it (`unwrapPasted`) when that reads or says more. */
3350
+ function pastedAgain(input, reading, read) {
3351
+ const bare = unwrapPasted(input);
3352
+ if (bare === input.trim() || !bare) return reading;
3353
+ const again = read(bare);
3354
+ if (again.ok || !reading.ok && reading.reason === "not-ghostly") return again;
3320
3355
  return reading;
3321
3356
  }
3322
3357
  function readInviteForm(input) {
@@ -3429,8 +3464,8 @@ function encodeDeviceInvite(invite) {
3429
3464
  new DataView(payload.buffer).setUint32(129, invite.expires);
3430
3465
  return bech32m.encode(INVITE_HRP, [2, ...bech32m.toWords(payload)], false);
3431
3466
  }
3432
- /** The code inside whatever was pasted or scanned: after the last `#`, trimmed. */
3433
- var body$1 = (input) => trimEndOf(input.trim().replace(/^.*#/, ""), ".,)!");
3467
+ /** The code inside whatever was pasted or scanned: the token in it (`unwrapPasted`), after its last `#`. */
3468
+ var body$1 = (input) => unwrapPasted(input).replace(/^.*#/, "");
3434
3469
  /**
3435
3470
  * Reads a device code, pasted or scanned (bare, in capitals from a QR code, or after a `#`). `now` is in UNIX
3436
3471
  * seconds: a code past its expiry is refused here already, though only the inviter's word counts.
@@ -3620,12 +3655,7 @@ function read(input) {
3620
3655
  function readContactLink(input) {
3621
3656
  const reading = read(input);
3622
3657
  if (reading.ok) return reading;
3623
- const bare = trimEndOf(input.trim(), ".,)!");
3624
- if (bare !== input.trim()) {
3625
- const again = read(bare);
3626
- if (again.ok) return again;
3627
- }
3628
- return reading;
3658
+ return pastedAgain(input, reading, read);
3629
3659
  }
3630
3660
  /** A new contact link: the owner keeps `seedB64` in its profile and hands out `code`. */
3631
3661
  function createContactLink() {
@@ -7741,6 +7771,13 @@ var LinkSession = class {
7741
7771
  fastStepsAfter = 0;
7742
7772
  /** When the last `expectPeer` window ends (or ended): the pace slows down from there step by step. */
7743
7773
  expectUntil = 0;
7774
+ /**
7775
+ * Until when this link's reads go as a resume's (`PkarrRequestOptions.resume`: a group edge's on the relays' floor):
7776
+ * the peer is due now and nothing reaches it until its packet is read (`expectPeer(true)`: the edge to a member a hub
7777
+ * just let in). As plain fast reads, a hub's admissions in a row spent the budget and the newcomer's edge waited for it:
7778
+ * 22-39 s before it could send, receive or leave (agents#1740). Ends once a read finds the peer's packet.
7779
+ */
7780
+ awaitedUntil = 0;
7744
7781
  watchUntil = 0;
7745
7782
  /** The time of the peer's packet read last when it went away (`watchPeer`): a newer one that advertises says it is back. */
7746
7783
  watchFrom = 0;
@@ -7890,9 +7927,10 @@ var LinkSession = class {
7890
7927
  * The peer, or its offer, is due any moment: poll fast for `EXPECT_PEER_MS` (never cutting a longer fast window short),
7891
7928
  * then slow down step by step (`nextInterval`) rather than at once.
7892
7929
  */
7893
- expectPeer() {
7930
+ expectPeer(awaited = false) {
7894
7931
  const until = Date.now() + EXPECT_PEER_MS;
7895
7932
  this.expectUntil = Math.max(this.expectUntil, until);
7933
+ if (awaited) this.awaitedUntil = Math.max(this.awaitedUntil, until);
7896
7934
  const stepping = this.fastStepsAfter > 0 && Date.now() >= this.fastStepsAfter;
7897
7935
  if (this.fastStepsAfter) this.fastStepsAfter = Math.max(this.fastStepsAfter, until);
7898
7936
  if (until <= this.fastPollUntil) {
@@ -8209,7 +8247,7 @@ var LinkSession = class {
8209
8247
  const watch = !signal && this.watching();
8210
8248
  const departed = !signal && Date.now() < this.departedUntil;
8211
8249
  const background = pace === "background" || pace === "connected";
8212
- const resume = !signal && !watch && this.resumeReads;
8250
+ const resume = !signal && !watch && (this.resumeReads || Date.now() < this.awaitedUntil);
8213
8251
  const packet = await this.transport.resolve(this.peerPubKeyZ32, {
8214
8252
  background,
8215
8253
  urgent: pace === "fast",
@@ -8227,6 +8265,7 @@ var LinkSession = class {
8227
8265
  const read = answered !== void 0 && answered >= started;
8228
8266
  if (read) this.lastReadAt = started;
8229
8267
  if (read || !this.transport.readAnsweredAt) this.resumeReads = false;
8268
+ if (packet && (read || !this.transport.readAnsweredAt)) this.awaitedUntil = 0;
8230
8269
  this.readMissed = !!this.transport.readAnsweredAt && !read;
8231
8270
  if (this.readMissed) heldBackMs = this.transport.readHeldBackFor?.(this.peerPubKeyZ32);
8232
8271
  let receivedNew = false;
@@ -10569,25 +10608,6 @@ function voiceLevel(samples) {
10569
10608
  for (let i = 0; i < samples.length; i++) sum += samples[i] * samples[i];
10570
10609
  return Math.min(1, Math.sqrt(sum / samples.length) * 4);
10571
10610
  }
10572
- /**
10573
- * The readings the recorder would have taken of this sound (mono, -1 to 1), for a recording made elsewhere: one
10574
- * every `intervalMs` of it, each over the window that ends there, as long in time as the analyser's.
10575
- */
10576
- function voiceLevelsOf(mono, sampleRate) {
10577
- if (!(sampleRate > 0) || mono.length === 0) return [];
10578
- const window = Math.max(1, Math.round(VOICE_METER.window * sampleRate / VOICE_METER.windowRate));
10579
- const levels = [];
10580
- for (let step = 1;; step++) {
10581
- const end = Math.round(step * VOICE_METER.intervalMs * sampleRate / 1e3);
10582
- if (end > mono.length) break;
10583
- levels.push(voiceLevel(mono.subarray(Math.max(0, end - window), end)));
10584
- }
10585
- return levels;
10586
- }
10587
- /** The waveform sent with a recording made elsewhere, drawn as the recorder draws its own. */
10588
- function voicePeaksOf(mono, sampleRate, bars = VOICE_LIMITS.bars) {
10589
- return downsamplePeaks(voiceLevelsOf(mono, sampleRate), bars);
10590
- }
10591
10611
  /** Below this a recording is silence, and is drawn flat rather than stretched to fill the bars. */
10592
10612
  var QUIET = .02;
10593
10613
  /**
@@ -10659,6 +10679,11 @@ var INVISIBLE = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu;
10659
10679
  */
10660
10680
  var BLANK = /[\u034F\u115F\u1160\u2800\u3164\uFFA0]/gu;
10661
10681
  /**
10682
+ * A run of whitespace, with the marks that sit on it: a mark that draws nothing (a variation selector, a Mongolian or
10683
+ * Khmer one) between two spaces must not keep them apart, or " \uFE0F" repeated is a blank run again.
10684
+ */
10685
+ var SPACE_RUN = /(?:\s\p{M}*)+/gu;
10686
+ /**
10662
10687
  * Names Windows keeps for devices, whatever the case, with any extension, and with spaces before the dot:
10663
10688
  * "CON", "nul.txt", "COM1 .log" open a device there, not a file.
10664
10689
  */
@@ -10675,7 +10700,7 @@ function shorten(name) {
10675
10700
  }
10676
10701
  /** A file name is display text and a download suggestion, never a path. */
10677
10702
  function sanitizeFileName(name) {
10678
- const clean = shorten(name.replace(INVISIBLE, "").replace(BLANK, "").replace(/[/\\:]/g, "").replace(/\s+/gu, " ").replace(/^[\s.]+/, "").trim());
10703
+ const clean = shorten(name.replace(INVISIBLE, "").replace(BLANK, "").replace(/[/\\:]/g, "").replace(SPACE_RUN, " ").replace(/^[\s.]+/, "").trim());
10679
10704
  if (WINDOWS_DEVICE.test(clean)) return shorten("_" + clean);
10680
10705
  return clean || "file";
10681
10706
  }
@@ -11611,7 +11636,7 @@ var DhtDelivery = class DhtDelivery {
11611
11636
  const receiptDue = !!receipt && !receipt.settled && (receipt.next ?? 0) <= now;
11612
11637
  const reseal = this.resealDue;
11613
11638
  const keepAlive = !force && (!pending || pending.next > now) && !receiptDue && !this.reactionsDue && !reseal;
11614
- if (keepAlive && (this.controlDue > now || this.state.inviteTaken && !this.options.credentials.peerKey)) return;
11639
+ if (keepAlive && (this.controlDue > now || this.state.inviteTaken)) return;
11615
11640
  const expires = pending?.expires ?? now - 12e4 + CONTROL_TTL;
11616
11641
  const issued = Math.min(now, Math.max(now - DHT_ISSUED_BACK_MS, expires - (pending ? DHT_MESSAGE_TTL : CONTROL_TTL), (pending?.message[1] ?? 0) - 3e4));
11617
11642
  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);
@@ -14152,9 +14177,17 @@ var CapsKeys = class {
14152
14177
  this.peerAddress = identityFromSeed(derive(`caps:${this.to}`)).pubKeyZ32;
14153
14178
  this.inviteKey = derive("envelope");
14154
14179
  }
14180
+ /** The key sealed for each pinned contact: one X25519 per contact and link, not one per seal and open (agents#1087). */
14181
+ pinned = /* @__PURE__ */ new Map();
14155
14182
  pinnedKey(peer) {
14156
- const shared = x25519.getSharedSecret(ed25519.utils.toMontgomerySecret(this.seed), ed25519.utils.toMontgomery(publicKeyFromZ32(peer)));
14157
- return hkdf(sha256, shared, this.inviteKey, utf8Encode("ghostly-caps-participation/1"), 32);
14183
+ let key = this.pinned.get(peer);
14184
+ if (!key) {
14185
+ const shared = x25519.getSharedSecret(ed25519.utils.toMontgomerySecret(this.seed), ed25519.utils.toMontgomery(publicKeyFromZ32(peer)));
14186
+ key = hkdf(sha256, shared, this.inviteKey, utf8Encode("ghostly-caps-participation/1"), 32);
14187
+ if (this.pinned.size >= 4) this.pinned.delete(this.pinned.keys().next().value);
14188
+ this.pinned.set(peer, key);
14189
+ }
14190
+ return key;
14158
14191
  }
14159
14192
  signable(from, to, body) {
14160
14193
  return utf8Encode(JSON.stringify([
@@ -15329,6 +15362,10 @@ var PairedSession = class {
15329
15362
  get peerAllowsFallback() {
15330
15363
  return this.peer?.capabilities.includes("transport-fallback/1") ?? false;
15331
15364
  }
15365
+ /** Frames received from the peer and not handled yet (the one being handled included). */
15366
+ get waiting() {
15367
+ return this.pending;
15368
+ }
15332
15369
  start() {
15333
15370
  const binding = this.options.binding;
15334
15371
  if (!(binding ? (binding.transport === "hyperdht/1" ? /^[a-f0-9]{128}$/.test(binding.context) : FINGERPRINT.test(binding.context)) && binding.identities.length === 2 && binding.identities.every((k) => FINGERPRINT.test(k)) && binding.identities[0] !== binding.identities[1] : this.options.fingerprints?.length === 2 && this.options.fingerprints.every((f) => FINGERPRINT.test(f))) || !this.offer.transports.includes(this.transport) || this.options.rendezvousKeys.some((k) => !isZ32Key(k))) return this.fail("Invalid connection binding or unavailable transport");
@@ -16314,6 +16351,13 @@ var AppRanges = class {
16314
16351
  release(task) {
16315
16352
  this.take(task);
16316
16353
  }
16354
+ /**
16355
+ * Whether `task` is still this session's: serving, or cancelled and draining until it is settled. False once it was
16356
+ * settled, or its app closed or the session ended, which free its place: an answer to it sends and frees nothing.
16357
+ */
16358
+ holds(task) {
16359
+ return this.draining.has(task) || this.serving.get(slot(task.app, task.request)) === task;
16360
+ }
16317
16361
  /** Reads `length` bytes at `offset` of what the contact's `app` serves as `serve`: the bytes (fewer at the end) and the file's size. */
16318
16362
  read(app, serve, offset, length) {
16319
16363
  appRangeGetFrame(app, serve, 0, offset, length);
@@ -17094,6 +17138,109 @@ function transferStalled(record, movedAt, restored, now) {
17094
17138
  if (record.direction === "in" && record.state === "verifying") return false;
17095
17139
  return restored || now - movedAt >= FILE_LIMITS.stallMs;
17096
17140
  }
17141
+ /**
17142
+ * The uplink several chats' files leave the device by. Each chat paces its files by its own path (`FilePace`), down to
17143
+ * a floor of `FILE_LIMITS.minWindowBytes`; on one uplink, that floor is shared out among the chats sending at once.
17144
+ * Each with a floor of its own, a member serving a file to three members on a 1 Mbit/s uplink kept 192 KiB in flight,
17145
+ * and everything else it sent (texts, a ring, a call's voice) waited 1-2 s behind them, up to 5.8 s (agents#1569). A
17146
+ * chat whose receiver barely confirms holds only its share, never the others' bytes. Each chat also reads the queue
17147
+ * against the lowest round trip of the uplink's chats, not its own alone (`lowestBase`).
17148
+ */
17149
+ var FileUplink = class {
17150
+ members = /* @__PURE__ */ new Set();
17151
+ join(member) {
17152
+ this.members.add(member);
17153
+ }
17154
+ leave(member) {
17155
+ this.members.delete(member);
17156
+ }
17157
+ /**
17158
+ * The floor of one chat's window: its share of `minWindowBytes` among the chats sending, in whole chunks, a chunk at
17159
+ * least (a window sends chunks while what is in flight is under it: 21 KiB would let two go).
17160
+ */
17161
+ floor() {
17162
+ let sending = 0;
17163
+ for (const member of this.members) if (member.sending()) sending++;
17164
+ const share = FILE_LIMITS.minWindowBytes / Math.max(1, sending);
17165
+ return Math.max(FILE_LIMITS.chunkBytes, Math.floor(share / FILE_LIMITS.chunkBytes) * FILE_LIMITS.chunkBytes);
17166
+ }
17167
+ /**
17168
+ * The shortest round trip any chat on the uplink saw: its path with the least queue. Each chat's own counts the
17169
+ * others' queue on the shared uplink as its path (428-637 ms read on a 1-10 ms path), and so never sees one.
17170
+ */
17171
+ lowestBase() {
17172
+ let lowest = Infinity;
17173
+ for (const member of this.members) lowest = Math.min(lowest, member.baseRtt());
17174
+ return lowest;
17175
+ }
17176
+ };
17177
+ /** How much one chat's files may have in flight on its session, sized by the path (delay-based, as LEDBAT: `paced`). */
17178
+ var FilePace = class {
17179
+ /** Bytes the files may have in flight together: sized by the path, from the confirms (`paced`). */
17180
+ window = FILE_LIMITS.minWindowBytes;
17181
+ /** The shortest round trip of a chunk to its confirm: the path without a queue. */
17182
+ baseRtt = Infinity;
17183
+ /** When a confirm last came close to `baseRtt`, or a probe measured it. */
17184
+ baseAt = 0;
17185
+ /** The path's own round trip is being measured: one chunk in flight from `since`, until one sent then is confirmed. */
17186
+ probe;
17187
+ /** A confirm has sized the window on this path. */
17188
+ sized = false;
17189
+ /** Another path (a session of its own opened): what was learnt of the old one goes. */
17190
+ reset() {
17191
+ this.window = FILE_LIMITS.minWindowBytes;
17192
+ this.baseRtt = Infinity;
17193
+ this.baseAt = 0;
17194
+ this.probe = void 0;
17195
+ this.sized = false;
17196
+ }
17197
+ /** The shortest round trip seen on this path. */
17198
+ get base() {
17199
+ return this.baseRtt;
17200
+ }
17201
+ /**
17202
+ * What may be in flight now: one chunk while the path's own round trip is measured, else the window; before any
17203
+ * confirm sized it, no more than `floor` (the chat's share of an uplink it shares: three edges starting at once each
17204
+ * sent their whole 64 KiB, 1.5 s of queue at 1 Mbit/s).
17205
+ */
17206
+ limit(floor) {
17207
+ return this.probe ? FILE_LIMITS.chunkBytes : this.sized ? this.window : Math.min(this.window, floor);
17208
+ }
17209
+ /**
17210
+ * A confirm came for a chunk sent at `sentAt` with `flight` bytes in flight then: the window becomes what keeps the path
17211
+ * busy with no more than `FILE_LIMITS.queueMs` of queue on it (delay-based, as LEDBAT). Throughput is about
17212
+ * flight / rtt, so flight × (base + queueMs) / rtt: it grows while confirms come about as fast as they can, and shrinks
17213
+ * when they slow down because the files queue on a slow uplink, ahead of everything else the sender says there.
17214
+ * The base is measured again once no confirm has come close to it for `FILE_LIMITS.baseProbeMs`: with one chunk in
17215
+ * flight, so the queue drains first and a slow link's own queue never passes for a longer path. `floor`: the least
17216
+ * the window is, `minWindowBytes` or the chat's share of an uplink it shares (`FileUplink.floor`).
17217
+ */
17218
+ paced(sentAt, flight, now, floor = FILE_LIMITS.minWindowBytes, lowest = Infinity) {
17219
+ const rtt = Math.max(1, now - sentAt);
17220
+ this.sized = true;
17221
+ if (this.probe) {
17222
+ if (sentAt < this.probe.since) return;
17223
+ this.baseRtt = rtt;
17224
+ this.baseAt = now;
17225
+ this.window = this.probe.window;
17226
+ this.probe = void 0;
17227
+ return;
17228
+ }
17229
+ if (rtt - this.baseRtt < FILE_LIMITS.queueMs / 2) this.baseAt = now;
17230
+ this.baseRtt = Math.min(this.baseRtt, rtt);
17231
+ if (now - this.baseAt > FILE_LIMITS.baseProbeMs) {
17232
+ this.probe = {
17233
+ since: now,
17234
+ window: this.window
17235
+ };
17236
+ return;
17237
+ }
17238
+ const base = Math.min(this.baseRtt, lowest);
17239
+ const fits = Math.max(flight * (base + FILE_LIMITS.queueMs) / rtt, rtt - base < FILE_LIMITS.queueMs / 2 ? 2 * flight : 0);
17240
+ const window = flight < this.window / 2 ? Math.max(this.window, fits) : fits;
17241
+ this.window = Math.min(FILE_LIMITS.chatWindowBytes, Math.max(floor, Math.round(window)));
17242
+ }
17243
+ };
17097
17244
  var key = (direction, id) => `${direction}:${id}`;
17098
17245
  var isInt$1 = (value, max = Number.MAX_SAFE_INTEGER) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 && value <= max;
17099
17246
  var FILE_DATA_OFFSET_BYTES = 8;
@@ -17169,17 +17316,23 @@ var ChatFiles = class {
17169
17316
  held = /* @__PURE__ */ new Set();
17170
17317
  attached = false;
17171
17318
  peerRoomValue = null;
17172
- /** Bytes the chat's files may have in flight on this session: sized by the path, from the confirms (`paced`). */
17173
- window = FILE_LIMITS.minWindowBytes;
17174
- /** The shortest round trip of a chunk to its confirm on this session: the path without a queue. */
17175
- baseRtt = Infinity;
17176
- /** When a confirm last came close to `baseRtt`, or a probe measured it. */
17177
- baseAt = 0;
17178
- /** The path's own round trip is being measured: one chunk in flight from `since`, until one sent then is confirmed. */
17179
- probe;
17319
+ /** What the chat's files may have in flight, sized by the path. */
17320
+ pace = new FilePace();
17180
17321
  constructor(host) {
17181
17322
  this.host = host;
17182
17323
  }
17324
+ /** The floor of this chat's window: all of `minWindowBytes`, or its share of an uplink it shares (`FileUplink`). */
17325
+ floor() {
17326
+ return this.host.uplink?.floor() ?? FILE_LIMITS.minWindowBytes;
17327
+ }
17328
+ /** Its files are sending: bytes in flight, or held for the window (`FileUplink`). */
17329
+ sending() {
17330
+ return this.attached && (this.inFlight() > 0 || this.held.size > 0);
17331
+ }
17332
+ /** The shortest round trip this chat's files saw on its session (`FileUplink.lowestBase`). */
17333
+ baseRtt() {
17334
+ return this.pace.base;
17335
+ }
17183
17336
  now() {
17184
17337
  return this.host.now?.() ?? Date.now();
17185
17338
  }
@@ -17248,10 +17401,8 @@ var ChatFiles = class {
17248
17401
  attach() {
17249
17402
  this.attached = true;
17250
17403
  this.peerRoomValue = null;
17251
- this.window = FILE_LIMITS.minWindowBytes;
17252
- this.baseRtt = Infinity;
17253
- this.baseAt = 0;
17254
- this.probe = void 0;
17404
+ this.pace.reset();
17405
+ this.host.uplink?.join(this);
17255
17406
  this.sayRoom();
17256
17407
  this.sweep();
17257
17408
  for (const entry of this.entries.values()) {
@@ -17268,6 +17419,7 @@ var ChatFiles = class {
17268
17419
  this.peerRoomValue = null;
17269
17420
  this.moving.clear();
17270
17421
  this.held.clear();
17422
+ this.host.uplink?.leave(this);
17271
17423
  for (const entry of this.entries.values()) {
17272
17424
  if (entry.out) {
17273
17425
  entry.out.generation++;
@@ -17398,38 +17550,7 @@ var ChatFiles = class {
17398
17550
  return this.attached && record.state === "active" && out.next < record.file.size && out.next - record.confirmed < FILE_LIMITS.windowBytes;
17399
17551
  }
17400
17552
  shouldPump(entry) {
17401
- return this.fileMayPump(entry) && this.inFlight() < (this.probe ? FILE_LIMITS.chunkBytes : this.window);
17402
- }
17403
- /**
17404
- * A confirm came for a chunk sent at `sentAt` with `flight` bytes in flight then: the window becomes what keeps the path
17405
- * busy with no more than `FILE_LIMITS.queueMs` of queue on it (delay-based, as LEDBAT). Throughput is about
17406
- * flight / rtt, so flight × (base + queueMs) / rtt: it grows while confirms come about as fast as they can, and shrinks
17407
- * when they slow down because the files queue on a slow uplink, ahead of everything else the sender says there.
17408
- * The base is measured again once no confirm has come close to it for `FILE_LIMITS.baseProbeMs`: with one chunk in
17409
- * flight, so the queue drains first and a slow link's own queue never passes for a longer path.
17410
- */
17411
- paced(sentAt, flight) {
17412
- const now = this.now(), rtt = Math.max(1, now - sentAt);
17413
- if (this.probe) {
17414
- if (sentAt < this.probe.since) return;
17415
- this.baseRtt = rtt;
17416
- this.baseAt = now;
17417
- this.window = this.probe.window;
17418
- this.probe = void 0;
17419
- return;
17420
- }
17421
- if (rtt - this.baseRtt < FILE_LIMITS.queueMs / 2) this.baseAt = now;
17422
- this.baseRtt = Math.min(this.baseRtt, rtt);
17423
- if (now - this.baseAt > FILE_LIMITS.baseProbeMs) {
17424
- this.probe = {
17425
- since: now,
17426
- window: this.window
17427
- };
17428
- return;
17429
- }
17430
- const fits = Math.max(flight * (this.baseRtt + FILE_LIMITS.queueMs) / rtt, rtt - this.baseRtt < FILE_LIMITS.queueMs / 2 ? 2 * flight : 0);
17431
- const window = flight < this.window / 2 ? Math.max(this.window, fits) : fits;
17432
- this.window = Math.min(FILE_LIMITS.chatWindowBytes, Math.max(FILE_LIMITS.minWindowBytes, Math.round(window)));
17553
+ return this.fileMayPump(entry) && this.inFlight() < this.pace.limit(this.floor());
17433
17554
  }
17434
17555
  /** Bytes this chat's files sent and have not seen confirmed. */
17435
17556
  inFlight() {
@@ -18088,7 +18209,7 @@ var ChatFiles = class {
18088
18209
  record.confirmed = frame.offset;
18089
18210
  let sample;
18090
18211
  while (out.sends.length && out.sends[0].end <= frame.offset) sample = out.sends.shift();
18091
- if (sample?.generation === out.generation) this.paced(sample.at, sample.flight);
18212
+ if (sample?.generation === out.generation) this.pace.paced(sample.at, sample.flight, this.now(), this.floor(), this.host.uplink?.lowestBase());
18092
18213
  this.changed(outgoing, true);
18093
18214
  this.wakeHeld();
18094
18215
  if (record.confirmed === record.file.size) this.sendSum(outgoing);
@@ -18844,6 +18965,7 @@ var CarriedTransport = class {
18844
18965
  subscribe;
18845
18966
  networkChanged;
18846
18967
  configure;
18968
+ publishHeld;
18847
18969
  constructor(inner, myKey, peerKey, hooks) {
18848
18970
  this.inner = inner;
18849
18971
  this.myKey = myKey;
@@ -18855,6 +18977,7 @@ var CarriedTransport = class {
18855
18977
  if (inner.subscribe) this.subscribe = (listener) => inner.subscribe(listener);
18856
18978
  if (inner.networkChanged) this.networkChanged = () => inner.networkChanged();
18857
18979
  if (inner.configure) this.configure = (options) => inner.configure(options);
18980
+ if (inner.publishHeld) this.publishHeld = (key, options) => inner.publishHeld(key, options);
18858
18981
  }
18859
18982
  describe() {
18860
18983
  return this.inner.describe();
@@ -18862,16 +18985,20 @@ var CarriedTransport = class {
18862
18985
  async publish(identity, records, options) {
18863
18986
  if (this.stopped || identity.pubKeyZ32 !== this.myKey) return this.inner.publish(identity, records, options);
18864
18987
  this.drop();
18865
- const payload = this.newest = this.stamp(identity, records);
18866
18988
  if (this.hooks.open()) {
18867
- this.mine = null;
18868
- const published = this.toRelays(identity, records, payload, options?.signal ? options : {
18989
+ const relayOptions = options?.signal ? options : {
18869
18990
  ...options,
18870
18991
  background: true
18871
- });
18992
+ };
18993
+ const held = this.inner.publishHeld?.(identity.pubKeyZ32, relayOptions);
18994
+ if (held) throw held;
18995
+ this.mine = null;
18996
+ const payload = this.newest = this.stamp(identity, records);
18997
+ const published = this.toRelays(identity, records, payload, relayOptions);
18872
18998
  if (this.hooks.direct && this.inner.publishPayload) published.then(() => this.handDirect(payload), () => {});
18873
18999
  return published;
18874
19000
  }
19001
+ const payload = this.newest = this.stamp(identity, records);
18875
19002
  this.mine = payload;
18876
19003
  let carried = {
18877
19004
  taken: 0,
@@ -19138,7 +19265,8 @@ var GROUP_HAVE_FRAME = "group-have";
19138
19265
  var REFUSALS = [
19139
19266
  "gone",
19140
19267
  "busy",
19141
- "refused"
19268
+ "refused",
19269
+ "day"
19142
19270
  ];
19143
19271
  /** A group message's id, as a private group (`<s>:<e>:<n>`) or a community (`<s>:<e>:<h>:<n>`) names it. */
19144
19272
  var MESSAGE_ID = /^[a-z0-9]{52}:\d{1,15}(:[A-Za-z0-9_-]{1,64})?:\d{1,15}$/;
@@ -22000,7 +22128,7 @@ var GhostLink = class {
22000
22128
  * anyway holds (a first pairing's role, a restart, WebRTC set aside). Its own dial, chosen by hand, is not retried.
22001
22129
  */
22002
22130
  awaitsContactDial() {
22003
- return !(!!this.tracker && !this.tracker.done && this.tracker.progress.stage !== "on-dht" ? this.options.pairingProgress?.role : void 0) && this.myPubKeyZ32 > this.options.params.peerPubKeyZ32 && !this.resuming && !this.dialsPastRtc();
22131
+ return !(this.firstPairing() ? this.options.pairingProgress?.role : void 0) && this.myPubKeyZ32 > this.options.params.peerPubKeyZ32 && !this.resuming && !this.dialsPastRtc();
22004
22132
  }
22005
22133
  /** A transport of the attempt under way did not connect. */
22006
22134
  attemptFailed(transport, error) {
@@ -22357,10 +22485,26 @@ var GhostLink = class {
22357
22485
  this.lastAutoConnectAt = 0;
22358
22486
  this.maybeAutoConnect(this.presence);
22359
22487
  }
22488
+ /**
22489
+ * Still a first pairing, for its dials (`dialWait`, `awaitsContactDial`): not live yet (nor stopped for good), and
22490
+ * not on the DHT, or on it only because a native stream dial failed, within `FIRST_PAIRING_PACE_MS`. That dial was
22491
+ * the first contact between two apps that just read each other's records, and one that aborts in milliseconds (a
22492
+ * hole punch on a lossy network) dropped the pairing to a saved contact's pace, the lower key alone dialling 20 s,
22493
+ * 40 s, 80 s later: two first dials failing went live after 40 s, and not in 180 s at 15% loss (agents#1657). A
22494
+ * WebRTC offer that connected nothing keeps the saved contact's pace: the other side answers each one, and offers at
22495
+ * a pairing's pace kept it answering, never shown on the DHT.
22496
+ */
22497
+ firstPairing() {
22498
+ const progress = this.tracker && !this.tracker.done ? this.tracker.progress : void 0;
22499
+ if (!progress) return false;
22500
+ if (progress.stage !== "on-dht") return true;
22501
+ if (progress.retryable === false || Date.now() - progress.startedAt > 6e5) return false;
22502
+ return !!(this.attempt ?? this.lastAttempt)?.failed.some((f) => f.transport !== "webrtc/1");
22503
+ }
22360
22504
  /** How long after the last automatic dial the next one may go. A first pairing tries again sooner: the contact just read the invite and is waiting. */
22361
22505
  dialWait() {
22362
22506
  if (this.instantRetry) return INSTANT_FAIL_RETRY_MS;
22363
- return !!this.tracker && !this.tracker.done && this.tracker.progress.stage !== "on-dht" ? Math.min(PAIRING_RETRY_MS * 2 ** this.autoConnectFailures, PAIRING_MAX_RETRY_MS) : Math.min(AUTO_CONNECT_RETRY_MS * 2 ** this.autoConnectFailures, AUTO_CONNECT_MAX_RETRY_MS);
22507
+ return this.firstPairing() ? Math.min(PAIRING_RETRY_MS * 2 ** this.autoConnectFailures, PAIRING_MAX_RETRY_MS) : Math.min(AUTO_CONNECT_RETRY_MS * 2 ** this.autoConnectFailures, AUTO_CONNECT_MAX_RETRY_MS);
22364
22508
  }
22365
22509
  /** The name this side shows, told to a paired peer directly. */
22366
22510
  setNick(nick) {
@@ -22898,6 +23042,10 @@ var GhostLink = class {
22898
23042
  failAppRange(task, error) {
22899
23043
  this.appRanges.fail(task, error);
22900
23044
  }
23045
+ /** Whether `task` still waits for an answer on this session (`AppRanges.holds`): one that does not needs none. */
23046
+ holdsAppRange(task) {
23047
+ return this.appRanges.holds(task);
23048
+ }
22901
23049
  /** An `ar-*` frame from the contact, on a session that agreed `app-ranges/1`. */
22902
23050
  receiveAppRange(frame) {
22903
23051
  const read = readAppRangeFrame(frame);
@@ -24087,6 +24235,10 @@ var GhostLink = class {
24087
24235
  this.handledWaiters.push(waiter);
24088
24236
  });
24089
24237
  }
24238
+ /** Frames the contact sent on this session that this app received and has not handled yet: 0 without a session. */
24239
+ framesWaiting() {
24240
+ return this.paired?.waiting ?? 0;
24241
+ }
24090
24242
  /** Something came back on the session: the ping's wait is over. */
24091
24243
  heardFromPeer() {
24092
24244
  if (this.pongWait) clearTimeout(this.pongWait);
@@ -24202,9 +24354,13 @@ var GhostLink = class {
24202
24354
  this.channel.send(JSON.stringify({ t: "paired-bye" }));
24203
24355
  } catch {}
24204
24356
  }
24205
- /** A link made just now for a peer that is about to show up (a group's entry session): look fast for a while. */
24206
- expectPeer() {
24207
- this.session.expectPeer();
24357
+ /**
24358
+ * A link made just now for a peer that is about to show up (a group's entry session): look fast for a while.
24359
+ * `awaited`: nothing reaches the peer until this link reads it (the edge to a member just let in): its reads go on the
24360
+ * relays' floor meanwhile (`LinkSession.expectPeer`).
24361
+ */
24362
+ expectPeer(awaited = false) {
24363
+ this.session.expectPeer(awaited);
24208
24364
  }
24209
24365
  /** The peer's packet is at hand without a relay (a member of the group carried it, `CarriedTransport`): read it now. */
24210
24366
  look() {
@@ -24626,12 +24782,16 @@ function decodeBolt11(text) {
24626
24782
  let description;
24627
24783
  let paymentHash;
24628
24784
  let descriptionHash;
24785
+ const seen = /* @__PURE__ */ new Set();
24629
24786
  for (let at = TIMESTAMP_WORDS; at + 3 <= data.length;) {
24630
24787
  const tag = CHARSET[data[at]];
24631
24788
  const length = data[at + 1] * 32 + data[at + 2];
24632
24789
  const field = data.slice(at + 3, at + 3 + length);
24633
24790
  if (field.length < length) return null;
24634
24791
  at += 3 + length;
24792
+ const counted = tag === "d" || tag === "x" || (tag === "p" || tag === "h") && length === 52;
24793
+ if (counted && seen.has(tag)) return null;
24794
+ if (counted) seen.add(tag);
24635
24795
  if (tag === "d") description = new TextDecoder().decode(wordsToBytes(field)).trim() || void 0;
24636
24796
  else if (tag === "x") expiry = wordsToInt(field);
24637
24797
  else if (tag === "p" && length === 52) paymentHash = [...wordsToBytes(field)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
@@ -28260,8 +28420,8 @@ var CatchUpAnswers = class {
28260
28420
  }
28261
28421
  /**
28262
28422
  * The first two slices go now, the rest without holding the group's other frames back. A newer answer to the same
28263
- * member goes after what is left of the last, without the frames still queued there (the same objects: a store's)
28264
- * nor those still on their way (`onTheirWay`); it took their place before, and left out what the member's `have`
28423
+ * member goes after what is left of the last, without the frames still queued there (the same objects: a store's, or
28424
+ * the same `key`) nor those still on their way (`onTheirWay`); it took their place before, and left out what the member's `have`
28265
28425
  * said it held: a live frame of an author raises it above that author's frames still queued, which were lost for
28266
28426
  * good. A frame the edge did not take ends the answer (the member asks again when its edge opens).
28267
28427
  */
@@ -28278,8 +28438,12 @@ var CatchUpAnswers = class {
28278
28438
  });
28279
28439
  const going = this.going.get(to);
28280
28440
  if (going) {
28281
- const queued = new Set(going);
28282
- going.push(...frames.filter((frame) => !queued.has(frame)));
28441
+ const queued = new Set(going), queuedKeys = new Set(key ? going.map(key) : []);
28442
+ const isQueued = (frame) => {
28443
+ const k = key?.(frame);
28444
+ return queued.has(frame) || k !== void 0 && queuedKeys.has(k);
28445
+ };
28446
+ going.push(...frames.filter((frame) => !isQueued(frame)));
28283
28447
  return;
28284
28448
  }
28285
28449
  const rest = [...frames], told = [];
@@ -29505,6 +29669,7 @@ var GroupSession = class {
29505
29669
  for (const f of [...this.state.sent]) {
29506
29670
  if (!alone.has(ownKey(f)) || f.e >= this.epoch) continue;
29507
29671
  looked.add(ownKey(f));
29672
+ if (this.isRemoved(f)) continue;
29508
29673
  const target = this.saidAgainEpoch(f);
29509
29674
  if (target === void 0) continue;
29510
29675
  const before = this.state.chain[f.e], key = epochKeys(this.secret(f.e), this.id, f.e).message;
@@ -29864,7 +30029,8 @@ var GroupSession = class {
29864
30029
  if (answer) this.answering.set(from, now + ANSWER_WINDOW_MS);
29865
30030
  if (relayed && (!rosterHas(this.roster, from) || !this.handsOn(raw.s, raw.e))) return;
29866
30031
  if (this.isDuplicate(raw)) return;
29867
- if (!verify(fromBase64Url(raw.sig), messageSigned$1(raw), publicKeyFromZ32(raw.s))) return;
30032
+ const signedWhole = relayed && this.wholeSigned(raw);
30033
+ if (!signedWhole && !verify(fromBase64Url(raw.sig), messageSigned$1(raw), publicKeyFromZ32(raw.s))) return;
29868
30034
  if (raw.e > this.epoch) {
29869
30035
  this.park(from, raw);
29870
30036
  return;
@@ -29873,7 +30039,7 @@ var GroupSession = class {
29873
30039
  const commit = this.state.chain[raw.e];
29874
30040
  if (!commit || !rosterHas(commit.m, raw.s) || !rosterHas(commit.m, this.myKey)) return;
29875
30041
  const own = groupMessageId(raw.s, raw.e, raw.n);
29876
- const whole = !relayed || this.wholeSigned(raw);
30042
+ const whole = !relayed || signedWhole;
29877
30043
  if (!whole) {
29878
30044
  if (this.provisional.has(own)) return;
29879
30045
  delete raw.m;
@@ -29895,6 +30061,13 @@ var GroupSession = class {
29895
30061
  const text = decryptText(key, messageAad$1(raw), raw.nn, raw.c);
29896
30062
  if (text === null) return;
29897
30063
  if (this.heardName(key, raw)) this.hooks.changed();
30064
+ if (this.isRemoved(raw)) {
30065
+ if (whole) {
30066
+ this.markSeen(raw);
30067
+ this.persistSoon();
30068
+ }
30069
+ return;
30070
+ }
29898
30071
  const firstFrame = first && {
29899
30072
  ...raw,
29900
30073
  e: first.e,
@@ -30284,7 +30457,7 @@ var GroupSession = class {
30284
30457
  const asked = new Set(Array.isArray(frame.ask) ? frame.ask.filter((k) => typeof k === "string" && k !== from && k !== this.myKey && rosterHas(this.roster, k)) : []);
30285
30458
  const handed = this.leaversHanded.get(from);
30286
30459
  const kept = !asked.size && !this.state.leftMarks ? [] : this.kept().filter((f) => {
30287
- if (!this.state.chain[f.e] || !rosterHas(this.state.chain[f.e].m, from) || !lacks(f)) return false;
30460
+ if (!this.state.chain[f.e] || !rosterHas(this.state.chain[f.e].m, from) || !lacks(f) || this.isRemoved(f)) return false;
30288
30461
  if (asked.has(f.s)) return true;
30289
30462
  return !rosterHas(this.roster, f.s) && !handed?.has(frameKey$1(f)) && this.handsOn(f.s, f.e);
30290
30463
  });
@@ -30318,7 +30491,11 @@ var GroupSession = class {
30318
30491
  }
30319
30492
  ownLacked(to, frame) {
30320
30493
  const lacks = missingIn(frame, to);
30321
- return this.state.sent.filter((sent) => this.state.chain[sent.e] && rosterHas(this.state.chain[sent.e].m, to) && lacks(sent));
30494
+ return this.state.sent.filter((sent) => this.state.chain[sent.e] && rosterHas(this.state.chain[sent.e].m, to) && lacks(sent) && !this.isRemoved(sent));
30495
+ }
30496
+ /** A frame of a message deleted for everyone (`hooks.removed`): handed to nobody, its removal is what they get. */
30497
+ isRemoved(f) {
30498
+ return !!this.hooks.removed?.(this.messageIdOf(f));
30322
30499
  }
30323
30500
  /** Sets (or, with null, removes) the group's picture: only the admin, signed under the current commit. */
30324
30501
  setPicture(picture, now = Date.now()) {
@@ -30574,8 +30751,14 @@ var info = (label) => utf8Encode(`ghostly-group-entry/1 ${label}`);
30574
30751
  function encodeGroupEntryLink(link) {
30575
30752
  return `${PREFIX}/${link.g}/${link.host}`;
30576
30753
  }
30577
- /** A pasted link, a `/join/…` path or the bare code; null when it is none of them. */
30754
+ /**
30755
+ * A pasted link, a `/join/…` path or the bare code; null when it is none of them. Copied with the words around it
30756
+ * ("Join our group: <https://…/join/group1/…>."), it is read as the token in it (`unwrapPasted`).
30757
+ */
30578
30758
  function decodeGroupEntryLink(input) {
30759
+ return readGroupEntryLink(input) ?? readGroupEntryLink(unwrapPasted(input));
30760
+ }
30761
+ function readGroupEntryLink(input) {
30579
30762
  const parts = input.trim().replace(/^.*#/, "").replace(/^.*?\/join\//, "").replace(/^\/+/, "").split("/");
30580
30763
  if (parts.length !== 3 || parts[0] !== PREFIX) return null;
30581
30764
  const [, g, host] = parts;
@@ -30722,8 +30905,11 @@ var GROUP_READ_NOTE_COMMUNITY = `Anyone with the group's link can join, and any
30722
30905
  function encodeCommunityLink(link) {
30723
30906
  return `group2/${link.g}/${link.host}`;
30724
30907
  }
30725
- /** A pasted link, a `/join/…` path or the bare code; null when it is not a community group's link. */
30908
+ /** A pasted link, a `/join/…` path or the bare code (or one in words: `unwrapPasted`); null when it is not a community group's link. */
30726
30909
  function decodeCommunityLink(input) {
30910
+ return readCommunityLink(input) ?? readCommunityLink(unwrapPasted(input));
30911
+ }
30912
+ function readCommunityLink(input) {
30727
30913
  const parts = input.trim().replace(/^.*#/, "").replace(/^.*?\/join\//, "").replace(/^\/+/, "").split("/");
30728
30914
  if (parts.length !== 3 || parts[0] !== "group2" || !GROUP_ID.test(parts[1]) || !MEMBER_KEY.test(parts[2])) return null;
30729
30915
  try {
@@ -31075,8 +31261,16 @@ var CommunitySession = class {
31075
31261
  known = /* @__PURE__ */ new Map();
31076
31262
  /** Commit hash → roster after it, for the window of the main branch and the side commits. */
31077
31263
  rosters = /* @__PURE__ */ new Map();
31078
- /** Commit hash → roster after it, for a few main-branch commits older than the window that `couldRead` was asked about. */
31079
- pastRosters = /* @__PURE__ */ new Map();
31264
+ /**
31265
+ * Who was in the roster after each main-branch commit, from one replay of the branch: key → the places where it came in
31266
+ * and went out, in turn (an open last span while it is in). `through` commits are counted, the last one `top`.
31267
+ */
31268
+ spans = {
31269
+ through: 0,
31270
+ top: "",
31271
+ roster: null,
31272
+ byKey: /* @__PURE__ */ new Map()
31273
+ };
31080
31274
  mainIndex = /* @__PURE__ */ new Map();
31081
31275
  pendingCommits = /* @__PURE__ */ new Map();
31082
31276
  pendingSecrets = /* @__PURE__ */ new Map();
@@ -31104,7 +31298,8 @@ var CommunitySession = class {
31104
31298
  this.answers = new CatchUpAnswers({
31105
31299
  send: (to, frame) => hooks.direct(to, frame),
31106
31300
  ...hooks.handled && { handled: (to) => hooks.handled(to) },
31107
- active: () => this.state.status === "active"
31301
+ active: () => this.state.status === "active",
31302
+ key: (frame) => frame.t === "group-msg" ? communityMessageId(frame.s, frame.e, frame.h, frame.n) : frame.t === "group-commit" ? `commit:${communityCommitHash(frame.commit)}` : frame.t === "group-secret" ? `secret:${frame.h}` : void 0
31108
31303
  });
31109
31304
  this.rebuild();
31110
31305
  if ((state.status === "active" || state.status === "lost") && this.bestBranch().tip !== this.topHash) this.serialize(() => this.chooseBranch());
@@ -31236,9 +31431,19 @@ var CommunitySession = class {
31236
31431
  get top() {
31237
31432
  return this.state.chain[this.state.chain.length - 1];
31238
31433
  }
31434
+ /**
31435
+ * The top commit's hash, kept for the commit it was taken from: a view reads it for each member (its roster, what
31436
+ * each member's lines are missing), and hashing it every time cost tens of milliseconds per state in big communities.
31437
+ */
31239
31438
  get topHash() {
31240
- return communityCommitHash(this.top);
31439
+ const top = this.top;
31440
+ if (this.topHashOf?.commit !== top) this.topHashOf = {
31441
+ commit: top,
31442
+ hash: communityCommitHash(top)
31443
+ };
31444
+ return this.topHashOf.hash;
31241
31445
  }
31446
+ topHashOf;
31242
31447
  get epoch() {
31243
31448
  return this.top.e;
31244
31449
  }
@@ -31291,20 +31496,33 @@ var CommunitySession = class {
31291
31496
  const i = this.state.chain.length - 1 - (this.epoch - Number(e));
31292
31497
  const commit = Number.isSafeInteger(i) && i >= 0 ? this.state.chain[i] : void 0;
31293
31498
  const hash = commit && communityCommitHash(commit);
31294
- return !!hash && hash.startsWith(h) && rosterHas(this.pastRoster(i, hash), key);
31499
+ return !!hash && hash.startsWith(h) && this.wasInAt(key, i);
31295
31500
  }
31296
- /** The roster after an old commit of the main branch, replayed and kept apart from the window's (a few, the latest asked). */
31297
- pastRoster(i, hash) {
31298
- const known = this.pastRosters.get(hash);
31299
- if (known) return known;
31300
- let roster = null;
31301
- for (let j = 0; j <= i && (j === 0 || roster); j++) roster = communityRoster(roster, this.state.chain[j]);
31302
- this.pastRosters.set(hash, roster ?? []);
31303
- for (const old of this.pastRosters.keys()) {
31304
- if (this.pastRosters.size <= 8) break;
31305
- this.pastRosters.delete(old);
31501
+ /**
31502
+ * Whether `key` was in the roster after the main branch's commit `i`. The branch is replayed once, as `rebuild` does (its
31503
+ * leaves were checked when they were taken), and only further as it grows: again from the start only once it changed.
31504
+ */
31505
+ wasInAt(key, i) {
31506
+ let s = this.spans;
31507
+ if (s.through > 0 && this.mainIndex.get(s.top) !== s.through - 1) s = this.spans = {
31508
+ through: 0,
31509
+ top: "",
31510
+ roster: null,
31511
+ byKey: /* @__PURE__ */ new Map()
31512
+ };
31513
+ if (s.through <= i) {
31514
+ for (; s.through <= i; s.through++) {
31515
+ const before = new Set((s.roster ?? []).map(([k]) => k));
31516
+ s.roster = s.through === 0 || s.roster ? communityRoster(s.roster, this.state.chain[s.through], true) : null;
31517
+ const after = new Set((s.roster ?? []).map(([k]) => k));
31518
+ for (const k of after) if (!before.has(k)) s.byKey.set(k, [...s.byKey.get(k) ?? [], s.through]);
31519
+ for (const k of before) if (!after.has(k)) s.byKey.get(k).push(s.through);
31520
+ }
31521
+ s.top = communityCommitHash(this.state.chain[s.through - 1]);
31306
31522
  }
31307
- return roster ?? [];
31523
+ const at = s.byKey.get(key) ?? [];
31524
+ for (let j = 0; j < at.length; j += 2) if (at[j] <= i && (j + 1 >= at.length || i < at[j + 1])) return true;
31525
+ return false;
31308
31526
  }
31309
31527
  /** Someone the chain took out (removed or left) and who is not back in. */
31310
31528
  wasRemoved(key) {
@@ -31633,6 +31851,7 @@ var CommunitySession = class {
31633
31851
  * within the window.
31634
31852
  */
31635
31853
  async chooseBranch() {
31854
+ const status = this.state.status;
31636
31855
  const best = this.bestBranch();
31637
31856
  if (best.tip !== this.topHash) await this.adopt(best.tip);
31638
31857
  if (this.state.status === "lost" && rosterHas(this.roster, this.myKey)) {
@@ -31641,9 +31860,11 @@ var CommunitySession = class {
31641
31860
  }
31642
31861
  this.followEntry();
31643
31862
  this.pruneSide();
31644
- await this.persist();
31863
+ if (this.state.status !== status) await this.persist();
31864
+ else this.persistSoon();
31645
31865
  this.hooks.changed();
31646
31866
  await this.replayWaiting();
31867
+ await this.renewLasting();
31647
31868
  }
31648
31869
  bestBranch() {
31649
31870
  const counts = this.adminCounts();
@@ -31845,6 +32066,7 @@ var CommunitySession = class {
31845
32066
  });
31846
32067
  }
31847
32068
  this.hooks.changed();
32069
+ await this.renewLasting();
31848
32070
  return {
31849
32071
  commit,
31850
32072
  hash,
@@ -32113,15 +32335,15 @@ var CommunitySession = class {
32113
32335
  }
32114
32336
  /**
32115
32337
  * An application frame that says the group's state (`CommunitySessionHooks.lasting`) in place of the one of its
32116
- * kind kept now, unless that one is newer (by the author's time, then the frame's identity, so every member keeps
32117
- * the same one).
32338
+ * kind kept now, unless that one is newer (by the author's time, then its epoch, so one said again under a newer
32339
+ * commit takes the first's place, then the frame's identity, so every member keeps the same one).
32118
32340
  */
32119
32341
  keepLasting(message, frame) {
32120
32342
  const kind = this.hooks.lasting?.(message);
32121
32343
  if (typeof kind !== "string" || !kind) return;
32122
32344
  const kept = { ...this.state.lasting };
32123
32345
  const now = kept[kind];
32124
- if (now && (now.ts > frame.ts || now.ts === frame.ts && frameKey(now) >= frameKey(frame))) return;
32346
+ if (now && (now.ts > frame.ts || now.ts === frame.ts && (now.e > frame.e || now.e === frame.e && frameKey(now) >= frameKey(frame)))) return;
32125
32347
  if (!now && Object.keys(kept).length >= COMMUNITY_LIMITS.lasting) return;
32126
32348
  kept[kind] = frame;
32127
32349
  this.state.lasting = kept;
@@ -32241,6 +32463,29 @@ var CommunitySession = class {
32241
32463
  this.state.unheard = this.state.unheard.filter((key) => key !== frameKey(frame));
32242
32464
  this.persistSoon();
32243
32465
  }
32466
+ /**
32467
+ * Message `id` was deleted for everyone (WISP 400 § Delete for everyone), by its author or here: its frame goes from
32468
+ * the store, so no catch-up hands it to a member who was away (they get the removal, which stays). A frame said again
32469
+ * (`reseal`) carries the first one's place inside: its author's are opened to tell.
32470
+ */
32471
+ forget(id) {
32472
+ const author = id.slice(0, id.indexOf(":"));
32473
+ const kept = this.state.store.filter((f) => f.s !== author || this.storedId(f) !== id);
32474
+ if (kept.length === this.state.store.length) return;
32475
+ this.state.store = kept;
32476
+ this.persistSoon();
32477
+ }
32478
+ /** The id of the message a stored frame is, by its first place when it was said again (and I can open it). */
32479
+ storedId(f) {
32480
+ const found = this.commitByShort(f.e, f.h), secret = found && this.state.secrets[found.hash];
32481
+ const plain = secret ? decryptText(epochKeys(fromBase64Url(secret), this.id, f.e).message, messageAad(f), f.nn, f.c) : null;
32482
+ let parsed = null;
32483
+ try {
32484
+ parsed = plain === null ? null : JSON.parse(plain);
32485
+ } catch {}
32486
+ const original = isObject$2(parsed) && parsed.o !== void 0 ? readOriginal(parsed.o, f) : null;
32487
+ return original ? communityMessageId(f.s, original.e, original.h, original.n) : communityMessageId(f.s, f.e, f.h, f.n);
32488
+ }
32244
32489
  keep(frame) {
32245
32490
  this.state.store.push(frame);
32246
32491
  let bytes = this.state.store.reduce((sum, f) => sum + f.c.length, 0);
@@ -32308,6 +32553,78 @@ var CommunitySession = class {
32308
32553
  this.state.alone = (this.state.alone ?? []).filter((key) => !looked.includes(key));
32309
32554
  this.persistSoon();
32310
32555
  }
32556
+ /**
32557
+ * My lasting frames (`keepLasting`), said again under the current commit once theirs is half the window behind: past
32558
+ * the window no member finds that commit or holds its secret, and a member back from away after more commits than
32559
+ * that was never handed the group's state. With the same content and time and `o` naming the first, as
32560
+ * `resealBehind` says one, so it stays one message, and in the place of the one kept, everywhere.
32561
+ */
32562
+ async renewLasting() {
32563
+ if (!this.isMember || !this.state.secrets[this.topHash]) return;
32564
+ for (const [kind, f] of Object.entries(this.state.lasting ?? {})) {
32565
+ if (f.s !== this.myKey || this.epoch - f.e < COMMUNITY_LIMITS.window / 2) continue;
32566
+ const found = this.commitByShort(f.e, f.h), secret = found && this.state.secrets[found.hash];
32567
+ if (!secret) continue;
32568
+ const plain = decryptText(epochKeys(fromBase64Url(secret), this.id, f.e).message, messageAad(f), f.nn, f.c);
32569
+ let parsed = null;
32570
+ try {
32571
+ parsed = plain === null ? null : JSON.parse(plain);
32572
+ } catch {}
32573
+ if (!isObject$2(parsed) || !isObject$2(parsed.x)) continue;
32574
+ const o = readOriginal(parsed.o, f) ?? {
32575
+ e: f.e,
32576
+ h: f.h,
32577
+ n: f.n
32578
+ };
32579
+ const id = communityMessageId(this.myKey, o.e, o.h, o.n);
32580
+ if (this.hooks.lasting?.({
32581
+ id,
32582
+ sender: this.myKey,
32583
+ epoch: this.epoch,
32584
+ timestamp: f.ts,
32585
+ frame: parsed.x
32586
+ }) !== kind) continue;
32587
+ const { nick, o: _first, ...body } = parsed;
32588
+ const name = typeof nick === "string" ? nick : void 0;
32589
+ const fits = (withNick) => Math.ceil((utf8Encode(JSON.stringify({
32590
+ ...body,
32591
+ o,
32592
+ ...withNick && name ? { nick: name } : {}
32593
+ })).length + 16) * 4 / 3) + 4 <= MAX_TEXT_BOX;
32594
+ if (!fits(false)) continue;
32595
+ const sent = await this.sendPayload(() => ({
32596
+ ...body,
32597
+ o
32598
+ }), fits(true) ? name : void 0, f.ts);
32599
+ if ("error" in sent) continue;
32600
+ this.resealedFrom.set(frameKey(sent.frame), id);
32601
+ this.keepLasting({
32602
+ id,
32603
+ sender: this.myKey,
32604
+ epoch: sent.frame.e,
32605
+ timestamp: f.ts,
32606
+ frame: parsed.x
32607
+ }, sent.frame);
32608
+ await this.say(sent.frame);
32609
+ }
32610
+ }
32611
+ /** Whether a lasting frame kept here is `f`'s author's, said at its time, and is the message `id` (the first's, said again). */
32612
+ keepsLasting(f, id) {
32613
+ return Object.values(this.state.lasting ?? {}).some((kept) => {
32614
+ if (kept.s !== f.s || kept.ts !== f.ts || frameKey(kept) === frameKey(f)) return false;
32615
+ const found = this.commitByShort(kept.e, kept.h), secret = found && this.state.secrets[found.hash];
32616
+ const plain = secret ? decryptText(epochKeys(fromBase64Url(secret), this.id, kept.e).message, messageAad(kept), kept.nn, kept.c) : null;
32617
+ let parsed;
32618
+ try {
32619
+ parsed = plain === null ? null : JSON.parse(plain);
32620
+ } catch {
32621
+ return false;
32622
+ }
32623
+ if (!isObject$2(parsed)) return false;
32624
+ const o = readOriginal(parsed.o, kept) ?? kept;
32625
+ return communityMessageId(kept.s, o.e, o.h, o.n) === id;
32626
+ });
32627
+ }
32311
32628
  /** The message a frame of mine is: the first one's id for a frame said again (`resealBehind`), else its own. */
32312
32629
  messageIdOf(f) {
32313
32630
  return f.s === this.myKey && this.resealedFrom.get(frameKey(f)) || communityMessageId(f.s, f.e, f.h, f.n);
@@ -32361,7 +32678,7 @@ var CommunitySession = class {
32361
32678
  if (frame.to !== this.myKey || typeof frame.h !== "string") return false;
32362
32679
  const took = this.takeSecret(frame.h, frame.s);
32363
32680
  if (took) {
32364
- await this.persist();
32681
+ this.persistSoon();
32365
32682
  this.hooks.changed();
32366
32683
  await this.replayWaiting();
32367
32684
  }
@@ -32372,7 +32689,7 @@ var CommunitySession = class {
32372
32689
  let took = false;
32373
32690
  for (const entry of frame.secrets) if (entry && typeof entry.h === "string") took = this.takeSecret(entry.h, entry.s) || took;
32374
32691
  if (took) {
32375
- await this.persist();
32692
+ this.persistSoon();
32376
32693
  this.hooks.changed();
32377
32694
  await this.replayWaiting();
32378
32695
  }
@@ -32465,7 +32782,20 @@ var CommunitySession = class {
32465
32782
  } : raw;
32466
32783
  const firstAt = original && this.commitByShort(original.e, original.h);
32467
32784
  const readFirst = !!firstAt && rosterHas(this.rosterOf(firstAt.hash) ?? [], this.myKey);
32468
- if (original && readFirst && this.isDuplicate(first)) {
32785
+ const id = communityMessageId(raw.s, first.e, first.h, first.n);
32786
+ if (this.hooks.removed?.(id)) {
32787
+ this.markSeen(raw);
32788
+ this.persistSoon();
32789
+ return false;
32790
+ }
32791
+ if (original && (readFirst && this.isDuplicate(first) || this.keepsLasting(raw, id))) {
32792
+ if (isObject$2(parsed.x)) this.keepLasting({
32793
+ id,
32794
+ sender: raw.s,
32795
+ epoch: raw.e,
32796
+ timestamp: raw.ts,
32797
+ frame: parsed.x
32798
+ }, raw);
32469
32799
  this.markSeen(raw);
32470
32800
  this.keep(raw);
32471
32801
  this.persistSoon();
@@ -32482,7 +32812,6 @@ var CommunitySession = class {
32482
32812
  this.state.nicks[raw.s] = nick;
32483
32813
  this.hooks.changed();
32484
32814
  }
32485
- const id = communityMessageId(raw.s, first.e, first.h, first.n);
32486
32815
  if (text !== void 0) {
32487
32816
  const mentions = validMentions(parsed.m, text, false);
32488
32817
  const reply = parsed.r === void 0 ? void 0 : readReply(parsed.r, groupReplyAuthor);
@@ -32679,6 +33008,7 @@ var CommunitySession = class {
32679
33008
  if (stored.s === from) continue;
32680
33009
  const high = have[stored.s]?.[seenKey(stored.e, stored.h)];
32681
33010
  if (Number.isSafeInteger(high) && high >= stored.n) continue;
33011
+ if (this.hooks.removed?.(communityMessageId(stored.s, stored.e, stored.h, stored.n))) continue;
32682
33012
  if (!this.heardAfterOut(stored)) continue;
32683
33013
  const found = this.commitByShort(stored.e, stored.h);
32684
33014
  if (!found) continue;
@@ -33577,6 +33907,6 @@ function readX401SdJwtVc(text) {
33577
33907
  };
33578
33908
  }
33579
33909
  //#endregion
33580
- export { parseSshPublicKey as $, sameButtonText as $a, deviceInviteJoinerParams as $c, irohRelayUrl as $i, parseRelayPayload as $l, readGroupWantNo as $n, HANDOFF_TIMINGS as $o, isServeId as $r, inboxRecord as $s, SEPOLIA_TEST_USDT_FAUCET as $t, knockRecords as A, queueReaction as Aa, readAppBundleAsync as Ac, CapsExchange as Ai, signTurnRelease as Al, findEndpoint as An, CALL_SIGNAL_MAX_AGE_MS as Ao, transferStalled as Ar, SET_ACK as As, didWebDocumentUrl as At, GROUP_READ_NOTE as B, CRON_LINE as Ba, readAppRevocation as Bc, emptyIdentityLedger as Bi, SLOW_MS as Bl, engineError as Bn, emptyLinkRecords as Bo, pinIsNewer as Br, ENROLL_PROOF as Bs, staticDidDocument as Bt, decodeCommunityLink as C, forwardedAgain as Ca, appDigest as Cc, nip05RootKey as Ci, turnPutSummary as Cl, pubkyHomeserverOf as Cn, GhostlyHttpError as Co, readBeacon as Cr, readHandoffDone as Cs, DID_JWS_MAX_LENGTH as Ct, encodeGroupEntryLink as D, REACTION_LIMITS as Da, isAppUrl as Dc, recordsName as Di, nextTurnPosition as Dl, ENDPOINT as Dn, LIMITS as Do, ChatFiles as Dr, readHandoffTurnFrame as Ds, didGhostlyServiceEntry as Dt, decodeGroupEntryLink as E, GROUP_REACTION_FRAME as Ea, checkAppManifest as Ec, recordsFromWellKnown as Ei, firstDeviceSetSecret as El, decodeBolt11 as En, webLocalFetch as Eo, shouldBeHub as Er, readHandoffPake as Es, checkDidSignature as Et, groupWakeFrame as F, wireReaction as Fa, appRef as Fc, IDENTITY_MAX_VALIDITY as Fi, turnVerifierMark as Fl, INVITE_TAKEN as Fn, callSignalHeardAt as Fo, typingActivity as Fr, signTombstone as Fs, normalizeDid as Ft, GROUP_EDIT_TEXT_BYTES as G, RUN_RESULTS as Ga, readImageMeta as Gc, revokesIdentity as Gi, budgetRetryMs as Gl, GROUP_WANT_FRAME as Gn, HANDOFF_CANCEL as Go, deviceWakeRequest as Gr, enrollGrantFrame as Gs, encodeDidDhtPacket as Gt, frameBytes as H, PR_CHECKS as Ha, signAppObject as Hc, identityStatement as Hi, normalizeRelayUrl as Hl, parseEngineError as Hn, LEGACY_SERVICES as Ho, readPin as Hr, enrollCancelReason as Hs, didDhtDocument as Ht, groupWakes as I, pairedReplyAuthor as Ia, checkAppRevokeStatement as Ic, IDENTITY_REVOCATION_LABEL as Ii, DEFAULT_RELAYS as Il, LIVENESS_PING_MS as In, contactRtcConfig as Io, GROUP_PIN_FRAME as Ir, verifySetUpdate as Is, parseDid as It, mentionsMember as J, appCardId as Ja, readCanonicalJson as Jc, emptyProofLedger as Ji, PacketTooLargeError as Jl, groupFileFallback as Jn, HANDOFF_HELLO as Jo, relayRequest as Jr, readEnrollGrant as Js, ETHEREUM_USDT as Jt, carryMentions as K, STATUS_CARD_LIMITS as Ka, canonicalJson as Kc, lastSharedWithMe as Ki, isDiscoveryBudgetError as Kl, GROUP_WANT_NO_FRAME as Kn, HANDOFF_DONE as Ko, newWakeToken as Kr, enrollHelloFrame as Ks, resolveDidDht as Kt, parseGroupWakeFrame as L, readReply as La, isAppHash as Lc, IdentityCheckUnavailable as Li, HEDGE_MS as Ll, PAIRED_FRAME_TOO_LARGE as Ln, extractParamsFromSdp as Lo, PIN_LIMITS as Lr, ENROLL_DONE as Ls, parseDidDocument as Lt, readKnocks as M, reactionIsNewer as Ma, APP_PREFIXES as Mc, capsDescriptors as Mi, turnKeys as Ml, parseCashuRequestPayload as Mn, answersOffer as Mo, TYPING_REFRESH_MS as Mr, readSetUpdate as Ms, didWebFileNames as Mt, GROUP_WAKE_FRAME as N, readReaction as Na, APP_STATEMENT_LIMITS as Nc, dialDescriptors as Ni, turnName as Nl, parseFedimintRequestPayload as Nn, buildSdpFromSignal as No, TypingSender as Nr, setAckFrame as Ns, didWebFileUrl as Nt, entryParams as O, ReactionWindow as Oa, pacer as Oc, txtValue as Oi, readTurnPacket as Ol, cashuRequestPayload as On, decodeControl as Oo, FILE_LIMITS as Or, readHandoffVerified as Os, didJwsAlg as Ot, GroupWakeLimiter as P, validReactionNumber as Pa, appFingerprint as Pc, IDENTITY_MAX_EVIDENCE as Pi, turnStatedVerifier as Pl, GhostLink as Pn, callRtcConfig as Po, sanitizeTypingStatus as Pr, setUpdateFrame as Ps, didWebHost as Pt, SshSigError as Q, checkStatusCard as Qa, createDeviceInvite as Qc, irohDescriptor as Qi, openRelayPayload as Ql, readGroupWant as Qn, HANDOFF_REQUEST as Qo, APP_RANGE_LIMITS as Qr, endedRequests as Qs, SEPOLIA_TEST_USDT as Qt, GROUP_LIMITS as R, replySnippet as Ra, isAppKey as Rc, IdentityExchange as Ri, RelayTransport as Rl, pairedMessageFits as Rn, parseCallSignal as Ro, mayPin as Rr, ENROLL_GRANT as Rs, parseDidSignaturePaste as Rt, communityHasFrame as S, parseLinkPreview as Sa, APP_PERMISSIONS as Sc, isPublicAddress as Si, classifyTurnRead as Sl, homeserverWebEndpoint as Sn, presenceSeenAt as So, rankHubs as Sr, readHandoffCancel as Ss, DID_FILE_MAX_BYTES as St, KNOCK_TTL_MS as T, COMMUNITY_REACTION_FRAME as Ta, assembleAppBundle as Tc, recordsFromTxt as Ti, TURN_MAX as Tl, resolveLightningDestination as Tn, parseLocalTarget as To, readLobby as Tr, readHandoffHello as Ts, checkDidJws as Tt, COMMUNITY_EDIT_FRAME as U, PR_STATES as Ua, signAppRevocation as Uc, newIdentityBinding as Ui, setLinkTraceSink as Ul, GROUP_FILE_LIMITS as Un, serviceIdFromName as Uo, WAKE_CALL_INTERVAL_MS as Ur, enrollDigits as Us, didDhtFromPublicKey as Ut, GroupSession as V, ITEM_STATES as Va, readAppRevocations as Vc, identityRevocationValue as Vi, currentRelays as Vl, engineText as Vn, HTTP_SERVICE_PROTO as Vo, pinNumberHolds as Vr, enrollCancelFrame as Vs, strictBase64Url as Vt, GROUP_EDIT_FRAME as W, ROUTINE_STATES as Wa, parseImageMeta as Wc, receivedIdentityStatus as Wi, traceLink as Wl, GROUP_HAVE_FRAME as Wn, HANDOFF_ACK as Wo, WakeLimiter as Wr, enrollDoneFrame as Ws, encodeDidDhtDeactivated as Wt, SSHSIG_MAX_ARMOR as X, cardLine as Xa, encodeContactLink as Xc, TRANSPORTS as Xi, createRelayPayload as Xl, readGroupFileMeta as Xn, HANDOFF_PAKE as Xo, checkPushEndpoint as Xr, verifyEnrollProof as Xs, ONCHAIN_PROVIDER as Xt, groupName as Y, buttonLabelClash as Ya, createContactLink as Yc, validExternalKey as Yi, RELAY_PAYLOAD_MAX_BYTES as Yl, isGroupMessageId as Yn, HANDOFF_OFFER as Yo, wakeRequest as Yr, readEnrollHello as Ys, EVM_TEST_CHAINS as Yt, SSHSIG_NAMESPACE as Z, cardUrl as Za, readContactLink as Zc, automaticTransport as Zi, newerPacket as Zl, readGroupHave as Zn, HANDOFF_PIECE_BYTES as Zo, vapidKeysMatch as Zr, clearMissed as Zs, PaymentPreflightError as Zt, openGroupTyping as _, EDIT_RATE_WINDOW_MS as _a, requestRecords as _c, decodeDnsResponse as _i, seedSigner as _l, newPubkyProofFolder as _n, AWAITING_PEER_MS as _o, lobbyRecords as _r, handoffRetryAfter as _s, parseAtprotoDidDocument as _t, appStoreDecision as a, formatFileSize as aa, ContactRequestError as ac, EDIT_CAPABILITY as ai, inviteLink as al, assertWholeSats as an, shownTime as ao, groupSignalFrame as ar, handoffBusyFrame as as, BitcoinAddressError as at, MAX_AVATAR_LENGTH as au, CommunitySession as b, RateWindow as ba, APP_BUNDLE_MAGIC as bc, domainWellKnownFile as bi, TURN_RAISE_READ_TIMEOUT_MS as bl, pubkyProofFile as bn, RELAY_POLL_INTERVALS as bo, newerHead as br, newHandoffId as bs, verifyAtprotoRecordProof as bt, planAppUpdate as c, PLAYABLE_AUDIO as ca, knockSlotIdentity as cc, HOLD_CAPABILITY as ci, DEVICES_CAPABILITY as cl, walletNetworkOf as cn, MAX_GROUP_CHAIN as co, mayBeHub as cr, handoffContextProof as cs, ATPROTO_FULL_SCOPE as ct, bytesEqual as cu, readAppStore as d, fileMessageText as da, linkRecords as dc, HoldKeys as di, deviceEchoFrame as dl, sparkAddressKind as dn, parseGroupCommit as do, COMMUNITY_TOPOLOGY as dr, handoffEphemeral as ds, atprotoDidMethod as dt, randomBytes as du, DHT_FILE_TOO_LARGE as ea, newInbox as ec, APP_DATA_MAX_BYTES as ei, readDeviceInvite as el, TEST_USDT_FAUCET_AMOUNT as en, statusCardText as eo, CarriedTransport as er, HANDOFF_VERIFIED as es, parseSshSignature as et, createIdentity as eu, readAppStoreSteps as f, parseVoiceMeta as fa, makeStampPaced as fc, HoldRefusedError as fi, deviceEchoNonce as fl, sparkInvoiceDetails as fn, rosterAdmin as fo, beaconKeys as fr, handoffHelloFrame as fs, atprotoProofRecord as ft, toBase64Url as fu, groupTypingEpoch as g, EDIT_BUFFER_MS as ga, readLinkRecord as gc, DOMAIN_FILE_MAX_BYTES as gi, newDeviceSetSecret as gl, isPubkyProofFolder as gn, DirectPathWatch as go, lobbyKeys as gr, handoffReleaseFrame as gs, normalizeAtprotoHandle as gt, GroupTypingBoard as h, parseVideoMeta as ha, readKnockSlot as hc, readManifest as hi, devicePingFrame as hl, isPubkyKey as hn, edgeParams as ho, freshHubs as hr, handoffPakeFrame as hs, isAtprotoDid as ht, utf8Encode as hu, appRevocationFor as i, dhtFileId as ia, turnOff as ic, BUTTONS_CAPABILITY as ii, encodeInviteCode as il, assertTokenUnits as in, receivedTimestamp as io, SIGNAL_REPLY_MS as ir, handoffAttemptSucceeded as is, verifyBitcoinMessage as it, verify as iu, mergeKnocks as j, reactionEmoji as ja, sha256Paced as jc, DHT_TEXT_CAPABILITY as ji, turnInstance as jl, isFederationId as jn, RTC_CONFIG as jo, TYPING_KINDS as jr, SET_UPDATE as js, didWebFile as jt, knockIdentity as k, nextReactionNumber as ka, readAppBundle as kc, wellKnownUrl as ki, signTurnPacket as kl, fedimintRequestPayload as kn, encodeControl as ko, transferEnded as kr, sealHandoffPiece as ks, didSignedMessages as kt, APP_STORE_LIMITS as l, VOICE_LIMITS as la, knockSlotOf as lc, HOLD_DATED_BACK_MS as li, ENROLL_CAPABILITY as ll, SPARK_NETWORKS as ln, MEMBER_KEY as lo, meshHubs as lr, handoffDataFrame as ls, ATPROTO_PROOF_COLLECTION as lt, fromBase64Url as lu, GROUP_TYPING_FRAME as m, voicePeaksOf as ma, openRequest as mc, newMailbox as mi, deviceLinkPairing as ml, PUBKY_PROOF_MAX_BYTES as mn, verifyCommitSignature as mo, doorHubs as mr, handoffOfferFrame as ms, checkAtprotoProofRecord as mt, utf8Decode as mu, readX401SdJwtVc as n, peekDhtMailbox as na, settleRequest as nc, isAppVersion as ni, createChatInvite as nl, WALLET_NETWORKS as nn, claimedTime as no, SIGNAL_FRESH_MS as nr, handoffAttemptAllowed as ns, sshSignCommand as nt, identityFromSeedB64 as nu, appUpdateDecision as o, sanitizeFileName as oa, REQUEST_LIFETIME_MS as oc, STATUS_CARD_CAPABILITY as oi, inviteOwnership as ol, formatPaymentAmount as on, GROUP_ADMIN_OFF_ERROR as oo, readGroupSignal as or, handoffCancelFrame as os, decodeAnyBitcoinAddress as ot, sanitizeAvatar as ou, signAppStore as p, voiceDownloadName as pa, mergeContactKnocks as pc, isHoldUrl as pi, deviceKeyZ32 as pl, isBitcoinAddress as pn, rosterHas as po, beaconRecords as pr, handoffManifestFrames as ps, atprotoProofRkey as pt, toZ32 as pu, parseCommunityEdit as q, TASK_STATUSES as qa, canonicalJsonBytes as qc, PeerProofs as qi, withRequestOptions as ql, fetchesByItself as qn, HANDOFF_HAVE as qo, parseWakeFrame as qr, enrollProofFrame as qs, signDidDhtPacket as qt, sameX401HolderJwk as r, DHT_FILE_CAPABILITY as ra, takeRequest as rc, APPS_CAPABILITY as ri, decodeInviteCode as rl, arkAddressPrefix as rn, heardTime as ro, SIGNAL_HOLD_MS as rr, handoffAttemptFailed as rs, verifySshSignature as rt, publicKeyFromZ32 as ru, checkAppBeforeRun as s, sanitizeMime as sa, contactDay as sc, UPGRADE_CAPABILITY as si, ownInviteRefusal as sl, validatePaymentTarget as sn, GROUP_MEMBER_CAP as so, MESH_HUBS as sr, handoffContext as ss, ATPROTO_DECLARED_SCOPE as st, sanitizeDisplayText as su, newX401HolderKey as t, DHT_MESSAGE_TTL as ta, planKnocks as tc, chatAppId as ti, OwnInviteError as tl, USDT_PUBLIC_RPC as tn, arrivalKey as to, GROUP_SIGNAL_FRAME as tr, filePartName as ts, sameSshKey as tt, identityFromSeed as tu, checkAppStoreIndex as u, baseMime as ua, knockSlotRecords as uc, HOLD_LIMITS as ui, HANDOFF_CAPABILITY as ul, SPARK_PROVIDER as un, commitHash as uo, pickMeshHubs as ur, handoffDigest as us, ATPROTO_PROOF_SCOPE as ut, isZ32Key as uu, sealGroupTyping as v, MAX_REMOVAL_NUMBER as va, seenEntry as vc, dnsProofName as vi, webCryptoSigner as vl, normalizePubkyKey as vn, DHT_POLL_INTERVALS as vo, mergeBeacon as vr, handoffStreamKey as vs, shortAtprotoDid as vt, encodeCommunityLink as w, readForwarded as wa, appViewOf as wc, normalizeDomain as wi, TURN_LAST_SEQUENCE as wl, requestLnurlInvoice as wn, formatLocalTarget as wo, readBeaconHead as wr, readHandoffHave as ws, DidError as wt, GROUP_READ_NOTE_COMMUNITY as x, dhtEditId as xa, APP_ICON_PATH as xc, encodeDnsQuery as xi, TURN_SETTLE_MS as xl, pubkyProofPath as xn, WATCH_PEER_MS as xo, pickHubs as xr, readHandoffAck as xs, DID_DOCUMENT_MAX_BYTES as xt, COMMUNITY_LIMITS as y, REMOVED_TEXT as ya, APP_BUNDLE_LIMITS as yc, domainTxtRecord as yi, TURN_PUT_WINDOW_MS as yl, pubkyProofCapability as yn, EXPECT_PEER_MS as yo, mergeLobby as yr, handoffVersions as ys, AtprotoProofError as yt, GROUP_REACTED_FRAME as z, BUTTON_ID as za, isAppRef as zc, boundVerifiedIdentity as zi, RelaysFailedError as zl, pairedMessageFrame as zn, signalHasVideo as zo, nextPinNumber as zr, ENROLL_HELLO as zs, signingKeys as zt };
33910
+ export { parseSshPublicKey as $, buttonLabelClash as $a, createContactLink as $c, automaticTransport as $i, PacketTooLargeError as $l, readGroupWant as $n, HANDOFF_OFFER as $o, vapidKeysMatch as $r, readEnrollHello as $s, SEPOLIA_TEST_USDT_FAUCET as $t, knockRecords as A, GROUP_REACTION_FRAME as Aa, checkAppManifest as Ac, txtValue as Ai, firstDeviceSetSecret as Al, findEndpoint as An, webLocalFetch as Ao, FileUplink as Ar, readHandoffPake as As, didWebDocumentUrl as At, GROUP_READ_NOTE as B, pairedReplyAuthor as Ba, checkAppRevokeStatement as Bc, IdentityExchange as Bi, DEFAULT_RELAYS as Bl, EngineError as Bn, contactRtcConfig as Bo, mayPin as Br, verifySetUpdate as Bs, staticDidDocument as Bt, decodeCommunityLink as C, REMOVED_TEXT as Ca, APP_BUNDLE_LIMITS as Cc, encodeDnsQuery as Ci, TURN_PUT_WINDOW_MS as Cl, pubkyHomeserverOf as Cn, EXPECT_PEER_MS as Co, rankHubs as Cr, handoffVersions as Cs, DID_JWS_MAX_LENGTH as Ct, encodeGroupEntryLink as D, forwardedAgain as Da, appDigest as Dc, recordsFromTxt as Di, turnPutSummary as Dl, ENDPOINT as Dn, GhostlyHttpError as Do, shouldBeHub as Dr, readHandoffDone as Ds, didGhostlyServiceEntry as Dt, decodeGroupEntryLink as E, parseLinkPreview as Ea, APP_PERMISSIONS as Ec, normalizeDomain as Ei, classifyTurnRead as El, decodeBolt11 as En, presenceSeenAt as Eo, readLobby as Er, readHandoffCancel as Es, checkDidSignature as Et, groupWakeFrame as F, reactionEmoji as Fa, sha256Paced as Fc, dialDescriptors as Fi, turnInstance as Fl, INVITE_TAKEN as Fn, RTC_CONFIG as Fo, TypingSender as Fr, SET_UPDATE as Fs, normalizeDid as Ft, GROUP_EDIT_TEXT_BYTES as G, ITEM_STATES as Ga, readAppRevocations as Gc, newIdentityBinding as Gi, SLOW_MS as Gl, GROUP_HAVE_FRAME as Gn, HTTP_SERVICE_PROTO as Go, WAKE_CALL_INTERVAL_MS as Gr, enrollCancelFrame as Gs, encodeDidDhtPacket as Gt, frameBytes as H, replySnippet as Ha, isAppKey as Hc, emptyIdentityLedger as Hi, HEDGE_MS as Hl, engineText as Hn, parseCallSignal as Ho, pinIsNewer as Hr, ENROLL_GRANT as Hs, didDhtDocument as Ht, groupWakes as I, reactionIsNewer as Ia, APP_PREFIXES as Ic, IDENTITY_MAX_EVIDENCE as Ii, turnKeys as Il, LIVENESS_PING_MS as In, answersOffer as Io, sanitizeTypingStatus as Ir, readSetUpdate as Is, parseDid as It, mentionsMember as J, ROUTINE_STATES as Ja, parseImageMeta as Jc, lastSharedWithMe as Ji, setLinkTraceSink as Jl, fetchesByItself as Jn, HANDOFF_ACK as Jo, newWakeToken as Jr, enrollDoneFrame as Js, ETHEREUM_USDT as Jt, carryMentions as K, PR_CHECKS as Ka, signAppObject as Kc, receivedIdentityStatus as Ki, currentRelays as Kl, GROUP_WANT_FRAME as Kn, LEGACY_SERVICES as Ko, WakeLimiter as Kr, enrollCancelReason as Ks, resolveDidDht as Kt, parseGroupWakeFrame as L, readReaction as La, APP_STATEMENT_LIMITS as Lc, IDENTITY_MAX_VALIDITY as Li, turnName as Ll, PAIRED_FRAME_TOO_LARGE as Ln, buildSdpFromSignal as Lo, typingActivity as Lr, setAckFrame as Ls, parseDidDocument as Lt, readKnocks as M, ReactionWindow as Ma, pacer as Mc, CapsExchange as Mi, readTurnPacket as Ml, parseCashuRequestPayload as Mn, decodeControl as Mo, transferStalled as Mr, readHandoffVerified as Ms, didWebFileNames as Mt, GROUP_WAKE_FRAME as N, nextReactionNumber as Na, readAppBundle as Nc, DHT_TEXT_CAPABILITY as Ni, signTurnPacket as Nl, parseFedimintRequestPayload as Nn, encodeControl as No, TYPING_KINDS as Nr, sealHandoffPiece as Ns, didWebFileUrl as Nt, entryParams as O, readForwarded as Oa, appViewOf as Oc, recordsFromWellKnown as Oi, TURN_LAST_SEQUENCE as Ol, cashuRequestPayload as On, formatLocalTarget as Oo, ChatFiles as Or, readHandoffHave as Os, didJwsAlg as Ot, GroupWakeLimiter as P, queueReaction as Pa, readAppBundleAsync as Pc, capsDescriptors as Pi, signTurnRelease as Pl, GhostLink as Pn, CALL_SIGNAL_MAX_AGE_MS as Po, TYPING_REFRESH_MS as Pr, SET_ACK as Ps, didWebHost as Pt, SshSigError as Q, appCardId as Qa, readCanonicalJson as Qc, TRANSPORTS as Qi, withRequestOptions as Ql, readGroupHave as Qn, HANDOFF_HELLO as Qo, checkPushEndpoint as Qr, readEnrollGrant as Qs, SEPOLIA_TEST_USDT as Qt, GROUP_LIMITS as R, validReactionNumber as Ra, appFingerprint as Rc, IDENTITY_REVOCATION_LABEL as Ri, turnStatedVerifier as Rl, pairedMessageFits as Rn, callRtcConfig as Ro, GROUP_PIN_FRAME as Rr, setUpdateFrame as Rs, parseDidSignaturePaste as Rt, communityHasFrame as S, MAX_REMOVAL_NUMBER as Sa, seenEntry as Sc, domainWellKnownFile as Si, webCryptoSigner as Sl, homeserverWebEndpoint as Sn, DHT_POLL_INTERVALS as So, pickHubs as Sr, handoffStreamKey as Ss, DID_FILE_MAX_BYTES as St, KNOCK_TTL_MS as T, dhtEditId as Ta, APP_ICON_PATH as Tc, nip05RootKey as Ti, TURN_SETTLE_MS as Tl, resolveLightningDestination as Tn, WATCH_PEER_MS as To, readBeaconHead as Tr, readHandoffAck as Ts, checkDidJws as Tt, COMMUNITY_EDIT_FRAME as U, BUTTON_ID as Ua, isAppRef as Uc, identityRevocationValue as Ui, RelayTransport as Ul, parseEngineError as Un, signalHasVideo as Uo, pinNumberHolds as Ur, ENROLL_HELLO as Us, didDhtFromPublicKey as Ut, GroupSession as V, readReply as Va, isAppHash as Vc, boundVerifiedIdentity as Vi, HEDGE_MISSING_MS as Vl, engineError as Vn, extractParamsFromSdp as Vo, nextPinNumber as Vr, ENROLL_DONE as Vs, strictBase64Url as Vt, GROUP_EDIT_FRAME as W, CRON_LINE as Wa, readAppRevocation as Wc, identityStatement as Wi, RelaysFailedError as Wl, GROUP_FILE_LIMITS as Wn, emptyLinkRecords as Wo, readPin as Wr, ENROLL_PROOF as Ws, encodeDidDhtDeactivated as Wt, SSHSIG_MAX_ARMOR as X, STATUS_CARD_LIMITS as Xa, canonicalJson as Xc, emptyProofLedger as Xi, budgetRetryMs as Xl, isGroupMessageId as Xn, HANDOFF_DONE as Xo, relayRequest as Xr, enrollHelloFrame as Xs, ONCHAIN_PROVIDER as Xt, groupName as Y, RUN_RESULTS as Ya, readImageMeta as Yc, PeerProofs as Yi, traceLink as Yl, groupFileFallback as Yn, HANDOFF_CANCEL as Yo, parseWakeFrame as Yr, enrollGrantFrame as Ys, EVM_TEST_CHAINS as Yt, SSHSIG_NAMESPACE as Z, TASK_STATUSES as Za, canonicalJsonBytes as Zc, validExternalKey as Zi, isDiscoveryBudgetError as Zl, readGroupFileMeta as Zn, HANDOFF_HAVE as Zo, wakeRequest as Zr, enrollProofFrame as Zs, PaymentPreflightError as Zt, openGroupTyping as _, voiceDownloadName as _a, mergeContactKnocks as _c, readManifest as _i, deviceKeyZ32 as _l, newPubkyProofFolder as _n, rosterHas as _o, lobbyKeys as _r, handoffManifestFrames as _s, parseAtprotoDidDocument as _t, toBase64Url as _u, appStoreDecision as a, DHT_FILE_CAPABILITY as aa, planKnocks as ac, APPS_CAPABILITY as ai, OwnInviteError as al, assertWholeSats as an, arrivalKey as ao, SIGNAL_REPLY_MS as ar, filePartName as as, BitcoinAddressError as at, createIdentity as au, CommunitySession as b, EDIT_BUFFER_MS as ba, readLinkRecord as bc, dnsProofName as bi, newDeviceSetSecret as bl, pubkyProofFile as bn, DirectPathWatch as bo, mergeLobby as br, handoffReleaseFrame as bs, verifyAtprotoRecordProof as bt, utf8Encode as bu, planAppUpdate as c, sanitizeFileName as ca, turnOff as cc, STATUS_CARD_CAPABILITY as ci, encodeInviteCode as cl, walletNetworkOf as cn, receivedTimestamp as co, MESH_HUBS as cr, handoffAttemptSucceeded as cs, ATPROTO_FULL_SCOPE as ct, publicKeyFromZ32 as cu, readAppStore as d, VOICE_LIMITS as da, contactDay as dc, HOLD_DATED_BACK_MS as di, ownInviteRefusal as dl, sparkAddressKind as dn, GROUP_MEMBER_CAP as do, pickMeshHubs as dr, handoffContext as ds, atprotoDidMethod as dt, sanitizeAvatar as du, irohDescriptor as ea, verifyEnrollProof as ec, APP_RANGE_LIMITS as ei, encodeContactLink as el, TEST_USDT_FAUCET_AMOUNT as en, cardLine as eo, readGroupWantNo as er, HANDOFF_PAKE as es, parseSshSignature as et, RELAY_PAYLOAD_MAX_BYTES as eu, readAppStoreSteps as f, VOICE_METER as fa, knockSlotIdentity as fc, HOLD_LIMITS as fi, DEVICES_CAPABILITY as fl, sparkInvoiceDetails as fn, MAX_GROUP_CHAIN as fo, COMMUNITY_TOPOLOGY as fr, handoffContextProof as fs, atprotoProofRecord as ft, sanitizeDisplayText as fu, groupTypingEpoch as g, parseVoiceMeta as ga, makeStampPaced as gc, newMailbox as gi, deviceEchoNonce as gl, isPubkyProofFolder as gn, rosterAdmin as go, freshHubs as gr, handoffHelloFrame as gs, normalizeAtprotoHandle as gt, randomBytes as gu, GroupTypingBoard as h, fileMessageText as ha, linkRecords as hc, isHoldUrl as hi, deviceEchoFrame as hl, isPubkyKey as hn, parseGroupCommit as ho, doorHubs as hr, handoffEphemeral as hs, isAtprotoDid as ht, isZ32Key as hu, appRevocationFor as i, peekDhtMailbox as ia, newInbox as ic, isAppVersion as ii, readDeviceInvite as il, assertTokenUnits as in, statusCardText as io, SIGNAL_HOLD_MS as ir, HANDOFF_VERIFIED as is, verifyBitcoinMessage as it, parseRelayPayload as iu, mergeKnocks as j, REACTION_LIMITS as ja, isAppUrl as jc, wellKnownUrl as ji, nextTurnPosition as jl, isFederationId as jn, LIMITS as jo, transferEnded as jr, readHandoffTurnFrame as js, didWebFile as jt, knockIdentity as k, COMMUNITY_REACTION_FRAME as ka, assembleAppBundle as kc, recordsName as ki, TURN_MAX as kl, fedimintRequestPayload as kn, parseLocalTarget as ko, FILE_LIMITS as kr, readHandoffHello as ks, didSignedMessages as kt, APP_STORE_LIMITS as l, sanitizeMime as la, ContactRequestError as lc, UPGRADE_CAPABILITY as li, inviteLink as ll, SPARK_NETWORKS as ln, shownTime as lo, mayBeHub as lr, handoffBusyFrame as ls, ATPROTO_PROOF_COLLECTION as lt, verify as lu, GROUP_TYPING_FRAME as m, downsamplePeaks as ma, knockSlotRecords as mc, HoldRefusedError as mi, HANDOFF_CAPABILITY as ml, PUBKY_PROOF_MAX_BYTES as mn, commitHash as mo, beaconRecords as mr, handoffDigest as ms, checkAtprotoProofRecord as mt, fromBase64Url as mu, readX401SdJwtVc as n, DHT_FILE_TOO_LARGE as na, endedRequests as nc, APP_DATA_MAX_BYTES as ni, createDeviceInvite as nl, WALLET_NETWORKS as nn, checkStatusCard as no, GROUP_SIGNAL_FRAME as nr, HANDOFF_REQUEST as ns, sshSignCommand as nt, newerPacket as nu, appUpdateDecision as o, dhtFileId as oa, settleRequest as oc, BUTTONS_CAPABILITY as oi, createChatInvite as ol, formatPaymentAmount as on, claimedTime as oo, groupSignalFrame as or, handoffAttemptAllowed as os, decodeAnyBitcoinAddress as ot, identityFromSeed as ou, signAppStore as p, baseMime as pa, knockSlotOf as pc, HoldKeys as pi, ENROLL_CAPABILITY as pl, isBitcoinAddress as pn, MEMBER_KEY as po, beaconKeys as pr, handoffDataFrame as ps, atprotoProofRkey as pt, bytesEqual as pu, parseCommunityEdit as q, PR_STATES as qa, signAppRevocation as qc, revokesIdentity as qi, normalizeRelayUrl as ql, GROUP_WANT_NO_FRAME as qn, serviceIdFromName as qo, deviceWakeRequest as qr, enrollDigits as qs, signDidDhtPacket as qt, sameX401HolderJwk as r, DHT_MESSAGE_TTL as ra, inboxRecord as rc, chatAppId as ri, deviceInviteJoinerParams as rl, arkAddressPrefix as rn, sameButtonText as ro, SIGNAL_FRESH_MS as rr, HANDOFF_TIMINGS as rs, verifySshSignature as rt, openRelayPayload as ru, checkAppBeforeRun as s, formatFileSize as sa, takeRequest as sc, EDIT_CAPABILITY as si, decodeInviteCode as sl, validatePaymentTarget as sn, heardTime as so, readGroupSignal as sr, handoffAttemptFailed as ss, ATPROTO_DECLARED_SCOPE as st, identityFromSeedB64 as su, newX401HolderKey as t, irohRelayUrl as ta, clearMissed as tc, isServeId as ti, readContactLink as tl, USDT_PUBLIC_RPC as tn, cardUrl as to, CarriedTransport as tr, HANDOFF_PIECE_BYTES as ts, sameSshKey as tt, createRelayPayload as tu, checkAppStoreIndex as u, PLAYABLE_AUDIO as ua, REQUEST_LIFETIME_MS as uc, HOLD_CAPABILITY as ui, inviteOwnership as ul, SPARK_PROVIDER as un, GROUP_ADMIN_OFF_ERROR as uo, meshHubs as ur, handoffCancelFrame as us, ATPROTO_PROOF_SCOPE as ut, MAX_AVATAR_LENGTH as uu, sealGroupTyping as v, voiceLevel as va, openRequest as vc, DOMAIN_FILE_MAX_BYTES as vi, deviceLinkPairing as vl, normalizePubkyKey as vn, verifyCommitSignature as vo, lobbyRecords as vr, handoffOfferFrame as vs, shortAtprotoDid as vt, toZ32 as vu, encodeCommunityLink as w, RateWindow as wa, APP_BUNDLE_MAGIC as wc, isPublicAddress as wi, TURN_RAISE_READ_TIMEOUT_MS as wl, requestLnurlInvoice as wn, RELAY_POLL_INTERVALS as wo, readBeacon as wr, newHandoffId as ws, DidError as wt, GROUP_READ_NOTE_COMMUNITY as x, EDIT_RATE_WINDOW_MS as xa, requestRecords as xc, domainTxtRecord as xi, seedSigner as xl, pubkyProofPath as xn, AWAITING_PEER_MS as xo, newerHead as xr, handoffRetryAfter as xs, DID_DOCUMENT_MAX_BYTES as xt, COMMUNITY_LIMITS as y, parseVideoMeta as ya, readKnockSlot as yc, decodeDnsResponse as yi, devicePingFrame as yl, pubkyProofCapability as yn, edgeParams as yo, mergeBeacon as yr, handoffPakeFrame as ys, AtprotoProofError as yt, utf8Decode as yu, GROUP_REACTED_FRAME as z, wireReaction as za, appRef as zc, IdentityCheckUnavailable as zi, turnVerifierMark as zl, pairedMessageFrame as zn, callSignalHeardAt as zo, PIN_LIMITS as zr, signTombstone as zs, signingKeys as zt };
33581
33911
 
33582
- //# sourceMappingURL=src-BLHey3Q1.js.map
33912
+ //# sourceMappingURL=src-Dd_7Ew1X.js.map