@ghostlytools/sdk 1.11.3 → 1.11.4

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.
@@ -1117,7 +1117,7 @@ var staleTurn = (turn, now) => now - Math.max(turn.askedAt, turn.servedAt) >= 6e
1117
1117
  * Counted as they were, an hour's step back held every background read for 59 minutes, and a daemon with 50 contacts
1118
1118
  * away read 4 of them in the next 15 (bug hunt, 2026-11-07).
1119
1119
  */
1120
- var within = (list, now, ms) => list.map((at) => Math.min(at, now)).filter((at) => now - at < ms);
1120
+ var within$1 = (list, now, ms) => list.map((at) => Math.min(at, now)).filter((at) => now - at < ms);
1121
1121
  /**
1122
1122
  * Keys and when each was last set, those of the last minute: how many and the latest, without walking them all (the
1123
1123
  * chats that need a relay, `chatNeeds`). Each is set at the time it is set, so the sets come oldest first; a clock
@@ -2388,7 +2388,7 @@ var RelayTransport = class {
2388
2388
  */
2389
2389
  hedgeRoom(relay) {
2390
2390
  const now = Date.now();
2391
- return within(this.spent.get(relay) ?? [], now, 6e4).length < this.limitOf(relay) - this.reserveOf(relay);
2391
+ return within$1(this.spent.get(relay) ?? [], now, 6e4).length < this.limitOf(relay) - this.reserveOf(relay);
2392
2392
  }
2393
2393
  readAnsweredAt(pubKeyZ32) {
2394
2394
  return this.readAt.get(pubKeyZ32);
@@ -2575,7 +2575,7 @@ var RelayTransport = class {
2575
2575
  if (isGroupSignal(who)) this.spentGroupSignal.get(relay).push(now);
2576
2576
  const departedOver = isDepartedRead(who) && this.spent.get(relay).length >= this.limitOf(relay);
2577
2577
  if (departedOver) this.overAdd(this.departedOver, key, now);
2578
- if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.awaitedOver = [...within(this.awaitedOver, now, 6e4), now];
2578
+ if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.awaitedOver = [...within$1(this.awaitedOver, now, 6e4), now];
2579
2579
  this.spent.get(relay).push(now);
2580
2580
  if (who.background) this.spentBackground.get(relay).push(now);
2581
2581
  if (who.background && who.write) this.spentBackgroundWrites.get(relay).push(now);
@@ -2610,26 +2610,26 @@ var RelayTransport = class {
2610
2610
  * without its own allowance (`ANSWER_READ_ALLOWANCE`).
2611
2611
  */
2612
2612
  heldFor(relay, who, now = Date.now(), key, turns = true, ownAllowance = true) {
2613
- const recent = within(this.spent.get(relay) ?? [], now, 6e4);
2614
- const recentBackground = within(this.spentBackground.get(relay) ?? [], now, 6e4);
2613
+ const recent = within$1(this.spent.get(relay) ?? [], now, 6e4);
2614
+ const recentBackground = within$1(this.spentBackground.get(relay) ?? [], now, 6e4);
2615
2615
  this.spent.set(relay, recent);
2616
2616
  this.spentBackground.set(relay, recentBackground);
2617
- const recentBackgroundWrites = within(this.spentBackgroundWrites.get(relay) ?? [], now, 6e4);
2617
+ const recentBackgroundWrites = within$1(this.spentBackgroundWrites.get(relay) ?? [], now, 6e4);
2618
2618
  this.spentBackgroundWrites.set(relay, recentBackgroundWrites);
2619
2619
  const over = (list, limit) => list.length >= limit ? list[list.length - limit] + 6e4 - now : 0;
2620
2620
  const limit = this.limitOf(relay);
2621
2621
  const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.overReads(this.departedOver, key, now) < 6;
2622
- if (isAwaitedRead(who)) this.awaitedOver = within(this.awaitedOver, now, 6e4);
2622
+ if (isAwaitedRead(who)) this.awaitedOver = within$1(this.awaitedOver, now, 6e4);
2623
2623
  const awaited = isAwaitedRead(who) && key !== void 0 && recent.length >= limit && this.awaitedOver.length < 4;
2624
2624
  const share = isChatSignal(who) || departed || awaited ? SIGNALING_ALLOWANCE_SHARE : isGroupSignal(who) ? GROUP_SIGNALING_ALLOWANCE_SHARE : 0;
2625
2625
  let allowance = share ? Math.max(0, Math.floor(limit * share) - (who.write ? 0 : 1)) : 0;
2626
2626
  if (departed && now - this.awaitedAt < 6e4) allowance = Math.max(0, allowance - 2);
2627
- const groupSignaled = within(this.spentGroupSignal.get(relay) ?? [], now, 6e4);
2627
+ const groupSignaled = within$1(this.spentGroupSignal.get(relay) ?? [], now, 6e4);
2628
2628
  this.spentGroupSignal.set(relay, groupSignaled);
2629
2629
  const groupFloor = isGroupSignal(who) && groupSignaled.length < allowance;
2630
2630
  let wait = groupFloor ? 0 : over(recent, limit + allowance);
2631
2631
  const starved = key !== void 0 && this.starved(key, who, now);
2632
- const groupOver = within(this.spentGroupOver.get(relay) ?? [], now, GROUP_OVER_PACE_MS);
2632
+ const groupOver = within$1(this.spentGroupOver.get(relay) ?? [], now, GROUP_OVER_PACE_MS);
2633
2633
  this.spentGroupOver.set(relay, groupOver);
2634
2634
  if (isGroupSignal(who) && !who.write && recent.length >= limit && groupOver.length > 0) wait = Math.max(wait, groupOver[groupOver.length - 1] + GROUP_OVER_PACE_MS - now);
2635
2635
  if (who.background && !starved) {
@@ -2639,16 +2639,16 @@ var RelayTransport = class {
2639
2639
  const signaling = this.urgentAt + SIGNALING_WINDOW_MS - now;
2640
2640
  if (signaling > 0 && !who.door) wait = Math.max(wait, Math.min(signaling, over(recentBackground, Math.min(this.backgroundWhileSignaling, Math.ceil(limit / 6)))));
2641
2641
  }
2642
- const burst = within(this.spentGroupUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
2642
+ const burst = within$1(this.spentGroupUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
2643
2643
  this.spentGroupUrgent.set(relay, burst);
2644
- const answerBurst = within(this.spentAnswerUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
2644
+ const answerBurst = within$1(this.spentAnswerUrgent.get(relay) ?? [], now, GROUP_BURST_MS);
2645
2645
  this.spentAnswerUrgent.set(relay, answerBurst);
2646
2646
  if (isGroupUrgentRead(who)) {
2647
2647
  const most = Math.max(8, Math.floor(limit * GROUP_BURST_MS / 6e4));
2648
2648
  const spent = isGroupAnswerRead(who) ? answerBurst : burst;
2649
2649
  if (spent.length >= most) wait = Math.max(wait, spent[spent.length - most] + GROUP_BURST_MS - now);
2650
2650
  }
2651
- const watched = within(this.spentWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
2651
+ const watched = within$1(this.spentWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
2652
2652
  this.spentWatch.set(relay, watched);
2653
2653
  let turn = 0;
2654
2654
  if (isWatch(who)) {
@@ -2656,14 +2656,14 @@ var RelayTransport = class {
2656
2656
  if (watched.length >= most) wait = Math.max(wait, watched[watched.length - most] + GROUP_RATION_WINDOW_MS - now);
2657
2657
  if (this.readsAhead(key, now, watchLane(who)) > 0) turn = TURN_WAIT_MS;
2658
2658
  }
2659
- const chatWatched = within(this.spentChatWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
2659
+ const chatWatched = within$1(this.spentChatWatch.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
2660
2660
  this.spentChatWatch.set(relay, chatWatched);
2661
2661
  if (isChatWatch(who) && !departed) {
2662
2662
  const most = Math.max(1, Math.ceil(limit * CHAT_WATCH_SHARE * GROUP_RATION_WINDOW_MS / 6e4));
2663
2663
  if (chatWatched.length >= most) wait = Math.max(wait, chatWatched[chatWatched.length - most] + GROUP_RATION_WINDOW_MS - now);
2664
2664
  if (this.readsAhead(key, now, watchLane(who)) > 0) turn = TURN_WAIT_MS;
2665
2665
  }
2666
- const rationed = within(this.spentGroupReads.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
2666
+ const rationed = within$1(this.spentGroupReads.get(relay) ?? [], now, GROUP_RATION_WINDOW_MS);
2667
2667
  this.spentGroupReads.set(relay, rationed);
2668
2668
  const pastLimit = isGroupSignal(who) && recent.length >= limit;
2669
2669
  if (isGroupRead(who) && !pastLimit && now - (this.groupsFullAt.get(relay) ?? -Infinity) < GROUP_RATION_MS) {
@@ -2697,7 +2697,7 @@ var RelayTransport = class {
2697
2697
  * than it in the last minute, and none within `ANSWER_READ_SPACING_MS`. None where the groups have no allowance.
2698
2698
  */
2699
2699
  answerAllowanceFree(relay, now) {
2700
- const spent = within(this.spentAnswerAllowance.get(relay) ?? [], now, 6e4);
2700
+ const spent = within$1(this.spentAnswerAllowance.get(relay) ?? [], now, 6e4);
2701
2701
  this.spentAnswerAllowance.set(relay, spent);
2702
2702
  const most = Math.min(3, Math.floor(this.limitOf(relay) * GROUP_SIGNALING_ALLOWANCE_SHARE));
2703
2703
  return spent.length < most && (spent.length === 0 || now - spent[spent.length - 1] >= 2e4);
@@ -2722,7 +2722,7 @@ var RelayTransport = class {
2722
2722
  }
2723
2723
  /** What is left of the community members' way back allowance on this relay (`WAY_BACK_SHARE`); its reads leave a write the last of it. */
2724
2724
  wayBackLeft(relay, who, now) {
2725
- const spent = within(this.spentWayBack.get(relay) ?? [], now, 6e4);
2725
+ const spent = within$1(this.spentWayBack.get(relay) ?? [], now, 6e4);
2726
2726
  this.spentWayBack.set(relay, spent);
2727
2727
  return Math.floor(this.limitOf(relay) * WAY_BACK_SHARE) - (who.write ? 0 : 1) - spent.length;
2728
2728
  }
@@ -2806,7 +2806,7 @@ var RelayTransport = class {
2806
2806
  }
2807
2807
  /** This key's departed reads past the limit in the last minute (`DEPARTED_READS`). */
2808
2808
  overReads(over, key, now) {
2809
- const reads = within(over.get(key) ?? [], now, 6e4);
2809
+ const reads = within$1(over.get(key) ?? [], now, 6e4);
2810
2810
  if (reads.length) over.set(key, reads);
2811
2811
  else over.delete(key);
2812
2812
  return reads.length;
@@ -2854,7 +2854,7 @@ var RelayTransport = class {
2854
2854
  spareHeldFor(relay, now) {
2855
2855
  const reserved = this.chatReservedFor(relay, now);
2856
2856
  if (reserved <= 0) return 0;
2857
- const recent = within(this.spent.get(relay) ?? [], now, 6e4);
2857
+ const recent = within$1(this.spent.get(relay) ?? [], now, 6e4);
2858
2858
  const keep = this.limitOf(relay) - this.chatReserveOf(relay, now);
2859
2859
  return recent.length >= keep ? Math.min(reserved, recent[recent.length - keep] + 6e4 - now) : 0;
2860
2860
  }
@@ -3195,7 +3195,7 @@ var TurnRecordError = class extends Error {
3195
3195
  this.name = "TurnRecordError";
3196
3196
  }
3197
3197
  };
3198
- var refuse$2 = (refusal, detail) => {
3198
+ var refuse$3 = (refusal, detail) => {
3199
3199
  throw new TurnRecordError(refusal, detail);
3200
3200
  };
3201
3201
  var isZero = (bytes) => bytes.every((b) => b === 0);
@@ -3291,70 +3291,70 @@ async function signTurnBody(address, fields, signer) {
3291
3291
  * against the device that was active before) is the caller's: `turnRead.ts`.
3292
3292
  */
3293
3293
  function readTurnBody(body, address) {
3294
- if (body.length !== 374) refuse$2("length");
3295
- if (body[OFFSET.version] !== 1) refuse$2("version");
3294
+ if (body.length !== 374) refuse$3("length");
3295
+ if (body[OFFSET.version] !== 1) refuse$3("version");
3296
3296
  const turn = new DataView(body.buffer, body.byteOffset, body.byteLength).getUint32(OFFSET.turn);
3297
3297
  const rev = body[OFFSET.rev] << 16 | body[OFFSET.rev + 1] << 8 | body[OFFSET.rev + 2];
3298
- if (rev >= TURN_REV_LIMIT) refuse$2("rev");
3298
+ if (rev >= TURN_REV_LIMIT) refuse$3("rev");
3299
3299
  const author = body[OFFSET.author], active = body[OFFSET.active], count = body[OFFSET.count];
3300
- if (author >= 4) refuse$2("author");
3301
- if (active >= 4 && active !== 255) refuse$2("active");
3302
- if (count > 4) refuse$2("count");
3300
+ if (author >= 4) refuse$3("author");
3301
+ if (active >= 4 && active !== 255) refuse$3("active");
3302
+ if (count > 4) refuse$3("count");
3303
3303
  const slots = [];
3304
3304
  const decoder = new TextDecoder("utf-8", { fatal: true });
3305
3305
  for (let i = 0; i < 4; i++) {
3306
3306
  const at = OFFSET.slots + i * SLOT_BYTES;
3307
3307
  const key = body.slice(at, at + 32), padded = body.subarray(at + 32, at + SLOT_BYTES);
3308
3308
  if (isZero(key)) {
3309
- if (!isZero(padded)) refuse$2("slots");
3309
+ if (!isZero(padded)) refuse$3("slots");
3310
3310
  slots.push(null);
3311
3311
  continue;
3312
3312
  }
3313
3313
  const end = padded.indexOf(0);
3314
3314
  const name = end < 0 ? padded : padded.subarray(0, end);
3315
- if (end >= 0 && !isZero(padded.subarray(end))) refuse$2("name");
3315
+ if (end >= 0 && !isZero(padded.subarray(end))) refuse$3("name");
3316
3316
  let text = "";
3317
3317
  try {
3318
3318
  text = decoder.decode(name);
3319
3319
  } catch {
3320
- refuse$2("name");
3320
+ refuse$3("name");
3321
3321
  }
3322
- if (slots.some((other) => other && bytesEqual(other.key, key))) refuse$2("slots", "one key in two slots");
3322
+ if (slots.some((other) => other && bytesEqual(other.key, key))) refuse$3("slots", "one key in two slots");
3323
3323
  slots.push({
3324
3324
  key,
3325
3325
  name: turnName(text)
3326
3326
  });
3327
3327
  }
3328
- if (slots.filter(Boolean).length !== count) refuse$2("count");
3328
+ if (slots.filter(Boolean).length !== count) refuse$3("count");
3329
3329
  const authorSlot = slots[author];
3330
- if (!authorSlot) return refuse$2("author");
3330
+ if (!authorSlot) return refuse$3("author");
3331
3331
  const tombstone = turn === TOMBSTONE_TURN;
3332
- if (tombstone !== (active === 255)) refuse$2("tombstone");
3332
+ if (tombstone !== (active === 255)) refuse$3("tombstone");
3333
3333
  if (!tombstone) {
3334
- if (!slots[active]) refuse$2("active");
3335
- if (author !== active) refuse$2("author-not-active");
3334
+ if (!slots[active]) refuse$3("active");
3335
+ if (author !== active) refuse$3("author-not-active");
3336
3336
  }
3337
3337
  const present = body[OFFSET.releasePresent];
3338
- if (present > 1) refuse$2("release-layout");
3338
+ if (present > 1) refuse$3("release-layout");
3339
3339
  let release;
3340
3340
  if (!present) {
3341
- if (!isZero(body.subarray(OFFSET.releaseFrom, OFFSET.signature))) refuse$2("release-layout");
3341
+ if (!isZero(body.subarray(OFFSET.releaseFrom, OFFSET.signature))) refuse$3("release-layout");
3342
3342
  } else {
3343
- if (tombstone) refuse$2("tombstone", "a tombstone carries no release");
3343
+ if (tombstone) refuse$3("tombstone", "a tombstone carries no release");
3344
3344
  const from = body[OFFSET.releaseFrom], to = body[OFFSET.releaseTo];
3345
3345
  const fromSlot = from < 4 ? slots[from] : null, toSlot = to < 4 ? slots[to] : null;
3346
- if (!fromSlot || !toSlot) return refuse$2("release-layout");
3346
+ if (!fromSlot || !toSlot) return refuse$3("release-layout");
3347
3347
  release = {
3348
3348
  from,
3349
3349
  to,
3350
3350
  h: body.slice(OFFSET.releaseH, OFFSET.releaseSignature),
3351
3351
  signature: body.slice(OFFSET.releaseSignature, OFFSET.signature)
3352
3352
  };
3353
- if (to !== active) refuse$2("release", "the release is to another device than the active one");
3354
- if (!verify(release.signature, turnReleaseMessage(address, turn, toSlot.key, release.h), fromSlot.key)) refuse$2("release");
3353
+ if (to !== active) refuse$3("release", "the release is to another device than the active one");
3354
+ if (!verify(release.signature, turnReleaseMessage(address, turn, toSlot.key, release.h), fromSlot.key)) refuse$3("release");
3355
3355
  }
3356
3356
  const signature = body.slice(OFFSET.signature);
3357
- if (!verify(signature, turnSignedMessage(address, body), authorSlot.key)) refuse$2("signature");
3357
+ if (!verify(signature, turnSignedMessage(address, body), authorSlot.key)) refuse$3("signature");
3358
3358
  return {
3359
3359
  turn,
3360
3360
  rev,
@@ -4529,7 +4529,7 @@ function parseImageMeta(value, mime) {
4529
4529
  var u16be$1 = (b, at) => b[at] << 8 | b[at + 1];
4530
4530
  var u16le = (b, at) => b[at] | b[at + 1] << 8;
4531
4531
  var u24le = (b, at) => b[at] | b[at + 1] << 8 | b[at + 2] << 16;
4532
- var u32be$2 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
4532
+ var u32be$3 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
4533
4533
  var ascii = (b, at, text) => [...text].every((c, i) => b[at + i] === c.charCodeAt(0));
4534
4534
  var sized = (width, height) => edge(width) && edge(height) ? {
4535
4535
  width,
@@ -4557,7 +4557,7 @@ function exifOrientation(b, tiff, end) {
4557
4557
  const little = ascii(b, tiff, "II");
4558
4558
  if (!little && !ascii(b, tiff, "MM")) return 1;
4559
4559
  const u16 = (at) => little ? u16le(b, at) : u16be$1(b, at);
4560
- const u32 = (at) => little ? u16le(b, at) + u16le(b, at + 2) * 65536 : u32be$2(b, at);
4560
+ const u32 = (at) => little ? u16le(b, at) + u16le(b, at + 2) * 65536 : u32be$3(b, at);
4561
4561
  if (u16(tiff + 2) !== 42) return 1;
4562
4562
  const ifd = tiff + u32(tiff + 4);
4563
4563
  if (ifd + 2 > end) return 1;
@@ -4642,7 +4642,7 @@ function gifSize(b) {
4642
4642
  function imageSize(head) {
4643
4643
  const b = head;
4644
4644
  try {
4645
- if (b.length >= 24 && b[0] === 137 && ascii(b, 1, "PNG\r\n\n") && ascii(b, 12, "IHDR")) return sized(u32be$2(b, 16), u32be$2(b, 20));
4645
+ if (b.length >= 24 && b[0] === 137 && ascii(b, 1, "PNG\r\n\n") && ascii(b, 12, "IHDR")) return sized(u32be$3(b, 16), u32be$3(b, 20));
4646
4646
  if (b.length >= 10 && (ascii(b, 0, "GIF87a") || ascii(b, 0, "GIF89a"))) return gifSize(b);
4647
4647
  if (b.length >= 4 && b[0] === 255 && b[1] === 216 && b[2] === 255) return jpegSize(b);
4648
4648
  if (b.length >= 16 && ascii(b, 0, "RIFF") && ascii(b, 8, "WEBP")) return webpSize(b);
@@ -7981,6 +7981,24 @@ var LIMITS = {
7981
7981
  */
7982
7982
  maxClientWaiting: 64,
7983
7983
  maxClientWaitingBodyBytes: 67108864,
7984
+ /**
7985
+ * Response-body bytes a client holds for one response before whatever reads it took them. Past it, a response its
7986
+ * reader takes nothing of for `unreadStallMs` is reset: its reader stalled. Four times what a host keeps buffered on
7987
+ * the link (`sendHighWaterMark`), so a reader that keeps up never reaches it.
7988
+ */
7989
+ maxUnreadResponseBytes: 4194304,
7990
+ /**
7991
+ * How long a reader past `maxUnreadResponseBytes` may take nothing before its response is reset. One that keeps
7992
+ * reading, only slower than the link (a video playing as it arrives, a contact's app read through the web's services
7993
+ * worker), is not cut: it holds up to the response's own bound.
7994
+ */
7995
+ unreadStallMs: 2e3,
7996
+ /**
7997
+ * Response-body bytes a client holds for all its responses before their readers took them. Past it, a response over
7998
+ * `maxUnreadResponseBytes` is reset at once, its reader's pace aside: one slow reader keeps its whole response (as
7999
+ * much as `maxResponseBodyBytes`), but many cannot add up (a contact's app reading each answer a chunk at a time).
8000
+ */
8001
+ maxClientUnreadResponseBytes: 67108864,
7984
8002
  maxChatMessageBytes: 16384,
7985
8003
  maxFileBytes: 104857600,
7986
8004
  /** Files a peer may be sending us at once. */
@@ -8352,10 +8370,11 @@ function resolveTargetUrl(target, path) {
8352
8370
  if (!path.startsWith("/") || path.startsWith("//")) return null;
8353
8371
  for (const char of path) {
8354
8372
  const code = char.codePointAt(0) ?? 0;
8355
- if (code <= 32 || code === 127 || char === "\\") return null;
8373
+ if (code <= 32 || code === 127) return null;
8356
8374
  }
8357
8375
  const queryAt = path.indexOf("?");
8358
8376
  const pathPart = queryAt === -1 ? path : path.slice(0, queryAt);
8377
+ if (pathPart.includes("\\")) return null;
8359
8378
  if (/%(2f|5c|2e)/i.test(pathPart)) return null;
8360
8379
  if (pathPart.split("/").some(climbsOut)) return null;
8361
8380
  let url;
@@ -8434,14 +8453,15 @@ function sanitizeRequestHeaders(headers) {
8434
8453
  return !DROPPED_REQUEST_HEADER_PREFIXES.some((prefix) => lower.startsWith(prefix));
8435
8454
  });
8436
8455
  }
8437
- function sanitizeResponseHeaders(headers, target) {
8456
+ /** `from`: the local URL of the request answered, the one a relative `Location` is read against. */
8457
+ function sanitizeResponseHeaders(headers, target, from) {
8438
8458
  const out = [];
8439
8459
  for (const [name, value] of headers) {
8440
8460
  const lower = name.toLowerCase();
8441
8461
  if (!HEADER_NAME.test(name) || !isCleanHeaderValue(value)) continue;
8442
8462
  if (HOP_BY_HOP.has(lower) || DROPPED_RESPONSE_HEADERS.has(lower)) continue;
8443
8463
  if (lower === "location" || lower === "content-location") {
8444
- const location = relativizeLocation(value, target);
8464
+ const location = relativizeLocation(value, target, from);
8445
8465
  if (location !== null) out.push([name, location]);
8446
8466
  } else if (lower === "set-cookie") out.push([name, value.replace(/;\s*domain\s*=[^;]*/gi, "")]);
8447
8467
  else out.push([name, value]);
@@ -8557,12 +8577,14 @@ function withViewerPolicy(headers, relayOnly = false) {
8557
8577
  /**
8558
8578
  * Turns `http://localhost:3400/base/x` into `/x` so the client never learns or
8559
8579
  * follows the local address. Null when the location is not on the target origin
8560
- * and under its base path.
8580
+ * and under its base path. A relative one (`edit`, `?page=2`, `../x`) is read
8581
+ * against `from`, the local URL of the request it answers, as a browser reads it;
8582
+ * without one, against the base path.
8561
8583
  */
8562
- function relativizeLocation(location, target) {
8584
+ function relativizeLocation(location, target, from) {
8563
8585
  let url;
8564
8586
  try {
8565
- url = new URL(location, `${target.origin}${target.basePath}/`);
8587
+ url = new URL(location, from ?? `${target.origin}${target.basePath}/`);
8566
8588
  } catch {
8567
8589
  return null;
8568
8590
  }
@@ -8575,10 +8597,10 @@ function relativizeLocation(location, target) {
8575
8597
  if (!path.startsWith("/") || path.startsWith("//")) return null;
8576
8598
  return `${path}${url.search}${url.hash}`;
8577
8599
  }
8578
- function isRedirectBlocked(response, target) {
8600
+ function isRedirectBlocked(response, target, from) {
8579
8601
  if (response.status < 300 || response.status > 399) return false;
8580
8602
  const location = response.headers.find(([name]) => name.toLowerCase() === "location");
8581
- return location !== void 0 && relativizeLocation(location[1], target) === null;
8603
+ return location !== void 0 && relativizeLocation(location[1], target, from) === null;
8582
8604
  }
8583
8605
  var ALLOWED_METHODS = /* @__PURE__ */ new Set([
8584
8606
  "GET",
@@ -8603,6 +8625,8 @@ var HttpHost = class {
8603
8625
  live = /* @__PURE__ */ new Set();
8604
8626
  /** Body bytes of the streams in `live`: a peer cannot make the host hold more than `maxHostBodyBytesPerPeer`. */
8605
8627
  heldBodyBytes = 0;
8628
+ /** One listener per `revoked` signal of the open streams, not one per stream: a page opens dozens at once. */
8629
+ revokedListeners = /* @__PURE__ */ new Map();
8606
8630
  constructor(channel, getService, localFetch) {
8607
8631
  this.channel = channel;
8608
8632
  this.getService = getService;
@@ -8615,7 +8639,7 @@ var HttpHost = class {
8615
8639
  if (this.streams.has(frame.id)) return;
8616
8640
  const method = frame.m.toUpperCase();
8617
8641
  const service = this.getService(frame.s);
8618
- if (!service) return this.fail(frame.id, 404, "unknown-service", "This peer does not share that service.");
8642
+ if (!service || service.revoked?.aborted) return this.fail(frame.id, 404, "unknown-service", "This peer does not share that service.");
8619
8643
  if (!ALLOWED_METHODS.has(method)) return this.fail(frame.id, 405, "method-not-allowed", "Method not allowed.");
8620
8644
  if (this.live.size >= LIMITS.maxConcurrentRequestsPerPeer) return this.fail(frame.id, 503, "busy", "Too many concurrent requests.");
8621
8645
  const url = resolveTargetUrl(service.target, frame.p);
@@ -8635,6 +8659,7 @@ var HttpHost = class {
8635
8659
  };
8636
8660
  this.streams.set(frame.id, stream);
8637
8661
  this.live.add(stream);
8662
+ if (service.revoked) this.watchRevoked(service.revoked);
8638
8663
  if (frame.b && !BODYLESS_METHODS.has(method)) this.watchPace(stream);
8639
8664
  else this.run(stream);
8640
8665
  }
@@ -8683,6 +8708,33 @@ var HttpHost = class {
8683
8708
  stream.abort.abort();
8684
8709
  if (this.isCurrent(stream)) this.streams.delete(stream.frame.id);
8685
8710
  if (!stream.started) this.release(stream);
8711
+ const revoked = stream.service.revoked;
8712
+ const listener = revoked && this.revokedListeners.get(revoked);
8713
+ if (listener && ![...this.streams.values()].some((s) => s.service.revoked === revoked)) {
8714
+ revoked.removeEventListener("abort", listener);
8715
+ this.revokedListeners.delete(revoked);
8716
+ }
8717
+ }
8718
+ /** An answer still on its way would reach someone the app is no longer shared with: those streams are reset. */
8719
+ watchRevoked(revoked) {
8720
+ if (this.revokedListeners.has(revoked)) return;
8721
+ const listener = () => {
8722
+ this.revokedListeners.delete(revoked);
8723
+ for (const stream of [...this.streams.values()]) {
8724
+ if (stream.service.revoked !== revoked) continue;
8725
+ this.end(stream);
8726
+ try {
8727
+ this.channel.send(encodeControl({
8728
+ t: "rst",
8729
+ id: stream.frame.id,
8730
+ d: "s",
8731
+ e: "The app is no longer shared with you."
8732
+ }));
8733
+ } catch {}
8734
+ }
8735
+ };
8736
+ this.revokedListeners.set(revoked, listener);
8737
+ revoked.addEventListener("abort", listener, { once: true });
8686
8738
  }
8687
8739
  /** The stream no longer counts toward the limits: its body is dropped, or its local fetch has settled. */
8688
8740
  release(stream) {
@@ -8734,7 +8786,7 @@ var HttpHost = class {
8734
8786
  }));
8735
8787
  return;
8736
8788
  }
8737
- if (isRedirectBlocked(response, service.target)) {
8789
+ if (isRedirectBlocked(response, service.target, stream.url)) {
8738
8790
  this.end(stream);
8739
8791
  return this.fail(frame.id, 502, "redirect-blocked", "The service redirected outside of the shared target.");
8740
8792
  }
@@ -8743,7 +8795,7 @@ var HttpHost = class {
8743
8795
  t: "res",
8744
8796
  id: frame.id,
8745
8797
  st: response.status,
8746
- h: sanitizeResponseHeaders(response.headers, service.target),
8798
+ h: sanitizeResponseHeaders(response.headers, service.target, stream.url),
8747
8799
  b: hasBody
8748
8800
  };
8749
8801
  this.channel.send(encodeControl(res));
@@ -8815,12 +8867,23 @@ var GhostlyHttpError = class extends Error {
8815
8867
  }
8816
8868
  };
8817
8869
  var BodyQueue = class {
8870
+ all;
8818
8871
  chunks = [];
8819
8872
  done = false;
8820
8873
  error = null;
8821
8874
  wake = null;
8875
+ /** Bytes received and not yet read. */
8876
+ held = 0;
8877
+ /** Bytes read so far, all told. */
8878
+ taken = 0;
8879
+ /** `all`: what every queue of the same client holds, kept with this one's. */
8880
+ constructor(all) {
8881
+ this.all = all;
8882
+ }
8822
8883
  push(chunk) {
8823
8884
  this.chunks.push(chunk);
8885
+ this.held += chunk.length;
8886
+ this.all.held += chunk.length;
8824
8887
  this.wake?.();
8825
8888
  }
8826
8889
  finish(error) {
@@ -8829,9 +8892,24 @@ var BodyQueue = class {
8829
8892
  this.error = error ?? null;
8830
8893
  this.wake?.();
8831
8894
  }
8895
+ /** Lets go of what was not read yet, ended or not: the reader gets `error` in its place. */
8896
+ drop(error) {
8897
+ this.chunks = [];
8898
+ this.all.held -= this.held;
8899
+ this.held = 0;
8900
+ this.done = true;
8901
+ this.error = error;
8902
+ this.wake?.();
8903
+ }
8832
8904
  async *[Symbol.asyncIterator]() {
8833
8905
  for (;;) {
8834
- while (this.chunks.length > 0) yield this.chunks.shift();
8906
+ while (this.chunks.length > 0) {
8907
+ const chunk = this.chunks.shift();
8908
+ this.held -= chunk.length;
8909
+ this.all.held -= chunk.length;
8910
+ this.taken += chunk.length;
8911
+ yield chunk;
8912
+ }
8835
8913
  if (this.error) throw this.error;
8836
8914
  if (this.done) return;
8837
8915
  await new Promise((resolve) => this.wake = resolve);
@@ -8847,6 +8925,8 @@ var HttpClient = class {
8847
8925
  waitingBytes = 0;
8848
8926
  inFlight = 0;
8849
8927
  closed = false;
8928
+ /** Response-body bytes all this client's responses hold before their readers took them. */
8929
+ unread = { held: 0 };
8850
8930
  constructor(channel) {
8851
8931
  this.channel = channel;
8852
8932
  }
@@ -8919,7 +8999,7 @@ var HttpClient = class {
8919
8999
  const stream = this.streams.get(frame.id);
8920
9000
  if (!stream || stream.queue) return;
8921
9001
  clearTimeout(stream.headersTimer);
8922
- const queue = new BodyQueue();
9002
+ const queue = new BodyQueue(this.unread);
8923
9003
  stream.queue = queue;
8924
9004
  if (frame.b) this.armIdleTimer(frame.id, stream);
8925
9005
  else this.finish(frame.id);
@@ -8940,9 +9020,34 @@ var HttpClient = class {
8940
9020
  stream.received += chunk.payload.length;
8941
9021
  if (stream.received > stream.maxBytes) return this.abort(chunk.id, new GhostlyHttpError("response-too-large", "Response body too large"));
8942
9022
  if (chunk.payload.length > 0) stream.queue.push(chunk.payload.slice());
9023
+ if (stream.queue.held > LIMITS.maxUnreadResponseBytes) {
9024
+ if (this.unread.held > LIMITS.maxClientUnreadResponseBytes) return this.dropUnread(chunk.id, stream.queue);
9025
+ this.checkUnread(chunk.id, stream, stream.queue);
9026
+ }
8943
9027
  if (chunk.end) this.finish(chunk.id);
8944
9028
  else this.armIdleTimer(chunk.id, stream);
8945
9029
  }
9030
+ /**
9031
+ * Nothing tells the peer to slow down, and its last chunk frees the slot: a reader that stalls (a contact's page that
9032
+ * never reads what it fetched) would have the whole body held here, one per request it leaves unread. Past the bound
9033
+ * the reader gets `unreadStallMs`, as a link that hands over many chunks at once leaves it no turn: one that took
9034
+ * something in it is looked at again, one that took nothing has the response reset and what it held let go.
9035
+ */
9036
+ checkUnread(id, stream, queue) {
9037
+ if (stream.unreadCheck) return;
9038
+ const taken = queue.taken;
9039
+ stream.unreadCheck = setTimeout(() => {
9040
+ stream.unreadCheck = void 0;
9041
+ if (queue.held <= LIMITS.maxUnreadResponseBytes) return;
9042
+ if (queue.taken > taken) return this.checkUnread(id, stream, queue);
9043
+ this.dropUnread(id, queue);
9044
+ }, LIMITS.unreadStallMs);
9045
+ }
9046
+ dropUnread(id, queue) {
9047
+ const error = new GhostlyHttpError("unread", "Response body not read in time");
9048
+ queue.drop(error);
9049
+ this.abort(id, error);
9050
+ }
8946
9051
  handleReset(frame) {
8947
9052
  this.abort(frame.id, new GhostlyHttpError("reset", frame.e || "Request reset by peer"), false);
8948
9053
  }
@@ -10462,6 +10567,8 @@ var DataLink = class {
10462
10567
  fullGather = false;
10463
10568
  /** The offer or answer out has no public candidate (as it went: the connection's description gains any that come later). */
10464
10569
  sentLacksPublic = false;
10570
+ /** Connections the gathering under way replaced for finding no candidate at all (`gathered`); 0 when none is under way. */
10571
+ gatherStalls = 0;
10465
10572
  lastSignalTs = 0;
10466
10573
  /** The peer's description as this connection was given it: Chrome shows it as `remoteDescription` only once applied. */
10467
10574
  remoteSdp = null;
@@ -10555,11 +10662,13 @@ var DataLink = class {
10555
10662
  }
10556
10663
  this.lastSignalTs = signal.ts;
10557
10664
  const wasOpen = this.state === "open";
10665
+ const unpublic = this.gatherStalled;
10558
10666
  this.teardown();
10559
10667
  if (wasOpen) {
10560
10668
  this.options.onDirect?.("closed");
10561
10669
  this.options.onClose();
10562
10670
  }
10671
+ if (unpublic) this.options.onDirect?.("no-public");
10563
10672
  this.answered = {
10564
10673
  offer: signal,
10565
10674
  at: Date.now(),
@@ -10637,7 +10746,7 @@ var DataLink = class {
10637
10746
  }
10638
10747
  close() {
10639
10748
  const stalled = Date.now() - this.connectingSince >= STALLED_EVIDENCE_MS;
10640
- const evidence = stalled ? this.directEvidence() : null;
10749
+ const evidence = (stalled ? this.directEvidence() : null) ?? (this.gatherStalled ? "no-public" : null);
10641
10750
  this.noteNoPublic(stalled);
10642
10751
  this.answered = null;
10643
10752
  this.reset();
@@ -10669,6 +10778,16 @@ var DataLink = class {
10669
10778
  return !PUBLIC_CANDIDATE.test(local) ? "no-public" : symmetricNat(local) ? "symmetric" : this.myOfferTs ? "no-path" : null;
10670
10779
  }
10671
10780
  /**
10781
+ * The gathering under way found no candidate on every connection but the one it waits on now (`GATHER_ATTEMPTS` - 1
10782
+ * stalls): ended from outside now (another transport went live, the contact's offer took its place), it says what
10783
+ * one that ran out says, `no-public`. Saying nothing held the note back on a network that blocks direct connections:
10784
+ * a browser there gathers none, its chats went live over Iroh before the third stall, and only a later attempt, if
10785
+ * any came, said it (direct-blocked e2e, 2026-11-13).
10786
+ */
10787
+ get gatherStalled() {
10788
+ return this.gatherStalls >= 2;
10789
+ }
10790
+ /**
10672
10791
  * The attempt on this connection failed (it timed out, ICE failed or closed, its channel closed). An answer the
10673
10792
  * offerer may not have read yet is made again for the same offer while it still stands (`REANSWERS`); anything
10674
10793
  * else goes back to idle. `byConnection`: the connection said so itself, rather than a timer of this link's.
@@ -10753,6 +10872,7 @@ var DataLink = class {
10753
10872
  */
10754
10873
  async gathered(offer, describe) {
10755
10874
  let stalled = null;
10875
+ this.gatherStalls = 0;
10756
10876
  for (let attempt = 1;; attempt++) {
10757
10877
  const pc = this.createConnection();
10758
10878
  if (stalled) this.closeConnection(stalled);
@@ -10772,6 +10892,7 @@ var DataLink = class {
10772
10892
  offer,
10773
10893
  ...attempt > 1 ? { attempt } : {}
10774
10894
  });
10895
+ this.gatherStalls = 0;
10775
10896
  return pc;
10776
10897
  }
10777
10898
  traceLink(this.options.myPubKeyZ32, "ice-stalled", {
@@ -10785,6 +10906,7 @@ var DataLink = class {
10785
10906
  return null;
10786
10907
  }
10787
10908
  stalled = pc;
10909
+ this.gatherStalls = attempt;
10788
10910
  }
10789
10911
  }
10790
10912
  createConnection() {
@@ -10862,6 +10984,7 @@ var DataLink = class {
10862
10984
  this.myOfferTs = this.myOfferOutAt = 0;
10863
10985
  this.answerCameLate = false;
10864
10986
  this.remoteSdp = null;
10987
+ this.gatherStalls = 0;
10865
10988
  if (!pc) return false;
10866
10989
  this.closeConnection(pc);
10867
10990
  return true;
@@ -16811,7 +16934,7 @@ async function verifyPeerProof(event, c, readStorage) {
16811
16934
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
16812
16935
  } else if (c.adapter === "keet-import") {
16813
16936
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
16814
- const { default: IdentityKey } = await import("./keet-identity-key-CDgu84Dj.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
16937
+ const { default: IdentityKey } = await import("./keet-identity-key-DLXTTFZH.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
16815
16938
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
16816
16939
  } else throw new Error("Unsupported proof adapter");
16817
16940
  }
@@ -19721,6 +19844,8 @@ var AppRanges = class {
19721
19844
  newServeId;
19722
19845
  now;
19723
19846
  serves = /* @__PURE__ */ new Map();
19847
+ /** The same serves by app, then file: an app may serve 100,000 files, and walking `serves` for each was O(n²). */
19848
+ servesByApp = /* @__PURE__ */ new Map();
19724
19849
  serving = /* @__PURE__ */ new Map();
19725
19850
  /**
19726
19851
  * Tasks cancelled, unserved, or stopped by the contact's close or a session's end, that this side is still reading or
@@ -19750,25 +19875,33 @@ var AppRanges = class {
19750
19875
  */
19751
19876
  serve(app, file) {
19752
19877
  if (!isChatAppId(app)) throw new Error("Not a chat app id");
19753
- for (const [served, serve] of this.serves) if (serve.app === app && serve.file === file) return served;
19878
+ const files = this.servesByApp.get(app) ?? /* @__PURE__ */ new Map();
19879
+ const served = files.get(file);
19880
+ if (served !== void 0) return served;
19754
19881
  let id = this.newServeId();
19755
19882
  while (this.serves.has(id)) id = this.newServeId();
19756
19883
  this.serves.set(id, {
19757
19884
  app,
19758
19885
  file
19759
19886
  });
19887
+ files.set(file, id);
19888
+ this.servesByApp.set(app, files);
19760
19889
  return id;
19761
19890
  }
19762
19891
  /** Ends one serve: requests under it still being sent stop. False when it was not served. */
19763
19892
  unserve(serveId) {
19764
- if (!this.serves.get(serveId)) return false;
19893
+ const serve = this.serves.get(serveId);
19894
+ if (!serve) return false;
19765
19895
  this.serves.delete(serveId);
19896
+ const files = this.servesByApp.get(serve.app);
19897
+ files.delete(serve.file);
19898
+ if (!files.size) this.servesByApp.delete(serve.app);
19766
19899
  for (const task of this.serving.values()) if (task.serve === serveId) this.drop(task, true);
19767
19900
  return true;
19768
19901
  }
19769
19902
  /** The serve ids `app` has given out and not ended (what the panel's "Sharing with" line shows). */
19770
19903
  servesOf(app) {
19771
- return [...this.serves].filter(([, serve]) => serve.app === app).map(([id]) => id);
19904
+ return [...this.servesByApp.get(app)?.values() ?? []];
19772
19905
  }
19773
19906
  /** An `ar-get` from the contact: the task to read and send, or null when it was refused (the refusal is sent) or dropped. */
19774
19907
  receiveGet(frame) {
@@ -19901,14 +20034,15 @@ var AppRanges = class {
19901
20034
  * them now.
19902
20035
  */
19903
20036
  closeApp(app, error = "peer-closed", stopped = false) {
19904
- for (const [id, serve] of this.serves) if (serve.app === app) this.serves.delete(id);
20037
+ for (const id of this.servesByApp.get(app)?.values() ?? []) this.serves.delete(id);
20038
+ this.servesByApp.delete(app);
19905
20039
  for (const key of [...this.sizes.keys()]) if (key.startsWith(`${app} `)) this.sizes.delete(key);
19906
20040
  this.endRequests(app, error, stopped);
19907
20041
  }
19908
20042
  /** The session ended: no serve id lasts into the next, and every request fails with `offline`. Tasks still being read keep their places into the next. */
19909
20043
  reset() {
19910
20044
  this.sizes.clear();
19911
- for (const app of new Set([...this.serves.values()].map((serve) => serve.app))) this.closeApp(app, "offline");
20045
+ for (const app of [...this.servesByApp.keys()]) this.closeApp(app, "offline");
19912
20046
  this.suspend();
19913
20047
  }
19914
20048
  /**
@@ -22887,9 +23021,10 @@ function mergeLobby(existing, mine, now = Date.now()) {
22887
23021
  function freshHubs(hubs, now = Date.now()) {
22888
23022
  return hubs.filter((h) => now - h.ts < COMMUNITY_TOPOLOGY.beaconFreshMs && h.ts <= now + 6e4);
22889
23023
  }
23024
+ var rankHash = (subject, hubKey) => sha256(concatBytes(utf8Encode("ghostly-group-community/1 rank"), publicKeyFromZ32(subject), publicKeyFromZ32(hubKey)));
22890
23025
  /** Rendezvous hashing: how strongly a hub is responsible for someone (a knock, a member). Highest first. */
22891
23026
  function hubRank(subject, hubKey) {
22892
- return toBase64Url(sha256(concatBytes(utf8Encode("ghostly-group-community/1 rank"), publicKeyFromZ32(subject), publicKeyFromZ32(hubKey))));
23027
+ return toBase64Url(rankHash(subject, hubKey));
22893
23028
  }
22894
23029
  function rankHubs(subject, hubs) {
22895
23030
  return [...hubs].sort((a, b) => {
@@ -22898,12 +23033,25 @@ function rankHubs(subject, hubs) {
22898
23033
  });
22899
23034
  }
22900
23035
  /**
22901
- * The hubs a member asks for edges: the least loaded fresh ones with room, ties broken by rank
22902
- * for this member (so members spread out), at most `hubsPerMember`.
23036
+ * The hubs a member asks for edges: fresh ones with room, at most `hubsPerMember`, by rendezvous hashing weighted by
23037
+ * the room each has left, so the members picking at once spread over the hubs in proportion to it. The members a
23038
+ * closing hub carried all pick in the same second: each took the least loaded hub, all of them the same one, which
23039
+ * opened their 12 or 16 edges at once on its relays' budget and brought none up for minutes, then the next hub did the
23040
+ * same, and 6 of them stepped up as hubs with nobody on them (36 members, bug hunt, 2026-11-11).
22903
23041
  */
22904
23042
  function pickHubs(me, hubs, now = Date.now(), avoid = /* @__PURE__ */ new Set()) {
22905
23043
  const lately = (h) => now - h.ts < COMMUNITY_TOPOLOGY.beaconEveryMs * 1.5 ? 0 : 1;
22906
- return freshHubs(hubs, now).filter((h) => h.key !== me && !avoid.has(h.key) && h.load < COMMUNITY_TOPOLOGY.hubCapacity).sort((a, b) => lately(a) - lately(b) || a.load - b.load || (hubRank(me, a.key) < hubRank(me, b.key) ? 1 : -1)).slice(0, COMMUNITY_TOPOLOGY.hubsPerMember).map((h) => h.key);
23044
+ return freshHubs(hubs, now).filter((h) => h.key !== me && !avoid.has(h.key) && h.load < COMMUNITY_TOPOLOGY.hubCapacity).map((h) => ({
23045
+ key: h.key,
23046
+ lately: lately(h),
23047
+ score: spreadScore(me, h)
23048
+ })).sort((a, b) => a.lately - b.lately || b.score - a.score).slice(0, COMMUNITY_TOPOLOGY.hubsPerMember).map((h) => h.key);
23049
+ }
23050
+ /** Weighted rendezvous hashing: room / -ln(u), u in (0, 1) from this member's rank of the hub; the highest is picked. */
23051
+ function spreadScore(me, hub) {
23052
+ const r = rankHash(me, hub.key);
23053
+ const u = (r[0] * 65536 + r[1] * 256 + r[2] + .5) / 16777216;
23054
+ return (COMMUNITY_TOPOLOGY.hubCapacity - hub.load) / -Math.log(u);
22907
23055
  }
22908
23056
  /** Should this member be a hub? Too few fresh hubs, or all full, and room in the beacon. */
22909
23057
  function shouldBeHub(me, hubs, now = Date.now()) {
@@ -23934,6 +24082,12 @@ var BLOCKED_DIAL_WAIT_MS = 1e4;
23934
24082
  */
23935
24083
  var UNPROVEN_AUTH_MS = 15e3;
23936
24084
  /**
24085
+ * Connections dialled in that authenticate at once beside the one waiting to take over (`contend`). Whoever read the
24086
+ * endpoint and dials it over and over pushes out only the oldest of them: the contact's, a few round trips long, is
24087
+ * pushed out only by this many dials within those round trips.
24088
+ */
24089
+ var DIALED_IN_CONTENDERS = 8;
24090
+ /**
23937
24091
  * A native connection this side dialled that has not authenticated this long after it opened, while the contact's
23938
24092
  * record names a newer way to dial it: the dial went to an old address (the web app's Iroh homed on another relay after
23939
24093
  * a restart), and the chat dials the new one at once. Sooner, it is a handshake still under way.
@@ -24281,6 +24435,11 @@ var GhostLink = class {
24281
24435
  switcher;
24282
24436
  /** `plan`: a switch both sides agreed; without one, a replacement the contact dialled (`attachReplacement`). */
24283
24437
  candidate = null;
24438
+ /**
24439
+ * Connections that authenticate beside a `candidate` dialled in and unproven (`contend`), oldest first: whichever
24440
+ * authenticates first takes over, so one that never does neither holds the place nor takes it from the contact's.
24441
+ */
24442
+ contenders = [];
24284
24443
  candidateEpoch = 0;
24285
24444
  /** The native dial a transport change has in flight, per transport (`prepareSwitch`). */
24286
24445
  switchDials = /* @__PURE__ */ new Map();
@@ -24445,6 +24604,10 @@ var GhostLink = class {
24445
24604
  /** The attempt (its epoch) whose direct transports were knocked on as its offer went out (`knockEarly`), and whether that is under way. */
24446
24605
  knockedEarly = -1;
24447
24606
  knockingEarly = false;
24607
+ /** The attempt (its epoch) of a resume over WebRTC whose offer Iroh joined, its endpoint up only after the dial (`joinRace`). */
24608
+ irohJoinedResume = -1;
24609
+ /** The same for HyperDHT (direct, and already in the race's `afterRtc`). */
24610
+ hyperdhtJoinedResume = -1;
24448
24611
  /** When this side's offer's answer was applied (`RACE_ANSWERED_MS`); 0 while the data link is not connecting on it. */
24449
24612
  answeredAt = 0;
24450
24613
  /** This side's offer is out unanswered, or answered and not connected yet: what is ranked after WebRTC may race it. */
@@ -24792,7 +24955,7 @@ var GhostLink = class {
24792
24955
  if (isDiscoveryBudgetError(error)) return;
24793
24956
  if (!signal || !options.params.profile) return;
24794
24957
  this.signalPublishFailed = true;
24795
- events.onPairingState?.({
24958
+ this.sayPairingState({
24796
24959
  status: "error",
24797
24960
  error: publishFailure(error)
24798
24961
  });
@@ -25048,7 +25211,7 @@ var GhostLink = class {
25048
25211
  } else if (credentials?.requireSignedSignals && !this.isDataLinkOpen) {
25049
25212
  this.securityRejected = true;
25050
25213
  this.tracker?.failed("rejected", false);
25051
- options.events?.onPairingState?.({
25214
+ this.sayPairingState({
25052
25215
  status: "error",
25053
25216
  keyMismatch: false,
25054
25217
  error: "Ignored an unauthenticated discovery signal. Keep both peers on the updated version; the saved key has not been replaced."
@@ -25140,7 +25303,7 @@ var GhostLink = class {
25140
25303
  if (this.stopped || this.keyStopped || this.securityRejected) return;
25141
25304
  if (this.streamBlocked) this.emitDeliveryState();
25142
25305
  else if (this.paired?.state) this.emitPairingState();
25143
- else this.options.events?.onPairingState?.({ status: "connecting" });
25306
+ else this.sayPairingState({ status: "connecting" });
25144
25307
  }
25145
25308
  emitPairingState() {
25146
25309
  this.syncWait();
@@ -25157,7 +25320,7 @@ var GhostLink = class {
25157
25320
  if (!open) this.pairedFiles?.closeAll();
25158
25321
  this.options.events?.onDataLinkState?.(open ? "open" : "idle");
25159
25322
  }
25160
- this.options.events?.onPairingState?.({
25323
+ this.sayPairingState({
25161
25324
  ...state,
25162
25325
  ...blocked ? {
25163
25326
  status: this.transitionError ? "error" : "negotiating",
@@ -25244,17 +25407,36 @@ var GhostLink = class {
25244
25407
  this.session.setActive(active);
25245
25408
  this.dht?.setActive(active);
25246
25409
  }
25410
+ /**
25411
+ * What `emitDeliveryState` said last, cleared by any other pairing state: every mailbox read and publication of a
25412
+ * DHT-only chat asks for it again, and one that changed nothing builds no engine state (bug hunt 1109-chat-perf).
25413
+ */
25414
+ saidDeliveryState;
25415
+ sayPairingState(state) {
25416
+ this.saidDeliveryState = void 0;
25417
+ this.options.events?.onPairingState?.(state);
25418
+ }
25247
25419
  emitDeliveryState() {
25248
25420
  if (!this.streamBlocked) return;
25249
25421
  const credentials = this.options.pairing?.credentials;
25250
25422
  const error = this.dht?.view.error;
25251
- this.options.events?.onPairingState?.({
25423
+ const state = {
25252
25424
  status: error ? "error" : credentials?.peerKey ? "ready" : "connecting",
25253
25425
  peerKey: credentials?.peerKey,
25254
25426
  code: this.dht?.comparisonCode,
25255
25427
  verified: !!credentials?.peerKey && credentials.verifiedPeerKey === credentials.peerKey,
25256
25428
  error
25257
- });
25429
+ };
25430
+ const said = JSON.stringify([
25431
+ state.status,
25432
+ state.peerKey,
25433
+ state.code,
25434
+ state.verified,
25435
+ state.error
25436
+ ]);
25437
+ if (said === this.saidDeliveryState) return;
25438
+ this.saidDeliveryState = said;
25439
+ this.options.events?.onPairingState?.(state);
25258
25440
  }
25259
25441
  async setDeliveryMode(mode) {
25260
25442
  if (!this.dht) throw new Error("DHT delivery is unavailable for this conversation.");
@@ -25365,7 +25547,7 @@ var GhostLink = class {
25365
25547
  if (epoch !== this.connectionEpoch) return;
25366
25548
  const message = error instanceof Error ? error.message : String(error);
25367
25549
  this.tracker?.failed("transport", true, message);
25368
- if (!this.dialFailed(message)) this.options.events?.onPairingState?.({
25550
+ if (!this.dialFailed(message)) this.sayPairingState({
25369
25551
  status: "error",
25370
25552
  error: message
25371
25553
  });
@@ -26147,7 +26329,7 @@ var GhostLink = class {
26147
26329
  side: "dialled",
26148
26330
  failed: []
26149
26331
  };
26150
- this.options.events?.onPairingState?.({ status: "connecting" });
26332
+ this.sayPairingState({ status: "connecting" });
26151
26333
  try {
26152
26334
  const local = this.transportOffer();
26153
26335
  const relayed = relayedTransports(this.localDescriptors(), this.peerDescriptors);
@@ -26480,9 +26662,12 @@ var GhostLink = class {
26480
26662
  maybeKnockEarly(epoch) {
26481
26663
  const next = this.afterRtc, missed = !!this.offered?.knockMissed;
26482
26664
  if (!(this.offered?.resume || missed) || this.offered?.epoch !== epoch || this.knockedEarly === epoch || next?.epoch !== epoch || epoch !== this.connectionEpoch) return;
26483
- if (this.dialing || this.channel || this.stopped || !this.offerOut || !(missed || this.offered.woke || this.contactQuiet())) return;
26665
+ if (this.dialing || this.channel || this.stopped || !this.offerOut) return;
26666
+ const iroh = !missed && this.irohJoinedResume === epoch && this.irohRanksFirst();
26667
+ const hyperdht = !missed && this.hyperdhtJoinedResume === epoch && next.rest.includes("hyperdht/1") && !this.relayedTransports.includes("hyperdht/1") && this.canDial("hyperdht/1");
26668
+ if (!iroh && !hyperdht && !(missed || this.offered.woke || this.contactQuiet())) return;
26484
26669
  const relayed = missed || this.upgradesFromRelay() ? [] : this.relayedTransports;
26485
- const direct = next.rest.filter((t) => !relayed.includes(t) && this.canDial(t));
26670
+ const direct = iroh || hyperdht ? [...iroh ? ["iroh/1"] : [], ...hyperdht ? ["hyperdht/1"] : []] : next.rest.filter((t) => !relayed.includes(t) && this.canDial(t));
26486
26671
  if (!direct.length) return;
26487
26672
  this.knockedEarly = epoch;
26488
26673
  this.knockEarly(epoch, direct);
@@ -26529,9 +26714,20 @@ var GhostLink = class {
26529
26714
  rest: [...rest, transport]
26530
26715
  };
26531
26716
  traceLink(this.myPubKeyZ32, "race-join", { transport });
26717
+ if (offered.resume && transport === "iroh/1") this.irohJoinedResume = offered.epoch;
26718
+ if (offered.resume && transport === "hyperdht/1") this.hyperdhtJoinedResume = offered.epoch;
26532
26719
  if (offered.knockMissed && this.canDial(transport)) this.knockEarly(offered.epoch, [transport]);
26533
26720
  if (!this.racing) this.scheduleRace(offered.epoch, offered.at);
26534
26721
  }
26722
+ /**
26723
+ * On Automatic with no choice standing, Iroh ranks ahead of WebRTC for this contact and can be dialled now (WISP 100,
26724
+ * revision 2026-11-08): where a resume over WebRTC goes on Iroh instead (`dial`).
26725
+ */
26726
+ irohRanksFirst() {
26727
+ if (!this.automatic || !this.peerTransports || !this.canDial("iroh/1") || (this.switcher.chosenTarget ?? this.choiceApart?.transport)) return false;
26728
+ const ranked = rankTransports(this.transportOffer(), this.peerFallback ? this.peerTransports : this.peerTransports.slice(0, 1), this.relayedTransports);
26729
+ return ranked.includes("iroh/1") && ranked.indexOf("iroh/1") < ranked.indexOf("webrtc/1");
26730
+ }
26535
26731
  /** WebRTC could not start an attempt here: it goes last in the dial order for `RTC_UNSTARTED_MS`, while another transport remains. */
26536
26732
  rtcUnstarted() {
26537
26733
  traceLink(this.myPubKeyZ32, "rtc-unstarted", {});
@@ -27976,16 +28172,18 @@ var GhostLink = class {
27976
28172
  requireLegacyCapabilities() {
27977
28173
  if (this.options.params.profile) throw new Error("This experimental paired profile supports chat only.");
27978
28174
  }
27979
- cancelCandidate() {
28175
+ /** `closeRtc`: a WebRTC attempt under way beside a native session is this change's, and ends with it. */
28176
+ cancelCandidate(closeRtc = true) {
27980
28177
  this.candidateEpoch++;
27981
28178
  const candidate = this.candidate;
27982
28179
  this.candidate = null;
27983
28180
  candidate?.session.stop();
27984
28181
  candidate?.reject(/* @__PURE__ */ new Error("Transport change cancelled"));
27985
28182
  candidate?.channel.close();
28183
+ this.dropContenders("Transport change cancelled");
27986
28184
  this.rtcCandidateWaiter?.reject(/* @__PURE__ */ new Error("Transport change cancelled"));
27987
28185
  this.rtcCandidateWaiter = null;
27988
- if (this.activeBinding) this.dataLink.close();
28186
+ if (this.activeBinding && closeRtc) this.dataLink.close();
27989
28187
  }
27990
28188
  async prepareSwitch(plan) {
27991
28189
  const epoch = ++this.candidateEpoch;
@@ -28071,6 +28269,7 @@ var GhostLink = class {
28071
28269
  candidate?.session.stop();
28072
28270
  candidate?.reject(/* @__PURE__ */ new Error("Candidate failed"));
28073
28271
  candidate?.channel.close();
28272
+ this.dropContenders("Candidate failed");
28074
28273
  this.rtcCandidateWaiter = null;
28075
28274
  if (transport === "webrtc/1") this.dataLink.close();
28076
28275
  }
@@ -28078,16 +28277,62 @@ var GhostLink = class {
28078
28277
  if (epoch === this.candidateEpoch && this.switcher.pending === plan) this.switcher.fail(`Transport change failed: ${lastError instanceof Error ? lastError.message : "no permitted transport connected"}. Retry or choose another transport.`);
28079
28278
  }
28080
28279
  attachCandidate(channel, binding, plan) {
28081
- if (this.candidate || this.switcher.pending !== plan || !plan.choices.includes(binding?.transport ?? "webrtc/1")) {
28280
+ const rtcMove = !binding && plan.choices[0] === "webrtc/1";
28281
+ if (this.candidate && !this.contendable(rtcMove ? this.candidate.plan : plan) || this.switcher.pending !== plan || !plan.choices.includes(binding?.transport ?? "webrtc/1")) {
28082
28282
  channel.close();
28083
28283
  return Promise.reject(/* @__PURE__ */ new Error("Obsolete or duplicate transport candidate"));
28084
28284
  }
28085
- return new Promise((resolve, reject) => this.attach(channel, binding, {
28285
+ return new Promise((resolve, reject) => this.contend(channel, binding, {
28086
28286
  plan,
28087
28287
  resolve,
28088
28288
  reject
28089
28289
  }));
28090
28290
  }
28291
+ /** The candidate waiting for `plan` (none: a replacement) was dialled in and has not authenticated yet. */
28292
+ contendable(plan) {
28293
+ const held = this.candidate;
28294
+ return !!held && held.plan === plan && this.unproven(held.channel) && held.session.state.status !== "ready";
28295
+ }
28296
+ /**
28297
+ * A connection that authenticates beside the candidate held (`contenders`), or takes the place if none is. With
28298
+ * `DIALED_IN_CONTENDERS` waiting already, the oldest dialled in and unproven of them gives its place up.
28299
+ */
28300
+ contend(channel, binding, migration) {
28301
+ if (this.candidate && this.contenders.length >= 8) {
28302
+ const at = this.contenders.findIndex((c) => this.unproven(c.channel));
28303
+ if (at < 0) {
28304
+ channel.close();
28305
+ migration.reject(/* @__PURE__ */ new Error("Obsolete or duplicate transport candidate"));
28306
+ return;
28307
+ }
28308
+ const [oldest] = this.contenders.splice(at, 1);
28309
+ traceLink(this.myPubKeyZ32, "dialed-in-dropped", { transport: oldest.binding?.transport });
28310
+ oldest.session.stop();
28311
+ oldest.reject(/* @__PURE__ */ new Error("A newer connection took its place"));
28312
+ oldest.channel.close();
28313
+ }
28314
+ this.attach(channel, binding, migration);
28315
+ }
28316
+ /** One of the `contenders` authenticated first: it takes the candidate's place, and the candidate held closes. */
28317
+ promoteContender(channel) {
28318
+ const at = this.contenders.findIndex((c) => c.channel === channel);
28319
+ if (at < 0) return false;
28320
+ const [won] = this.contenders.splice(at, 1), held = this.candidate;
28321
+ this.candidate = won;
28322
+ if (held) {
28323
+ held.session.stop();
28324
+ held.reject(/* @__PURE__ */ new Error("Another connection authenticated first"));
28325
+ held.channel.close();
28326
+ }
28327
+ return true;
28328
+ }
28329
+ dropContenders(reason) {
28330
+ for (const c of this.contenders.splice(0)) {
28331
+ c.session.stop();
28332
+ c.reject(new Error(reason));
28333
+ c.channel.close();
28334
+ }
28335
+ }
28091
28336
  /**
28092
28337
  * Both sides dialled at once (two apps back after a restart, each knocking): the lower key's dial carries the chat, on
28093
28338
  * both sides; the higher key's side takes it over as a replacement (`attachReplacement`). Here, on the lower key's
@@ -28154,13 +28399,12 @@ var GhostLink = class {
28154
28399
  channel.close();
28155
28400
  return;
28156
28401
  }
28157
- const waiting = this.candidate;
28158
- if (waiting && !waiting.plan && this.unproven(waiting.channel) && waiting.session.state.status !== "ready") {
28159
- traceLink(this.myPubKeyZ32, "dialed-in-dropped", { transport: waiting.binding?.transport });
28160
- this.candidate = null;
28161
- waiting.session.stop();
28162
- waiting.channel.close();
28163
- waiting.reject(/* @__PURE__ */ new Error("A newer connection took its place"));
28402
+ if (this.contendable()) {
28403
+ this.contend(channel, binding, {
28404
+ resolve: () => {},
28405
+ reject: () => {}
28406
+ });
28407
+ return;
28164
28408
  }
28165
28409
  if (this.candidate) {
28166
28410
  channel.close();
@@ -28302,6 +28546,11 @@ var GhostLink = class {
28302
28546
  this.candidate = null;
28303
28547
  migration?.reject(/* @__PURE__ */ new Error("Candidate connection closed"));
28304
28548
  }
28549
+ const contender = this.contenders.findIndex((c) => c.channel === channel);
28550
+ if (contender >= 0) {
28551
+ this.contenders.splice(contender, 1)[0].session.stop();
28552
+ migration?.reject(/* @__PURE__ */ new Error("Candidate connection closed"));
28553
+ }
28305
28554
  if (this.channel === channel) {
28306
28555
  const wasLive = this.paired?.state.status === "ready";
28307
28556
  this.rejectWaiters(/* @__PURE__ */ new Error("The peer closed this connection. Check that both transport preferences allow a common transport, then reconnect."));
@@ -28375,7 +28624,7 @@ var GhostLink = class {
28375
28624
  let carried = null;
28376
28625
  let switched = null, replaced = false;
28377
28626
  if (migration) {
28378
- if (this.candidate?.channel !== channel) {
28627
+ if (this.candidate?.channel !== channel && !this.promoteContender(channel)) {
28379
28628
  paired.stop();
28380
28629
  channel.close();
28381
28630
  return;
@@ -28383,6 +28632,7 @@ var GhostLink = class {
28383
28632
  const oldChannel = this.channel, oldPaired = this.paired, oldBinding = this.activeBinding;
28384
28633
  const from = oldPaired?.state.transport;
28385
28634
  this.candidate = null;
28635
+ this.dropContenders("Another connection authenticated first");
28386
28636
  const files = this.pairedFiles;
28387
28637
  this.pairedFiles = null;
28388
28638
  if (files && migration.plan && paired.supports("files/2")) {
@@ -28823,14 +29073,17 @@ var GhostLink = class {
28823
29073
  }
28824
29074
  }
28825
29075
  });
28826
- if (migration) this.candidate = {
28827
- channel,
28828
- session: paired,
28829
- binding,
28830
- ...migration.plan && { plan: migration.plan },
28831
- reject: migration.reject
28832
- };
28833
- else this.paired = paired;
29076
+ if (migration) {
29077
+ const entry = {
29078
+ channel,
29079
+ session: paired,
29080
+ binding,
29081
+ ...migration.plan && { plan: migration.plan },
29082
+ reject: migration.reject
29083
+ };
29084
+ if (this.candidate) this.contenders.push(entry);
29085
+ else this.candidate = entry;
29086
+ } else this.paired = paired;
28834
29087
  paired.start();
28835
29088
  return;
28836
29089
  }
@@ -29227,7 +29480,7 @@ var GhostLink = class {
29227
29480
  this.applicationOpen = false;
29228
29481
  this.dht?.setLive(false);
29229
29482
  if (!this.candidate) {
29230
- this.cancelCandidate();
29483
+ this.cancelCandidate(!!this.switcher.pending || !!this.rtcCandidateWaiter);
29231
29484
  this.switcher.stop();
29232
29485
  this.transitionTarget = this.transitionError = void 0;
29233
29486
  }
@@ -29294,9 +29547,12 @@ var GhostLink = class {
29294
29547
  via: "datalink"
29295
29548
  });
29296
29549
  break;
29297
- case "call":
29298
- this.options.events?.onCallSignal?.(heardCallSignal(frame.s, Date.now()));
29550
+ case "call": {
29551
+ if (!this.callsReceived.take()) break;
29552
+ const signal = heardCallSignal(frame.s, Date.now());
29553
+ if (this.pairedCalls.heard(signal)) this.options.events?.onCallSignal?.(signal);
29299
29554
  break;
29555
+ }
29300
29556
  case "req":
29301
29557
  this.httpHost?.handleRequest(frame);
29302
29558
  break;
@@ -29363,8 +29619,9 @@ var GhostLink = class {
29363
29619
  * and HEIF (HEIC, AVIF), without decoding or re-encoding a pixel.
29364
29620
  *
29365
29621
  * Fail-closed: a file that is one of these pictures, by its bytes or by its type, and whose metadata cannot be removed
29366
- * (truncated, malformed, a part this does not know) is refused with `NO_PICTURE_METADATA`, never sent as it was. Any
29367
- * other file goes as it is.
29622
+ * (truncated, malformed, a part this does not know) is refused with `NO_PICTURE_METADATA`, never sent as it was. So is
29623
+ * a JPEG XL or a JPEG 2000 in its boxes (their Exif, XMP and GeoJP2 boxes are not removed here). Any other file goes
29624
+ * as it is.
29368
29625
  */
29369
29626
  var PICTURE_METADATA_LIMITS = {
29370
29627
  /** The largest picture read whole to remove its metadata: past this it is refused. */
@@ -29405,9 +29662,11 @@ var HEIF_BRANDS = /* @__PURE__ */ new Set([
29405
29662
  "avif",
29406
29663
  "avis"
29407
29664
  ]);
29665
+ /** The signature box a JPEG XL (`JXL `) or a JPEG 2000 (`jP `) in boxes starts with. */
29666
+ var SIGNATURE_BOXES = /* @__PURE__ */ new Set(["JXL ", "jP "]);
29408
29667
  var u16be = (b, at) => b[at] << 8 | b[at + 1];
29409
- var u32be$1 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
29410
- var u32le$1 = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
29668
+ var u32be$2 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
29669
+ var u32le$2 = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
29411
29670
  var text$2 = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
29412
29671
  var starts = (b, at, prefix) => at + prefix.length <= b.length && text$2(b, at, prefix.length) === prefix;
29413
29672
  /** A picture this strips, by its first bytes. */
@@ -29417,8 +29676,9 @@ function kindOf(b) {
29417
29676
  if (b.length >= 12 && starts(b, 0, "RIFF") && starts(b, 8, "WEBP")) return "webp";
29418
29677
  if (starts(b, 0, "GIF87a") || starts(b, 0, "GIF89a")) return "gif";
29419
29678
  if (starts(b, 0, "II*\0") || starts(b, 0, "MM\0*") || starts(b, 0, "II+\0") || starts(b, 0, "MM\0+")) return "tiff";
29679
+ if (b.length >= 12 && u32be$2(b, 0) === 12 && SIGNATURE_BOXES.has(text$2(b, 4, 4)) && u32be$2(b, 8) === 218793738) return "boxes";
29420
29680
  if (b.length >= 16 && starts(b, 4, "ftyp")) {
29421
- const end = Math.min(b.length, u32be$1(b, 0));
29681
+ const end = Math.min(b.length, u32be$2(b, 0));
29422
29682
  for (let at = 8; at + 4 <= end; at += 4) if (at !== 12 && HEIF_BRANDS.has(text$2(b, at, 4))) return "heif";
29423
29683
  }
29424
29684
  }
@@ -29542,7 +29802,7 @@ function stripPng(b) {
29542
29802
  let at = 8, exif = false, imaged = false;
29543
29803
  for (;;) {
29544
29804
  check$2(at + 12 <= b.length);
29545
- const length = u32be$1(b, at), type = text$2(b, at + 4, 4);
29805
+ const length = u32be$2(b, at), type = text$2(b, at + 4, 4);
29546
29806
  check$2(at + 12 + length <= b.length && (at > 8 || type === "IHDR"));
29547
29807
  const critical = (b[at + 4] & 32) === 0;
29548
29808
  check$2(!critical || PNG_CRITICAL.has(type));
@@ -29568,13 +29828,13 @@ var WEBP_KEEPS = /* @__PURE__ */ new Set([
29568
29828
  ]);
29569
29829
  function stripWebp(b) {
29570
29830
  check$2(b.length >= 20);
29571
- const riffEnd = 8 + u32le$1(b, 4);
29831
+ const riffEnd = 8 + u32le$2(b, 4);
29572
29832
  check$2(riffEnd <= b.length && riffEnd % 2 === 0);
29573
29833
  const parts = [];
29574
29834
  let at = 12, size = 4, drawn = false, exif = false, vp8x;
29575
29835
  while (at < riffEnd) {
29576
29836
  check$2(at + 8 <= riffEnd);
29577
- const type = text$2(b, at, 4), length = u32le$1(b, at + 4), end = at + 8 + length + (length & 1);
29837
+ const type = text$2(b, at, 4), length = u32le$2(b, at + 4), end = at + 8 + length + (length & 1);
29578
29838
  check$2(end <= riffEnd && (at > 12 || type === "VP8 " || type === "VP8L" || type === "VP8X"));
29579
29839
  let chunk;
29580
29840
  if (WEBP_KEEPS.has(type)) {
@@ -29692,11 +29952,11 @@ function boxes$1(b, start, end) {
29692
29952
  const found = [];
29693
29953
  for (let at = start; at < end;) {
29694
29954
  check$2(at + 8 <= end);
29695
- let size = u32be$1(b, at), body = at + 8;
29955
+ let size = u32be$2(b, at), body = at + 8;
29696
29956
  const type = text$2(b, at + 4, 4);
29697
29957
  if (size === 1) {
29698
29958
  check$2(at + 16 <= end);
29699
- size = u32be$1(b, at + 8) * 2 ** 32 + u32be$1(b, at + 12);
29959
+ size = u32be$2(b, at + 8) * 2 ** 32 + u32be$2(b, at + 12);
29700
29960
  body = at + 16;
29701
29961
  } else if (size === 0) size = end - at;
29702
29962
  if (type === "uuid") body += 16;
@@ -29734,7 +29994,7 @@ function stripHeif(b) {
29734
29994
  const version = b[infe.body];
29735
29995
  check$2(version === 2 || version === 3);
29736
29996
  let at = infe.body + 4;
29737
- const id = version === 2 ? u16be(b, at) : u32be$1(b, at);
29997
+ const id = version === 2 ? u16be(b, at) : u32be$2(b, at);
29738
29998
  at += version === 2 ? 2 : 4;
29739
29999
  check$2(at + 6 <= infe.end);
29740
30000
  if (HEIF_METADATA_ITEMS.has(text$2(b, at + 2, 4))) metadata.add(id);
@@ -29756,7 +30016,7 @@ function stripHeif(b) {
29756
30016
  /** The next field of `size` bytes (0, 2, 4 or 8), big-endian. */
29757
30017
  const read = (size) => {
29758
30018
  check$2(at + size <= iloc.end);
29759
- const value = size === 0 ? 0 : size === 2 ? u16be(b, at) : size === 4 ? u32be$1(b, at) : size === 8 ? u32be$1(b, at) * 2 ** 32 + u32be$1(b, at + 4) : NaN;
30019
+ const value = size === 0 ? 0 : size === 2 ? u16be(b, at) : size === 4 ? u32be$2(b, at) : size === 8 ? u32be$2(b, at) * 2 ** 32 + u32be$2(b, at + 4) : NaN;
29760
30020
  check$2(Number.isSafeInteger(value));
29761
30021
  at += size;
29762
30022
  return value;
@@ -29962,7 +30222,7 @@ function stripTiff(b) {
29962
30222
  };
29963
30223
  const u32 = (at) => {
29964
30224
  check$2(at + 4 <= b.length);
29965
- return little ? u32le$1(b, at) : u32be$1(b, at);
30225
+ return little ? u32le$2(b, at) : u32be$2(b, at);
29966
30226
  };
29967
30227
  check$2(b.length >= 8 && u16(2) === 42);
29968
30228
  const out = b.slice(), seen = /* @__PURE__ */ new Set();
@@ -30022,13 +30282,18 @@ function stripTiff(b) {
30022
30282
  }
30023
30283
  return [out];
30024
30284
  }
30285
+ /** A JPEG XL or a JPEG 2000 in boxes: refused. */
30286
+ function refuse$2() {
30287
+ throw new Error(NO_PICTURE_METADATA);
30288
+ }
30025
30289
  var STRIP = {
30026
30290
  jpeg: stripJpeg,
30027
30291
  png: stripPng,
30028
30292
  webp: stripWebp,
30029
30293
  heif: stripHeif,
30030
30294
  gif: stripGif,
30031
- tiff: stripTiff
30295
+ tiff: stripTiff,
30296
+ boxes: refuse$2
30032
30297
  };
30033
30298
  /**
30034
30299
  * A picture's bytes without its metadata, as parts to put in a Blob; undefined when the file is not a picture this
@@ -30081,18 +30346,31 @@ async function withoutPictureMetadata(source, mime) {
30081
30346
  * removed (truncated, malformed, a part of its movie this does not know) is refused with `NO_VIDEO_METADATA`, never sent as it was.
30082
30347
  * A picture (HEIF is pictureMetadata.ts's) and any other file go as they are; so does a file without a video track (an
30083
30348
  * M4A) here: audioMetadata.ts strips it.
30349
+ *
30350
+ * An AVI (a dashcam's, an older camera's) goes without what its header and its `INFO` list say: each chunk but the
30351
+ * ones its frames and sound are made of (`avih`, `strh`, `strf`, `indx`, `vprp`, `dmlh`) becomes `JUNK`, zeroed (a
30352
+ * stream's name `strn` and data `strd`, `IDIT`'s date, a camera's `LIST ncdt`), and the chunks of a stream that is
30353
+ * neither pictures nor sound (a GPS or subtitle text stream) are zeroed in `movi`, so no offset moves. An ASF (WMV,
30354
+ * WMA), an FLV and an MPEG transport stream are refused with `NO_VIDEO_METADATA` (a WMA, typed as audio, with
30355
+ * `NO_AUDIO_METADATA`): their titles, places and dates are not removed here.
30084
30356
  */
30085
30357
  var VIDEO_METADATA_LIMITS = {
30086
30358
  /** The largest `moov` or `moof` read whole, and the most bytes of a metadata track's chunk: past this the video is refused. */
30087
30359
  maxBoxBytes: 67108864,
30088
30360
  /** The most top-level boxes walked (a fragmented MP4 has two per fragment). */
30089
30361
  maxBoxes: 1e5,
30362
+ /** The most chunks of an AVI walked (one per frame and per piece of sound). */
30363
+ maxChunks: 4e6,
30090
30364
  /** Bytes read first to tell a video from another file. */
30091
30365
  headBytes: 64,
30092
30366
  /** Bytes read at once for a box's header or a small box, so the next headers and `moof`s are read with it. */
30093
30367
  readAhead: 65536,
30094
30368
  /** The most a walk going on from its window reads at once (an Ogg's pages, a live WebM's blocks: the whole file). */
30095
- readAheadMax: 4194304
30369
+ readAheadMax: 4194304,
30370
+ /** The most bytes between two parts replaced that are read and sent with them as one part of the stripped video. */
30371
+ joinGap: 65536,
30372
+ /** The most bytes of such a part. */
30373
+ joinedBytes: 4194304
30096
30374
  };
30097
30375
  /** Why a video is refused: its metadata could not be removed, so it does not go at all. */
30098
30376
  var NO_VIDEO_METADATA = "This video cannot be sent: Ghostly could not remove the details saved in it, like where it was recorded";
@@ -30219,7 +30497,7 @@ var VISUAL = /* @__PURE__ */ new Set([
30219
30497
  ]);
30220
30498
  /** Zeros put in a Blob a slice at a time: a Blob's Blob parts are not copied, so a zeroed range of any size holds no more. */
30221
30499
  var ZEROS$1 = new Blob([/* @__PURE__ */ new Uint8Array(1048576)]);
30222
- var u32be = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
30500
+ var u32be$1 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
30223
30501
  var text$1 = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
30224
30502
  /** Refuses the video where its bytes are not what this expects. */
30225
30503
  function check$1(ok) {
@@ -30228,11 +30506,11 @@ function check$1(ok) {
30228
30506
  /** A box's header at `at` of `b` (`base` its offset in the file), up to `end` (a size of 0 runs to it). */
30229
30507
  function header(b, at, end, base = 0) {
30230
30508
  check$1(at + 8 <= b.length);
30231
- let size = u32be(b, at), body = at + 8;
30509
+ let size = u32be$1(b, at), body = at + 8;
30232
30510
  const type = text$1(b, at + 4, 4);
30233
30511
  if (size === 1) {
30234
30512
  check$1(at + 16 <= b.length);
30235
- size = u32be(b, at + 8) * 2 ** 32 + u32be(b, at + 12);
30513
+ size = u32be$1(b, at + 8) * 2 ** 32 + u32be$1(b, at + 12);
30236
30514
  body = at + 16;
30237
30515
  } else if (size === 0) size = end - (base + at);
30238
30516
  if (type === "uuid") body += 16;
@@ -30262,7 +30540,7 @@ function empty(b, box) {
30262
30540
  101,
30263
30541
  101
30264
30542
  ], box.start + 4);
30265
- b.fill(0, box.start + (u32be(b, box.start) === 1 ? 16 : 8), box.end);
30543
+ b.fill(0, box.start + (u32be$1(b, box.start) === 1 ? 16 : 8), box.end);
30266
30544
  }
30267
30545
  /**
30268
30546
  * Every metadata box in a container's children (and in theirs, for the containers below a track) emptied, every
@@ -30305,9 +30583,9 @@ function chunkOffsets(b, stbl) {
30305
30583
  check$1(!!stco !== !!co64);
30306
30584
  const offsets = stco ?? co64;
30307
30585
  check$1(offsets.body + 8 <= offsets.end);
30308
- const chunks = u32be(b, offsets.body + 4);
30586
+ const chunks = u32be$1(b, offsets.body + 4);
30309
30587
  check$1(offsets.body + 8 + chunks * (co64 ? 8 : 4) <= offsets.end);
30310
- const offsetOf = (i) => co64 ? u32be(b, co64.body + 8 + i * 8) * 2 ** 32 + u32be(b, co64.body + 12 + i * 8) : u32be(b, stco.body + 8 + i * 4);
30588
+ const offsetOf = (i) => co64 ? u32be$1(b, co64.body + 8 + i * 8) * 2 ** 32 + u32be$1(b, co64.body + 12 + i * 8) : u32be$1(b, stco.body + 8 + i * 4);
30311
30589
  return {
30312
30590
  chunks,
30313
30591
  offsetOf
@@ -30320,14 +30598,14 @@ function sampleRanges(b, stbl) {
30320
30598
  const need = (box, at, bytes) => check$1(at + bytes <= box.end);
30321
30599
  const sizeTable = stsz ?? stz2;
30322
30600
  need(sizeTable, sizeTable.body, 12);
30323
- const count = u32be(b, sizeTable.body + 8);
30601
+ const count = u32be$1(b, sizeTable.body + 8);
30324
30602
  let sizeOf;
30325
30603
  /** Samples of one size: a chunk's length is counted, not added up a sample at a time. */
30326
30604
  let uniform = 0;
30327
30605
  if (stsz) {
30328
- uniform = u32be(b, stsz.body + 4);
30606
+ uniform = u32be$1(b, stsz.body + 4);
30329
30607
  if (!uniform) need(stsz, stsz.body + 12, count * 4);
30330
- sizeOf = (i) => u32be(b, stsz.body + 12 + i * 4);
30608
+ sizeOf = (i) => u32be$1(b, stsz.body + 12 + i * 4);
30331
30609
  } else {
30332
30610
  const field = b[stz2.body + 7];
30333
30611
  check$1(field === 4 || field === 8 || field === 16);
@@ -30337,13 +30615,13 @@ function sampleRanges(b, stbl) {
30337
30615
  }
30338
30616
  const { chunks, offsetOf } = chunkOffsets(b, stbl);
30339
30617
  need(stsc, stsc.body, 8);
30340
- const runs = u32be(b, stsc.body + 4);
30618
+ const runs = u32be$1(b, stsc.body + 4);
30341
30619
  need(stsc, stsc.body + 8, runs * 12);
30342
30620
  const ranges = [];
30343
30621
  let sample = 0;
30344
30622
  for (let run = 0; run < runs; run++) {
30345
- const first = u32be(b, stsc.body + 8 + run * 12), perChunk = u32be(b, stsc.body + 12 + run * 12);
30346
- const last = run + 1 < runs ? u32be(b, stsc.body + 8 + (run + 1) * 12) : chunks + 1;
30623
+ const first = u32be$1(b, stsc.body + 8 + run * 12), perChunk = u32be$1(b, stsc.body + 12 + run * 12);
30624
+ const last = run + 1 < runs ? u32be$1(b, stsc.body + 8 + (run + 1) * 12) : chunks + 1;
30347
30625
  check$1(first >= 1 && last > first && last <= chunks + 1);
30348
30626
  for (let chunk = first; chunk < last; chunk++) {
30349
30627
  const start = offsetOf(chunk - 1);
@@ -30365,7 +30643,7 @@ function defaultSampleSizes(moov) {
30365
30643
  for (const trex of mvex ? boxes(moov, mvex.body, mvex.end) : []) {
30366
30644
  if (trex.type !== "trex") continue;
30367
30645
  check$1(trex.body + 24 <= trex.end);
30368
- sizes.set(u32be(moov, trex.body + 4), u32be(moov, trex.body + 16));
30646
+ sizes.set(u32be$1(moov, trex.body + 4), u32be$1(moov, trex.body + 16));
30369
30647
  }
30370
30648
  return sizes;
30371
30649
  }
@@ -30383,30 +30661,30 @@ function fragmentRanges(b, at, sizes) {
30383
30661
  if (traf.type !== "traf") continue;
30384
30662
  const tfhd = child(b, traf, "tfhd");
30385
30663
  check$1(!!tfhd && tfhd.body + 8 <= tfhd.end);
30386
- const flags = u32be(b, tfhd.body) & 16777215;
30664
+ const flags = u32be$1(b, tfhd.body) & 16777215;
30387
30665
  let field = tfhd.body + 8, base = flags & 131072 ? at : previous;
30388
30666
  if (flags & 1) {
30389
30667
  check$1(field + 8 <= tfhd.end);
30390
- base = u32be(b, field) * 2 ** 32 + u32be(b, field + 4);
30668
+ base = u32be$1(b, field) * 2 ** 32 + u32be$1(b, field + 4);
30391
30669
  field += 8;
30392
30670
  }
30393
30671
  if (flags & 2) field += 4;
30394
30672
  if (flags & 8) field += 4;
30395
- const track = u32be(b, tfhd.body + 4);
30673
+ const track = u32be$1(b, tfhd.body + 4);
30396
30674
  let size = sizes.get(track);
30397
30675
  if (flags & 16) {
30398
30676
  check$1(field + 4 <= tfhd.end);
30399
- size = u32be(b, field);
30677
+ size = u32be$1(b, field);
30400
30678
  }
30401
30679
  let next = base;
30402
30680
  for (const trun of boxes(b, traf.body, traf.end)) {
30403
30681
  if (trun.type !== "trun") continue;
30404
30682
  check$1(trun.body + 8 <= trun.end);
30405
- const runFlags = u32be(b, trun.body) & 16777215, count = u32be(b, trun.body + 4);
30683
+ const runFlags = u32be$1(b, trun.body) & 16777215, count = u32be$1(b, trun.body + 4);
30406
30684
  let field = trun.body + 8;
30407
30685
  if (runFlags & 1) {
30408
30686
  check$1(field + 4 <= trun.end);
30409
- next = base + (u32be(b, field) | 0);
30687
+ next = base + (u32be$1(b, field) | 0);
30410
30688
  field += 4;
30411
30689
  }
30412
30690
  if (runFlags & 4) field += 4;
@@ -30420,7 +30698,7 @@ function fragmentRanges(b, at, sizes) {
30420
30698
  let length = 0;
30421
30699
  if (runFlags & 512) {
30422
30700
  const sizeAt = field + (runFlags & 256 ? 4 : 0);
30423
- for (let i = 0; i < count; i++) length += u32be(b, sizeAt + i * stride);
30701
+ for (let i = 0; i < count; i++) length += u32be$1(b, sizeAt + i * stride);
30424
30702
  } else if (count) {
30425
30703
  check$1(size !== void 0);
30426
30704
  length = count * size;
@@ -30501,7 +30779,7 @@ function stripMoov(b) {
30501
30779
  check$1(selfContained(b, minf) && !!tkhd);
30502
30780
  const id = tkhd.body + 4 + (b[tkhd.body] === 1 ? 16 : 8);
30503
30781
  check$1(id + 4 <= tkhd.end);
30504
- captions.add(u32be(b, id));
30782
+ captions.add(u32be$1(b, id));
30505
30783
  for (const range of sampleRanges(b, stbl)) zeroed.push(range);
30506
30784
  } else check$1(HANDLERS.has(handler));
30507
30785
  if (handler === "vide") video = true;
@@ -30531,6 +30809,20 @@ function meets(ranges, start, end) {
30531
30809
  return low < ranges.length && ranges[low][0] < end;
30532
30810
  }
30533
30811
  /**
30812
+ * Whether `start` to `end` of the file is within one of `boxes` (in file order, apart): the first one that ends at or
30813
+ * past `end` is the only one that can hold it, found by halves, so a caption run per fragment is not checked against
30814
+ * every fragment's `mdat`.
30815
+ */
30816
+ function within(boxes, start, end) {
30817
+ let low = 0, high = boxes.length;
30818
+ while (low < high) {
30819
+ const middle = low + high >>> 1;
30820
+ if (boxes[middle].end >= end) high = middle;
30821
+ else low = middle + 1;
30822
+ }
30823
+ return low < boxes.length && start >= boxes[low].body;
30824
+ }
30825
+ /**
30534
30826
  * `source` read a window at a time: a read that fits in `readAhead` bytes reads that many from where it starts, and
30535
30827
  * the reads after it within them (the next boxes' headers, a fragment's `moof`) are served from it, as copies (they
30536
30828
  * are changed in place). A Blob's read costs most for being one (in Chromium ~0.3 ms, and ~0.9 ms per MiB), so a
@@ -30572,6 +30864,142 @@ async function whole(source, box) {
30572
30864
  check$1(bytes.length === box.end - box.start);
30573
30865
  return bytes;
30574
30866
  }
30867
+ var u32le$1 = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
30868
+ var JUNK = Uint8Array.from("JUNK", (c) => c.charCodeAt(0));
30869
+ /** The chunks of an AVI's header its frames and sound are read with, kept; any other becomes `JUNK`. */
30870
+ var AVI_HEADER_KEEPS = /* @__PURE__ */ new Set([
30871
+ "avih",
30872
+ "strh",
30873
+ "strf",
30874
+ "indx",
30875
+ "vprp",
30876
+ "dmlh"
30877
+ ]);
30878
+ /** The lists of an AVI's header looked into. */
30879
+ var AVI_HEADER_LISTS = /* @__PURE__ */ new Set([
30880
+ "hdrl",
30881
+ "strl",
30882
+ "odml"
30883
+ ]);
30884
+ /** The streams whose chunks in `movi` are kept: pictures and sound. */
30885
+ var AVI_STREAMS = /* @__PURE__ */ new Set(["vids", "auds"]);
30886
+ /** A frame's or a piece of sound's chunk in `movi`: its stream's number, then what it is. */
30887
+ var AVI_DATA = /^\d\d(dc|db|wb|pc)$/;
30888
+ /** An AVI: `RIFF` `AVI `, then any `RIFF` `AVIX` (an OpenDML one past 1 GiB). */
30889
+ var isAvi = (head) => head.length >= 12 && text$1(head, 0, 4) === "RIFF" && text$1(head, 8, 4) === "AVI ";
30890
+ /** An AVI without what its header and `INFO` say, nor its text and data streams' chunks; the patches in file order. */
30891
+ async function avi(source) {
30892
+ const patches = [], size = source.size;
30893
+ /** Whether each stream, in order, is kept (pictures or sound). */
30894
+ const streams = [];
30895
+ let chunks = 0;
30896
+ const chunkAt = async (at, end) => {
30897
+ check$1(++chunks <= VIDEO_METADATA_LIMITS.maxChunks && at + 8 <= end);
30898
+ const head = await source.read(at, 12);
30899
+ check$1(head.length >= 8);
30900
+ const id = text$1(head, 0, 4), length = u32le$1(head, 4), list = id === "LIST" || id === "RIFF";
30901
+ check$1(!list || length >= 4 && head.length >= 12);
30902
+ return {
30903
+ id,
30904
+ type: list ? text$1(head, 8, 4) : "",
30905
+ start: at,
30906
+ body: at + (list ? 12 : 8),
30907
+ end: at + 8 + length,
30908
+ next: at + 8 + length + (length & 1)
30909
+ };
30910
+ };
30911
+ /** Zeros from `start` to `end`; a chunk made `JUNK` (`junk`) has its id replaced too. */
30912
+ const zero = (start, end) => {
30913
+ if (end > start) patches.push({
30914
+ start,
30915
+ end
30916
+ });
30917
+ };
30918
+ const junk = (chunk, end = chunk.end) => {
30919
+ if (chunk.id !== "JUNK") patches.push({
30920
+ start: chunk.start,
30921
+ end: chunk.start + 4,
30922
+ bytes: JUNK
30923
+ });
30924
+ zero(chunk.start + 8, end);
30925
+ };
30926
+ const header = async (start, end) => {
30927
+ for (let at = start; at < end;) {
30928
+ const chunk = await chunkAt(at, end);
30929
+ check$1(chunk.end <= end);
30930
+ if (chunk.id === "LIST" && AVI_HEADER_LISTS.has(chunk.type)) await header(chunk.body, chunk.end);
30931
+ else if (chunk.id === "strh") {
30932
+ check$1(chunk.end - chunk.body >= 4);
30933
+ streams.push(AVI_STREAMS.has(text$1(await source.read(chunk.body, 4), 0, 4)));
30934
+ } else if (chunk.id === "JUNK") zero(chunk.body, chunk.end);
30935
+ else if (!AVI_HEADER_KEEPS.has(chunk.id)) junk(chunk);
30936
+ at = Math.min(chunk.next, end);
30937
+ }
30938
+ };
30939
+ const movi = async (start, end) => {
30940
+ let at = start;
30941
+ for (; at + 8 <= end;) {
30942
+ const chunk = await chunkAt(at, end), until = Math.min(chunk.end, end);
30943
+ if (chunk.id === "LIST" && chunk.type === "rec ") await movi(chunk.body, until);
30944
+ else if (chunk.id.startsWith("ix") || AVI_DATA.test(chunk.id) && streams[Number(chunk.id.slice(0, 2))]) {} else if (/^\d\d/.test(chunk.id)) zero(chunk.body, until);
30945
+ else junk(chunk, until);
30946
+ at = Math.min(chunk.next, end);
30947
+ }
30948
+ zero(at, end);
30949
+ };
30950
+ let at = 0;
30951
+ for (let first = true; at + 12 <= size; first = false) {
30952
+ const head = await source.read(at, 12);
30953
+ if (text$1(head, 0, 4) !== "RIFF" || text$1(head, 8, 4) !== (first ? "AVI " : "AVIX")) break;
30954
+ const form = await chunkAt(at, size), end = Math.min(form.end, size);
30955
+ for (let inner = form.body; inner + 8 <= end;) {
30956
+ const chunk = await chunkAt(inner, end);
30957
+ if (first && chunk.id === "LIST" && chunk.type === "hdrl") {
30958
+ check$1(!streams.length && chunk.end <= end);
30959
+ await header(chunk.body, chunk.end);
30960
+ } else if (chunk.id === "LIST" && chunk.type === "movi") {
30961
+ check$1(streams.length > 0);
30962
+ await movi(chunk.body, Math.min(chunk.end, end));
30963
+ } else if (chunk.id === "JUNK") zero(chunk.body, Math.min(chunk.end, end));
30964
+ else if (chunk.id !== "idx1") junk(chunk, Math.min(chunk.end, end));
30965
+ inner = Math.min(chunk.next, end);
30966
+ }
30967
+ at = Math.min(form.next, size);
30968
+ }
30969
+ zero(at, size);
30970
+ return patches;
30971
+ }
30972
+ /** An ASF (WMV, WMA): its header object's GUID. */
30973
+ var ASF = [
30974
+ 48,
30975
+ 38,
30976
+ 178,
30977
+ 117,
30978
+ 142,
30979
+ 102,
30980
+ 207,
30981
+ 17,
30982
+ 166,
30983
+ 217,
30984
+ 0,
30985
+ 170,
30986
+ 0,
30987
+ 98,
30988
+ 206,
30989
+ 108
30990
+ ];
30991
+ var isAsf = (head) => head.length >= 16 && ASF.every((byte, i) => head[i] === byte);
30992
+ /** A video whose metadata is not removed here, so it is refused: an ASF, an FLV, an MPEG transport stream (`.ts`, `.m2ts`). */
30993
+ async function refused(source, head) {
30994
+ if (isAsf(head) || head.length >= 4 && text$1(head, 0, 3) === "FLV" && head[3] === 1) return true;
30995
+ const packetAt = (b, at) => b[at] === 71 && (b[at + 3] & 48) !== 0;
30996
+ for (const [packet, offset] of [[188, 0], [192, 4]]) {
30997
+ if (!packetAt(head, offset) || source.size < offset + 2 * packet + 4) continue;
30998
+ const next = await source.read(offset + packet, packet + 4);
30999
+ if (packetAt(next, 0) && packetAt(next, packet)) return true;
31000
+ }
31001
+ return false;
31002
+ }
30575
31003
  /**
30576
31004
  * What a file is by its first box: a movie (`FIRST_BOXES`), a file of boxes that is one when it holds a `moov` (any
30577
31005
  * other box found at the top of a movie: a stream's segment holds none), or another file. An HEIF picture is
@@ -30596,11 +31024,20 @@ async function withoutVideoMetadata(source, mime) {
30596
31024
  if (!patches) return void 0;
30597
31025
  const parts = [];
30598
31026
  let at = 0;
30599
- for (const patch of patches) {
31027
+ for (let i = 0; i < patches.length;) {
31028
+ const patch = patches[i];
31029
+ let last = i;
31030
+ while (last + 1 < patches.length && patches[last + 1].start - patches[last].end <= VIDEO_METADATA_LIMITS.joinGap && patches[last + 1].end - patch.start <= VIDEO_METADATA_LIMITS.joinedBytes) last++;
30600
31031
  if (patch.start > at) parts.push(source.slice(at, patch.start));
30601
- if (patch.bytes) parts.push(patch.bytes);
31032
+ if (last > i) {
31033
+ const joined = new Uint8Array(await source.slice(patch.start, patches[last].end).arrayBuffer());
31034
+ for (const { start, end, bytes } of patches.slice(i, last + 1)) if (bytes) joined.set(bytes, start - patch.start);
31035
+ else joined.fill(0, start - patch.start, end - patch.start);
31036
+ parts.push(joined);
31037
+ } else if (patch.bytes) parts.push(patch.bytes);
30602
31038
  else for (let left = patch.end - patch.start; left > 0; left -= ZEROS$1.size) parts.push(ZEROS$1.slice(0, Math.min(left, ZEROS$1.size)));
30603
- at = patch.end;
31039
+ at = patches[last].end;
31040
+ i = last + 1;
30604
31041
  }
30605
31042
  if (at < source.size) parts.push(source.slice(at));
30606
31043
  return new Blob(parts, { type: mime });
@@ -30613,6 +31050,11 @@ async function withoutVideoMetadata(source, mime) {
30613
31050
  async function videoMetadataPatches(file, mime, audio = false) {
30614
31051
  const source = readingAhead(file);
30615
31052
  const head = await source.read(0, VIDEO_METADATA_LIMITS.headBytes);
31053
+ if (isAvi(head)) {
31054
+ const patches = await avi(source);
31055
+ return patches.length ? patches : void 0;
31056
+ }
31057
+ if (!(isAsf(head) && mime.toLowerCase().startsWith("audio/"))) check$1(!await refused(source, head));
30616
31058
  const typed = STRIPPED_TYPES.has(mime.split(";")[0].trim().toLowerCase());
30617
31059
  const container = containerOf(head, mime);
30618
31060
  if (!container) {
@@ -30702,7 +31144,7 @@ async function videoMetadataPatches(file, mime, audio = false) {
30702
31144
  const mdats = top.filter((box) => box.type === "mdat");
30703
31145
  const merged = [];
30704
31146
  for (const [start, end] of zeroed.sort((a, b) => a[0] - b[0])) {
30705
- check$1(mdats.some((mdat) => start >= mdat.body && end <= mdat.end));
31147
+ check$1(within(mdats, start, end));
30706
31148
  const last = merged[merged.length - 1];
30707
31149
  if (last && start <= last[1]) last[1] = Math.max(last[1], end);
30708
31150
  else merged.push([start, end]);
@@ -30738,13 +31180,22 @@ async function videoMetadataPatches(file, mime, audio = false) {
30738
31180
  * - WAV (RIFF, RF64 or BW64): every chunk but its format, data and the ones of the sound itself (`fact`, `cue `,
30739
31181
  * `smpl`, `inst`, an RF64's `ds64`) becomes `JUNK`, zeroed (an INFO list, an `id3 ` chunk, a broadcast `bext` with
30740
31182
  * its date and originator, iXML, XMP).
31183
+ * - AIFF and AIFF-C: every chunk but its sound's (`COMM`, `SSND`, `FVER`, `MARK`, `INST`, `AESD`, `chan`) becomes
31184
+ * `JUNK`, zeroed (NAME, AUTH, ANNO, `(c) `, COMT, an `ID3 ` chunk, an app's `APPL`).
31185
+ * - CAF: every chunk but its sound's (`desc`, `data`, `pakt`, `kuki`, `chan`, `peak`, `ovvw`) becomes `free`, zeroed
31186
+ * (its `info` strings, a marker's names in `strg`, `edct` comments, `uuid` chunks).
31187
+ * - WavPack: its APEv2 and ID3v1 tags at the end as an MP3's, and the source file's header and trailer each block may
31188
+ * keep for a lossless restore (a WAV's INFO list, an AIFF's NAME) made a sub-block that says nothing, zeroed.
31189
+ * - TTA: its tags at the end (and an ID3v2 before it) as an MP3's.
31190
+ * - Sun AU: its annotation, zeros.
30741
31191
  * - WebM and Matroska, audio or video: `Tags`, `Attachments`, `Chapters`, the title, the date, the file names and each
30742
31192
  * track's name become `Void` elements (and the SeekHead's entries for them); the muxer's and the writing app's names
30743
31193
  * are zeroed. A Vorbis, Theora or FLAC track's CodecPrivate (its Ogg headers or its FLAC metadata blocks) has its
30744
31194
  * comments emptied as an Ogg's or a FLAC's. Clusters, cues and other track settings are kept as they are.
30745
31195
  *
30746
31196
  * Fail-closed: a file that is one of these by its bytes and whose tags cannot be removed (truncated, malformed) is
30747
- * refused with `NO_AUDIO_METADATA`, never sent as it was. Any other file goes as it is (other audio formats too).
31197
+ * refused with `NO_AUDIO_METADATA`, never sent as it was. So is a WMA (ASF): its title, place and date are not removed
31198
+ * here. Any other file goes as it is (other audio formats too).
30748
31199
  */
30749
31200
  var AUDIO_METADATA_LIMITS = {
30750
31201
  /** The largest header, element or tag read whole (an Ogg comment header with a picture in it): past this the file is refused. */
@@ -30760,6 +31211,7 @@ var NO_AUDIO_METADATA = "This audio cannot be sent: Ghostly could not remove the
30760
31211
  var ZEROS = new Blob([/* @__PURE__ */ new Uint8Array(1048576)]);
30761
31212
  var text = (b, at, length) => String.fromCharCode(...b.subarray(at, at + length));
30762
31213
  var u32le = (b, at) => (b[at] | b[at + 1] << 8 | b[at + 2] << 16 | b[at + 3] << 24) >>> 0;
31214
+ var u32be = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
30763
31215
  var syncsafe = (b, at) => b[at] << 21 | b[at + 1] << 14 | b[at + 2] << 7 | b[at + 3];
30764
31216
  var latin = (s) => Uint8Array.from(s, (c) => c.charCodeAt(0));
30765
31217
  /** Refuses the file where its bytes are not what this expects. */
@@ -31122,6 +31574,121 @@ async function wav(read, size, rf64, patches) {
31122
31574
  at = Math.min(end, size);
31123
31575
  }
31124
31576
  }
31577
+ /** The chunks an AIFF's or AIFF-C's sound is made of, kept; any other becomes `JUNK`. */
31578
+ var AIFF_KEEPS = /* @__PURE__ */ new Set([
31579
+ "COMM",
31580
+ "SSND",
31581
+ "FVER",
31582
+ "MARK",
31583
+ "INST",
31584
+ "AESD",
31585
+ "chan"
31586
+ ]);
31587
+ /** An AIFF's chunks from its form type: big-endian sizes, each padded to an even length. */
31588
+ async function aiff(read, size, patches) {
31589
+ const count = counter();
31590
+ for (let at = 12; at + 8 <= size;) {
31591
+ count();
31592
+ const head = await read(at, 8);
31593
+ const id = text(head, 0, 4), length = u32be(head, 4);
31594
+ let end = at + 8 + length + length % 2;
31595
+ if (id === "SSND") end = length ? Math.min(end, size) : size;
31596
+ else check(at + 8 + length <= size);
31597
+ if (!AIFF_KEEPS.has(id)) {
31598
+ if (id !== "JUNK") patches.push({
31599
+ start: at,
31600
+ end: at + 4,
31601
+ bytes: latin("JUNK")
31602
+ });
31603
+ if (length) patches.push({
31604
+ start: at + 8,
31605
+ end: at + 8 + length
31606
+ });
31607
+ }
31608
+ at = Math.min(end, size);
31609
+ }
31610
+ }
31611
+ /** The chunks a CAF's sound is made of, kept; any other becomes `free`. */
31612
+ var CAF_KEEPS = /* @__PURE__ */ new Set([
31613
+ "desc",
31614
+ "data",
31615
+ "pakt",
31616
+ "kuki",
31617
+ "chan",
31618
+ "peak",
31619
+ "ovvw"
31620
+ ]);
31621
+ /** A CAF's chunks after its 8-byte header: big-endian 64-bit sizes, `data`'s -1 when it runs to the end. */
31622
+ async function caf(read, size, patches) {
31623
+ const count = counter();
31624
+ for (let at = 8; at + 12 <= size;) {
31625
+ count();
31626
+ const head = await read(at, 12);
31627
+ const id = text(head, 0, 4), high = u32be(head, 4), length = high * 2 ** 32 + u32be(head, 8);
31628
+ const toEnd = id === "data" && high === 4294967295 && u32be(head, 8) === 4294967295;
31629
+ check(toEnd || Number.isSafeInteger(length) && at + 12 + length <= size);
31630
+ const end = toEnd ? size : at + 12 + length;
31631
+ if (!CAF_KEEPS.has(id)) {
31632
+ if (id !== "free") patches.push({
31633
+ start: at,
31634
+ end: at + 4,
31635
+ bytes: latin("free")
31636
+ });
31637
+ if (end > at + 12) patches.push({
31638
+ start: at + 12,
31639
+ end
31640
+ });
31641
+ }
31642
+ at = end;
31643
+ }
31644
+ }
31645
+ /** A WavPack sub-block's own id (its flags apart): the source file's header and trailer, a WAV's or another's. */
31646
+ var WAVPACK_SOURCE = /* @__PURE__ */ new Set([
31647
+ 33,
31648
+ 34,
31649
+ 35,
31650
+ 36
31651
+ ]);
31652
+ /** A WavPack's blocks from `at`, their source file's header and trailer emptied; returns where they end (its tags). */
31653
+ async function wavpack(read, size, at, patches) {
31654
+ const count = counter();
31655
+ while (at + 32 <= size && text(await read(at, 4), 0, 4) === "wvpk") {
31656
+ count();
31657
+ const end = at + 8 + u32le(await read(at + 4, 4), 0);
31658
+ check(end >= at + 32 && end <= size);
31659
+ for (let sub = at + 32; sub < end;) {
31660
+ count();
31661
+ const head = await read(sub, Math.min(4, end - sub));
31662
+ const large = (head[0] & 128) !== 0, body = sub + (large ? 4 : 2);
31663
+ check(body <= end);
31664
+ const length = (large ? head[1] | head[2] << 8 | head[3] << 16 : head[1]) * 2;
31665
+ check(body + length <= end);
31666
+ if (WAVPACK_SOURCE.has(head[0] & 63)) {
31667
+ patches.push({
31668
+ start: sub,
31669
+ end: sub + 1,
31670
+ bytes: Uint8Array.of(head[0] & 192 | 32)
31671
+ });
31672
+ if (length) patches.push({
31673
+ start: body,
31674
+ end: body + length
31675
+ });
31676
+ }
31677
+ sub = body + length;
31678
+ }
31679
+ at = end;
31680
+ }
31681
+ return at;
31682
+ }
31683
+ /** A Sun AU's annotation: from its 24-byte header to its sound. */
31684
+ async function au(read, size, patches) {
31685
+ const offset = u32be(await read(4, 4), 0);
31686
+ check(offset >= 24 && offset <= size);
31687
+ if (offset > 24) patches.push({
31688
+ start: 24,
31689
+ end: offset
31690
+ });
31691
+ }
31125
31692
  var EBML_HEADER = 440786851;
31126
31693
  var SEGMENT$1 = 408125543;
31127
31694
  var CLUSTER = 524531317;
@@ -31376,6 +31943,12 @@ async function audioMetadataPatches(file, mime) {
31376
31943
  "BW64"
31377
31944
  ].includes(text(head, 0, 4)) && text(head, 8, 4) === "WAVE") await wav(read, size, text(head, 0, 4) !== "RIFF", patches);
31378
31945
  else if (text(head, 0, 4) === "Eߣ") await matroska(source, read, patches);
31946
+ else if (head.length >= 12 && text(head, 0, 4) === "FORM" && ["AIFF", "AIFC"].includes(text(head, 8, 4))) await aiff(read, size, patches);
31947
+ else if (head.length >= 8 && text(head, 0, 4) === "caff") await caf(read, size, patches);
31948
+ else if (head.length >= 24 && text(head, 0, 4) === ".snd") await au(read, size, patches);
31949
+ else if (text(head, 0, 4) === "wvpk") await trailingTags(read, size, await wavpack(read, size, 0, patches), patches);
31950
+ else if (text(head, 0, 4) === "TTA1") await trailingTags(read, size, 0, patches);
31951
+ else if (isAsf(head)) check(false);
31379
31952
  else if (text(head, 0, 4) === "fLaC") await trailingTags(read, size, await flac(read, size, 0, patches), patches);
31380
31953
  else if (isId3(head) || isFrame(head, 0)) {
31381
31954
  let at = 0;
@@ -31385,6 +31958,7 @@ async function audioMetadataPatches(file, mime) {
31385
31958
  at = await emptyId3(read, size, at, next, patches);
31386
31959
  }
31387
31960
  if (at + 4 <= size && text(await read(at, 4), 0, 4) === "fLaC") at = await flac(read, size, at, patches);
31961
+ else if (at + 4 <= size && text(await read(at, 4), 0, 4) === "wvpk") at = await wavpack(read, size, at, patches);
31388
31962
  await trailingTags(read, size, at, patches);
31389
31963
  } else if (MPEG_AUDIO.has(baseMime(mime))) await trailingTags(read, size, 0, patches);
31390
31964
  else return void 0;
@@ -31867,7 +32441,7 @@ function parsePayParams(body, destination) {
31867
32441
  maxSat,
31868
32442
  metadata,
31869
32443
  descriptionHash: hex(sha256(new TextEncoder().encode(metadata))),
31870
- description: description.slice(0, 280),
32444
+ description: stripHidden(description.replace(/\s+/g, " ")).slice(0, 280),
31871
32445
  identifier,
31872
32446
  commentAllowed: comment
31873
32447
  };
@@ -31893,12 +32467,15 @@ function invoiceCallbackUrl(params, amountSat, comment) {
31893
32467
  }
31894
32468
  return url.href;
31895
32469
  }
31896
- /** A success action's link: HTTPS, bounded, and no user part ("https://www.paypal.com@evil.example" opens evil.example). */
31897
- function successUrl(text) {
32470
+ /**
32471
+ * A success action's link: HTTPS, bounded, no user part ("https://www.paypal.com@evil.example" opens evil.example),
32472
+ * and on the callback's own host (LUD-09), so a service cannot hand out a link to somewhere else.
32473
+ */
32474
+ function successUrl(text, host) {
31898
32475
  if (!/^https:\/\//i.test(text) || text.length > LNURL_LIMITS.maxUrlLength) return false;
31899
32476
  try {
31900
32477
  const url = new URL(text);
31901
- return !url.username && !url.password;
32478
+ return !url.username && !url.password && url.host === host;
31902
32479
  } catch {
31903
32480
  return false;
31904
32481
  }
@@ -31923,7 +32500,7 @@ function parseInvoiceCallback(body, params, amountSat) {
31923
32500
  tag: "message",
31924
32501
  message: reason(action.message)
31925
32502
  };
31926
- else if (action.tag === "url" && typeof action.url === "string" && successUrl(action.url)) successAction = {
32503
+ else if (action.tag === "url" && typeof action.url === "string" && successUrl(action.url, params.callbackDomain)) successAction = {
31927
32504
  tag: "url",
31928
32505
  description: reason(action.description),
31929
32506
  url: action.url
@@ -39011,6 +39588,37 @@ function isSealed(v) {
39011
39588
  "c"
39012
39589
  ].every((k) => typeof v[k] === "string" && B64.test(v[k]) && v[k].length <= 128);
39013
39590
  }
39591
+ var COMMIT_HASH = /^[0-9a-f]{64}$/;
39592
+ /**
39593
+ * A `group-secret` or `group-entry` frame a hub routes for another member, rebuilt from its known fields when each has
39594
+ * its real shape: what a hub remembers and hands on is no bigger than a real one. Null for anything else.
39595
+ */
39596
+ function routedCommunityFrame(raw) {
39597
+ const { t, v, g, to, s } = raw;
39598
+ if (v !== 2 || typeof g !== "string" || !GROUP_ID.test(g) || !MEMBER_KEY.test(to) || !isSealed(s)) return null;
39599
+ const sealed = {
39600
+ e: s.e,
39601
+ n: s.n,
39602
+ c: s.c
39603
+ };
39604
+ if (t === "group-secret" && typeof raw.h === "string" && COMMIT_HASH.test(raw.h)) return {
39605
+ t,
39606
+ v,
39607
+ g,
39608
+ to,
39609
+ h: raw.h,
39610
+ s: sealed
39611
+ };
39612
+ if (t === "group-entry" && isZ32Key(raw.x)) return {
39613
+ t,
39614
+ v,
39615
+ g,
39616
+ to,
39617
+ x: raw.x,
39618
+ s: sealed
39619
+ };
39620
+ return null;
39621
+ }
39014
39622
  /** A welcome's shape and the whole chain it and the pieces before it carry, not yet checked (`CommunitySession.join`). */
39015
39623
  function readWelcome(link, pieces, welcome) {
39016
39624
  if (!welcome || typeof welcome !== "object") return { error: "Malformed welcome" };
@@ -39247,18 +39855,22 @@ var CommunitySession = class CommunitySession {
39247
39855
  return this.state.chain[this.state.chain.length - 1];
39248
39856
  }
39249
39857
  /**
39250
- * The top commit's hash, kept for the commit it was taken from: a view reads it for each member (its roster, what
39251
- * each member's lines are missing), and hashing it every time cost tens of milliseconds per state in big communities.
39858
+ * The top commit's hash: a view reads it for each member (its roster, what each member's lines are missing), and
39859
+ * hashing it every time cost tens of milliseconds per state in big communities.
39252
39860
  */
39253
39861
  get topHash() {
39254
- const top = this.top;
39255
- if (this.topHashOf?.commit !== top) this.topHashOf = {
39256
- commit: top,
39257
- hash: communityCommitHash(top)
39258
- };
39259
- return this.topHashOf.hash;
39862
+ return this.hashOf(this.top);
39863
+ }
39864
+ /**
39865
+ * A commit's hash, kept for the commit it was taken from (a commit never changes once made): every sync frame, sync
39866
+ * answer and commit hashed the whole window again, about a tenth of the load test's CPU at 64 and 128 members.
39867
+ */
39868
+ hashOf(c) {
39869
+ let h = this.hashes.get(c);
39870
+ if (h === void 0) this.hashes.set(c, h = communityCommitHash(c));
39871
+ return h;
39260
39872
  }
39261
- topHashOf;
39873
+ hashes = /* @__PURE__ */ new WeakMap();
39262
39874
  get epoch() {
39263
39875
  return this.top.e;
39264
39876
  }
@@ -39324,11 +39936,11 @@ var CommunitySession = class CommunitySession {
39324
39936
  * does never wins, see `better`), and it parts within the window. Kept until the tip or the side moves.
39325
39937
  */
39326
39938
  mayWin() {
39327
- const side = this.state.side, at = `${this.topHash}:${side.length}:${side.length ? communityCommitHash(side[side.length - 1]) : ""}`;
39939
+ const side = this.state.side, at = `${this.topHash}:${side.length}:${side.length ? this.hashOf(side[side.length - 1]) : ""}`;
39328
39940
  if (this.winning?.at === at) return this.winning.set;
39329
39941
  const counts = this.adminCounts(), main = this.branch(this.topHash), set = /* @__PURE__ */ new Set();
39330
39942
  for (const c of side) {
39331
- const h = communityCommitHash(c), branch = this.rosters.has(h) ? this.branch(h) : null;
39943
+ const h = this.hashOf(c), branch = this.rosters.has(h) ? this.branch(h) : null;
39332
39944
  if (!branch || !branch.path.length) continue;
39333
39945
  const { parent, admin } = this.parting(branch, main, counts);
39334
39946
  if (!(admin[1] && !admin[0]) && parent >= this.epoch - COMMUNITY_LIMITS.window) set.add(h);
@@ -39348,12 +39960,12 @@ var CommunitySession = class CommunitySession {
39348
39960
  const side = this.state.side, parents = new Set(side.map((c) => c.p)), counts = this.adminCounts();
39349
39961
  let lost;
39350
39962
  for (const c of side) {
39351
- const h = communityCommitHash(c);
39963
+ const h = this.hashOf(c);
39352
39964
  if (parents.has(h)) continue;
39353
39965
  const branch = this.branch(h);
39354
39966
  if (!branch || !branch.path.some((x) => rosterHas(this.rosters.get(x) ?? [], key))) continue;
39355
39967
  for (let j = branch.fork + 1; j < this.state.chain.length; j++) {
39356
- if (this.better(branch, this.branch(communityCommitHash(this.state.chain[j])), counts)) continue;
39968
+ if (this.better(branch, this.branch(this.hashOf(this.state.chain[j])), counts)) continue;
39357
39969
  lost = {
39358
39970
  fork: Math.min(lost?.fork ?? j, branch.fork),
39359
39971
  end: Math.max(lost?.end ?? j, j)
@@ -39374,7 +39986,7 @@ var CommunitySession = class CommunitySession {
39374
39986
  if (found) return rosterHas(this.rosterAt(found.hash) ?? [], key);
39375
39987
  const i = this.state.chain.length - 1 - (this.epoch - Number(e));
39376
39988
  const commit = Number.isSafeInteger(i) && i >= 0 ? this.state.chain[i] : void 0;
39377
- const hash = commit && communityCommitHash(commit);
39989
+ const hash = commit && this.hashOf(commit);
39378
39990
  return !!hash && hash.startsWith(h) && this.wasInAt(key, i);
39379
39991
  }
39380
39992
  /**
@@ -39397,7 +40009,7 @@ var CommunitySession = class CommunitySession {
39397
40009
  for (const k of after) if (!before.has(k)) s.byKey.set(k, [...s.byKey.get(k) ?? [], s.through]);
39398
40010
  for (const k of before) if (!after.has(k)) s.byKey.get(k).push(s.through);
39399
40011
  }
39400
- s.top = communityCommitHash(this.state.chain[s.through - 1]);
40012
+ s.top = this.hashOf(this.state.chain[s.through - 1]);
39401
40013
  }
39402
40014
  const at = s.byKey.get(key) ?? [];
39403
40015
  for (let j = 0; j < at.length; j += 2) if (at[j] <= i && (j + 1 >= at.length || i < at[j + 1])) return true;
@@ -39433,14 +40045,14 @@ var CommunitySession = class CommunitySession {
39433
40045
  if (i < 0) return rosterHas(this.roster, f.s) || this.isRecentMember(f.s) || !this.lostAt(f.s);
39434
40046
  const commit = this.state.chain[i];
39435
40047
  if (commit.k !== "leave") return false;
39436
- const high = this.state.left?.[communityCommitHash(commit)]?.hi[seenKey(f.e, f.h)];
40048
+ const high = this.state.left?.[this.hashOf(commit)]?.hi[seenKey(f.e, f.h)];
39437
40049
  return high !== void 0 && f.n <= high;
39438
40050
  }
39439
40051
  /** The mark of a leave on my branch, as a frame to hand on (see `heardAfterOut`). */
39440
40052
  leftFrame(key) {
39441
40053
  const i = this.outIndex(key);
39442
40054
  if (i < 0 || this.state.chain[i].k !== "leave") return void 0;
39443
- const h = communityCommitHash(this.state.chain[i]), mark = this.state.left?.[h];
40055
+ const h = this.hashOf(this.state.chain[i]), mark = this.state.left?.[h];
39444
40056
  return mark && {
39445
40057
  t: "group-left",
39446
40058
  v: 2,
@@ -39559,7 +40171,7 @@ var CommunitySession = class CommunitySession {
39559
40171
  this.state.chain.forEach((commit, i) => {
39560
40172
  roster = communityRoster(roster, commit, true);
39561
40173
  if (!roster) throw new Error("Stored membership chain does not replay");
39562
- const h = communityCommitHash(commit);
40174
+ const h = this.hashOf(commit);
39563
40175
  this.known.set(h, commit);
39564
40176
  this.mainIndex.set(h, i);
39565
40177
  if (i >= keepFrom) this.rosters.set(h, roster);
@@ -39571,7 +40183,7 @@ var CommunitySession = class CommunitySession {
39571
40183
  if (!parentRoster || !parent) return false;
39572
40184
  const result = verifyCommunityCommit(commit, parent, parentRoster, this.id, this.ancestry(commit.p));
39573
40185
  if ("error" in result) return false;
39574
- const h = communityCommitHash(result.commit);
40186
+ const h = this.hashOf(result.commit);
39575
40187
  this.known.set(h, result.commit);
39576
40188
  this.rosters.set(h, result.roster);
39577
40189
  return true;
@@ -39598,7 +40210,7 @@ var CommunitySession = class CommunitySession {
39598
40210
  const i = this.state.chain.length - 1 - (this.epoch - e);
39599
40211
  const candidates = [...i >= 0 && i < this.state.chain.length ? [this.state.chain[i]] : [], ...this.state.side.filter((c) => c.e === e)];
39600
40212
  for (const commit of candidates) {
39601
- const hash = communityCommitHash(commit);
40213
+ const hash = this.hashOf(commit);
39602
40214
  if (hash.startsWith(h16) && this.rosters.has(hash)) return {
39603
40215
  commit,
39604
40216
  hash
@@ -39648,8 +40260,8 @@ var CommunitySession = class CommunitySession {
39648
40260
  const admin = counts[x.fork] - counts[m] > 0 || path.some((h) => ADMIN_ONLY.has(this.known.get(h).k));
39649
40261
  return {
39650
40262
  admin,
39651
- first: x.fork > m ? communityCommitHash(this.state.chain[m + 1]) : path[0] ?? "",
39652
- roles: !admin ? [] : [...this.state.chain.slice(m + 1, x.fork + 1).filter((c) => c.k === "role").map((c) => communityCommitHash(c)), ...path.filter((h) => this.known.get(h).k === "role")]
40263
+ first: x.fork > m ? this.hashOf(this.state.chain[m + 1]) : path[0] ?? "",
40264
+ roles: !admin ? [] : [...this.state.chain.slice(m + 1, x.fork + 1).filter((c) => c.k === "role").map((c) => this.hashOf(c)), ...path.filter((h) => this.known.get(h).k === "role")]
39653
40265
  };
39654
40266
  };
39655
40267
  const sa = side(a), sb = side(b);
@@ -39671,7 +40283,7 @@ var CommunitySession = class CommunitySession {
39671
40283
  if (fork === void 0 || this.signedAfter(h, role.s)) return false;
39672
40284
  return [...at === void 0 ? this.state.chain.slice(fork + 1) : [], ...this.state.side].some((c) => {
39673
40285
  if (c.k !== "leave" || c.s !== role.s) return false;
39674
- const b = this.branch(communityCommitHash(c));
40286
+ const b = this.branch(this.hashOf(c));
39675
40287
  if (!b || (at !== void 0 ? b.fork >= at : b.path.includes(h))) return false;
39676
40288
  return leaveStands(c, this.ancestry(role.p));
39677
40289
  });
@@ -39683,7 +40295,7 @@ var CommunitySession = class CommunitySession {
39683
40295
  if (at !== void 0 && this.state.chain.slice(at + 1).some((c) => c.by === key)) return true;
39684
40296
  return this.state.side.some((c) => {
39685
40297
  if (c.by !== key) return false;
39686
- const b = this.branch(communityCommitHash(c));
40298
+ const b = this.branch(this.hashOf(c));
39687
40299
  return !!b && (at !== void 0 ? b.fork >= at : b.path.includes(h));
39688
40300
  });
39689
40301
  }
@@ -39751,7 +40363,7 @@ var CommunitySession = class CommunitySession {
39751
40363
  if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
39752
40364
  const parentAdmin = rosterAdmin(parentRoster);
39753
40365
  if (result.commit.k === "add" && result.commit.by !== parentAdmin && memberAdmissions(parentAdmin, this.ancestry(p)) >= COMMUNITY_LIMITS.memberAdmissions) return false;
39754
- const commit = result.commit, h = communityCommitHash(commit);
40366
+ const commit = result.commit, h = this.hashOf(commit);
39755
40367
  const admin = rosterAdmin(parentRoster);
39756
40368
  if (commit.by === admin) {
39757
40369
  for (const [other, c] of this.known) if (other !== h && c.p === commit.p && c.by === admin) {
@@ -39841,7 +40453,7 @@ var CommunitySession = class CommunitySession {
39841
40453
  let best = this.branch(this.topHash);
39842
40454
  const parents = new Set(this.state.side.map((c) => c.p));
39843
40455
  for (const c of this.state.side) {
39844
- const h = communityCommitHash(c);
40456
+ const h = this.hashOf(c);
39845
40457
  if (this.mainIndex.has(h) || parents.has(h)) continue;
39846
40458
  const branch = this.branch(h);
39847
40459
  if (branch && this.better(branch, best, counts)) best = branch;
@@ -39854,13 +40466,13 @@ var CommunitySession = class CommunitySession {
39854
40466
  const ancestor = this.mainIndex.get(this.known.get(path[0]).p);
39855
40467
  const dropped = this.state.chain.splice(ancestor + 1);
39856
40468
  for (const c of dropped) {
39857
- const h = communityCommitHash(c);
40469
+ const h = this.hashOf(c);
39858
40470
  this.mainIndex.delete(h);
39859
40471
  this.state.side.push(c);
39860
40472
  }
39861
40473
  for (const h of path) {
39862
40474
  const c = this.known.get(h);
39863
- this.state.side = this.state.side.filter((x) => communityCommitHash(x) !== h);
40475
+ this.state.side = this.state.side.filter((x) => this.hashOf(x) !== h);
39864
40476
  this.mainIndex.set(h, this.state.chain.length);
39865
40477
  this.state.chain.push(c);
39866
40478
  this.takeDerived(h);
@@ -39918,12 +40530,7 @@ var CommunitySession = class CommunitySession {
39918
40530
  * branch it grows still comes in commit by commit (one let go comes again from where it parts in a catch-up).
39919
40531
  */
39920
40532
  pruneSide() {
39921
- const admin = this.admin, hashes = /* @__PURE__ */ new Map();
39922
- const hash = (c) => {
39923
- let h = hashes.get(c);
39924
- if (!h) hashes.set(c, h = communityCommitHash(c));
39925
- return h;
39926
- };
40533
+ const admin = this.admin, hash = (c) => this.hashOf(c);
39927
40534
  let side = this.state.side.slice(-COMMUNITY_LIMITS.side);
39928
40535
  for (;;) {
39929
40536
  const held = new Set(side.map(hash)), parents = new Set(side.map((c) => c.p)), drop = /* @__PURE__ */ new Set();
@@ -39982,10 +40589,10 @@ var CommunitySession = class CommunitySession {
39982
40589
  * kept, only get what is left of the bound, the most recent first.
39983
40590
  */
39984
40591
  pruneSecrets() {
39985
- const keep = new Set(this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => communityCommitHash(c)));
40592
+ const keep = new Set(this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => this.hashOf(c)));
39986
40593
  let room = COMMUNITY_LIMITS.secrets - [...keep].filter((h) => this.state.secrets[h]).length;
39987
40594
  for (let i = this.state.side.length - 1; i >= 0 && room > 0; i--) {
39988
- const h = communityCommitHash(this.state.side[i]);
40595
+ const h = this.hashOf(this.state.side[i]);
39989
40596
  if (this.state.secrets[h] && !keep.has(h)) {
39990
40597
  keep.add(h);
39991
40598
  room--;
@@ -40123,7 +40730,7 @@ var CommunitySession = class CommunitySession {
40123
40730
  ...draft,
40124
40731
  c: confirmationTag(epochKeys(secret, this.id, draft.e).confirm, untagged)
40125
40732
  }, this.identity.seed);
40126
- const hash = communityCommitHash(commit);
40733
+ const hash = this.hashOf(commit);
40127
40734
  this.known.set(hash, commit);
40128
40735
  this.rosters.set(hash, roster);
40129
40736
  this.mainIndex.set(hash, this.state.chain.length);
@@ -40196,7 +40803,7 @@ var CommunitySession = class CommunitySession {
40196
40803
  if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey || !isZ32Key(memberKey)) throw new Error("Not a member");
40197
40804
  for (let i = this.state.chain.length - 1; i >= 0; i--) {
40198
40805
  const c = this.state.chain[i];
40199
- if (c.k === "add" && c.s === memberKey) return this.welcomeFor(memberKey, communityCommitHash(c));
40806
+ if (c.k === "add" && c.s === memberKey) return this.welcomeFor(memberKey, this.hashOf(c));
40200
40807
  }
40201
40808
  throw new Error("Not a member");
40202
40809
  });
@@ -40204,7 +40811,7 @@ var CommunitySession = class CommunitySession {
40204
40811
  /** The chain, the secrets from the admitting commit on, the rendezvous secret and the entry seed, for one newcomer. */
40205
40812
  welcomeFor(memberKey, admittedAt) {
40206
40813
  const chain = this.state.chain, from = this.mainIndex.get(admittedAt);
40207
- const secrets = chain.slice(from).map((c) => communityCommitHash(c)).filter((h) => this.state.secrets[h]).map((h) => ({
40814
+ const secrets = chain.slice(from).map((c) => this.hashOf(c)).filter((h) => this.state.secrets[h]).map((h) => ({
40208
40815
  h,
40209
40816
  s: sealSecret(memberKey, fromBase64Url(this.state.secrets[h]), secretAad(this.id, h, memberKey))
40210
40817
  }));
@@ -40329,7 +40936,7 @@ var CommunitySession = class CommunitySession {
40329
40936
  ls: toBase64Url(sign(leaveStatement(this.id, this.myKey), this.identity.seed))
40330
40937
  };
40331
40938
  for (const c of this.ancestry(this.topHash)) if (c.k === "add" && c.s === this.myKey || c.k === "create" && c.by === this.myKey) {
40332
- frame.ls3 = toBase64Url(sign(leaveStatement3(this.id, this.myKey, communityCommitHash(c)), this.identity.seed));
40939
+ frame.ls3 = toBase64Url(sign(leaveStatement3(this.id, this.myKey, this.hashOf(c)), this.identity.seed));
40333
40940
  break;
40334
40941
  }
40335
40942
  this.hooks.broadcast(frame);
@@ -40973,9 +41580,9 @@ var CommunitySession = class CommunitySession {
40973
41580
  heard: open?.heard ?? false
40974
41581
  });
40975
41582
  }
40976
- const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => communityCommitHash(c)).filter((h) => this.state.secrets[h]).map(shortHash);
41583
+ const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => this.hashOf(c)).filter((h) => this.state.secrets[h]).map(shortHash);
40977
41584
  const loc = [];
40978
- for (let back = 1; back < this.state.chain.length && loc.length < 12; back *= 2) loc.push(communityCommitHash(this.state.chain[this.state.chain.length - 1 - back]));
41585
+ for (let back = 1; back < this.state.chain.length && loc.length < 12; back *= 2) loc.push(this.hashOf(this.state.chain[this.state.chain.length - 1 - back]));
40979
41586
  return {
40980
41587
  t: "group-sync",
40981
41588
  v: 2,
@@ -41420,7 +42027,7 @@ var CommunitySession = class CommunitySession {
41420
42027
  }
41421
42028
  const out = this.outEpoch(from);
41422
42029
  for (let i = start; i < this.state.chain.length; i++) {
41423
- const commit = this.state.chain[i], h = communityCommitHash(commit);
42030
+ const commit = this.state.chain[i], h = this.hashOf(commit);
41424
42031
  answer.push({
41425
42032
  t: "group-commit",
41426
42033
  v: 2,
@@ -41438,7 +42045,7 @@ var CommunitySession = class CommunitySession {
41438
42045
  });
41439
42046
  }
41440
42047
  const held = new Set(Array.isArray(frame.secrets) ? frame.secrets.filter((x) => typeof x === "string") : []);
41441
- const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => communityCommitHash(c)).filter((h) => this.state.secrets[h] && !held.has(shortHash(h)) && this.readsAt(h, from, out)).map((h) => ({
42048
+ const secrets = this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => this.hashOf(c)).filter((h) => this.state.secrets[h] && !held.has(shortHash(h)) && this.readsAt(h, from, out)).map((h) => ({
41442
42049
  h,
41443
42050
  s: sealSecret(from, fromBase64Url(this.state.secrets[h]), secretAad(this.id, h, from))
41444
42051
  }));
@@ -42206,12 +42813,14 @@ function appRevocationFor(version, revocations) {
42206
42813
  return null;
42207
42814
  }
42208
42815
  function checkAppBeforeRun(version, stores, revocations = []) {
42209
- const revocation = appRevocationFor(version, [...revocations, ...stores.flatMap((s) => s.revoked)]);
42210
- if (revocation) return {
42211
- status: "revoked",
42212
- revocation
42213
- };
42214
- const by = stores.flatMap((s) => s.removed.filter((r) => r.ref === version.ref && r.digest === version.digest).map((r) => ({
42816
+ for (const list of [revocations, ...stores.map((s) => s.revoked)]) {
42817
+ const revocation = appRevocationFor(version, indexed(list, (r) => r.statement.app).get(version.ref) ?? []);
42818
+ if (revocation) return {
42819
+ status: "revoked",
42820
+ revocation
42821
+ };
42822
+ }
42823
+ const by = stores.flatMap((s) => (indexed(s.removed, (r) => `${r.ref} ${r.digest}`).get(`${version.ref} ${version.digest}`) ?? []).map((r) => ({
42215
42824
  store: s.key,
42216
42825
  name: s.name,
42217
42826
  reason: r.reason,
@@ -42222,6 +42831,23 @@ function checkAppBeforeRun(version, stores, revocations = []) {
42222
42831
  by
42223
42832
  } : { status: "ok" };
42224
42833
  }
42834
+ var indexes = /* @__PURE__ */ new WeakMap();
42835
+ function indexed(list, key) {
42836
+ const held = indexes.get(list);
42837
+ if (held && held.length === list.length) return held.byKey;
42838
+ const byKey = /* @__PURE__ */ new Map();
42839
+ for (const entry of list) {
42840
+ const k = key(entry);
42841
+ const same = byKey.get(k);
42842
+ if (same) same.push(entry);
42843
+ else byKey.set(k, [entry]);
42844
+ }
42845
+ indexes.set(list, {
42846
+ length: list.length,
42847
+ byKey
42848
+ });
42849
+ return byKey;
42850
+ }
42225
42851
  function appStoreDecision(held, read) {
42226
42852
  if (!held) return "new";
42227
42853
  if (held.key !== read.key) return "other-key";
@@ -43004,6 +43630,6 @@ function x401ApprovalDigest(subject) {
43004
43630
  return toBase64Url(sha256(utf8Encode(canonical)));
43005
43631
  }
43006
43632
  //#endregion
43007
- export { sealGroupTyping as $, TURN_SEALED_BYTES as $C, INVITE_LINK_ORIGIN as $S, MAX_AVATAR_LENGTH as $T, RTC_SIGNAL_FUTURE_MS as $_, isStrippedPicture as $a, turnOff as $b, pinFrame as $c, verifyNostrProof as $d, DHT_FILE_REFUSED as $f, OFFER_STEP_MAX as $g, decryptText as $h, validatePaymentTarget as $i, readAppRangeFrame as $l, PR_CHECKS as $m, isLegacySignature as $n, GROUP_WANT_NO_FRAME as $o, editedFrame as $p, DID_JWS_ALGS as $r, FILE_DATA_KIND as $s, CATCH_UP_SLICE as $t, emptyCapsState as $u, HANDOFF_DATA as $v, SLOW_DEMOTE_MS as $w, pacer as $x, readHandoffData as $y, readX401ProofResponseHeader as A, devicePingFrame as AC, imageSize as AS, openRelayPayload as AT, formatLocalTarget as A_, requestLnurlInvoice as Aa, enrollDigits as Ab, TYPING_REFRESH_MS as Ac, receivedIdentityStatus as Ad, DNS_TYPE as Af, GATHER_ATTEMPTS as Ag, GROUP_MEMBER_CAP as Ah, didDhtKey as Ai, WebPushError as Al, parseReactionFrame as Am, groupName as An, RESUME_WAIT_MS as Ao, voiceFileName as Ap, atprotoProofRkey as Ar, beaconRecords as As, knockIdentity as At, STATUS_CAPABILITY as Au, RECORD_TTL as Av, BACKGROUND_WHILE_SIGNALING as Aw, readLinkRecord as Ax, handoffDigest as Ay, APP_STORE_KINDS as B, TURN_VISIBLE_MS as BC, createContactLink as BS, IDENTITY_MEMO_SIZE as BT, CHUNK_FLAG_END as B_, parseCashuRequestPayload as Ba, FLOOD_PER_DAY as Bb, typingActivity as Bc, STORAGE_LIFETIME as Bd, domainWellKnownFile as Bf, directBlocked as Bg, expectedRoster as Bh, ONCHAIN_PROVIDER as Bi, APP_RANGE_FRAMES as Bl, PAIRED_REPLY_AUTHORS as Bm, wrapGroupMeta as Bn, pairedMessageFrame as Bo, EDITED_FRAME as Bp, decodeDagCbor as Br, rankHubs as Bs, groupWakeFrame as Bt, SESSION_FRAME_MAX as Bu, encodeServices as Bv, GROUP_BURST_ONE_LINK as Bw, APP_ICON_PATH as Bx, handoffReleaseFrame as By, buildX401TokenObject as C, deviceFrameCapability as CC, __commonJSMin as CE, signAppObject as CS, MAX_DNS_PACKET_BYTES as CT, HttpClient as C_, LNURL_LIMITS as Ca, ENROLL_CANCEL_REASONS as Cb, sanitizeStatusText as Cc, identityPresentationBytes as Cd, HOLD_LIMITS as Cf, ratchetSeal as Cg, arrivalKey as Ch, DID_DHT_PREFIX as Ci, readWakePayload as Cl, QUICK_REACTIONS as Cm, groupDisplayName as Cn, PAIRING_RETRY_MS as Co, downsamplePeaks as Cp, varBytes as Cr, meshHubs as Cs, GROUP_ENTRY_PROFILE as Ct, FILES_BINARY_CAPABILITY as Cu, parseCallSignal as Cv, turnStatedVerifier as Cw, knockSlotRecords as Cx, handoffAttemptFailed as Cy, readX401ProofRequest as D, deviceLinkRendezvousSeed as DC, __toCommonJS as DE, verifyAppStatementBytes as DS, createRelayPayload as DT, VIEWER_PERMISSIONS_POLICY as D_, parseInvoiceCallback as Da, ENROLL_PROOF as Db, TYPING_KINDS as Dc, identityStatementText as Dd, newMailbox as Df, CONNECT_TIMEOUT_MS as Dg, shownTime as Dh, decodeDidDhtPacket as Di, wakeRequest as Dl, ReactionWindow as Dm, groupMetaPicture as Dn, RACE_RELAYED_MS as Do, parseVoiceMeta as Dp, ATPROTO_PROOF_SCOPE as Dr, wireHubPolicy as Ds, encodeGroupEntryLink as Dt, REACTIONS_CAPABILITY as Du, waitForIceGathering as Dv, ANSWER_READ_SPACING_MS as Dw, mergeContactKnocks as Dx, handoffContext as Dy, isX401Protocol as E, deviceLinkParams as EC, __require as EE, verifyAppSignature as ES, RELAY_PAYLOAD_MAX_BYTES as ET, VIEWER_DROPPED_HEADERS as E_, invoiceCallbackUrl as Ea, ENROLL_HELLO as Eb, TYPING_FRAME as Ec, identityStatement as Ed, isHoldUrl as Ef, ANSWER_REFUSED_REDIALS as Eg, receivedTimestamp as Eh, DidDhtError as Ei, wakePayload as El, REACTION_LIMITS as Em, groupMetaNewer as En, RACE_DIRECT_MS as Eo, isPlayableAudioType as Ep, ATPROTO_PROOF_COLLECTION as Er, pickMeshHubs as Es, decodeGroupEntryLink as Et, PIN_CAPABILITY as Eu, signalHasVideo as Ev, ANSWER_READ_FIRST_MS as Ew, makeStampPaced as Ex, handoffCancelFrame as Ey, appRevocationFor as F, seedSigner as FC, canonicalJson as FS, decodeTxtPacket as FT, sanitizeResponseHeaders as F_, ENDPOINT as Fa, enrollProofFrame as Fb, TypingSender as Fc, applyIdentityEvent as Fd, NIP05_PATH as Ff, STALLED_EVIDENCE_MS as Fg, MEMBER_KEY as Fh, openDidDhtPayload as Fi, pushRequest as Fl, reactionIsNewer as Fm, parseGroupMetaFrame as Fn, UNPROVEN_AUTH_MS as Fo, VIDEO_LIMITS as Fp, shortAtprotoDid as Fr, lobbyRecords as Fs, GROUP_WAKE_GROUP_LIMIT as Ft, WAKE_SESSION_CAPABILITY as Fu, HTTP_SERVICE_PROTO as Fv, CHAT_WATCH_SHARE as Fw, APP_BUNDLE_LIMITS as Fx, handoffHaveFrames as Fy, readAppStore as G, TOMBSTONE_TURN as GC, DEVICE_INVITE_OWN_DEVICE as GS, setPublicKeyFastPath as GT, decodeChunk as G_, withoutAudioMetadata as Ga, REOPEN_BELOW as Gb, PINNED_FRAME as Gc, nostrProofTemplate as Gd, parseDomainTxt as Gf, DHT_POLL_INTERVALS as Gg, signCommit as Gh, USDT_PUBLIC_RPC as Gi, appRangeDataFrame as Gl, readReply as Gm, SshSigError as Gn, engineError as Go, EDIT_RECEIVE_LIMIT as Gp, parseAtprotoVerificationKey as Gr, validHead as Gs, GROUP_REACTED_FRAME as Gt, CAPS_PUBLISH_SPACING_MS as Gu, servicesToWire as Gv, HEDGE_MS as Gw, appViewOf as Gx, handoffVerifiedMessage as Gy, checkAppListing as H, keptAtEqualSequence as HC, readContactLink as HS, identityFromSeed as HT, LIMITS as H_, AUDIO_METADATA_LIMITS as Ha, MAX_MISSED as Hb, typingKindOf as Hc, emptyProofLedger as Hd, isPublicAddress as Hf, AWAITING_PEER_MS as Hg, rememberAlone as Hh, SEPOLIA_TEST_USDT as Hi, AppRanges as Hl, REPLY_LIMITS as Hm, SSHSIG_NAMESPACE as Hn, publishFailure as Ho, EDIT_BUFFER_MS as Hp, findInMst as Hr, readBeaconHead as Hs, mentionedMembers as Ht, CAPS_ISSUED_BACK_MS as Hu, isViewerTag as Hv, GROUP_RATION_WINDOW_MS as Hw, APP_SCREENSHOTS_DIR as Hx, handoffRetryAfter as Hy, appStoreDecision as I, webCryptoSigner as IC, canonicalJsonBytes as IS, encodeTxtPacket as IT, viewerResponseHeaders as I_, cashuRequestPayload as Ia, formatEnrollDigits as Ib, parseTypingActivity as Ic, lastSharedWithMe as Id, WELL_KNOWN_PATH as If, DIRECT_EVIDENCE_MS as Ig, OWN_FRAME_LIMIT as Ih, resolveDidDht as Ii, vapidAuthorization as Il, readDhtReactions as Im, parseGroupMetaStatement as In, WAKE_ANSWER_GRACE_MS as Io, formatVideoDuration as Ip, AtprotoCid as Ir, mergeBeacon as Is, GROUP_WAKE_GROUP_WINDOW_MS as It, parseSessionCapabilities as Iu, LEGACY_SERVICES as Iv, DEFAULT_RELAYS as Iw, APP_BUNDLE_MAGIC as Ix, handoffHelloFrame as Iy, signAppStore as J, TURN_LAST_SEQUENCE as JC, deviceInviteJoinerParams as JS, decrypt as JT, encodeControl as J_, readingAhead as Ja, inboxRecord as Jb, PIN_LIMITS as Jc, proofStatement as Jd, recordsName as Jf, IDLE_THRESHOLD as Jg, verifyCommit as Jh, assertTokenUnits as Ji, appRangeGetFrame as Jl, ACTIVE_TASK_STATUSES as Jm, sameSshKey as Jn, PairingTracker as Jo, MAX_REMOVAL_NUMBER as Jp, verifyAtprotoRecordProof as Jr, MAX_PAIRED_CALL_SIGNAL as Js, asWritten as Jt, CapsKeys as Ju, HANDOFF_ATTEMPTS as Jv, REQUESTS_PER_MINUTE as Jw, checkAppManifest as Jx, newHandoffId as Jy, readAppStoreSteps as K, TURN_BODY_BYTES as KC, createDeviceInvite as KS, sign as KT, decodeControl as K_, NO_VIDEO_METADATA as Ka, clearMissed as Kb, PIN_CLOCK_SKEW_MS as Kc, proofCapability as Kd, recordsFromTxt as Kf, EXPECT_PEER_MS as Kg, sortRoster as Kh, WALLET_NETWORKS as Ki, appRangeEndFrame as Kl, replySnippet as Km, parseSshPublicKey as Kn, engineText as Ko, EDIT_SEND_LIMIT as Kp, readAtprotoCid as Kr, CALL_RATE_WINDOW_MS as Ks, GROUP_READ_NOTE as Kt, CAPS_REFRESH_MS as Ku, viewerTag as Kv, PREVIOUS_DEFAULT_RELAYS as Kw, assembleAppBundle as Kx, handoffVersions as Ky, appUpdateDecision as L, TURN_PUT_WINDOW_MS as LC, readCanonicalJson as LS, readDnsName as LT, viewerServicePolicy as L_, fedimintRequestPayload as La, readEnrollGrant as Lb, parseTypingFrame as Lc, PROOF_ADAPTERS as Ld, decodeDnsResponse as Lf, DIRECT_OWN_ATTEMPTS as Lg, SAID_AGAIN as Lh, signDidDhtPacket as Li, vapidKeysMatch as Ll, readReaction as Lm, parseGroupMetaTag as Ln, WAKE_LOST_MS as Lo, isPlayableVideoType as Lp, AtprotoProofError as Lr, mergeLobby as Ls, GROUP_WAKE_MEMBER_INTERVAL_MS as Lt, sessionCapabilitiesFrame as Lu, MAX_SERVICES as Lv, DEPARTED_READS as Lw, APP_CLIENTS as Lx, handoffManifestFrames as Ly, readX401ProofResultHeader as M, signDeviceTransports as MC, parseImageMeta as MS, readOwnRelayPayload as MT, relativizeLocation as M_, BOLT11_PATTERN as Ma, enrollGrantFrame as Mb, TYPING_STATUS_MAX as Mc, signIdentityPresentation as Md, DOMAIN_MAX_RECORDS as Mf, LATE_ANSWER_MS as Mg, LEGACY_GROUP_MEMBERS as Mh, encodeDidDhtDeactivated as Mi, decryptPushPayload as Ml, reactedFrame as Mm, nextGroupMetaRevision as Mn, RTC_SIGNAL_RECEIVE_LIMIT as Mo, voiceLevelsOf as Mp, isAtprotoDid as Mr, freshHubs as Ms, mergeKnocks as Mt, SessionCapabilities as Mu, emptyLinkRecords as Mv, CHAT_RESERVE as Mw, requestRecords as Mx, handoffEphemeral as My, x401AnswerableRequests as N, unsignedDeviceTransports as NC, previewable as NS, signRelayPayload as NT, resolveTargetUrl as N_, decodeBolt11 as Na, enrollHelloFrame as Nb, TYPING_TIMEOUT_MS as Nc, verifyIdentityPresentation as Nd, DOMAIN_METHODS as Nf, OFFER_HOST_GATHER_MS as Ng, MAX_GROUP_CHAIN as Nh, encodeDidDhtPacket as Ni, encryptPushPayload as Nl, reactionEmoji as Nm, openGroupMeta as Nn, RTC_UNSTARTED_MS as No, voicePeaksOf as Np, normalizeAtprotoHandle as Nr, hubRank as Ns, readKnocks as Nt, TYPING_CAPABILITY as Nu, isEmptyLinkPacket as Nv, CHAT_RESERVE_MOST_SHARE as Nw, seenEntry as Nx, handoffFileMissingFrame as Ny, readX401ProofRequestHeader as O, deviceLinkSealKey as OC, IMAGE_LIMITS as OS, measureRecords as OT, VIEWER_SERVICE_CSP as O_, parseLightningDestination as Oa, enrollCancelFrame as Ob, TYPING_RATE_LIMIT as Oc, isIdentityBinding as Od, readManifest as Of, DATA_SETTLE_MS as Og, GROUP_ADMIN_OFF_ERROR as Oh, didDhtDocument as Oi, PUSH_PAD_BYTES as Ol, nextReactionNumber as Om, groupMetaTag as On, REDESCRIBED_GRACE_MS as Oo, recordingMime as Op, atprotoDidMethod as Or, COMMUNITY_TOPOLOGY as Os, entryParams as Ot, SERVICES_CAPABILITY as Ou, LABEL$1 as Ov, AWAITED_READS as Ow, openRequest as Ox, handoffContextProof as Oy, addedAppPermissions as P, verifyDeviceTransports as PC, readImageMeta as PS, decodeDnsAnswers as PT, sanitizeRequestHeaders as P_, findBolt11 as Pa, enrollMessage as Pb, TypingReceiver as Pc, IDENTITY_TIMELINE_MAX as Pd, DOMAIN_TXT_MAX_BYTES as Pf, REANSWERS as Pg, MAX_GROUP_MEMBERS as Ph, jwkThumbprint as Pi, generateVapidKeys as Pl, reactionFrame as Pm, parseGroupMetaBody as Pn, SWITCH_RETIRE_MS as Po, PLAYABLE_VIDEO as Pp, parseAtprotoDidDocument as Pr, lobbyKeys as Ps, GROUP_WAKE_FRAME as Pt, UPGRADE_CAPABILITY as Pu, parseLinkRecords as Pv, CHAT_RESERVE_PER_CHAT as Pw, stampHolds as Px, handoffFileRequestFrame as Py, openGroupTyping as Q, TURN_REV_LIMIT as QC, INVITE_HRP as QS, tryDecrypt as QT, DATA_CHANNEL_LABEL as Q_, PICTURE_METADATA_LIMITS as Qa, takeRequest as Qb, parsePinnedFrame as Qc, validExternalKey as Qd, ACTIVE_DHT_POLL_MS as Qf, OFFER_LOOK_MS as Qg, confirmationTag as Qh, parsePaymentAmount as Qi, parseAppRangeFrame as Ql, ITEM_STATES as Qm, verifySshSignature as Qn, GROUP_WANT_FRAME as Qo, editFrame as Qp, DID_GHOSTLY_SERVICE as Qr, ChatFiles as Qs, CATCH_UP_PAUSE_MS as Qt, dialDescriptors as Qu, HANDOFF_CANCEL_REASONS as Qv, SIGNALING_WINDOW_MS as Qw, isAppUrl as Qx, readHandoffCancel as Qy, checkAppBeforeRun as R, TURN_RAISE_READ_TIMEOUT_MS as RC, CONTACT_LINK_BYTES as RS, IDENTITY_MEMO_IDLE_MS as RT, webLocalFetch as R_, findEndpoint as Ra, readEnrollHello as Rb, plainStatusLine as Rc, PROOF_CAPABILITY as Rd, dnsProofName as Rf, DIRECT_PEERS as Rg, commitHash as Rh, ETHEREUM_USDT as Ri, APP_RANGE_DATA_KIND as Rl, validReactionNumber as Rm, signGroupMeta as Rn, pairedEditFits as Ro, isVideoMime as Rp, atprotoCidFor as Rr, newerHead as Rs, GROUP_WAKE_RECEIVE_LIMIT as Rt, PAIRED_PROFILE as Ru, SERVICES_VERSION as Rv, FRESH_READ_MS as Rw, APP_CLIENT_NAME as Rx, handoffOfferFrame as Ry, buildX401ResultArtifact as S, deviceEchoNonce as SC, utf8Encode as SE, setAppSignatureFastPath as SS, withRequestOptions as ST, GhostlyHttpError as S_, LIGHTNING_DESTINATION_PATTERN as Sa, ENROLL_CANCEL as Sb, sameStatusState as Sc, emptyIdentityLedger as Sd, HOLD_DATED_BACK_MS as Sf, ratchetRoot as Sg, MESSAGE_CLOCK_SKEW_MS as Sh, DID_DHT_MAX_PAYLOAD as Si, readWake as Sl, GROUP_REACTION_FRAME as Sm, encodeGroupMetaBody as Sn, PAIRING_ATTEMPT_MS as So, baseMime as Sp, u64 as Sr, mayBeHub as Ss, verifyCommunityCommit as St, EDIT_CAPABILITY as Su, keepsToRelays as Sv, turnSignedMessage as Sw, knockSlotOf as Sx, handoffAttemptAllowed as Sy, encodeX401Header as T, deviceLinkPairing as TC, __exportAll as TE, verifyAppRevocation as TS, PacketTooLargeError as TT, VIEWER_DROPPED_DIRECTIVES as T_, findLightningDestination as Ta, ENROLL_GRANT as Tb, statusState as Tc, identityRevocationValue as Td, HoldRefusedError as Tf, ratchetUnknownSession as Tg, heardTime as Th, DID_DHT_VERSION as Ti, wakeFrame as Tl, REACTION_FRAME as Tm, groupMetaChange as Tn, RACE_ANSWERED_MS as To, formatVoiceDuration as Tp, ATPROTO_FULL_SCOPE as Tr, parseHubPolicy as Ts, MAX_KNOCKS as Tt, KNOWN_SESSION_CAPABILITIES as Tu, sdpHasCandidates as Tv, ANSWER_READ_ALLOWANCE as Tw, makeStamp as Tx, handoffBusyFrame as Ty, checkAppStoreIndex as U, turnPutSummary as UC, DEVICE_INVITE_BYTES as US, identityFromSeedB64 as UT, MAX_CHUNK_PAYLOAD_BYTES as U_, NO_AUDIO_METADATA as Ua, MAX_WAITING as Ub, COMMUNITY_PIN_FRAME as Uc, importedProof as Ud, nip05RootKey as Uf, DAEMON_WATCH_PEER_IDLE_MS as Ug, rosterAdmin as Uh, SEPOLIA_TEST_USDT_FAUCET as Ui, appRangeCancelFrame as Ul, groupReplyAuthor as Um, SSH_KEY_TYPES as Un, ENGINE_ERRORS as Uo, EDIT_FRAME as Up, parseAtprotoCar as Ur, readLobby as Us, parseGroupWakeFrame as Ut, CAPS_LABEL as Uu, serviceIdFromName as Uv, GROUP_SIGNALING_ALLOWANCE_SHARE as Uw, APP_VIEWS as Ux, handoffStreamKey as Uy, APP_STORE_LIMITS as V, classifyTurnRead as VC, encodeContactLink as VS, createIdentity as VT, CHUNK_KIND as V_, parseFedimintRequestPayload as Va, MAX_DONE as Vb, typingFrame as Vc, STORAGE_ROOT as Vd, encodeDnsQuery as Vf, symmetricNat as Vg, parseGroupCommit as Vh, PaymentPreflightError as Vi, APP_RANGE_LIMITS as Vl, REPLY_ID as Vm, SSHSIG_MAX_ARMOR as Vn, parsePaymentNetworks as Vo, EDIT_BUFFER_MAX as Vp, encodeDagCbor as Vr, readBeacon as Vs, groupWakes as Vt, SESSION_RECEIVE_PENDING as Vu, isValidServiceId as Vv, GROUP_OVER_PACE_MS as Vw, APP_PERMISSIONS as Vx, handoffRequestFrame as Vy, readAppListing as W, TOMBSTONE_SEQUENCE as WC, DEVICE_INVITE_LIFETIME_S as WS, publicKeyFromZ32 as WT, PROTOCOL_VERSION as W_, audioMetadataPatches as Wa, NEW_PER_HOUR as Wb, GROUP_PIN_FRAME as Wc, isProofAdapter as Wd, normalizeDomain as Wf, DEPARTED_READ_MS as Wg, rosterHas as Wh, TEST_USDT_FAUCET_AMOUNT as Wi, appRangeChunk as Wl, pairedReplyAuthor as Wm, SSH_PUBLIC_KEY_MAX as Wn, EngineError as Wo, EDIT_RATE_WINDOW_MS as Wp, parseAtprotoDidKey as Wr, shouldBeHub as Ws, GROUP_LIMITS as Wt, CAPS_LIMITS as Wu, servicesFromWire as Wv, HEDGE_MISSING_MS as Ww, appDigest as Wx, handoffVerifiedFrame as Wy, GroupTypingBoard as X, TURN_NAME_BYTES as XC, readDeviceInvite as XS, generateEncryptionKey as XT, wrapDataChannel as X_, withoutVideoMetadata as Xa, planKnocks as Xb, nextPinNumber as Xc, storageProofBody as Xd, validDomainRecord as Xf, MAX_DHT_TEXT_BYTES as Xg, GROUP_PROFILE as Xh, formatPaymentAmount as Xi, encodeAppRangeData as Xl, BUTTON_STYLES as Xm, sshKeyDigestHex as Xn, GROUP_HAVE_FRAME as Xo, RateWindow as Xp, DID_DOCUMENT_MAX_BYTES as Xr, PairedCalls as Xs, frameBytes as Xt, DHT_TEXT_CAPABILITY as Xu, HANDOFF_BUSY_REASONS as Xv, RelaysFailedError as Xw, isAppLicense as Xx, readHandoffAck as Xy, GROUP_TYPING_FRAME as Y, TURN_MAX as YC, encodeDeviceInvite as YS, encrypt as YT, sendBody as Y_, videoMetadataPatches as Ya, newInbox as Yb, mayPin as Yc, storageProof as Yd, txtValue as Yf, LinkSession as Yg, verifyCommitSignature as Yh, assertWholeSats as Yi, decodeAppRangeData as Yl, BUTTON_ID as Ym, sshFingerprint as Yn, GROUP_FILE_LIMITS as Yo, REMOVED_TEXT as Yp, verifyAtprotoSignature as Yr, PAIRED_CALL_FRAME as Ys, chainPieces as Yt, CapsRefusedError as Yu, HANDOFF_BUSY as Yv, RelayTransport as Yw, findAppForbiddenKey as Yx, openHandoffPiece as Yy, groupTypingEpoch as Z, TURN_NO_ACTIVE as ZC, DEVICE_INVITE_VERSION as ZS, sealedLength as ZT, DATA_CHANNEL_ID as Z_, NO_PICTURE_METADATA as Za, settleRequest as Zb, parsePinFrame as Zc, storageProofPath as Zd, wellKnownUrl as Zf, OFFER_FAST_MS as Zg, confirmationMatches as Zh, isWalletNetwork as Zi, isServeId as Zl, CRON_LINE as Zm, sshSignCommand as Zn, GROUP_VERSION_FILES as Zo, dhtEditId as Zp, DID_FILE_MAX_BYTES as Zr, parsePairedCallFrame as Zs, groupMessageId as Zt, capsDescriptors as Zu, HANDOFF_CANCEL as Zv, SIGNALING_ALLOWANCE_SHARE as Zw, isAppPath as Zx, readHandoffBusy as Zy, X401_PROTOCOLS as _, DEVICE_ECHO_FRAME as _C, randomBytes as _E, isAppSignature as _S, PublishFailedError as _T, VIEWER_WORKER_GUARD_CSP as __, pubkyProofPath as _a, setUpdateFrame as _b, StatusReceiver as _c, IDENTITY_SUBJECT as _d, rankTransports as _f, emptyRatchetState as _g, sameButtonText as _h, parseDidJws as _i, WAKE_TTL_SECONDS as _l, FORWARD_LIMITS as _m, GROUP_META_PAST_CHARS as _n, LIVENESS_MISSED_PINGS as _o, sanitizeMime as _p, encodeWitness as _r, groupSignalFrame as _s, rosterHash as _t, readAppFrame as _u, decompressSdp as _v, turnName as _w, contactAskerFrame as _x, HANDOFF_WINDOW as _y, X401_DCQL_LIMITS as a, decodeInviteCode as aC, hasVisible as aE, APP_PREFIXES as aS, currentRelays as aT, STALLED_LOOK_MS as a_, sparkInvoiceDetails as aa, readHandoffPake as ab, refusalText as ac, IDENTITY_FRAME_LIMIT as ad, validRingKey as af, openSecret as ag, TASK_STATUSES as ah, checkDidSignature as ai, WAKE_CALL_INTERVAL_MS as al, LINK_MAX_CHARS as am, communityEditFrame as an, CROSSED_FRESH_MS as ao, LIVE_POLL_MS as ap, bip322ToSign as ar, readGroupWant as as, communityGroupId as at, APP_RESUME_GRACE_MS as au, BURST_RING_MS as av, encodeTurnFields as aw, LINK_RECORD_LABEL as ax, HANDOFF_LATER_BYTES as ay, buildX401ProofRequest as b, HANDOFF_CAPABILITY as bC, toZ32 as bE, readAppRevocations as bS, isDiscoveryBudgetError as bT, guardViewerAnswer as b_, homeserverWebEndpoint as ba, verifySetUpdate as bb, parseStatusFrame as bc, boundIdentityDisplay as bd, transportOrder as bf, ratchetOn as bg, taskProgress as bh, staticDidDocument as bi, newWakeToken as bl, readForwarded as bm, MAX_GROUP_NAME_LENGTH as bn, MESSAGE_RECEIVE_LIMITS as bo, VOICE_LIMITS as bp, txHash as br, MESH_HUBS as bs, verifyCommunityChain as bt, BUTTONS_CAPABILITY as bu, isCandidateAddress as bv, turnReleaseMessage as bw, knockHolds as bx, filePartName as by, readX401DcqlQuery as c, inviteLink as cC, stripHidden as cE, appRef as cS, relayUrlProblem as cT, UNUSED_INVITE_UPKEEP_MS as c_, isBitcoinAddress as ca, readHandoffVerified as cb, transferStalled as cc, IDENTITY_MAX_EVIDENCE as cd, AUTOMATIC_ORDER as cf, sha256Hex as cg, buttonLabelClash as ch, didSignedMessages as ci, WAKE_FRAME as cl, canonicalUrl as cm, parseCommunityEdit as cn, DEMOTE_AFTER_FAILURES as co, DHT_FILE_CAPABILITY as cp, verifyBip322 as cr, CarriedTransport as cs, communityRoster as ct, AppSessions as cu, PAIRED_CALL_CANDIDATES as cv, openTurnValue as cw, REQUEST_CLOCK_SKEW_MS as cx, HANDOFF_OFFER as cy, newX401HolderKey as d, inviteQrText as dC, bytesEqual as dE, appSignedBytes as dS, BREAKER_ALL_DOWN_PROBE_MS as dT, countUnusedInvite as d_, isPubkyKey as da, sortParts as db, STATUS_FRAME as dc, IDENTITY_MAX_VALIDITY as dd, TRANSPORTS as df, MAX_SKIPPED_KEYS as dg, cardLinkHost as dh, didWebFileNames as di, WAKE_ONLINE_BATCH_MS as dl, linkTail as dm, MENTION_LIMITS as dn, EARLY_DIAL_JOIN_MS as do, readDhtFile as dp, compactSize as dr, SIGNALS_PER_MINUTE as ds, derivedSecret as dt, appDataFrame as du, answersOffer as dv, sealTurnBody as dw, REQUEST_NAME_UNITS as dx, HANDOFF_PIECE_OVERHEAD as dy, INVITE_MAX_LENGTH as eC, MAX_AVATAR_SIDE as eE, readAppBundle as eS, SLOW_MS as eT, PRESENCE_HEARTBEAT as e_, walletNetworkOf as ea, readHandoffDone as eb, FILE_FRAMES as ec, encodePacketTransports as ed, verifyPeerProof as ef, edgeParams as eg, PR_STATES as eh, DID_JWS_MAX_LENGTH as ei, pinIsNewer as el, parseEditFrame as em, CatchUpAnswers as en, stripPictureMetadata as eo, DHT_FILE_TOO_LARGE as ep, legacyMessageHash as er, fetchesByItself as es, COMMUNITY_LIMITS as et, APP_DATA_MAX_BYTES as eu, RTC_SIGNAL_MAX_AGE_MS as ev, TURN_SIGNED_BYTES as ew, CONTACT_ASKER_FRAME as ex, HANDOFF_DONE as ey, readX401SdJwtVc as f, ownInviteRefusal as fC, concatBytes as fE, checkAppRevokeStatement as fS, BREAKER_BASE_MS as fT, presenceSeenAt as f_, isPubkyProofFolder as fa, SET_ACK as fb, STATUS_IDLE_AFTER_MS as fc, IDENTITY_PROOF_CAPABILITY as fd, automaticTransport as ff, RATCHET_CAPABILITY as fg, cardTimeUtc as fh, didWebFileUrl as fi, WAKE_ONLINE_DELAY_MS as fl, linksIn as fm, mentionsBytes as fn, FIRST_PAIRING_PACE_MS as fo, FileTransfers as fp, decodeAnyBitcoinAddress as fr, SIGNAL_CARRIERS as fs, encodeCommunityLink as ft, appOpenFrame as fu, buildSdpFromSignal as fv, signTurnBody as fw, REQUEST_PACKET_BYTES as fx, HANDOFF_RELEASE as fy, X401_LIMITS as g, DEVICE_CAPABILITIES as gC, isZ32Key as gE, isAppRef as gS, DiscoveryBudgetError as gT, VIEWER_GUARD_SCRIPT as g_, pubkyProofFile as ga, setAckFrame as gb, STATUS_TEXT_MAX as gc, IDENTITY_STATEMENT_PREFIX as gd, irohRelayUrl as gf, RatchetBox as gg, removedCardText as gh, parseDidDocument as gi, WAKE_SUBJECT as gl, uriEnd as gm, GROUP_META_PAST as gn, INVITE_TAKEN as go, sanitizeFileName as gp, encodeTx as gr, SIGNAL_REPLY_MS as gs, leftStatement as gt, parseAppFrame as gu, contactRtcConfig as gv, turnKeys as gw, STAMP_BITS_MIN as gx, HANDOFF_VERSION as gy, X401_HEADERS as h, DEVICES_CAPABILITY as hC, fromZ32 as hE, isAppLine as hS, RelayBreaker as hT, VIEWER_GUARD_HASH as h_, pubkyProofCapability as ha, readSetUpdate as hb, STATUS_SEND_INTERVAL_MS as hc, IDENTITY_REVOCATION_LABEL as hd, irohDescriptor as hf, RATCHET_OVERHEAD as hg, readStatusCard as hh, parseDid as hi, WAKE_RETRY_MS as hl, sanitizePreviewImage as hm, wireMentions as hn, INVITER_DIAL_GRACE_MS as ho, safeBlobType as hp, decodeWitness as hr, SIGNAL_PROVEN_MS as hs, leaveStatement3 as ht, isChatAppId as hu, compressSdp as hv, turnInstance as hw, STAMP_BITS_MAX as hx, HANDOFF_VERIFIED as hy, x401ApprovalDigest as i, createLink as iC, dropLoneJoiners as iE, APP_NAME as iS, WRITE_FIRST_MS as iT, SIGNAL_OUT_READS as i_, sparkAddressKind as ia, readHandoffManifest as ib, encodeFileData as ic, IDENTITY_CLOCK_SKEW as id, ringEvidence as if, openPair as ig, STATUS_CARD_LIMITS as ih, checkDidJws as ii, DEVICE_WAKE_TTL_SECONDS as il, validRemovalNumber as im, carryMentions as in, BLOCKED_DIAL_WAIT_MS as io, DhtDelivery as ip, bip322MessageHash as ir, readGroupHave as is, communityCommitHash as it, APP_RATE_WINDOW_MS as iu, parseRtcSignal as iv, TurnRecordError as iw, KNOCK_SLOT_LABEL as ix, HANDOFF_HELLO as iy, readX401ProofResult as j, newDeviceSetSecret as jC, isImageMime as jS, parseRelayPayload as jT, parseLocalTarget as j_, resolveLightningDestination as ja, enrollDoneFrame as jb, TYPING_SEND_LIMIT as jc, revokesIdentity as jd, DOMAIN_FILE_MAX_BYTES as jf, GATHER_STALL_MS as jg, GROUP_VERSION_LARGE as jh, didDhtRecords as ji, checkPushEndpoint as jl, queueReaction as jm, keepPastGroupMeta as jn, RTC_SIGNAL_RATE_WINDOW_MS as jo, voiceLevel as jp, checkAtprotoProofRecord as jr, doorHubs as js, knockRecords as jt, STATUS_CARD_CAPABILITY as ju, buildLinkRecords as jv, BACKGROUND_WRITES_SHARE as jw, requestPlaintextBytes as jx, handoffDoneFrame as jy, readX401ProofResponse as k, deviceLinkSecret as kC, exifOrientation as kS, newerPacket as kT, VIEWER_SERVICE_CSP_RELAY_ONLY as k_, parsePayParams as ka, enrollCancelReason as kb, TYPING_RATE_WINDOW_MS as kc, newIdentityBinding as kd, DNS_LABEL as kf, DataLink as kg, GROUP_ID as kh, didDhtFromPublicKey as ki, PUSH_SERVICE_HOSTS as kl, parseReactedFrame as km, groupMetaToHand as kn, RELAYED_FIRST_MS as ko, voiceDownloadName as kp, atprotoProofRecord as kr, beaconKeys as ks, groupEntryUrl as kt, SESSION_CAPABILITIES_FRAME as ku, MAX_MSGS_PAYLOAD_B64 as kv, BACKGROUND_REQUESTS_PER_MINUTE as kw, readKnockSlot as kx, handoffDataFrame as ky, x401VpToken as l, inviteOwnership as lC, trimEndOf as lE, appRefPublisher as lS, setLinkTraceSink as lT, UNUSED_INVITE_WAIT_MAX_MS as l_, PUBKY_PROOF_MAX_BYTES as la, sameDigest as lb, PRESENCES as lc, IDENTITY_MAX_FRAME as ld, RELAY_URL as lf, FOLLOW_MS as lg, cardEditNumber as lh, didWebDocumentUrl as li, WAKE_INTERVAL_MS as ll, linkEnd as lm, validEditText as ln, DEMOTE_MS as lo, dhtFileElements as lp, BitcoinAddressError as lr, GROUP_SIGNAL_FRAME as ls, communityUntaggedHash as lt, appCloseFrame as lu, QUICK_REDIAL_MS as lv, readTurnBody as lw, REQUEST_LABEL as lx, HANDOFF_PAKE as ly, x401HolderJwk as m, readInviteCode as mC, fromBase64Url as mE, isAppKey as mS, BREAKER_THRESHOLD as mT, VIEWER_GUARD_CSP as m_, normalizePubkyKey as ma, encodeSetSlots as mb, STATUS_RATE_WINDOW_MS as mc, IDENTITY_REUSE_CHECK_S as md, dialableIrohRelay as mf, RATCHET_KEEP_MS as mg, checkStatusCard as mh, normalizeDid as mi, WAKE_ONLINE_TTL_SECONDS as ml, previewImageSize as mm, validMentions as mn, HANDLED_WAIT_MS as mo, formatFileSize as mp, decodeTx as mr, SIGNAL_HOLD_MS as ms, leaveStatement as mt, isAppVersion as mu, callSignalHeardAt as mv, signTurnRelease as mw, STAMP_BITS_DEFAULT as mx, HANDOFF_TIMINGS as my, X401_RESPONSE_MODES as n, OwnInviteError as nC, sanitizeAvatar as nE, sha256Paced as nS, WATCH_SHARE as nT, RELAY_POLL_INTERVALS as n_, SPARK_PROVIDER as na, readHandoffHave as nb, FileUplink as nc, IDENTITY_CHALLENGE_WINDOW as nd, ringAuthorization as nf, epochKeys as ng, ROUTINE_STATES as nh, DID_METHODS as ni, pinnedFrame as nl, validEditMessage as nm, GROUP_EDIT_FRAME as nn, ANSWERS_REFUSED_PAUSES as no, DHT_TEXT_BYTES as np, BIP322_REVISION as nr, isGroupMessageId as ns, CommunitySession as nt, APP_PEER_OPEN_MAX as nu, extractRtcParams as nv, TURN_TTL as nw, ContactRequestError as nx, HANDOFF_FILE_REQUEST as ny, matchX401Dcql as o, encodeGhostlyInvite as oC, sanitizeDisplayText as oE, APP_STATEMENT_LIMITS as oS, normalizeRelayUrl as oT, TRANSPORTS_GONE_MS as o_, sparkNetworkOf as oa, readHandoffRelease as ob, sentWhole as oc, IDENTITY_FRAME_WINDOW_MS as od, verifyRingAuthorization as of, sealPair as og, appCardId as oh, didGhostlyServiceEntry as oi, WAKE_CALL_TTL_SECONDS as ol, LINK_PREVIEW_LIMITS as om, communityMessageAuthor as on, CROSSED_PROBE_MS as oo, emptyDhtDeliveryState as op, bip322ToSpend as or, readGroupWantNo as os, communityHasFrame as ot, APP_SEND_LIMIT as ou, CALL_SIGNAL_FUTURE_MS as ov, firstDeviceSetSecret as ow, MAX_SEEN as ox, HANDOFF_LIST_PER_FRAME as oy, sameX401HolderJwk as p, pastedAgain as pC, fromBase64 as pE, isAppHash as pS, BREAKER_MAX_MS as pT, unusedInviteWait as p_, newPubkyProofFolder as pa, SET_UPDATE as pb, STATUS_RATE_LIMIT as pc, IDENTITY_PROVIDER_ID as pd, checkedDescriptors as pf, RATCHET_HEADER_BYTES as pg, cardUrl as ph, didWebHost as pi, WAKE_ONLINE_INTERVAL_MS as pl, parseLinkPreview as pm, mentionsMember as pn, GhostLink as po, PREVIEWABLE_IMAGE as pp, decodeBitcoinAddress as pr, SIGNAL_FRESH_MS as ps, leaveStands as pt, chatAppId as pu, callRtcConfig as pv, signTurnPacket as pw, REQUEST_TEXT_BYTES as px, HANDOFF_REQUEST as py, repeatedJsonKey as q, TURN_LABEL as qC, deviceInviteJoinerKeyZ32 as qS, verify as qT, encodeChunk as q_, VIDEO_METADATA_LIMITS as qa, endedRequests as qb, PIN_FRAME as qc, proofHash as qd, recordsFromWellKnown as qf, FIRST_PUBLISH_MAX_MS as qg, verifyChain as qh, arkAddressPrefix as qi, appRangeErrorFrame as ql, wireReply as qm, parseSshSignature as qn, parseEngineError as qo, MAX_EDITS_PER_MESSAGE as qp, unsignedCommitBytes as qr, CALL_RECEIVE_LIMIT as qs, GroupSession as qt, CapsExchange as qu, HANDOFF_ACK as qv, RELAY_REQUESTS_PER_MINUTE as qw, buildAppBundle as qx, isHandoffPartName as qy, readX401OpenId4VpRequest as r, createChatInvite as rC, MAX_NICK_LENGTH as rE, yieldThread as rS, WAY_BACK_SHARE as rT, SIGNAL_DUE_READS as r_, isSparkAddress as ra, readHandoffHello as rb, decodeFileData as rc, IDENTITY_CHECK_UNAVAILABLE as rd, ringClaims as rf, newEpochSecret as rg, RUN_RESULTS as rh, DidError as ri, readPin as rl, validEditNumber as rm, GROUP_EDIT_TEXT_BYTES as rn, ANSWERS_REFUSED_PAUSE_MS as ro, DHT_TEXT_REFUSED as rp, MessageRefusal as rr, readGroupFileMeta as rs, GROUP_READ_NOTE_COMMUNITY as rt, APP_RATE_LIMIT as ru, offerIsFresh as rv, TURN_VERSION as rw, KNOCK_SLOTS as rx, HANDOFF_HAVE as ry, presentX401SdJwtVc as s, encodeInviteCode as sC, sanitizeNick as sE, appFingerprint as sS, readRelayBody as sT, UNUSED_INVITE_READS_PER_MINUTE as s_, BITCOIN_NETWORKS as sa, readHandoffTurnFrame as sb, transferEnded as sc, IDENTITY_MAX_CHECKS_PER_HOUR as sd, verifyRingEvidence as sf, sealSecret as sg, appCardUrl as sh, didJwsAlg as si, WAKE_CALL_WAIT_MS as sl, LINK_TRAILING as sm, meshMessageRef as sn, CROSSED_WAIT_MS as so, peekDhtMailbox as sp, decodeBase64 as sr, CARRIED_DEFER_MS as ss, communityMessageId as st, APP_VERSION_MAX as su, CALL_SIGNAL_MAX_AGE_MS as sv, nextTurnPosition as sw, MAX_SLOT_KNOCKS as sx, HANDOFF_MANIFEST as sy, X401_REQUEST_LIMITS as t, INVITE_VERSION as tC, jpegSize$1 as tE, readAppBundleAsync as tS, TURN_SOURCE_TIMEOUT_MS as tT, PRESENCE_WINDOW as t_, SPARK_NETWORKS as ta, readHandoffFileFrame as tb, FILE_LIMITS as tc, parsePacketTransports as td, RING_LIFETIME as tf, encryptText as tg, REMOVABLE_KINDS as th, DID_MAX_LENGTH as ti, pinNumberHolds as tl, parseEditedFrame as tm, COMMUNITY_EDIT_FRAME as tn, withoutPictureMetadata as to, DHT_MESSAGE_TTL as tp, verifyBitcoinMessage as tr, groupFileFallback as ts, COMMUNITY_PROFILE as tt, APP_FRAME as tu, buildDataSdp as tv, TURN_SLOTS as tw, CONTACT_RECORD_TTL as tx, HANDOFF_FILE_MISSING as ty, X401_CREDENTIAL_LIMITS as u, inviteQrSegments as uC, unwrapPasted as uE, appRevocationId as uS, traceLink as uT, WATCH_PEER_MS as u_, PUBKY_PROOF_ROOT as ua, sealHandoffPiece as ub, STATUS_AVAILABILITIES as uc, IDENTITY_MAX_RECEIVED as ud, RELAY_WITH_SECRETS as uf, MAX_SKIP as ug, cardLine as uh, didWebFile as ui, WAKE_ONLINE_BATCH as ul, linkStop as um, MENTION_EVERYONE as un, DHT_PIN_GRACE_MS as uo, dhtFileId as up, ByteReader as ur, GROUP_VERSION_SIGNALS as us, decodeCommunityLink as ut, appDataBytes as uu, RTC_CONFIG as uv, readTurnPacket as uw, REQUEST_LIFETIME_MS as ux, HANDOFF_PIECE_BYTES as uy, X401_SCHEME as v, DEVICE_PING_FRAME as vC, toBase64 as vE, readAppRevocation as vS, budgetRetryMs as vT, WEBRTC_GUARD as v_, decodeSvcbRecords as va, setUpdateMessage as vb, StatusSender as vc, IdentityCheckUnavailable as vd, relayUrl as vf, isRatcheted as vg, statusCardBytes as vh, parseDidSignaturePaste as vi, WakeLimiter as vl, forwardedAgain as vm, MAX_GROUP_META_BODY as vn, LIVENESS_PING_MS as vo, PLAYABLE_AUDIO as vp, hash160 as vr, readGroupSignal as vs, shortHash as vt, APPS_CAPABILITY as vu, extractParamsFromSdp as vv, turnPacket as vw, contactAskerHolds as vx, NO_ATTEMPTS as vy, decodeX401Header as w, deviceKeyZ32 as wC, __esmMin as wE, signAppRevocation as wS, PKARR_FUTURE_SKEW_MS as wT, HttpHost as w_, fetchLnurlJson as wa, ENROLL_DONE as wb, statusFrame as wc, identityRefusal as wd, HoldKeys as wf, ratchetSessionOf as wg, claimedTime as wh, DID_DHT_TTL as wi, relayRequest as wl, REACTED_FRAME as wm, groupMetaBody as wn, PONG_WAIT_MS as wo, fileMessageText as wp, ATPROTO_DECLARED_SCOPE as wr, meshRendezvous as ws, KNOCK_TTL_MS as wt, FILES_CAPABILITY as wu, pickCallCandidates as wv, turnVerifierMark as ww, linkRecords as wx, handoffAttemptSucceeded as wy, buildX401ProofResult as x, deviceEchoFrame as xC, utf8Decode as xE, readAppSignature as xS, publishedNowhere as xT, viewerGuardOffset as x_, pubkyHomeserverOf as xa, DEVICE_KINDS as xb, personStatus as xc, boundVerifiedIdentity as xd, HOLD_CAPABILITY as xf, ratchetOpen as xg, usageLeft as xh, strictBase64Url as xi, parseWakeFrame as xl, COMMUNITY_REACTION_FRAME as xm, MAX_GROUP_PICTURE_LENGTH as xn, PAIRED_FRAME_TOO_LARGE as xo, VOICE_METER as xp, u32$1 as xr, NO_HUB_POLICY as xs, verifyCommunityChainPaced as xt, CALLS_CAPABILITY as xu, isGlobalIpv4Host as xv, turnSequence as xw, knockSlotIdentity as xx, handoffAckFrame as xy, X401_VERSION as y, ENROLL_CAPABILITY as yC, toBase64Url as yE, readAppRevocationShape as yS, heldBackError as yT, allowingViewerGuard as y_, encodeSvcbPacket as ya, signTombstone as yb, liveStatus as yc, IdentityExchange as yd, relayedTransports as yf, ratchetHeard as yg, statusCardText as yh, signingKeys as yi, deviceWakeRequest as yl, forwardedMany as ym, MAX_GROUP_NAME_BYTES as yn, MAX_PAIRED_MESSAGE_FRAME as yo, RECORDING_TYPES as yp, sha256d as yr, GROUP_VERSION_HUBS as ys, signCommunity as yt, APP_RANGES_CAPABILITY as yu, heardCallSignal as yv, turnPayloadSequence as yw, contactDay as yx, filePartDigest as yy, planAppUpdate as z, TURN_SETTLE_MS as zC, CONTACT_LINK_VERSION as zS, IDENTITY_MEMO_MAX as zT, withViewerPolicy as z_, isFederationId as za, verifyEnrollProof as zb, sanitizeTypingStatus as zc, PeerProofs as zd, domainTxtRecord as zf, DirectPathWatch as zg, commitUntaggedHash as zh, EVM_TEST_CHAINS as zi, APP_RANGE_ERRORS as zl, wireReaction as zm, verifyGroupMetaSignature as zn, pairedMessageFits as zo, parseVideoMeta as zp, decodeAtprotoCommit as zr, pickHubs as zs, GroupWakeLimiter as zt, PairedSession as zu, decodeServices as zv, GROUP_BURST_MS as zw, APP_FORBIDDEN_KEYS as zx, handoffPakeFrame as zy };
43633
+ export { sealGroupTyping as $, TURN_NAME_BYTES as $C, readDeviceInvite as $S, generateEncryptionKey as $T, wrapDataChannel as $_, NO_PICTURE_METADATA as $a, planKnocks as $b, nextPinNumber as $c, storageProofBody as $d, validDomainRecord as $f, MAX_DHT_TEXT_BYTES as $g, GROUP_PROFILE as $h, parsePaymentAmount as $i, encodeAppRangeData as $l, BUTTON_STYLES as $m, verifySshSignature as $n, GROUP_HAVE_FRAME as $o, RateWindow as $p, DID_GHOSTLY_SERVICE as $r, PairedCalls as $s, CATCH_UP_PAUSE_MS as $t, DHT_TEXT_CAPABILITY as $u, HANDOFF_BUSY_REASONS as $v, RelaysFailedError as $w, isAppLicense as $x, readHandoffAck as $y, readX401ProofResponseHeader as A, deviceLinkRendezvousSeed as AC, __toCommonJS as AE, verifyAppStatementBytes as AS, createRelayPayload as AT, VIEWER_PERMISSIONS_POLICY as A_, parsePayParams as Aa, ENROLL_PROOF as Ab, TYPING_KINDS as Ac, identityStatementText as Ad, newMailbox as Af, CONNECT_TIMEOUT_MS as Ag, shownTime as Ah, didDhtFromPublicKey as Ai, wakeRequest as Al, ReactionWindow as Am, groupMetaToHand as An, RACE_RELAYED_MS as Ao, parseVoiceMeta as Ap, atprotoProofRecord as Ar, wireHubPolicy as As, groupEntryUrl as At, REACTIONS_CAPABILITY as Au, waitForIceGathering as Av, ANSWER_READ_SPACING_MS as Aw, mergeContactKnocks as Ax, handoffContext as Ay, APP_STORE_KINDS as B, TURN_PUT_WINDOW_MS as BC, readCanonicalJson as BS, readDnsName as BT, viewerServicePolicy as B_, isFederationId as Ba, readEnrollGrant as Bb, parseTypingFrame as Bc, PROOF_ADAPTERS as Bd, decodeDnsResponse as Bf, DIRECT_OWN_ATTEMPTS as Bg, SAID_AGAIN as Bh, EVM_TEST_CHAINS as Bi, vapidKeysMatch as Bl, readReaction as Bm, verifyGroupMetaSignature as Bn, WAKE_LOST_MS as Bo, isPlayableVideoType as Bp, decodeAtprotoCommit as Br, mergeLobby as Bs, GroupWakeLimiter as Bt, sessionCapabilitiesFrame as Bu, MAX_SERVICES as Bv, DEPARTED_READS as Bw, APP_CLIENTS as Bx, handoffManifestFrames as By, buildX401TokenObject as C, HANDOFF_CAPABILITY as CC, toZ32 as CE, readAppRevocations as CS, isDiscoveryBudgetError as CT, guardViewerAnswer as C_, LIGHTNING_DESTINATION_PATTERN as Ca, verifySetUpdate as Cb, parseStatusFrame as Cc, boundIdentityDisplay as Cd, transportOrder as Cf, ratchetOn as Cg, taskProgress as Ch, DID_DHT_MAX_PAYLOAD as Ci, newWakeToken as Cl, readForwarded as Cm, encodeGroupMetaBody as Cn, MESSAGE_RECEIVE_LIMITS as Co, VOICE_LIMITS as Cp, u64 as Cr, MESH_HUBS as Cs, verifyCommunityCommit as Ct, BUTTONS_CAPABILITY as Cu, isCandidateAddress as Cv, turnReleaseMessage as Cw, knockHolds as Cx, filePartName as Cy, readX401ProofRequest as D, deviceKeyZ32 as DC, __esmMin as DE, signAppRevocation as DS, PKARR_FUTURE_SKEW_MS as DT, HttpHost as D_, invoiceCallbackUrl as Da, ENROLL_DONE as Db, statusFrame as Dc, identityRefusal as Dd, HoldKeys as Df, ratchetSessionOf as Dg, claimedTime as Dh, DidDhtError as Di, relayRequest as Dl, REACTED_FRAME as Dm, groupMetaNewer as Dn, PONG_WAIT_MS as Do, fileMessageText as Dp, ATPROTO_PROOF_COLLECTION as Dr, meshRendezvous as Ds, decodeGroupEntryLink as Dt, FILES_CAPABILITY as Du, pickCallCandidates as Dv, turnVerifierMark as Dw, linkRecords as Dx, handoffAttemptSucceeded as Dy, isX401Protocol as E, deviceFrameCapability as EC, __commonJSMin as EE, signAppObject as ES, MAX_DNS_PACKET_BYTES as ET, HttpClient as E_, findLightningDestination as Ea, ENROLL_CANCEL_REASONS as Eb, sanitizeStatusText as Ec, identityPresentationBytes as Ed, HOLD_LIMITS as Ef, ratchetSeal as Eg, arrivalKey as Eh, DID_DHT_VERSION as Ei, readWakePayload as El, QUICK_REACTIONS as Em, groupMetaChange as En, PAIRING_RETRY_MS as Eo, downsamplePeaks as Ep, ATPROTO_FULL_SCOPE as Er, meshHubs as Es, MAX_KNOCKS as Et, FILES_BINARY_CAPABILITY as Eu, parseCallSignal as Ev, turnStatedVerifier as Ew, knockSlotRecords as Ex, handoffAttemptFailed as Ey, appRevocationFor as F, signDeviceTransports as FC, parseImageMeta as FS, readOwnRelayPayload as FT, relativizeLocation as F_, findBolt11 as Fa, enrollGrantFrame as Fb, TYPING_STATUS_MAX as Fc, signIdentityPresentation as Fd, DOMAIN_MAX_RECORDS as Ff, LATE_ANSWER_MS as Fg, LEGACY_GROUP_MEMBERS as Fh, jwkThumbprint as Fi, decryptPushPayload as Fl, reactedFrame as Fm, parseGroupMetaBody as Fn, RTC_SIGNAL_RECEIVE_LIMIT as Fo, voiceLevelsOf as Fp, parseAtprotoDidDocument as Fr, freshHubs as Fs, GROUP_WAKE_FRAME as Ft, SessionCapabilities as Fu, emptyLinkRecords as Fv, CHAT_RESERVE as Fw, requestRecords as Fx, handoffEphemeral as Fy, readAppStore as G, keptAtEqualSequence as GC, readContactLink as GS, identityFromSeed as GT, LIMITS as G_, audioMetadataPatches as Ga, MAX_MISSED as Gb, typingKindOf as Gc, emptyProofLedger as Gd, isPublicAddress as Gf, AWAITING_PEER_MS as Gg, rememberAlone as Gh, TEST_USDT_FAUCET_AMOUNT as Gi, AppRanges as Gl, REPLY_LIMITS as Gm, SSH_PUBLIC_KEY_MAX as Gn, publishFailure as Go, EDIT_BUFFER_MS as Gp, parseAtprotoDidKey as Gr, readBeaconHead as Gs, GROUP_LIMITS as Gt, CAPS_ISSUED_BACK_MS as Gu, isViewerTag as Gv, GROUP_RATION_WINDOW_MS as Gw, APP_SCREENSHOTS_DIR as Gx, handoffRetryAfter as Gy, checkAppListing as H, TURN_SETTLE_MS as HC, CONTACT_LINK_VERSION as HS, IDENTITY_MEMO_MAX as HT, withViewerPolicy as H_, parseFedimintRequestPayload as Ha, verifyEnrollProof as Hb, sanitizeTypingStatus as Hc, PeerProofs as Hd, domainTxtRecord as Hf, DirectPathWatch as Hg, commitUntaggedHash as Hh, PaymentPreflightError as Hi, APP_RANGE_ERRORS as Hl, wireReaction as Hm, SSHSIG_MAX_ARMOR as Hn, pairedMessageFits as Ho, parseVideoMeta as Hp, encodeDagCbor as Hr, pickHubs as Hs, groupWakes as Ht, PairedSession as Hu, decodeServices as Hv, GROUP_BURST_MS as Hw, APP_FORBIDDEN_KEYS as Hx, handoffPakeFrame as Hy, appStoreDecision as I, unsignedDeviceTransports as IC, previewable as IS, signRelayPayload as IT, resolveTargetUrl as I_, ENDPOINT as Ia, enrollHelloFrame as Ib, TYPING_TIMEOUT_MS as Ic, verifyIdentityPresentation as Id, DOMAIN_METHODS as If, OFFER_HOST_GATHER_MS as Ig, MAX_GROUP_CHAIN as Ih, openDidDhtPayload as Ii, encryptPushPayload as Il, reactionEmoji as Im, parseGroupMetaFrame as In, RTC_UNSTARTED_MS as Io, voicePeaksOf as Ip, shortAtprotoDid as Ir, hubRank as Is, GROUP_WAKE_GROUP_LIMIT as It, TYPING_CAPABILITY as Iu, isEmptyLinkPacket as Iv, CHAT_RESERVE_MOST_SHARE as Iw, seenEntry as Ix, handoffFileMissingFrame as Iy, signAppStore as J, TOMBSTONE_TURN as JC, DEVICE_INVITE_OWN_DEVICE as JS, setPublicKeyFastPath as JT, decodeChunk as J_, VIDEO_METADATA_LIMITS as Ja, REOPEN_BELOW as Jb, PINNED_FRAME as Jc, nostrProofTemplate as Jd, parseDomainTxt as Jf, DHT_POLL_INTERVALS as Jg, signCommit as Jh, arkAddressPrefix as Ji, appRangeDataFrame as Jl, readReply as Jm, parseSshSignature as Jn, engineError as Jo, EDIT_RECEIVE_LIMIT as Jp, unsignedCommitBytes as Jr, validHead as Js, GroupSession as Jt, CAPS_PUBLISH_SPACING_MS as Ju, servicesToWire as Jv, HEDGE_MS as Jw, appViewOf as Jx, handoffVerifiedMessage as Jy, readAppStoreSteps as K, turnPutSummary as KC, DEVICE_INVITE_BYTES as KS, identityFromSeedB64 as KT, MAX_CHUNK_PAYLOAD_BYTES as K_, withoutAudioMetadata as Ka, MAX_WAITING as Kb, COMMUNITY_PIN_FRAME as Kc, importedProof as Kd, nip05RootKey as Kf, DAEMON_WATCH_PEER_IDLE_MS as Kg, rosterAdmin as Kh, USDT_PUBLIC_RPC as Ki, appRangeCancelFrame as Kl, groupReplyAuthor as Km, SshSigError as Kn, ENGINE_ERRORS as Ko, EDIT_FRAME as Kp, parseAtprotoVerificationKey as Kr, readLobby as Ks, GROUP_REACTED_FRAME as Kt, CAPS_LABEL as Ku, serviceIdFromName as Kv, GROUP_SIGNALING_ALLOWANCE_SHARE as Kw, APP_VIEWS as Kx, handoffStreamKey as Ky, appUpdateDecision as L, verifyDeviceTransports as LC, readImageMeta as LS, decodeDnsAnswers as LT, sanitizeRequestHeaders as L_, cashuRequestPayload as La, enrollMessage as Lb, TypingReceiver as Lc, IDENTITY_TIMELINE_MAX as Ld, DOMAIN_TXT_MAX_BYTES as Lf, REANSWERS as Lg, MAX_GROUP_MEMBERS as Lh, resolveDidDht as Li, generateVapidKeys as Ll, reactionFrame as Lm, parseGroupMetaStatement as Ln, SWITCH_RETIRE_MS as Lo, PLAYABLE_VIDEO as Lp, AtprotoCid as Lr, lobbyKeys as Ls, GROUP_WAKE_GROUP_WINDOW_MS as Lt, UPGRADE_CAPABILITY as Lu, parseLinkRecords as Lv, CHAT_RESERVE_PER_CHAT as Lw, stampHolds as Lx, handoffFileRequestFrame as Ly, readX401ProofResultHeader as M, deviceLinkSecret as MC, exifOrientation as MS, newerPacket as MT, VIEWER_SERVICE_CSP_RELAY_ONLY as M_, resolveLightningDestination as Ma, enrollCancelReason as Mb, TYPING_RATE_WINDOW_MS as Mc, newIdentityBinding as Md, DNS_LABEL as Mf, DataLink as Mg, GROUP_ID as Mh, didDhtRecords as Mi, PUSH_SERVICE_HOSTS as Ml, parseReactedFrame as Mm, keepPastGroupMeta as Mn, RELAYED_FIRST_MS as Mo, voiceDownloadName as Mp, checkAtprotoProofRecord as Mr, beaconKeys as Ms, knockRecords as Mt, SESSION_CAPABILITIES_FRAME as Mu, MAX_MSGS_PAYLOAD_B64 as Mv, BACKGROUND_REQUESTS_PER_MINUTE as Mw, readKnockSlot as Mx, handoffDataFrame as My, x401AnswerableRequests as N, devicePingFrame as NC, imageSize as NS, openRelayPayload as NT, formatLocalTarget as N_, BOLT11_PATTERN as Na, enrollDigits as Nb, TYPING_REFRESH_MS as Nc, receivedIdentityStatus as Nd, DNS_TYPE as Nf, GATHER_ATTEMPTS as Ng, GROUP_MEMBER_CAP as Nh, encodeDidDhtDeactivated as Ni, WebPushError as Nl, parseReactionFrame as Nm, nextGroupMetaRevision as Nn, RESUME_WAIT_MS as No, voiceFileName as Np, isAtprotoDid as Nr, beaconRecords as Ns, mergeKnocks as Nt, STATUS_CAPABILITY as Nu, RECORD_TTL as Nv, BACKGROUND_WHILE_SIGNALING as Nw, readLinkRecord as Nx, handoffDigest as Ny, readX401ProofRequestHeader as O, deviceLinkPairing as OC, __exportAll as OE, verifyAppRevocation as OS, PacketTooLargeError as OT, VIEWER_DROPPED_DIRECTIVES as O_, parseInvoiceCallback as Oa, ENROLL_GRANT as Ob, statusState as Oc, identityRevocationValue as Od, HoldRefusedError as Of, ratchetUnknownSession as Og, heardTime as Oh, decodeDidDhtPacket as Oi, wakeFrame as Ol, REACTION_FRAME as Om, groupMetaPicture as On, RACE_ANSWERED_MS as Oo, formatVoiceDuration as Op, ATPROTO_PROOF_SCOPE as Or, parseHubPolicy as Os, encodeGroupEntryLink as Ot, KNOWN_SESSION_CAPABILITIES as Ou, sdpHasCandidates as Ov, ANSWER_READ_ALLOWANCE as Ow, makeStamp as Ox, handoffBusyFrame as Oy, addedAppPermissions as P, newDeviceSetSecret as PC, isImageMime as PS, parseRelayPayload as PT, parseLocalTarget as P_, decodeBolt11 as Pa, enrollDoneFrame as Pb, TYPING_SEND_LIMIT as Pc, revokesIdentity as Pd, DOMAIN_FILE_MAX_BYTES as Pf, GATHER_STALL_MS as Pg, GROUP_VERSION_LARGE as Ph, encodeDidDhtPacket as Pi, checkPushEndpoint as Pl, queueReaction as Pm, openGroupMeta as Pn, RTC_SIGNAL_RATE_WINDOW_MS as Po, voiceLevel as Pp, normalizeAtprotoHandle as Pr, doorHubs as Ps, readKnocks as Pt, STATUS_CARD_CAPABILITY as Pu, buildLinkRecords as Pv, BACKGROUND_WRITES_SHARE as Pw, requestPlaintextBytes as Px, handoffDoneFrame as Py, openGroupTyping as Q, TURN_MAX as QC, encodeDeviceInvite as QS, encrypt as QT, sendBody as Q_, withoutVideoMetadata as Qa, newInbox as Qb, mayPin as Qc, storageProof as Qd, txtValue as Qf, LinkSession as Qg, verifyCommitSignature as Qh, isWalletNetwork as Qi, decodeAppRangeData as Ql, BUTTON_ID as Qm, sshSignCommand as Qn, GROUP_FILE_LIMITS as Qo, REMOVED_TEXT as Qp, DID_FILE_MAX_BYTES as Qr, PAIRED_CALL_FRAME as Qs, groupMessageId as Qt, CapsRefusedError as Qu, HANDOFF_BUSY as Qv, RelayTransport as Qw, findAppForbiddenKey as Qx, openHandoffPiece as Qy, checkAppBeforeRun as R, seedSigner as RC, canonicalJson as RS, decodeTxtPacket as RT, sanitizeResponseHeaders as R_, fedimintRequestPayload as Ra, enrollProofFrame as Rb, TypingSender as Rc, applyIdentityEvent as Rd, NIP05_PATH as Rf, STALLED_EVIDENCE_MS as Rg, MEMBER_KEY as Rh, signDidDhtPacket as Ri, pushRequest as Rl, reactionIsNewer as Rm, parseGroupMetaTag as Rn, UNPROVEN_AUTH_MS as Ro, VIDEO_LIMITS as Rp, AtprotoProofError as Rr, lobbyRecords as Rs, GROUP_WAKE_MEMBER_INTERVAL_MS as Rt, WAKE_SESSION_CAPABILITY as Ru, HTTP_SERVICE_PROTO as Rv, CHAT_WATCH_SHARE as Rw, APP_BUNDLE_LIMITS as Rx, handoffHaveFrames as Ry, buildX401ResultArtifact as S, ENROLL_CAPABILITY as SC, toBase64Url as SE, readAppRevocationShape as SS, heldBackError as ST, allowingViewerGuard as S_, pubkyHomeserverOf as Sa, signTombstone as Sb, liveStatus as Sc, IdentityExchange as Sd, relayedTransports as Sf, ratchetHeard as Sg, statusCardText as Sh, strictBase64Url as Si, deviceWakeRequest as Sl, forwardedMany as Sm, MAX_GROUP_PICTURE_LENGTH as Sn, MAX_PAIRED_MESSAGE_FRAME as So, RECORDING_TYPES as Sp, u32$1 as Sr, GROUP_VERSION_HUBS as Ss, verifyCommunityChainPaced as St, APP_RANGES_CAPABILITY as Su, heardCallSignal as Sv, turnPayloadSequence as Sw, contactDay as Sx, filePartDigest as Sy, encodeX401Header as T, deviceEchoNonce as TC, utf8Encode as TE, setAppSignatureFastPath as TS, withRequestOptions as TT, GhostlyHttpError as T_, fetchLnurlJson as Ta, ENROLL_CANCEL as Tb, sameStatusState as Tc, emptyIdentityLedger as Td, HOLD_DATED_BACK_MS as Tf, ratchetRoot as Tg, MESSAGE_CLOCK_SKEW_MS as Th, DID_DHT_TTL as Ti, readWake as Tl, GROUP_REACTION_FRAME as Tm, groupMetaBody as Tn, PAIRING_ATTEMPT_MS as To, baseMime as Tp, ATPROTO_DECLARED_SCOPE as Tr, mayBeHub as Ts, KNOCK_TTL_MS as Tt, EDIT_CAPABILITY as Tu, keepsToRelays as Tv, turnSignedMessage as Tw, knockSlotOf as Tx, handoffAttemptAllowed as Ty, checkAppStoreIndex as U, TURN_VISIBLE_MS as UC, createContactLink as US, IDENTITY_MEMO_SIZE as UT, CHUNK_FLAG_END as U_, AUDIO_METADATA_LIMITS as Ua, FLOOD_PER_DAY as Ub, typingActivity as Uc, STORAGE_LIFETIME as Ud, domainWellKnownFile as Uf, directBlocked as Ug, expectedRoster as Uh, SEPOLIA_TEST_USDT as Ui, APP_RANGE_FRAMES as Ul, PAIRED_REPLY_AUTHORS as Um, SSHSIG_NAMESPACE as Un, pairedMessageFrame as Uo, EDITED_FRAME as Up, findInMst as Ur, rankHubs as Us, mentionedMembers as Ut, SESSION_FRAME_MAX as Uu, encodeServices as Uv, GROUP_BURST_ONE_LINK as Uw, APP_ICON_PATH as Ux, handoffReleaseFrame as Uy, APP_STORE_LIMITS as V, TURN_RAISE_READ_TIMEOUT_MS as VC, CONTACT_LINK_BYTES as VS, IDENTITY_MEMO_IDLE_MS as VT, webLocalFetch as V_, parseCashuRequestPayload as Va, readEnrollHello as Vb, plainStatusLine as Vc, PROOF_CAPABILITY as Vd, dnsProofName as Vf, DIRECT_PEERS as Vg, commitHash as Vh, ONCHAIN_PROVIDER as Vi, APP_RANGE_DATA_KIND as Vl, validReactionNumber as Vm, wrapGroupMeta as Vn, pairedEditFits as Vo, isVideoMime as Vp, decodeDagCbor as Vr, newerHead as Vs, groupWakeFrame as Vt, PAIRED_PROFILE as Vu, SERVICES_VERSION as Vv, FRESH_READ_MS as Vw, APP_CLIENT_NAME as Vx, handoffOfferFrame as Vy, readAppListing as W, classifyTurnRead as WC, encodeContactLink as WS, createIdentity as WT, CHUNK_KIND as W_, NO_AUDIO_METADATA as Wa, MAX_DONE as Wb, typingFrame as Wc, STORAGE_ROOT as Wd, encodeDnsQuery as Wf, symmetricNat as Wg, parseGroupCommit as Wh, SEPOLIA_TEST_USDT_FAUCET as Wi, APP_RANGE_LIMITS as Wl, REPLY_ID as Wm, SSH_KEY_TYPES as Wn, parsePaymentNetworks as Wo, EDIT_BUFFER_MAX as Wp, parseAtprotoCar as Wr, readBeacon as Ws, parseGroupWakeFrame as Wt, SESSION_RECEIVE_PENDING as Wu, isValidServiceId as Wv, GROUP_OVER_PACE_MS as Ww, APP_PERMISSIONS as Wx, handoffRequestFrame as Wy, GroupTypingBoard as X, TURN_LABEL as XC, deviceInviteJoinerKeyZ32 as XS, verify as XT, encodeChunk as X_, readingAhead as Xa, endedRequests as Xb, PIN_FRAME as Xc, proofHash as Xd, recordsFromWellKnown as Xf, FIRST_PUBLISH_MAX_MS as Xg, verifyChain as Xh, assertWholeSats as Xi, appRangeErrorFrame as Xl, wireReply as Xm, sshFingerprint as Xn, parseEngineError as Xo, MAX_EDITS_PER_MESSAGE as Xp, verifyAtprotoSignature as Xr, CALL_RECEIVE_LIMIT as Xs, chainPieces as Xt, CapsExchange as Xu, HANDOFF_ACK as Xv, RELAY_REQUESTS_PER_MINUTE as Xw, buildAppBundle as Xx, isHandoffPartName as Xy, GROUP_TYPING_FRAME as Y, TURN_BODY_BYTES as YC, createDeviceInvite as YS, sign as YT, decodeControl as Y_, isAsf as Ya, clearMissed as Yb, PIN_CLOCK_SKEW_MS as Yc, proofCapability as Yd, recordsFromTxt as Yf, EXPECT_PEER_MS as Yg, sortRoster as Yh, assertTokenUnits as Yi, appRangeEndFrame as Yl, replySnippet as Ym, sameSshKey as Yn, engineText as Yo, EDIT_SEND_LIMIT as Yp, verifyAtprotoRecordProof as Yr, CALL_RATE_WINDOW_MS as Ys, asWritten as Yt, CAPS_REFRESH_MS as Yu, viewerTag as Yv, PREVIOUS_DEFAULT_RELAYS as Yw, assembleAppBundle as Yx, handoffVersions as Yy, groupTypingEpoch as Z, TURN_LAST_SEQUENCE as ZC, deviceInviteJoinerParams as ZS, decrypt as ZT, encodeControl as Z_, videoMetadataPatches as Za, inboxRecord as Zb, PIN_LIMITS as Zc, proofStatement as Zd, recordsName as Zf, IDLE_THRESHOLD as Zg, verifyCommit as Zh, formatPaymentAmount as Zi, appRangeGetFrame as Zl, ACTIVE_TASK_STATUSES as Zm, sshKeyDigestHex as Zn, PairingTracker as Zo, MAX_REMOVAL_NUMBER as Zp, DID_DOCUMENT_MAX_BYTES as Zr, MAX_PAIRED_CALL_SIGNAL as Zs, frameBytes as Zt, CapsKeys as Zu, HANDOFF_ATTEMPTS as Zv, REQUESTS_PER_MINUTE as Zw, checkAppManifest as Zx, newHandoffId as Zy, X401_PROTOCOLS as _, readInviteCode as _C, fromBase64Url as _E, isAppKey as _S, BREAKER_THRESHOLD as _T, VIEWER_GUARD_CSP as __, pubkyProofFile as _a, encodeSetSlots as _b, STATUS_RATE_WINDOW_MS as _c, IDENTITY_REUSE_CHECK_S as _d, dialableIrohRelay as _f, RATCHET_KEEP_MS as _g, checkStatusCard as _h, parseDidDocument as _i, WAKE_ONLINE_TTL_SECONDS as _l, previewImageSize as _m, GROUP_META_PAST as _n, HANDLED_WAIT_MS as _o, formatFileSize as _p, encodeTx as _r, SIGNAL_HOLD_MS as _s, rosterHash as _t, isAppVersion as _u, callSignalHeardAt as _v, signTurnRelease as _w, STAMP_BITS_DEFAULT as _x, HANDOFF_TIMINGS as _y, X401_DCQL_LIMITS as a, OwnInviteError as aC, sanitizeAvatar as aE, sha256Paced as aS, WATCH_SHARE as aT, RELAY_POLL_INTERVALS as a_, sparkAddressKind as aa, readHandoffHave as ab, FileUplink as ac, IDENTITY_CHALLENGE_WINDOW as ad, ringAuthorization as af, epochKeys as ag, ROUTINE_STATES as ah, checkDidJws as ai, pinnedFrame as al, validEditMessage as am, carryMentions as an, ANSWERS_REFUSED_PAUSE_MS as ao, DHT_TEXT_BYTES as ap, bip322MessageHash as ar, isGroupMessageId as as, communityGroupId as at, APP_PEER_OPEN_MAX as au, extractRtcParams as av, TURN_TTL as aw, ContactRequestError as ax, HANDOFF_FILE_REQUEST as ay, buildX401ProofRequest as b, DEVICE_ECHO_FRAME as bC, randomBytes as bE, isAppSignature as bS, PublishFailedError as bT, VIEWER_WORKER_GUARD_CSP as b_, encodeSvcbPacket as ba, setUpdateFrame as bb, StatusReceiver as bc, IDENTITY_SUBJECT as bd, rankTransports as bf, emptyRatchetState as bg, sameButtonText as bh, signingKeys as bi, WAKE_TTL_SECONDS as bl, FORWARD_LIMITS as bm, MAX_GROUP_NAME_BYTES as bn, LIVENESS_MISSED_PINGS as bo, sanitizeMime as bp, sha256d as br, groupSignalFrame as bs, signCommunity as bt, readAppFrame as bu, decompressSdp as bv, turnName as bw, contactAskerFrame as bx, HANDOFF_WINDOW as by, readX401DcqlQuery as c, decodeInviteCode as cC, hasVisible as cE, APP_PREFIXES as cS, currentRelays as cT, STALLED_LOOK_MS as c_, BITCOIN_NETWORKS as ca, readHandoffPake as cb, refusalText as cc, IDENTITY_FRAME_LIMIT as cd, validRingKey as cf, openSecret as cg, TASK_STATUSES as ch, didJwsAlg as ci, WAKE_CALL_INTERVAL_MS as cl, LINK_MAX_CHARS as cm, meshMessageRef as cn, CROSSED_PROBE_MS as co, LIVE_POLL_MS as cp, decodeBase64 as cr, readGroupWant as cs, communityRoster as ct, APP_RESUME_GRACE_MS as cu, BURST_RING_MS as cv, encodeTurnFields as cw, LINK_RECORD_LABEL as cx, HANDOFF_LATER_BYTES as cy, newX401HolderKey as d, inviteLink as dC, stripHidden as dE, appRef as dS, relayUrlProblem as dT, UNUSED_INVITE_UPKEEP_MS as d_, PUBKY_PROOF_ROOT as da, readHandoffVerified as db, transferStalled as dc, IDENTITY_MAX_EVIDENCE as dd, AUTOMATIC_ORDER as df, sha256Hex as dg, buttonLabelClash as dh, didWebFile as di, WAKE_FRAME as dl, canonicalUrl as dm, MENTION_EVERYONE as dn, DEMOTE_MS as do, DHT_FILE_CAPABILITY as dp, ByteReader as dr, CarriedTransport as ds, derivedSecret as dt, AppSessions as du, PAIRED_CALL_CANDIDATES as dv, openTurnValue as dw, REQUEST_CLOCK_SKEW_MS as dx, HANDOFF_OFFER as dy, DEVICE_INVITE_VERSION as eC, sealedLength as eE, isAppPath as eS, SIGNALING_ALLOWANCE_SHARE as eT, OFFER_FAST_MS as e_, validatePaymentTarget as ea, readHandoffBusy as eb, parsePairedCallFrame as ec, capsDescriptors as ed, storageProofPath as ef, confirmationMatches as eg, CRON_LINE as eh, DID_JWS_ALGS as ei, parsePinFrame as el, dhtEditId as em, CATCH_UP_SLICE as en, PICTURE_METADATA_LIMITS as eo, wellKnownUrl as ep, isLegacySignature as er, GROUP_VERSION_FILES as es, COMMUNITY_LIMITS as et, isServeId as eu, DATA_CHANNEL_ID as ev, TURN_NO_ACTIVE as ew, settleRequest as ex, HANDOFF_CANCEL as ey, readX401SdJwtVc as f, inviteOwnership as fC, trimEndOf as fE, appRefPublisher as fS, setLinkTraceSink as fT, UNUSED_INVITE_WAIT_MAX_MS as f_, isPubkyKey as fa, sameDigest as fb, PRESENCES as fc, IDENTITY_MAX_FRAME as fd, RELAY_URL as ff, FOLLOW_MS as fg, cardEditNumber as fh, didWebFileNames as fi, WAKE_INTERVAL_MS as fl, linkEnd as fm, MENTION_LIMITS as fn, DHT_PIN_GRACE_MS as fo, dhtFileElements as fp, compactSize as fr, GROUP_SIGNAL_FRAME as fs, encodeCommunityLink as ft, appCloseFrame as fu, QUICK_REDIAL_MS as fv, readTurnBody as fw, REQUEST_LABEL as fx, HANDOFF_PAKE as fy, X401_LIMITS as g, pastedAgain as gC, fromBase64 as gE, isAppHash as gS, BREAKER_MAX_MS as gT, unusedInviteWait as g_, pubkyProofCapability as ga, SET_UPDATE as gb, STATUS_RATE_LIMIT as gc, IDENTITY_PROVIDER_ID as gd, checkedDescriptors as gf, RATCHET_HEADER_BYTES as gg, cardUrl as gh, parseDid as gi, WAKE_ONLINE_INTERVAL_MS as gl, parseLinkPreview as gm, wireMentions as gn, GhostLink as go, PREVIEWABLE_IMAGE as gp, decodeWitness as gr, SIGNAL_FRESH_MS as gs, leftStatement as gt, chatAppId as gu, callRtcConfig as gv, signTurnPacket as gw, REQUEST_TEXT_BYTES as gx, HANDOFF_REQUEST as gy, X401_HEADERS as h, ownInviteRefusal as hC, concatBytes as hE, checkAppRevokeStatement as hS, BREAKER_BASE_MS as hT, presenceSeenAt as h_, normalizePubkyKey as ha, SET_ACK as hb, STATUS_IDLE_AFTER_MS as hc, IDENTITY_PROOF_CAPABILITY as hd, automaticTransport as hf, RATCHET_CAPABILITY as hg, cardTimeUtc as hh, normalizeDid as hi, WAKE_ONLINE_DELAY_MS as hl, linksIn as hm, validMentions as hn, FIRST_PAIRING_PACE_MS as ho, FileTransfers as hp, decodeTx as hr, SIGNAL_CARRIERS as hs, leaveStatement3 as ht, appOpenFrame as hu, buildSdpFromSignal as hv, signTurnBody as hw, REQUEST_PACKET_BYTES as hx, HANDOFF_RELEASE as hy, x401ApprovalDigest as i, INVITE_VERSION as iC, jpegSize$1 as iE, readAppBundleAsync as iS, TURN_SOURCE_TIMEOUT_MS as iT, PRESENCE_WINDOW as i_, isSparkAddress as ia, readHandoffFileFrame as ib, FILE_LIMITS as ic, parsePacketTransports as id, RING_LIFETIME as if, encryptText as ig, REMOVABLE_KINDS as ih, DidError as ii, pinNumberHolds as il, parseEditedFrame as im, GROUP_EDIT_TEXT_BYTES as in, ANSWERS_REFUSED_PAUSES as io, DHT_MESSAGE_TTL as ip, MessageRefusal as ir, groupFileFallback as is, communityCommitHash as it, APP_FRAME as iu, buildDataSdp as iv, TURN_SLOTS as iw, CONTACT_RECORD_TTL as ix, HANDOFF_FILE_MISSING as iy, readX401ProofResult as j, deviceLinkSealKey as jC, IMAGE_LIMITS as jS, measureRecords as jT, VIEWER_SERVICE_CSP as j_, requestLnurlInvoice as ja, enrollCancelFrame as jb, TYPING_RATE_LIMIT as jc, isIdentityBinding as jd, readManifest as jf, DATA_SETTLE_MS as jg, GROUP_ADMIN_OFF_ERROR as jh, didDhtKey as ji, PUSH_PAD_BYTES as jl, nextReactionNumber as jm, groupName as jn, REDESCRIBED_GRACE_MS as jo, recordingMime as jp, atprotoProofRkey as jr, COMMUNITY_TOPOLOGY as js, knockIdentity as jt, SERVICES_CAPABILITY as ju, LABEL$1 as jv, AWAITED_READS as jw, openRequest as jx, handoffContextProof as jy, readX401ProofResponse as k, deviceLinkParams as kC, __require as kE, verifyAppSignature as kS, RELAY_PAYLOAD_MAX_BYTES as kT, VIEWER_DROPPED_HEADERS as k_, parseLightningDestination as ka, ENROLL_HELLO as kb, TYPING_FRAME as kc, identityStatement as kd, isHoldUrl as kf, ANSWER_REFUSED_REDIALS as kg, receivedTimestamp as kh, didDhtDocument as ki, wakePayload as kl, REACTION_LIMITS as km, groupMetaTag as kn, RACE_DIRECT_MS as ko, isPlayableAudioType as kp, atprotoDidMethod as kr, pickMeshHubs as ks, entryParams as kt, PIN_CAPABILITY as ku, signalHasVideo as kv, ANSWER_READ_FIRST_MS as kw, makeStampPaced as kx, handoffCancelFrame as ky, x401VpToken as l, encodeGhostlyInvite as lC, sanitizeDisplayText as lE, APP_STATEMENT_LIMITS as lS, normalizeRelayUrl as lT, TRANSPORTS_GONE_MS as l_, isBitcoinAddress as la, readHandoffRelease as lb, sentWhole as lc, IDENTITY_FRAME_WINDOW_MS as ld, verifyRingAuthorization as lf, sealPair as lg, appCardId as lh, didSignedMessages as li, WAKE_CALL_TTL_SECONDS as ll, LINK_PREVIEW_LIMITS as lm, parseCommunityEdit as ln, CROSSED_WAIT_MS as lo, emptyDhtDeliveryState as lp, verifyBip322 as lr, readGroupWantNo as ls, communityUntaggedHash as lt, APP_SEND_LIMIT as lu, CALL_SIGNAL_FUTURE_MS as lv, firstDeviceSetSecret as lw, MAX_SEEN as lx, HANDOFF_LIST_PER_FRAME as ly, x401HolderJwk as m, inviteQrText as mC, bytesEqual as mE, appSignedBytes as mS, BREAKER_ALL_DOWN_PROBE_MS as mT, countUnusedInvite as m_, newPubkyProofFolder as ma, sortParts as mb, STATUS_FRAME as mc, IDENTITY_MAX_VALIDITY as md, TRANSPORTS as mf, MAX_SKIPPED_KEYS as mg, cardLinkHost as mh, didWebHost as mi, WAKE_ONLINE_BATCH_MS as ml, linkTail as mm, mentionsMember as mn, EARLY_DIAL_JOIN_MS as mo, readDhtFile as mp, decodeBitcoinAddress as mr, SIGNALS_PER_MINUTE as ms, leaveStatement as mt, appDataFrame as mu, answersOffer as mv, sealTurnBody as mw, REQUEST_NAME_UNITS as mx, HANDOFF_PIECE_OVERHEAD as my, X401_RESPONSE_MODES as n, INVITE_LINK_ORIGIN as nC, MAX_AVATAR_LENGTH as nE, pacer as nS, SLOW_DEMOTE_MS as nT, OFFER_STEP_MAX as n_, SPARK_NETWORKS as na, readHandoffData as nb, FILE_DATA_KIND as nc, emptyCapsState as nd, verifyNostrProof as nf, decryptText as ng, PR_CHECKS as nh, DID_MAX_LENGTH as ni, pinFrame as nl, editedFrame as nm, COMMUNITY_EDIT_FRAME as nn, stripPictureMetadata as no, DHT_FILE_REFUSED as np, verifyBitcoinMessage as nr, GROUP_WANT_NO_FRAME as ns, CommunitySession as nt, readAppRangeFrame as nu, RTC_SIGNAL_FUTURE_MS as nv, TURN_SEALED_BYTES as nw, turnOff as nx, HANDOFF_DATA as ny, matchX401Dcql as o, createChatInvite as oC, MAX_NICK_LENGTH as oE, yieldThread as oS, WAY_BACK_SHARE as oT, SIGNAL_DUE_READS as o_, sparkInvoiceDetails as oa, readHandoffHello as ob, decodeFileData as oc, IDENTITY_CHECK_UNAVAILABLE as od, ringClaims as of, newEpochSecret as og, RUN_RESULTS as oh, checkDidSignature as oi, readPin as ol, validEditNumber as om, communityEditFrame as on, BLOCKED_DIAL_WAIT_MS as oo, DHT_TEXT_REFUSED as op, bip322ToSign as or, readGroupFileMeta as os, communityHasFrame as ot, APP_RATE_LIMIT as ou, offerIsFresh as ov, TURN_VERSION as ow, KNOCK_SLOTS as ox, HANDOFF_HAVE as oy, sameX401HolderJwk as p, inviteQrSegments as pC, unwrapPasted as pE, appRevocationId as pS, traceLink as pT, WATCH_PEER_MS as p_, isPubkyProofFolder as pa, sealHandoffPiece as pb, STATUS_AVAILABILITIES as pc, IDENTITY_MAX_RECEIVED as pd, RELAY_WITH_SECRETS as pf, MAX_SKIP as pg, cardLine as ph, didWebFileUrl as pi, WAKE_ONLINE_BATCH as pl, linkStop as pm, mentionsBytes as pn, DIALED_IN_CONTENDERS as po, dhtFileId as pp, decodeAnyBitcoinAddress as pr, GROUP_VERSION_SIGNALS as ps, leaveStands as pt, appDataBytes as pu, RTC_CONFIG as pv, readTurnPacket as pw, REQUEST_LIFETIME_MS as px, HANDOFF_PIECE_BYTES as py, repeatedJsonKey as q, TOMBSTONE_SEQUENCE as qC, DEVICE_INVITE_LIFETIME_S as qS, publicKeyFromZ32 as qT, PROTOCOL_VERSION as q_, NO_VIDEO_METADATA as qa, NEW_PER_HOUR as qb, GROUP_PIN_FRAME as qc, isProofAdapter as qd, normalizeDomain as qf, DEPARTED_READ_MS as qg, rosterHas as qh, WALLET_NETWORKS as qi, appRangeChunk as ql, pairedReplyAuthor as qm, parseSshPublicKey as qn, EngineError as qo, EDIT_RATE_WINDOW_MS as qp, readAtprotoCid as qr, shouldBeHub as qs, GROUP_READ_NOTE as qt, CAPS_LIMITS as qu, servicesFromWire as qv, HEDGE_MISSING_MS as qw, appDigest as qx, handoffVerifiedFrame as qy, readX401OpenId4VpRequest as r, INVITE_MAX_LENGTH as rC, MAX_AVATAR_SIDE as rE, readAppBundle as rS, SLOW_MS as rT, PRESENCE_HEARTBEAT as r_, SPARK_PROVIDER as ra, readHandoffDone as rb, FILE_FRAMES as rc, encodePacketTransports as rd, verifyPeerProof as rf, edgeParams as rg, PR_STATES as rh, DID_METHODS as ri, pinIsNewer as rl, parseEditFrame as rm, GROUP_EDIT_FRAME as rn, withoutPictureMetadata as ro, DHT_FILE_TOO_LARGE as rp, BIP322_REVISION as rr, fetchesByItself as rs, GROUP_READ_NOTE_COMMUNITY as rt, APP_DATA_MAX_BYTES as ru, RTC_SIGNAL_MAX_AGE_MS as rv, TURN_SIGNED_BYTES as rw, CONTACT_ASKER_FRAME as rx, HANDOFF_DONE as ry, presentX401SdJwtVc as s, createLink as sC, dropLoneJoiners as sE, APP_NAME as sS, WRITE_FIRST_MS as sT, SIGNAL_OUT_READS as s_, sparkNetworkOf as sa, readHandoffManifest as sb, encodeFileData as sc, IDENTITY_CLOCK_SKEW as sd, ringEvidence as sf, openPair as sg, STATUS_CARD_LIMITS as sh, didGhostlyServiceEntry as si, DEVICE_WAKE_TTL_SECONDS as sl, validRemovalNumber as sm, communityMessageAuthor as sn, CROSSED_FRESH_MS as so, DhtDelivery as sp, bip322ToSpend as sr, readGroupHave as ss, communityMessageId as st, APP_RATE_WINDOW_MS as su, parseRtcSignal as sv, TurnRecordError as sw, KNOCK_SLOT_LABEL as sx, HANDOFF_HELLO as sy, X401_REQUEST_LIMITS as t, INVITE_HRP as tC, tryDecrypt as tE, isAppUrl as tS, SIGNALING_WINDOW_MS as tT, OFFER_LOOK_MS as t_, walletNetworkOf as ta, readHandoffCancel as tb, ChatFiles as tc, dialDescriptors as td, validExternalKey as tf, confirmationTag as tg, ITEM_STATES as th, DID_JWS_MAX_LENGTH as ti, parsePinnedFrame as tl, editFrame as tm, CatchUpAnswers as tn, isStrippedPicture as to, ACTIVE_DHT_POLL_MS as tp, legacyMessageHash as tr, GROUP_WANT_FRAME as ts, COMMUNITY_PROFILE as tt, parseAppRangeFrame as tu, DATA_CHANNEL_LABEL as tv, TURN_REV_LIMIT as tw, takeRequest as tx, HANDOFF_CANCEL_REASONS as ty, X401_CREDENTIAL_LIMITS as u, encodeInviteCode as uC, sanitizeNick as uE, appFingerprint as uS, readRelayBody as uT, UNUSED_INVITE_READS_PER_MINUTE as u_, PUBKY_PROOF_MAX_BYTES as ua, readHandoffTurnFrame as ub, transferEnded as uc, IDENTITY_MAX_CHECKS_PER_HOUR as ud, verifyRingEvidence as uf, sealSecret as ug, appCardUrl as uh, didWebDocumentUrl as ui, WAKE_CALL_WAIT_MS as ul, LINK_TRAILING as um, validEditText as un, DEMOTE_AFTER_FAILURES as uo, peekDhtMailbox as up, BitcoinAddressError as ur, CARRIED_DEFER_MS as us, decodeCommunityLink as ut, APP_VERSION_MAX as uu, CALL_SIGNAL_MAX_AGE_MS as uv, nextTurnPosition as uw, MAX_SLOT_KNOCKS as ux, HANDOFF_MANIFEST as uy, X401_SCHEME as v, DEVICES_CAPABILITY as vC, fromZ32 as vE, isAppLine as vS, RelayBreaker as vT, VIEWER_GUARD_HASH as v_, pubkyProofPath as va, readSetUpdate as vb, STATUS_SEND_INTERVAL_MS as vc, IDENTITY_REVOCATION_LABEL as vd, irohDescriptor as vf, RATCHET_OVERHEAD as vg, readStatusCard as vh, parseDidJws as vi, WAKE_RETRY_MS as vl, sanitizePreviewImage as vm, GROUP_META_PAST_CHARS as vn, INVITER_DIAL_GRACE_MS as vo, safeBlobType as vp, encodeWitness as vr, SIGNAL_PROVEN_MS as vs, routedCommunityFrame as vt, isChatAppId as vu, compressSdp as vv, turnInstance as vw, STAMP_BITS_MAX as vx, HANDOFF_VERIFIED as vy, decodeX401Header as w, deviceEchoFrame as wC, utf8Decode as wE, readAppSignature as wS, publishedNowhere as wT, viewerGuardOffset as w_, LNURL_LIMITS as wa, DEVICE_KINDS as wb, personStatus as wc, boundVerifiedIdentity as wd, HOLD_CAPABILITY as wf, ratchetOpen as wg, usageLeft as wh, DID_DHT_PREFIX as wi, parseWakeFrame as wl, COMMUNITY_REACTION_FRAME as wm, groupDisplayName as wn, PAIRED_FRAME_TOO_LARGE as wo, VOICE_METER as wp, varBytes as wr, NO_HUB_POLICY as ws, GROUP_ENTRY_PROFILE as wt, CALLS_CAPABILITY as wu, isGlobalIpv4Host as wv, turnSequence as ww, knockSlotIdentity as wx, handoffAckFrame as wy, buildX401ProofResult as x, DEVICE_PING_FRAME as xC, toBase64 as xE, readAppRevocation as xS, budgetRetryMs as xT, WEBRTC_GUARD as x_, homeserverWebEndpoint as xa, setUpdateMessage as xb, StatusSender as xc, IdentityCheckUnavailable as xd, relayUrl as xf, isRatcheted as xg, statusCardBytes as xh, staticDidDocument as xi, WakeLimiter as xl, forwardedAgain as xm, MAX_GROUP_NAME_LENGTH as xn, LIVENESS_PING_MS as xo, PLAYABLE_AUDIO as xp, txHash as xr, readGroupSignal as xs, verifyCommunityChain as xt, APPS_CAPABILITY as xu, extractParamsFromSdp as xv, turnPacket as xw, contactAskerHolds as xx, NO_ATTEMPTS as xy, X401_VERSION as y, DEVICE_CAPABILITIES as yC, isZ32Key as yE, isAppRef as yS, DiscoveryBudgetError as yT, VIEWER_GUARD_SCRIPT as y_, decodeSvcbRecords as ya, setAckFrame as yb, STATUS_TEXT_MAX as yc, IDENTITY_STATEMENT_PREFIX as yd, irohRelayUrl as yf, RatchetBox as yg, removedCardText as yh, parseDidSignaturePaste as yi, WAKE_SUBJECT as yl, uriEnd as ym, MAX_GROUP_META_BODY as yn, INVITE_TAKEN as yo, sanitizeFileName as yp, hash160 as yr, SIGNAL_REPLY_MS as ys, shortHash as yt, parseAppFrame as yu, contactRtcConfig as yv, turnKeys as yw, STAMP_BITS_MIN as yx, HANDOFF_VERSION as yy, planAppUpdate as z, webCryptoSigner as zC, canonicalJsonBytes as zS, encodeTxtPacket as zT, viewerResponseHeaders as z_, findEndpoint as za, formatEnrollDigits as zb, parseTypingActivity as zc, lastSharedWithMe as zd, WELL_KNOWN_PATH as zf, DIRECT_EVIDENCE_MS as zg, OWN_FRAME_LIMIT as zh, ETHEREUM_USDT as zi, vapidAuthorization as zl, readDhtReactions as zm, signGroupMeta as zn, WAKE_ANSWER_GRACE_MS as zo, formatVideoDuration as zp, atprotoCidFor as zr, mergeBeacon as zs, GROUP_WAKE_RECEIVE_LIMIT as zt, parseSessionCapabilities as zu, LEGACY_SERVICES as zv, DEFAULT_RELAYS as zw, APP_BUNDLE_MAGIC as zx, handoffHelloFrame as zy };
43008
43634
 
43009
- //# sourceMappingURL=src-B9HeOlsG.js.map
43635
+ //# sourceMappingURL=src-CqAqFhh9.js.map