@ghostlytools/sdk 1.4.5 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6531,11 +6531,15 @@ var RTC_CONFIG = {
6531
6531
  * A call's WebRTC configuration: the apps' STUN servers, then the profile's own (Settings → Network → ICE
6532
6532
  * servers: a TURN relay, typically). A relay is what connects a call when no direct path works: a VPN that takes
6533
6533
  * every packet through its tunnel, or a NAT that maps each destination apart.
6534
+ *
6535
+ * `relayOnly` ("Hide my IP from contacts", WISP 100 § Relay only): the profile's TURN servers alone, no STUN server
6536
+ * (the apps' or the profile's), and the relay policy, so the connection gathers and uses relay candidates only. With
6537
+ * no usable TURN server it has no server at all, and finds no candidate: it fails, it never goes direct.
6534
6538
  */
6535
- function callRtcConfig(extra = []) {
6539
+ function callRtcConfig(extra = [], { relayOnly = false } = {}) {
6536
6540
  const servers = [];
6537
6541
  for (const server of extra) {
6538
- const urls = (Array.isArray(server.urls) ? server.urls : server.urls.split(/[\s,]+/)).filter(Boolean);
6542
+ const urls = (Array.isArray(server.urls) ? server.urls : server.urls.split(/[\s,]+/)).filter(Boolean).filter((url) => !relayOnly || /^turns?:/i.test(url));
6539
6543
  if (!urls.length) continue;
6540
6544
  if (urls.some((url) => /^turns?:/i.test(url)) && (!server.username?.trim() || !server.credential?.trim())) continue;
6541
6545
  servers.push({
@@ -6544,12 +6548,30 @@ function callRtcConfig(extra = []) {
6544
6548
  ...server.credential ? { credential: server.credential } : {}
6545
6549
  });
6546
6550
  }
6551
+ if (relayOnly) return {
6552
+ ...RTC_CONFIG,
6553
+ iceServers: servers,
6554
+ iceTransportPolicy: "relay"
6555
+ };
6547
6556
  return {
6548
6557
  ...RTC_CONFIG,
6549
6558
  iceServers: [...RTC_CONFIG.iceServers ?? [], ...servers]
6550
6559
  };
6551
6560
  }
6552
6561
  /**
6562
+ * The WebRTC configuration of a chat's data link or a group's edge, from the profile's settings: its ICE servers,
6563
+ * and "Hide my IP from contacts" (`relayOnly`), as a call's (`callRtcConfig`). No candidate pool: an app holds one
6564
+ * such connection per chat and per group member, and a call only one.
6565
+ */
6566
+ function contactRtcConfig(settings) {
6567
+ const { iceCandidatePoolSize: _pool, ...config } = callRtcConfig(settings.iceServers ?? [], { relayOnly: settings.relayOnly === true });
6568
+ return config;
6569
+ }
6570
+ /** Whether a connection keeps to relays (`iceTransportPolicy: "relay"`): what it sends a contact is then relay candidates only. */
6571
+ function keepsToRelays(pc) {
6572
+ return pc?.getConfiguration?.().iceTransportPolicy === "relay";
6573
+ }
6574
+ /**
6553
6575
  * How many candidates a signal on the chat session carries (`paired-call`, WISP 601): the receiver takes eight.
6554
6576
  * A compatibility chat's `_call` record keeps to one host and one server reflexive candidate (a DHT packet's worth).
6555
6577
  */
@@ -6569,11 +6591,14 @@ var PAIRED_CALL_CANDIDATES = 8;
6569
6591
  *
6570
6592
  * UDP only, loopback, link-local and unspecified addresses left out (loopback kept with `loopback`), the related
6571
6593
  * address dropped (it is informational, and an IPv6 one broke apps before 0.5).
6594
+ *
6595
+ * `relayOnly` ("Hide my IP from contacts"): relay candidates alone, whatever else the connection gathered. A relay
6596
+ * candidate's address is the TURN server's; its related address, dropped as every one is, would be this device's.
6572
6597
  */
6573
- function pickCallCandidates(candidates, max = 8, { loopback = false } = {}) {
6574
- const udp = candidates.map((c) => c.trim()).filter((c) => / udp /i.test(c));
6575
- const address = (c) => c.split(" ")[4] ?? "";
6598
+ function pickCallCandidates(candidates, max = 8, { loopback = false, relayOnly = false } = {}) {
6576
6599
  const type = (c) => / typ (\S+)/.exec(c)?.[1];
6600
+ const udp = candidates.map((c) => c.trim()).filter((c) => / udp /i.test(c) && (!relayOnly || type(c) === "relay"));
6601
+ const address = (c) => c.split(" ")[4] ?? "";
6577
6602
  const cost = (c) => Number(/ network-cost (\d+)/.exec(c)?.[1] ?? 0);
6578
6603
  const ipv6 = (c) => address(c).includes(":");
6579
6604
  const usable = (c) => {
@@ -6598,9 +6623,10 @@ function pickCallCandidates(candidates, max = 8, { loopback = false } = {}) {
6598
6623
  /**
6599
6624
  * The parameters of a call signal, from an SDP. `maxCandidates` above two (a signal on the chat session) carries
6600
6625
  * the candidates `pickCallCandidates` chooses; the default keeps a compatibility chat's one host and one server
6601
- * reflexive candidate.
6626
+ * reflexive candidate. `relayOnly` ("Hide my IP from contacts"): relay candidates only, in either; a compatibility
6627
+ * chat's two then go to the first two relay ones.
6602
6628
  */
6603
- function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false } = {}) {
6629
+ function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false, relayOnly = false } = {}) {
6604
6630
  const lines = sdp.split("\r\n");
6605
6631
  let ufrag = "";
6606
6632
  let pwd = "";
@@ -6644,7 +6670,10 @@ function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false } = {})
6644
6670
  }
6645
6671
  const srflxCandidates = candidates.filter((c) => / typ srflx( |$)/.test(c));
6646
6672
  const hostCandidates = candidates.filter((c) => / typ host( |$)/.test(c) && / udp /i.test(c));
6647
- const selectedCandidates = maxCandidates > 2 ? pickCallCandidates(candidates, maxCandidates, { loopback }) : [...hostCandidates.slice(0, 1), ...srflxCandidates.slice(0, 1)].map((c) => c.replace(/ raddr \S+ rport \d+/, ""));
6673
+ const selectedCandidates = maxCandidates > 2 || relayOnly ? pickCallCandidates(candidates, maxCandidates, {
6674
+ loopback,
6675
+ relayOnly
6676
+ }) : [...hostCandidates.slice(0, 1), ...srflxCandidates.slice(0, 1)].map((c) => c.replace(/ raddr \S+ rport \d+/, ""));
6648
6677
  const ssrcs = [];
6649
6678
  if (audioSsrc !== null) ssrcs.push(audioSsrc);
6650
6679
  if (videoSsrc !== null) ssrcs.push(videoSsrc);
@@ -7088,7 +7117,8 @@ function hostRank(parts, reflexiveBases) {
7088
7117
  const wayOut = reflexiveBases.has(parts[4]) || isGlobalIpv4Host(parts.join(" "));
7089
7118
  return (costly ? 2 : 0) + (wayOut ? 0 : 1);
7090
7119
  }
7091
- function extractRtcParams(sdp) {
7120
+ /** `relayOnly` ("Hide my IP from contacts", the connection keeps to relays): relay candidates only, whatever else is in the SDP. */
7121
+ function extractRtcParams(sdp, { relayOnly = false } = {}) {
7092
7122
  let u = "";
7093
7123
  let p = "";
7094
7124
  let f = "";
@@ -7104,7 +7134,7 @@ function extractRtcParams(sdp) {
7104
7134
  const parts = line.slice(12).split(" ");
7105
7135
  if (parts.length < 8 || parts[1] !== "1" || parts[2].toLowerCase() !== "udp") continue;
7106
7136
  const type = CANDIDATE_TYPES[parts[7]];
7107
- if (!type) continue;
7137
+ if (!type || relayOnly && type !== "r") continue;
7108
7138
  const compact = `${type},${parts[4]},${parts[5]}`;
7109
7139
  if (found.some((c) => c.compact === compact)) continue;
7110
7140
  found.push({
@@ -9084,7 +9114,7 @@ var DataLink = class {
9084
9114
  const signal = {
9085
9115
  t: "o",
9086
9116
  ts: this.myOfferTs,
9087
- ...extractRtcParams(pc.localDescription.sdp)
9117
+ ...extractRtcParams(pc.localDescription.sdp, { relayOnly: keepsToRelays(pc) })
9088
9118
  };
9089
9119
  this.options.publishSignal(JSON.stringify(signal));
9090
9120
  } catch {
@@ -9271,7 +9301,7 @@ var DataLink = class {
9271
9301
  t: "a",
9272
9302
  ts: Date.now(),
9273
9303
  o: offer.ts,
9274
- ...extractRtcParams(pc.localDescription.sdp)
9304
+ ...extractRtcParams(pc.localDescription.sdp, { relayOnly: keepsToRelays(pc) })
9275
9305
  };
9276
9306
  this.options.publishSignal(JSON.stringify(signal));
9277
9307
  this.setState("connecting");
@@ -9856,10 +9886,13 @@ var PR_CHECKS = [
9856
9886
  "failing",
9857
9887
  "pending"
9858
9888
  ];
9889
+ /** The kinds a sender may take back (WISP 405 § Removing a card). */
9890
+ var REMOVABLE_KINDS = ["task", "routine"];
9859
9891
  var ID$5 = /^[A-Za-z0-9_.:][A-Za-z0-9_.:-]{0,63}$/;
9860
9892
  /** A button's id: 1 to 32 of `A-Z a-z 0-9 _ . : -`, not starting with `-`. */
9861
9893
  var BUTTON_ID = /^[A-Za-z0-9_.:][A-Za-z0-9_.:-]{0,31}$/;
9862
- var CRON = /^[0-9A-Za-z*,/?#\- ]{1,64}$/;
9894
+ /** A routine's cron line, trimmed: 1 to 64 of `0-9 A-Z a-z * , / ? # -` and spaces (shown, never run). */
9895
+ var CRON_LINE = /^[0-9A-Za-z*,/?#\- ]{1,64}$/;
9863
9896
  /**
9864
9897
  * Whether a typed answer is a button's label or id (WISP 406 · Message Buttons): ignoring case and spaces at the ends.
9865
9898
  * Not the device's locale's case: the presser's and the author's apps must agree ("I" is not "ı" anywhere).
@@ -10046,6 +10079,14 @@ function readStatusCard(raw, now = Date.now()) {
10046
10079
  ...raw.opened === true && { opened: true }
10047
10080
  };
10048
10081
  }
10082
+ if (raw.kind === "removed") {
10083
+ const of = oneOf(REMOVABLE_KINDS, raw.of);
10084
+ return of && {
10085
+ kind: "removed",
10086
+ id,
10087
+ of
10088
+ };
10089
+ }
10049
10090
  const latest = now + MESSAGE_CLOCK_SKEW_MS;
10050
10091
  if (raw.kind === "usage") return readUsage(raw, id, now);
10051
10092
  const links = readLinks(raw.links);
@@ -10109,7 +10150,7 @@ function readStatusCard(raw, now = Date.now()) {
10109
10150
  if (raw.kind === "routine") {
10110
10151
  const name = cardLine(raw.name, STATUS_CARD_LIMITS.title), schedule = cardLine(raw.schedule, STATUS_CARD_LIMITS.schedule), state = oneOf(ROUTINE_STATES, raw.state);
10111
10152
  if (!name || !schedule || !state) return void 0;
10112
- const cron = typeof raw.cron === "string" && CRON.test(raw.cron.trim()) ? raw.cron.trim() : void 0;
10153
+ const cron = typeof raw.cron === "string" && CRON_LINE.test(raw.cron.trim()) ? raw.cron.trim() : void 0;
10113
10154
  const lastRun = readRun(raw.lastRun, now);
10114
10155
  const nextRunAt = typeof raw.nextRunAt === "number" && Number.isSafeInteger(raw.nextRunAt) && raw.nextRunAt > 0 && raw.nextRunAt <= now + STATUS_CARD_LIMITS.nextRunMs ? raw.nextRunAt : void 0;
10115
10156
  const runs = [];
@@ -10166,7 +10207,7 @@ function checkStatusCard(raw, now = Date.now()) {
10166
10207
  if (!isObject$7(raw)) return { error: "A card is an object" };
10167
10208
  const bytes = statusCardBytes(raw);
10168
10209
  if (bytes > STATUS_CARD_LIMITS.bytes) return { error: `The card takes ${bytes} bytes; at most ${STATUS_CARD_LIMITS.bytes}` };
10169
- if (raw.kind !== "task" && raw.kind !== "routine" && raw.kind !== "buttons" && raw.kind !== "app" && raw.kind !== "usage") return { error: "kind is task, routine, buttons, app or usage" };
10210
+ if (raw.kind !== "task" && raw.kind !== "routine" && raw.kind !== "buttons" && raw.kind !== "app" && raw.kind !== "usage" && raw.kind !== "removed") return { error: "kind is task, routine, buttons, app, usage or removed" };
10170
10211
  if (typeof raw.id !== "string" || !ID$5.test(raw.id)) return { error: `id is 1 to ${STATUS_CARD_LIMITS.id} of A-Z a-z 0-9 _ . : - and does not start with -` };
10171
10212
  const line = (field, value, max, required = false) => {
10172
10213
  if (value === void 0 && !required) return null;
@@ -10189,7 +10230,11 @@ function checkStatusCard(raw, now = Date.now()) {
10189
10230
  }
10190
10231
  const share = (field, value) => value === void 0 || typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100 ? null : `${field} is a number from 0 to 100`;
10191
10232
  const reset = (field, value) => value === void 0 || ahead(value, now) !== void 0 ? null : `${field} is a time in milliseconds, within a year`;
10192
- if (raw.kind === "usage") {
10233
+ if (raw.kind === "removed") {
10234
+ if (!oneOf(REMOVABLE_KINDS, raw.of)) errors.push(`of is one of ${REMOVABLE_KINDS.join(", ")}`);
10235
+ const extra = Object.keys(raw).find((key) => key !== "kind" && key !== "id" && key !== "of");
10236
+ if (extra) errors.push(`a removed card takes only kind, id and of, not ${extra}`);
10237
+ } else if (raw.kind === "usage") {
10193
10238
  if (raw.links !== void 0) errors.push("a usage card takes no links");
10194
10239
  if (raw.left === void 0 && raw.used === void 0) errors.push("left (a percent) or used and limit");
10195
10240
  errors.push(share("left", raw.left));
@@ -10296,7 +10341,7 @@ function checkStatusCard(raw, now = Date.now()) {
10296
10341
  } else {
10297
10342
  errors.push(line("name", raw.name, STATUS_CARD_LIMITS.title, true), line("schedule", raw.schedule, STATUS_CARD_LIMITS.schedule, true));
10298
10343
  if (!oneOf(ROUTINE_STATES, raw.state)) errors.push(`state is one of ${ROUTINE_STATES.join(", ")}`);
10299
- if (raw.cron !== void 0 && !(typeof raw.cron === "string" && CRON.test(raw.cron.trim()))) errors.push(`cron is a cron line of at most ${STATUS_CARD_LIMITS.cron} characters`);
10344
+ if (raw.cron !== void 0 && !(typeof raw.cron === "string" && CRON_LINE.test(raw.cron.trim()))) errors.push(`cron is a cron line of at most ${STATUS_CARD_LIMITS.cron} characters`);
10300
10345
  if (raw.nextRunAt !== void 0 && !(typeof raw.nextRunAt === "number" && Number.isSafeInteger(raw.nextRunAt) && raw.nextRunAt > 0 && raw.nextRunAt <= now + STATUS_CARD_LIMITS.nextRunMs)) errors.push("nextRunAt is a time in milliseconds, within a year");
10301
10346
  const run = (field, value) => {
10302
10347
  if (!isObject$7(value)) return errors.push(`${field} is an object`);
@@ -10346,10 +10391,18 @@ function cardTimeUtc(ms) {
10346
10391
  return `${new Date(ms).toISOString().slice(0, 16).replace("T", " ")} UTC`;
10347
10392
  }
10348
10393
  /**
10394
+ * The text a removed card's message carries (WISP 405 § Removing a card): "🗑 Task removed", with the card's title or
10395
+ * name when the sender knows it ("🗑 Task removed: Fix relay rotation"). An app without the `removed` kind shows it.
10396
+ */
10397
+ function removedCardText(of, title) {
10398
+ return `🗑 ${of === "task" ? "Task" : "Routine"} removed${title ? `: ${title}` : ""}`;
10399
+ }
10400
+ /**
10349
10401
  * The text a card's message carries: what an app without cards shows, the DHT floor carries, the chat list previews
10350
10402
  * and search finds. Plain lines, the first naming the card, no bars or layout that would read badly elsewhere.
10351
10403
  */
10352
10404
  function statusCardText(card) {
10405
+ if (card.kind === "removed") return removedCardText(card.of);
10353
10406
  if (card.kind === "app") {
10354
10407
  const named = `${card.title}${card.version ? ` ${card.version}` : ""}`;
10355
10408
  return [card.opened ? `🧩 Opened ${named} in this chat (Ghostly app)` : `🧩 ${named} (Ghostly app)`, ...card.url ? [card.url] : []].join("\n");
@@ -10860,11 +10913,20 @@ function parseLinkPreview(raw, text) {
10860
10913
  * message. A status card (`sc`, WISP 405 · Status Cards) may come with it too; a card message takes up to
10861
10914
  * `STATUS_CARD_LIMITS.edits` edits, a number past `MAX_EDITS_PER_MESSAGE` holding only with a card. Older apps drop
10862
10915
  * both frames: they have an id, but a `t` they do not know.
10916
+ *
10917
+ * A removal (WISP 400 § Delete for everyone) is the message's last edit, flagged `rm`, with a fallback text and
10918
+ * nothing else beside it; an app from before removals shows that text as the edit:
10919
+ *
10920
+ * {"t":"paired-edit","id":"<the message's wire id>","e":4,"ts":1790000000000,"m":"🗑 Message removed","rm":true}
10863
10921
  */
10864
10922
  var EDIT_FRAME = "paired-edit";
10865
10923
  var EDITED_FRAME = "paired-edited";
10866
10924
  /** Edits one message takes; the sender refuses the next one and the receiver ignores a higher number. */
10867
10925
  var MAX_EDITS_PER_MESSAGE = 100;
10926
+ /** A removal is numbered one past the message's last edit, so it may pass a card message's bound by one. */
10927
+ var MAX_REMOVAL_NUMBER = STATUS_CARD_LIMITS.edits + 1;
10928
+ /** The text a removal carries: only what an app from before removals shows in the message's place. */
10929
+ var REMOVED_TEXT = "🗑 Message removed";
10868
10930
  /** A sender says at most this many edits per `EDIT_RATE_WINDOW_MS` in one chat; the newest text of each message waits. */
10869
10931
  var EDIT_SEND_LIMIT = 10;
10870
10932
  /** A receiver takes at most this many edit frames per window; the rest are dropped unconfirmed, so they come again. */
@@ -10874,6 +10936,8 @@ var EDIT_RATE_WINDOW_MS = 1e4;
10874
10936
  var EDIT_BUFFER_MS = 6e4;
10875
10937
  var EDIT_BUFFER_MAX = 32;
10876
10938
  var ID$4 = /^[A-Za-z0-9_-]{22}$/;
10939
+ /** A removal may name a file too (WISP 401 § Edits): its offer's id, as a file's id holds (`files.ts`). */
10940
+ var REMOVAL_ID = /^[A-Za-z0-9_-]{8,64}$/;
10877
10941
  /** Largest edit frame sent with a preview: the preview is left out past it, as with a message. */
10878
10942
  var MAX_EDIT_FRAME = 57344;
10879
10943
  /**
@@ -10881,6 +10945,14 @@ var MAX_EDIT_FRAME = 57344;
10881
10945
  * goes: it is bounded well under what the frame has room for, and it is what a card message is.
10882
10946
  */
10883
10947
  function editFrame(edit) {
10948
+ if (edit.rm) return JSON.stringify({
10949
+ t: EDIT_FRAME,
10950
+ id: edit.id,
10951
+ e: edit.e,
10952
+ ts: edit.ts,
10953
+ m: edit.m,
10954
+ rm: true
10955
+ });
10884
10956
  const base = {
10885
10957
  t: EDIT_FRAME,
10886
10958
  id: edit.id,
@@ -10909,6 +10981,10 @@ function editedFrame(id, e) {
10909
10981
  function validEditNumber(e) {
10910
10982
  return Number.isSafeInteger(e) && e >= 1 && e <= 100;
10911
10983
  }
10984
+ /** A removal's number: any up to one past a card message's bound, card or not. */
10985
+ function validRemovalNumber(e) {
10986
+ return Number.isSafeInteger(e) && e >= 1 && e <= MAX_REMOVAL_NUMBER;
10987
+ }
10912
10988
  /** A message's new text: not empty, no space around it, within a chat message's bytes. The same on a session and on the DHT. */
10913
10989
  function validEditMessage(m) {
10914
10990
  return typeof m === "string" && !!m.trim() && m === m.trim() && utf8Encode(m).length <= LIMITS.maxChatMessageBytes;
@@ -10916,14 +10992,22 @@ function validEditMessage(m) {
10916
10992
  /**
10917
10993
  * The edit a `paired-edit` frame says, or null when it is malformed (then it says nothing and is not confirmed). A
10918
10994
  * preview or a card that does not hold is dropped, never the edit; an edit numbered past `MAX_EDITS_PER_MESSAGE`
10919
- * holds only with a card.
10995
+ * holds only with a card. A removal carries its fallback text alone, and a `rm` other than `true` is no edit.
10920
10996
  */
10921
10997
  function parseEditFrame(frame, now = Date.now()) {
10922
10998
  if (frame?.t !== "paired-edit") return null;
10923
- const { id, e, ts, m } = frame;
10924
- if (typeof id !== "string" || !ID$4.test(id) || !cardEditNumber(e)) return null;
10999
+ const { id, e, ts, m, rm } = frame;
11000
+ if (rm !== void 0 && rm !== true) return null;
11001
+ if (typeof id !== "string" || !(rm ? REMOVAL_ID : ID$4).test(id) || typeof e !== "number" || !(rm ? validRemovalNumber(e) : cardEditNumber(e))) return null;
10925
11002
  if (typeof ts !== "number" || !Number.isSafeInteger(ts) || ts <= 0) return null;
10926
11003
  if (!validEditMessage(m)) return null;
11004
+ if (rm) return {
11005
+ id,
11006
+ e,
11007
+ ts,
11008
+ m,
11009
+ rm
11010
+ };
10927
11011
  const sc = frame.sc === void 0 ? void 0 : readStatusCard(frame.sc, now);
10928
11012
  if (!validEditNumber(e) && !sc) return null;
10929
11013
  const pv = frame.pv === void 0 ? void 0 : parseLinkPreview(frame.pv, m);
@@ -10939,7 +11023,7 @@ function parseEditFrame(frame, now = Date.now()) {
10939
11023
  /** The confirmation a `paired-edited` frame says, or null when it is malformed. */
10940
11024
  function parseEditedFrame(frame) {
10941
11025
  if (frame?.t !== "paired-edited") return null;
10942
- return typeof frame.id === "string" && ID$4.test(frame.id) && cardEditNumber(frame.e) ? {
11026
+ return typeof frame.id === "string" && REMOVAL_ID.test(frame.id) && validRemovalNumber(frame.e) ? {
10943
11027
  id: frame.id,
10944
11028
  e: frame.e
10945
11029
  } : null;
@@ -11008,7 +11092,7 @@ function isVideoMime(mime) {
11008
11092
  function isPlayableVideoType(mime) {
11009
11093
  return PLAYABLE_VIDEO.test(mime.split(";")[0].trim().toLowerCase());
11010
11094
  }
11011
- var BASE64URL = /^[A-Za-z0-9_-]+$/;
11095
+ var BASE64URL$1 = /^[A-Za-z0-9_-]+$/;
11012
11096
  var JPEG_START = [
11013
11097
  255,
11014
11098
  216,
@@ -11031,7 +11115,7 @@ function parseVideoMeta(value, mime) {
11031
11115
  width,
11032
11116
  height
11033
11117
  };
11034
- if (typeof poster === "string" && poster.length <= Math.ceil(VIDEO_LIMITS.maxPosterBytes * 4 / 3) && BASE64URL.test(poster)) try {
11118
+ if (typeof poster === "string" && poster.length <= Math.ceil(VIDEO_LIMITS.maxPosterBytes * 4 / 3) && BASE64URL$1.test(poster)) try {
11035
11119
  const bytes = fromBase64Url(poster);
11036
11120
  const size = bytes.length <= VIDEO_LIMITS.maxPosterBytes && JPEG_START.every((b, i) => bytes[i] === b) ? imageSize(bytes) : void 0;
11037
11121
  if (size && Math.max(size.width, size.height) <= VIDEO_LIMITS.posterEdge) meta.poster = poster;
@@ -13632,7 +13716,7 @@ async function verifyPeerProof(event, c, readStorage) {
13632
13716
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
13633
13717
  } else if (c.adapter === "keet-import") {
13634
13718
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
13635
- const { default: IdentityKey } = await import("./keet-identity-key-CvMZHt9G.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
13719
+ const { default: IdentityKey } = await import("./keet-identity-key-D_bUxyiq.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
13636
13720
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
13637
13721
  } else throw new Error("Unsupported proof adapter");
13638
13722
  }
@@ -16232,6 +16316,11 @@ var UPGRADE_CAPABILITY = "upgrade/1";
16232
16316
  * `pairedApps.ts`). Offered only while the apps feature is on.
16233
16317
  */
16234
16318
  var APPS_CAPABILITY = "apps/1";
16319
+ /**
16320
+ * The read lane of mini-apps (WISP 1200 § A read lane to the contact, `pairedAppRanges.ts`): the contact's app reads a
16321
+ * file this side's app serves, in ranges, outside `apps/1`. Offered beside `apps/1` only.
16322
+ */
16323
+ var APP_RANGES_CAPABILITY = "app-ranges/1";
16235
16324
  /** Every capability this app knows on a session: what `receive` reports changes of. */
16236
16325
  var KNOWN_SESSION_CAPABILITIES = [
16237
16326
  CALLS_CAPABILITY,
@@ -16246,7 +16335,8 @@ var KNOWN_SESSION_CAPABILITIES = [
16246
16335
  STATUS_CARD_CAPABILITY,
16247
16336
  BUTTONS_CAPABILITY,
16248
16337
  UPGRADE_CAPABILITY,
16249
- APPS_CAPABILITY
16338
+ APPS_CAPABILITY,
16339
+ APP_RANGES_CAPABILITY
16250
16340
  ];
16251
16341
  var SESSION_CAPABILITIES_FRAME = "paired-capabilities";
16252
16342
  var MAX_ENTRIES$1 = 32;
@@ -16593,6 +16683,423 @@ var AppSessions = class {
16593
16683
  }
16594
16684
  };
16595
16685
  //#endregion
16686
+ //#region ../core/src/pairedAppRanges.ts
16687
+ /**
16688
+ * The read lane of mini-apps in a 1:1 chat (WISP 1200 § A read lane to the contact: `app-ranges/1`): the contact's app
16689
+ * reads, in ranges, a file this side's app serves, over the chat's session but not through `apps/1`.
16690
+ *
16691
+ * {"t":"ar-get","a":"<chat app id>","s":"<serve id>","r":7,"o":0,"n":1048576}
16692
+ * {"t":"ar-data","a":"<chat app id>","r":7,"o":0,"d":"<base64url>"}
16693
+ * {"t":"ar-end","a":"<chat app id>","r":7,"z":734003200}
16694
+ * {"t":"ar-err","a":"<chat app id>","r":7,"e":"not-served"}
16695
+ * {"t":"ar-cancel","a":"<chat app id>","r":7}
16696
+ *
16697
+ * The asker sends `ar-get` (request `r`, a number of its own, for `n` bytes at offset `o` of serve `s`) and may send
16698
+ * `ar-cancel`; the server answers with the bytes in chunks of at most `APP_RANGE_LIMITS.chunkBytes`, then `ar-end`
16699
+ * once every byte asked was sent (fewer at the end of the file), with `z` the served file's size, or `ar-err` instead of
16700
+ * any. A read of one byte at 0 is how the asker learns the size. Where `files/4` is on,
16701
+ * a chunk is a binary message of kind `APP_RANGE_DATA_KIND` (`encodeAppRangeData`) in place of `ar-data`. It needs
16702
+ * `app-ranges/1` in `paired-capabilities` on both sides. A reader ignores keys it does not know, so a later version
16703
+ * can add some.
16704
+ */
16705
+ var APP_RANGE_FRAMES = /* @__PURE__ */ new Set([
16706
+ "ar-get",
16707
+ "ar-data",
16708
+ "ar-end",
16709
+ "ar-err",
16710
+ "ar-cancel"
16711
+ ]);
16712
+ var APP_RANGE_LIMITS = {
16713
+ /** One `ar-get`, at most: as one `remote.read` of the app. */
16714
+ requestBytes: 1048576,
16715
+ /** One chunk, `ar-data` or binary: as a chat file's. */
16716
+ chunkBytes: 16384,
16717
+ /** The largest request number: it is 4 bytes in a binary chunk. */
16718
+ maxRequest: 4294967295,
16719
+ /** Requests a server takes in flight per app; one more is answered `busy`. An asker keeps the rest waiting. */
16720
+ inFlight: 4
16721
+ };
16722
+ /**
16723
+ * What an `ar-err` says. `not-served`: no serve of that id on this session (never given, or ended); `changed` and
16724
+ * `gone`: the file under it, as `files.read` says them; `busy`: past the requests the server takes in flight. A
16725
+ * later version may add one: an asker reads a code it does not know as a failure.
16726
+ */
16727
+ var APP_RANGE_ERRORS = [
16728
+ "not-served",
16729
+ "changed",
16730
+ "gone",
16731
+ "busy"
16732
+ ];
16733
+ /** A serve id as it is on the wire: 22 base64url characters (16 random bytes, no padding), as a chat app id. */
16734
+ var isServeId = isChatAppId;
16735
+ var isRequest = (value) => typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= APP_RANGE_LIMITS.maxRequest;
16736
+ var isOffset = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
16737
+ var ERROR_CODE$1 = /^[a-z][a-z-]{0,31}$/;
16738
+ var BASE64URL = /^[A-Za-z0-9_-]*$/;
16739
+ /** The bytes of `d`, or null when it is not 1 to `chunkBytes` bytes of canonical base64url without padding. */
16740
+ function appRangeChunk(d) {
16741
+ if (typeof d !== "string" || !d.length || d.length % 4 === 1 || d.length > Math.ceil(APP_RANGE_LIMITS.chunkBytes * 4 / 3) || !BASE64URL.test(d)) return null;
16742
+ let bytes;
16743
+ try {
16744
+ bytes = fromBase64Url(d);
16745
+ } catch {
16746
+ return null;
16747
+ }
16748
+ return bytes.length && bytes.length <= APP_RANGE_LIMITS.chunkBytes && toBase64Url(bytes) === d ? bytes : null;
16749
+ }
16750
+ function appRangeGetFrame(app, serve, request, offset, length) {
16751
+ const frame = {
16752
+ t: "ar-get",
16753
+ a: app,
16754
+ s: serve,
16755
+ r: request,
16756
+ o: offset,
16757
+ n: length
16758
+ };
16759
+ if (!readAppRangeFrame(frame).ok) throw new Error("Not an app range request");
16760
+ return frame;
16761
+ }
16762
+ function appRangeDataFrame(app, request, offset, data) {
16763
+ const frame = {
16764
+ t: "ar-data",
16765
+ a: app,
16766
+ r: request,
16767
+ o: offset,
16768
+ d: toBase64Url(data)
16769
+ };
16770
+ if (!readAppRangeFrame(frame).ok) throw new Error("Not app range data");
16771
+ return frame;
16772
+ }
16773
+ function appRangeEndFrame(app, request, size) {
16774
+ if (!isChatAppId(app) || !isRequest(request) || !isOffset(size)) throw new Error("Not an app range end");
16775
+ return {
16776
+ t: "ar-end",
16777
+ a: app,
16778
+ r: request,
16779
+ z: size
16780
+ };
16781
+ }
16782
+ function appRangeErrorFrame(app, request, error) {
16783
+ if (!isChatAppId(app) || !isRequest(request) || !APP_RANGE_ERRORS.includes(error)) throw new Error("Not an app range error");
16784
+ return {
16785
+ t: "ar-err",
16786
+ a: app,
16787
+ r: request,
16788
+ e: error
16789
+ };
16790
+ }
16791
+ function appRangeCancelFrame(app, request) {
16792
+ if (!isChatAppId(app) || !isRequest(request)) throw new Error("Not an app range cancel");
16793
+ return {
16794
+ t: "ar-cancel",
16795
+ a: app,
16796
+ r: request
16797
+ };
16798
+ }
16799
+ /**
16800
+ * An `ar-*` frame as the peer sent it, or why a reader must refuse it: an unknown `t`, no valid `a`, an `ar-get`
16801
+ * without a valid `s`, a request number that is not 0 to 2^32 - 1, an offset that is not a safe whole number at or
16802
+ * above 0, an `n` that is not 1 to `requestBytes` (or runs past 2^53 - 1), a `d` that is not 1 to `chunkBytes` bytes of
16803
+ * canonical base64url, an `e` that is not a code (lower case letters and `-`, at most 32), an `ar-end` whose `z` is not
16804
+ * a size (a safe whole number at or above 0). Other keys are ignored.
16805
+ */
16806
+ function readAppRangeFrame(frame) {
16807
+ const refuse = (refusal) => ({
16808
+ ok: false,
16809
+ refusal
16810
+ });
16811
+ const t = frame?.t;
16812
+ if (typeof t !== "string" || !APP_RANGE_FRAMES.has(t)) return refuse("not-ranges");
16813
+ if (!isChatAppId(frame.a)) return refuse("bad-a");
16814
+ const a = frame.a;
16815
+ if (t === "ar-get" && !isServeId(frame.s)) return refuse("bad-s");
16816
+ if (!isRequest(frame.r)) return refuse("bad-r");
16817
+ const r = frame.r;
16818
+ switch (t) {
16819
+ case "ar-get": {
16820
+ if (!isOffset(frame.o)) return refuse("bad-o");
16821
+ const n = frame.n;
16822
+ if (typeof n !== "number" || !Number.isInteger(n) || n < 1 || n > APP_RANGE_LIMITS.requestBytes || !Number.isSafeInteger(frame.o + n)) return refuse("bad-n");
16823
+ return {
16824
+ ok: true,
16825
+ frame: {
16826
+ t,
16827
+ a,
16828
+ s: frame.s,
16829
+ r,
16830
+ o: frame.o,
16831
+ n
16832
+ }
16833
+ };
16834
+ }
16835
+ case "ar-data":
16836
+ if (!isOffset(frame.o)) return refuse("bad-o");
16837
+ if (!appRangeChunk(frame.d)) return refuse("bad-d");
16838
+ return {
16839
+ ok: true,
16840
+ frame: {
16841
+ t,
16842
+ a,
16843
+ r,
16844
+ o: frame.o,
16845
+ d: frame.d
16846
+ }
16847
+ };
16848
+ case "ar-err": return typeof frame.e === "string" && ERROR_CODE$1.test(frame.e) ? {
16849
+ ok: true,
16850
+ frame: {
16851
+ t,
16852
+ a,
16853
+ r,
16854
+ e: frame.e
16855
+ }
16856
+ } : refuse("bad-e");
16857
+ case "ar-end": return isOffset(frame.z) ? {
16858
+ ok: true,
16859
+ frame: {
16860
+ t,
16861
+ a,
16862
+ r,
16863
+ z: frame.z
16864
+ }
16865
+ } : refuse("bad-z");
16866
+ default: return {
16867
+ ok: true,
16868
+ frame: {
16869
+ t: "ar-cancel",
16870
+ a,
16871
+ r
16872
+ }
16873
+ };
16874
+ }
16875
+ }
16876
+ /** An `ar-*` frame as the peer sent it, or null when a reader must refuse it (`readAppRangeFrame` says why). */
16877
+ function parseAppRangeFrame(frame) {
16878
+ const read = readAppRangeFrame(frame);
16879
+ return read.ok ? read.frame : null;
16880
+ }
16881
+ /**
16882
+ * `app-ranges/1` beside `files/4` (WISP 100 § Text and binary messages): a chunk as one binary message of the session,
16883
+ * in place of the base64url text of an `ar-data` frame:
16884
+ *
16885
+ * kind 0x05 (1) | chat app id (16) | request (4, big endian) | offset (8, big endian) | data (1 to `chunkBytes`)
16886
+ */
16887
+ var APP_RANGE_DATA_KIND = 5;
16888
+ var HEAD = 29;
16889
+ /** The binary message for the bytes of request `request` of app `app` at `offset`. Throws on what no receiver would take. */
16890
+ function encodeAppRangeData(app, request, offset, data) {
16891
+ if (!isChatAppId(app) || !isRequest(request) || !isOffset(offset) || !data.length || data.length > APP_RANGE_LIMITS.chunkBytes) throw new Error("Invalid app range data");
16892
+ const id = fromBase64Url(app);
16893
+ if (id.length !== 16) throw new Error("Invalid app range data");
16894
+ const out = new Uint8Array(HEAD + data.length);
16895
+ out[0] = 5;
16896
+ out.set(id, 1);
16897
+ const view = new DataView(out.buffer);
16898
+ view.setUint32(17, request);
16899
+ view.setUint32(21, Math.floor(offset / 2 ** 32));
16900
+ view.setUint32(25, offset % 2 ** 32);
16901
+ out.set(data, HEAD);
16902
+ return out;
16903
+ }
16904
+ /** What a binary message from the contact says, or null when it is not well-formed app range data. `data` is a view of `message`. */
16905
+ function decodeAppRangeData(message) {
16906
+ if (message.length <= HEAD || message[0] !== 5 || message.length - HEAD > APP_RANGE_LIMITS.chunkBytes) return null;
16907
+ const view = new DataView(message.buffer, message.byteOffset, message.byteLength);
16908
+ const high = view.getUint32(21);
16909
+ if (high > 2097151) return null;
16910
+ return {
16911
+ a: toBase64Url(message.slice(1, 17)),
16912
+ r: view.getUint32(17),
16913
+ o: high * 2 ** 32 + view.getUint32(25),
16914
+ data: message.subarray(HEAD)
16915
+ };
16916
+ }
16917
+ var slot = (app, request) => `${app}:${request}`;
16918
+ /**
16919
+ * The read lane of one chat, both ways (WISP 1200 § A read lane to the contact). As the side that serves it keeps the
16920
+ * serve ids it gave out on this session and answers the contact's `ar-get` for those only, at most
16921
+ * `APP_RANGE_LIMITS.inFlight` per app (`busy` past it); the bytes themselves are read and sent by the session, which
16922
+ * calls `finish` or `fail` for each task. As the side that asks it sends at most `inFlight` requests per app, keeps
16923
+ * the rest waiting, and puts each answer back together, in order, from the offset asked. Serves and requests last one
16924
+ * session: `reset` ends them all, `closeApp` those of one app.
16925
+ */
16926
+ var AppRanges = class {
16927
+ send;
16928
+ newServeId;
16929
+ serves = /* @__PURE__ */ new Map();
16930
+ serving = /* @__PURE__ */ new Map();
16931
+ /** Tasks cancelled or unserved that the session is still reading or sending: each counts in its app's `inFlight` until settled. */
16932
+ draining = /* @__PURE__ */ new Set();
16933
+ asking = /* @__PURE__ */ new Map();
16934
+ waiting = /* @__PURE__ */ new Map();
16935
+ nextRequest = 0;
16936
+ constructor(send, newServeId = () => toBase64Url(randomBytes(16))) {
16937
+ this.send = send;
16938
+ this.newServeId = newServeId;
16939
+ }
16940
+ /** Lets the contact's `app` read `file` on this session: the serve id to tell it. */
16941
+ serve(app, file) {
16942
+ if (!isChatAppId(app)) throw new Error("Not a chat app id");
16943
+ let id = this.newServeId();
16944
+ while (this.serves.has(id)) id = this.newServeId();
16945
+ this.serves.set(id, {
16946
+ app,
16947
+ file
16948
+ });
16949
+ return id;
16950
+ }
16951
+ /** Ends one serve: requests under it still being sent stop. False when it was not served. */
16952
+ unserve(serveId) {
16953
+ if (!this.serves.get(serveId)) return false;
16954
+ this.serves.delete(serveId);
16955
+ for (const task of this.serving.values()) if (task.serve === serveId) this.drop(task, true);
16956
+ return true;
16957
+ }
16958
+ /** The serve ids `app` has given out on this session (what the panel's "Sharing with" line shows). */
16959
+ servesOf(app) {
16960
+ return [...this.serves].filter(([, serve]) => serve.app === app).map(([id]) => id);
16961
+ }
16962
+ /** An `ar-get` from the contact: the task to read and send, or null when it was refused (the refusal is sent) or dropped. */
16963
+ receiveGet(frame) {
16964
+ const { a: app, r: request } = frame;
16965
+ if (this.serving.has(slot(app, request))) return null;
16966
+ const serve = this.serves.get(frame.s);
16967
+ if (!serve || serve.app !== app) {
16968
+ this.send(appRangeErrorFrame(app, request, "not-served"));
16969
+ return null;
16970
+ }
16971
+ if ([...this.serving.values(), ...this.draining].filter((task) => task.app === app).length >= APP_RANGE_LIMITS.inFlight) {
16972
+ this.send(appRangeErrorFrame(app, request, "busy"));
16973
+ return null;
16974
+ }
16975
+ const task = {
16976
+ app,
16977
+ request,
16978
+ serve: frame.s,
16979
+ file: serve.file,
16980
+ offset: frame.o,
16981
+ length: frame.n,
16982
+ live: true
16983
+ };
16984
+ this.serving.set(slot(app, request), task);
16985
+ return task;
16986
+ }
16987
+ /** An `ar-cancel` from the contact: that request sends nothing more, and its number frees; its place frees once it is settled. */
16988
+ receiveCancel(frame) {
16989
+ const task = this.serving.get(slot(frame.a, frame.r));
16990
+ if (task) this.drop(task, true);
16991
+ }
16992
+ /** Every byte of `task` was sent: `ar-end` goes with the file's size, unless the task was dropped meanwhile. */
16993
+ finish(task, size) {
16994
+ if (this.take(task)) this.send(appRangeEndFrame(task.app, task.request, size));
16995
+ }
16996
+ /** The file under `task` could not be read: `ar-err` goes in place of the rest, unless the task was dropped meanwhile. */
16997
+ fail(task, error) {
16998
+ if (this.take(task)) this.send(appRangeErrorFrame(task.app, task.request, error));
16999
+ }
17000
+ /** The session stopped working on `task` without an answer (it is no longer live, or the channel went): its place frees, nothing is sent. */
17001
+ release(task) {
17002
+ this.take(task);
17003
+ }
17004
+ /** Reads `length` bytes at `offset` of what the contact's `app` serves as `serve`: the bytes (fewer at the end) and the file's size. */
17005
+ read(app, serve, offset, length) {
17006
+ appRangeGetFrame(app, serve, 0, offset, length);
17007
+ return new Promise((resolve, reject) => {
17008
+ const ask = {
17009
+ app,
17010
+ serve,
17011
+ offset,
17012
+ length,
17013
+ chunks: [],
17014
+ got: 0,
17015
+ resolve,
17016
+ reject
17017
+ };
17018
+ const queue = this.waiting.get(app) ?? [];
17019
+ queue.push(ask);
17020
+ this.waiting.set(app, queue);
17021
+ this.pump(app);
17022
+ });
17023
+ }
17024
+ /** Bytes of a request of ours, from `ar-data` or a binary chunk. Out of order or past what was asked fails the request. */
17025
+ receiveData(app, request, offset, data) {
17026
+ const ask = this.asking.get(slot(app, request));
17027
+ if (!ask) return;
17028
+ if (offset !== ask.offset + ask.got || ask.got + data.length > ask.length) {
17029
+ this.send(appRangeCancelFrame(app, request));
17030
+ return this.settle(ask, "failed");
17031
+ }
17032
+ ask.chunks.push(data.slice());
17033
+ ask.got += data.length;
17034
+ }
17035
+ /** The contact's `ar-end` or `ar-err` for a request of ours. */
17036
+ receiveAnswer(frame) {
17037
+ const ask = this.asking.get(slot(frame.a, frame.r));
17038
+ if (!ask) return;
17039
+ if (frame.t === "ar-err") return this.settle(ask, [
17040
+ "not-served",
17041
+ "changed",
17042
+ "gone"
17043
+ ].find((code) => code === frame.e) ?? "failed");
17044
+ if (ask.got !== Math.max(0, Math.min(ask.length, frame.z - ask.offset))) return this.settle(ask, "failed");
17045
+ this.settle(ask);
17046
+ ask.resolve({
17047
+ bytes: concatBytes(...ask.chunks),
17048
+ size: frame.z
17049
+ });
17050
+ }
17051
+ /** `app` closed on either side: its serves end, what it was sending stops and what it asked fails with `error`. */
17052
+ closeApp(app, error = "peer-closed") {
17053
+ for (const [id, serve] of this.serves) if (serve.app === app) this.serves.delete(id);
17054
+ for (const task of this.serving.values()) if (task.app === app) this.drop(task);
17055
+ for (const task of this.draining) if (task.app === app) this.draining.delete(task);
17056
+ for (const ask of this.waiting.get(app) ?? []) ask.reject(new Error(error));
17057
+ this.waiting.delete(app);
17058
+ for (const ask of this.asking.values()) if (ask.app === app) this.settle(ask, error);
17059
+ }
17060
+ /** The session ended: no serve id lasts into the next, and every request fails with `offline`. */
17061
+ reset() {
17062
+ const apps = new Set([...this.serves.values()].map((serve) => serve.app).concat([...this.serving.values(), ...this.draining].map((task) => task.app), [...this.waiting.keys()], [...this.asking.values()].map((ask) => ask.app)));
17063
+ for (const app of apps) this.closeApp(app, "offline");
17064
+ }
17065
+ /** Stops `task` and frees its request number; `draining` keeps it counted until it is settled. */
17066
+ drop(task, draining = false) {
17067
+ task.live = false;
17068
+ this.serving.delete(slot(task.app, task.request));
17069
+ if (draining) this.draining.add(task);
17070
+ }
17071
+ /** Frees `task`'s place; false when it was no longer live (nothing to send for it). */
17072
+ take(task) {
17073
+ if (this.draining.delete(task)) return false;
17074
+ const held = this.serving.get(slot(task.app, task.request));
17075
+ if (held !== task || !held.live) return false;
17076
+ this.drop(held);
17077
+ return true;
17078
+ }
17079
+ /** Ends `ask` (failing it with `error` when given) and sends the next one waiting for its app. */
17080
+ settle(ask, error) {
17081
+ if (ask.request === void 0 || this.asking.get(slot(ask.app, ask.request)) !== ask) return;
17082
+ this.asking.delete(slot(ask.app, ask.request));
17083
+ if (error) ask.reject(new Error(error));
17084
+ this.pump(ask.app);
17085
+ }
17086
+ pump(app) {
17087
+ const queue = this.waiting.get(app);
17088
+ let inFlight = [...this.asking.values()].filter((ask) => ask.app === app).length;
17089
+ while (queue?.length && inFlight < APP_RANGE_LIMITS.inFlight) {
17090
+ const ask = queue.shift();
17091
+ let request = this.nextRequest;
17092
+ while (this.asking.has(slot(app, request))) request = request === APP_RANGE_LIMITS.maxRequest ? 0 : request + 1;
17093
+ this.nextRequest = request === APP_RANGE_LIMITS.maxRequest ? 0 : request + 1;
17094
+ ask.request = request;
17095
+ this.asking.set(slot(app, request), ask);
17096
+ inFlight++;
17097
+ this.send(appRangeGetFrame(app, ask.serve, request, ask.offset, ask.length));
17098
+ }
17099
+ if (queue && !queue.length) this.waiting.delete(app);
17100
+ }
17101
+ };
17102
+ //#endregion
16596
17103
  //#region ../core/src/webPush.ts
16597
17104
  var WebPushError = class extends Error {};
16598
17105
  var RECORD_SIZE = 4096;
@@ -20198,6 +20705,12 @@ var GhostLink = class {
20198
20705
  typingReceiver = new TypingReceiver((typing, activity) => this.options.events?.onPeerTyping?.(typing, activity));
20199
20706
  /** Mini-apps on this session (`apps/1`): this side's open apps (kept across sessions), the peer's, the limits. */
20200
20707
  apps;
20708
+ /** The read lane on this session (`app-ranges/1`): what this side serves and what it asked; none of it outlives the session. */
20709
+ appRanges = new AppRanges((frame) => {
20710
+ if (this.supportsAppRanges && this.channel) try {
20711
+ this.channel.send(JSON.stringify(frame));
20712
+ } catch {}
20713
+ });
20201
20714
  /** Reaction frames the contact may send per window; the rest go unconfirmed and come again. */
20202
20715
  reactionsReceived = new ReactionWindow(REACTION_LIMITS.receive);
20203
20716
  /** Pin frames the contact may send per window; the rest go unconfirmed and come again. */
@@ -22928,6 +23441,7 @@ var GhostLink = class {
22928
23441
  if (this.options.buttonsSupport) offered.push(BUTTONS_CAPABILITY);
22929
23442
  if (this.options.upgradeSupport) offered.push(UPGRADE_CAPABILITY);
22930
23443
  if (this.options.appsSupport) offered.push(APPS_CAPABILITY);
23444
+ if (this.options.appsSupport && this.options.appRangesSupport) offered.push(APP_RANGES_CAPABILITY);
22931
23445
  if (this.options.deviceCapabilities) offered.push(...this.options.deviceCapabilities);
22932
23446
  return offered;
22933
23447
  }
@@ -23050,7 +23564,7 @@ var GhostLink = class {
23050
23564
  if (!this.options.params.profile) return "Edits need a current chat";
23051
23565
  if (this.channel && this.isDataLinkOpen) {
23052
23566
  if (!this.supportsEdits) return "Your contact's app does not show edits yet";
23053
- if (!validEditNumber(edit.e) && !(edit.sc && this.supportsStatusCards)) return "Your contact's app takes no more edits of this message";
23567
+ if (!edit.rm && !validEditNumber(edit.e) && !(edit.sc && this.supportsStatusCards)) return "Your contact's app takes no more edits of this message";
23054
23568
  try {
23055
23569
  this.channel.send(editFrame(edit));
23056
23570
  return null;
@@ -23059,6 +23573,7 @@ var GhostLink = class {
23059
23573
  }
23060
23574
  }
23061
23575
  if (edit.sc) return "A card's update goes when you are live";
23576
+ if (edit.rm) return "A removal goes when you are live";
23062
23577
  if (dht && this.dht && this.textDelivery === "dht") return this.dht.send(edit.m, edit.ts, dhtEditId(edit.id, edit.e), void 0, [edit.id, edit.e]);
23063
23578
  return "Edits go when you are live";
23064
23579
  }
@@ -23116,6 +23631,7 @@ var GhostLink = class {
23116
23631
  closeApp(app) {
23117
23632
  const frame = JSON.stringify(appCloseFrame(app));
23118
23633
  if (!this.apps.open.delete(app)) return;
23634
+ this.appRanges.closeApp(app, "offline");
23119
23635
  if (this.supportsApps && this.channel) try {
23120
23636
  this.channel.send(frame);
23121
23637
  } catch {}
@@ -23150,8 +23666,98 @@ var GhostLink = class {
23150
23666
  if (files) files.appAhead = Math.min(files.appAhead + frame.length, APP_AHEAD_OF_FILES + APP_DATA_MAX_BYTES);
23151
23667
  return null;
23152
23668
  }
23669
+ /** Both sides offer `app-ranges/1` (and `apps/1`) on the open session: an app's files can be read from the other side. */
23670
+ get supportsAppRanges() {
23671
+ return this.supportsApps && this.sessionCapabilities.agreed("app-ranges/1");
23672
+ }
23673
+ /** Why the read lane cannot be used for `app` now, or null when it can: open on both sides, on a live session that has it. */
23674
+ appRangesRefusal(app) {
23675
+ if (!this.apps.open.has(app)) return "not-open";
23676
+ if (!this.channel || !this.isDataLinkOpen) return "offline";
23677
+ return this.supportsAppRanges && this.apps.peerOpen.has(app) ? null : "peer-closed";
23678
+ }
23679
+ /**
23680
+ * Lets the contact's `app` read `file` (what this side's app calls it) for as long as both have the app open on this
23681
+ * session: the serve id to tell it, or why not.
23682
+ */
23683
+ serveAppFile(app, file) {
23684
+ const error = this.appRangesRefusal(app);
23685
+ return error ? { error } : { serve: this.appRanges.serve(app, file) };
23686
+ }
23687
+ /** Ends a serve; false when it was not served (any more). */
23688
+ unserveAppFile(serve) {
23689
+ return this.appRanges.unserve(serve);
23690
+ }
23691
+ /** The serve ids `app` has given out on this session. */
23692
+ appServes(app) {
23693
+ return this.appRanges.servesOf(app);
23694
+ }
23695
+ /**
23696
+ * Reads `length` bytes at `offset` of what the contact's `app` serves as `serve`: the bytes (fewer at the end of the
23697
+ * file) and the file's size. Rejects with an `Error` whose message is an `AppRangeReadError` or `not-open`.
23698
+ */
23699
+ readAppRange(app, serve, offset, length) {
23700
+ const error = this.appRangesRefusal(app);
23701
+ return error ? Promise.reject(new Error(error)) : this.appRanges.read(app, serve, offset, length);
23702
+ }
23703
+ /**
23704
+ * The bytes `task` asked for (fewer at the end of the file, none past it) and the file's size: sent in chunks as the
23705
+ * channel has room, sharing files' line (`filesWritable`), as binary messages where `files/4` is agreed, then
23706
+ * `ar-end`. Stops when the task is no longer live or the session changes.
23707
+ */
23708
+ async sendAppRange(task, bytes, size) {
23709
+ bytes = bytes.subarray(0, task.length);
23710
+ const channel = this.channel;
23711
+ try {
23712
+ if (!channel) return;
23713
+ for (let at = 0; at < bytes.length; at += APP_RANGE_LIMITS.chunkBytes) {
23714
+ for (let room = this.filesWritable(); room; room = this.channel === channel ? this.filesWritable() : void 0) await room;
23715
+ if (!task.live || this.channel !== channel || !this.supportsAppRanges) return;
23716
+ const chunk = bytes.subarray(at, at + APP_RANGE_LIMITS.chunkBytes);
23717
+ const message = this.supportsBinaryFiles ? encodeAppRangeData(task.app, task.request, task.offset + at, chunk) : JSON.stringify(appRangeDataFrame(task.app, task.request, task.offset + at, chunk));
23718
+ try {
23719
+ channel.send(message);
23720
+ } catch {
23721
+ await new Promise((resolve) => setTimeout(resolve, FILE_LIMITS.sendRetryMs));
23722
+ at -= APP_RANGE_LIMITS.chunkBytes;
23723
+ continue;
23724
+ }
23725
+ this.filesWrote(channel, typeof message === "string" ? message.length : message.byteLength);
23726
+ }
23727
+ this.appRanges.finish(task, size);
23728
+ } finally {
23729
+ this.appRanges.release(task);
23730
+ }
23731
+ }
23732
+ /** `task`'s file cannot be read: `changed` or `gone` goes in place of its bytes (nothing once it is no longer live, but its place frees). */
23733
+ failAppRange(task, error) {
23734
+ this.appRanges.fail(task, error);
23735
+ }
23736
+ /** An `ar-*` frame from the contact, on a session that agreed `app-ranges/1`. */
23737
+ receiveAppRange(frame) {
23738
+ const read = readAppRangeFrame(frame);
23739
+ if (!read.ok) return;
23740
+ const ranges = read.frame;
23741
+ switch (ranges.t) {
23742
+ case "ar-get": {
23743
+ if (this.appRangesRefusal(ranges.a)) {
23744
+ try {
23745
+ this.channel?.send(JSON.stringify(appRangeErrorFrame(ranges.a, ranges.r, "not-served")));
23746
+ } catch {}
23747
+ return;
23748
+ }
23749
+ const task = this.appRanges.receiveGet(ranges);
23750
+ if (task) this.options.events?.onAppRangeTask?.(task);
23751
+ return;
23752
+ }
23753
+ case "ar-cancel": return this.appRanges.receiveCancel(ranges);
23754
+ case "ar-data": return this.appRanges.receiveData(ranges.a, ranges.r, ranges.o, appRangeChunk(ranges.d));
23755
+ default: return this.appRanges.receiveAnswer(ranges);
23756
+ }
23757
+ }
23153
23758
  /** What the contact had open is gone (`apps/1` is no longer agreed, or this link stopped): each app hears it now. */
23154
23759
  appsEnded() {
23760
+ this.appRanges.reset();
23155
23761
  if (this.appsGrace) {
23156
23762
  clearTimeout(this.appsGrace);
23157
23763
  this.appsGrace = null;
@@ -23165,6 +23771,7 @@ var GhostLink = class {
23165
23771
  * hears only that open, not a close first; one not said again by then is closed with `offline`.
23166
23772
  */
23167
23773
  appsSuspended() {
23774
+ this.appRanges.reset();
23168
23775
  this.apps.sessionSuspended();
23169
23776
  if (!this.apps.holding || this.appsGrace) return;
23170
23777
  this.appsGrace = setTimeout(() => {
@@ -23330,6 +23937,7 @@ var GhostLink = class {
23330
23937
  if (!this.supportsApps) this.appsEnded();
23331
23938
  this.options.events?.onAppsSupport?.(this.supportsApps);
23332
23939
  }
23940
+ if (changed.includes("app-ranges/1") && !this.supportsAppRanges) this.appRanges.reset();
23333
23941
  const devices = this.options.deviceCapabilities;
23334
23942
  if (devices && changed.some((capability) => devices.includes(capability))) this.options.events?.onDeviceCapabilities?.(devices.filter((capability) => this.supportsDevice(capability)));
23335
23943
  this.emitPairingState();
@@ -23874,6 +24482,11 @@ var GhostLink = class {
23874
24482
  this.heardFromPeer();
23875
24483
  this.framesHeard++;
23876
24484
  if (typeof data !== "string") {
24485
+ if (data[0] === 5) {
24486
+ const range = this.supportsAppRanges && this.supportsBinaryFiles ? decodeAppRangeData(data) : null;
24487
+ if (range) this.appRanges.receiveData(range.a, range.r, range.o, range.data);
24488
+ return;
24489
+ }
23877
24490
  const chunk = this.supportsBinaryFiles ? decodeFileData(data) : null;
23878
24491
  if (!chunk) return;
23879
24492
  this.activityAt = Date.now();
@@ -24021,9 +24634,14 @@ var GhostLink = class {
24021
24634
  if (frame?.t === "paired-app") {
24022
24635
  if (!this.supportsApps) return;
24023
24636
  const event = this.apps.receive(frame);
24637
+ if (event && "o" in event && event.o === "close") this.appRanges.closeApp(event.app);
24024
24638
  if (event) this.options.events?.onAppFrame?.(event);
24025
24639
  return;
24026
24640
  }
24641
+ if (APP_RANGE_FRAMES.has(String(frame?.t))) {
24642
+ if (this.supportsAppRanges) this.receiveAppRange(frame);
24643
+ return;
24644
+ }
24027
24645
  if (frame?.t === "paired-reaction") {
24028
24646
  if (!this.supportsReactions || !this.reactionsReceived.take()) return;
24029
24647
  const reaction = parseReactionFrame(frame);
@@ -28495,6 +29113,10 @@ var wireMentions = (mentions) => mentions.map(({ k, o, l }) => ({
28495
29113
  * `sc` is the status card of this version (WISP 405 · Status Cards); an edit with one may be numbered up to
28496
29114
  * `STATUS_CARD_LIMITS.edits`, one without only up to `MAX_EDITS_PER_MESSAGE`.
28497
29115
  *
29116
+ * A removal (WISP 400 § Delete for everyone) is an edit with `rm: true` and a fallback text, nothing else beside it,
29117
+ * numbered up to `MAX_REMOVAL_NUMBER`: in a mesh group's box as `{ "text", "rm": true }`, in a community's frame beside
29118
+ * `text`. A `rm` other than `true` is no edit.
29119
+ *
28498
29120
  * Older apps drop both: a mesh session ignores a `t` it does not know, a community app the `x` frames it does not know.
28499
29121
  */
28500
29122
  var GROUP_EDIT_FRAME = "group-edit";
@@ -28524,6 +29146,14 @@ function validEditText(text) {
28524
29146
  }
28525
29147
  /** The `x` frame a community edit travels as. */
28526
29148
  function communityEditFrame(edit) {
29149
+ if (edit.rm) return {
29150
+ t: COMMUNITY_EDIT_FRAME,
29151
+ id: edit.id,
29152
+ v: edit.e,
29153
+ ts: edit.ts,
29154
+ text: edit.m,
29155
+ rm: true
29156
+ };
28527
29157
  return {
28528
29158
  t: COMMUNITY_EDIT_FRAME,
28529
29159
  id: edit.id,
@@ -28541,9 +29171,17 @@ function communityEditFrame(edit) {
28541
29171
  */
28542
29172
  function parseCommunityEdit(frame, sender) {
28543
29173
  if (frame?.t !== "edit") return null;
28544
- const { id, v, ts, text } = frame;
28545
- if (typeof id !== "string" || communityMessageAuthor(id) !== sender || !cardEditNumber(v)) return null;
29174
+ const { id, v, ts, text, rm } = frame;
29175
+ if (rm !== void 0 && rm !== true) return null;
29176
+ if (typeof id !== "string" || communityMessageAuthor(id) !== sender || typeof v !== "number" || !(rm ? validRemovalNumber(v) : cardEditNumber(v))) return null;
28546
29177
  if (typeof ts !== "number" || !Number.isSafeInteger(ts) || ts <= 0 || !validEditText(text)) return null;
29178
+ if (rm) return {
29179
+ id,
29180
+ e: v,
29181
+ ts,
29182
+ m: text,
29183
+ rm
29184
+ };
28547
29185
  const sc = frame.sc === void 0 ? void 0 : readStatusCard(frame.sc);
28548
29186
  if (!validEditNumber(v) && !sc) return null;
28549
29187
  const k = validMentions(frame.m, text, false);
@@ -28943,7 +29581,7 @@ var editSigned = (f) => utf8Encode(JSON.stringify([
28943
29581
  function isEditFrame(v) {
28944
29582
  if (!v || typeof v !== "object") return false;
28945
29583
  const f = v;
28946
- return f.t === "group-edit" && typeof f.g === "string" && GROUP_ID.test(f.g) && Number.isSafeInteger(f.e) && f.e >= 0 && typeof f.s === "string" && MEMBER_KEY.test(f.s) && Number.isSafeInteger(f.n) && f.n >= 0 && cardEditNumber(f.v) && Number.isSafeInteger(f.ts) && f.ts > 0 && typeof f.nn === "string" && f.nn.length === 32 && B64$1.test(f.nn) && typeof f.c === "string" && f.c.length <= MAX_EDIT_BOX && B64$1.test(f.c) && typeof f.sig === "string" && f.sig.length === 86 && B64$1.test(f.sig);
29584
+ return f.t === "group-edit" && typeof f.g === "string" && GROUP_ID.test(f.g) && Number.isSafeInteger(f.e) && f.e >= 0 && typeof f.s === "string" && MEMBER_KEY.test(f.s) && Number.isSafeInteger(f.n) && f.n >= 0 && validRemovalNumber(f.v) && Number.isSafeInteger(f.ts) && f.ts > 0 && typeof f.nn === "string" && f.nn.length === 32 && B64$1.test(f.nn) && typeof f.c === "string" && f.c.length <= MAX_EDIT_BOX && B64$1.test(f.c) && typeof f.sig === "string" && f.sig.length === 86 && B64$1.test(f.sig);
28947
29585
  }
28948
29586
  /**
28949
29587
  * Where a frame said again was first said (`o`): an earlier epoch than the frame's own and a sequence number there, or
@@ -29281,13 +29919,24 @@ var GroupSession = class {
29281
29919
  return this.roster.map(([k]) => k).filter((k) => k !== this.myKey);
29282
29920
  }
29283
29921
  /**
29284
- * Whether `key` could read message `messageId` (`<s>:<e>:<n>`) and still can: in the roster of its epoch, and in the
29285
- * roster now. A holder serves a group file only to such a member (WISP 503 § Asking).
29922
+ * Whether `key` could read message `messageId` (`<s>:<e>:<n>`) and still can: in the roster now, and in the roster of
29923
+ * its epoch or, given the message's time `ts`, in the roster of the epoch its author, behind on the chain, said it
29924
+ * again under (`saidAgainEpoch`): the newest after its own that comes before any `add` dated later than it. That
29925
+ * member read it under its first id. A holder serves a group file only to such a member (WISP 503 § Asking).
29286
29926
  */
29287
- couldRead(key, messageId) {
29927
+ couldRead(key, messageId, ts) {
29288
29928
  const e = Number(messageId.split(":")[1]);
29289
29929
  const then = this.state.chain.find((c) => c.e === e);
29290
- return !!then && rosterHas(then.m, key) && rosterHas(this.roster, key);
29930
+ if (!then || !rosterHas(this.roster, key)) return false;
29931
+ if (rosterHas(then.m, key)) return true;
29932
+ if (ts === void 0) return false;
29933
+ let again;
29934
+ for (let later = e + 1; later <= this.epoch; later++) {
29935
+ const c = this.state.chain[later];
29936
+ if (!c || c.k === "add" && c.ts > ts) break;
29937
+ again = c;
29938
+ }
29939
+ return !!again && rosterHas(again.m, key);
29291
29940
  }
29292
29941
  role(key) {
29293
29942
  return this.roster.find(([k]) => k === key)?.[1];
@@ -29912,12 +30561,15 @@ var GroupSession = class {
29912
30561
  const ref = meshMessageRef(messageId);
29913
30562
  const commit = ref && this.state.chain[ref.e];
29914
30563
  if (!ref || ref.s !== this.myKey || !commit || !rosterHas(commit.m, this.myKey)) return { error: "Only your own messages can be edited" };
29915
- if (!(edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
30564
+ if (!(edit.remove ? validRemovalNumber(edit.v) : edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
29916
30565
  const text = edit.text.trim();
29917
30566
  if (!validEditText(text)) return { error: text ? "Message exceeds 16 KiB" : "An edit cannot be empty" };
29918
30567
  if (!this.secret(ref.e)) return { error: "This message is too old to edit: its epoch's key is gone" };
29919
30568
  const named = validMentions(wireMentions(edit.mentions ?? []), text, rosterAdmin(commit.m) === this.myKey && this.isAdmin);
29920
- const plain = JSON.stringify({
30569
+ const plain = JSON.stringify(edit.remove ? {
30570
+ text,
30571
+ rm: true
30572
+ } : {
29921
30573
  text,
29922
30574
  ...named.length ? { m: named } : {},
29923
30575
  ...edit.card ? { sc: edit.card } : {}
@@ -30314,9 +30966,12 @@ var GroupSession = class {
30314
30966
  return;
30315
30967
  }
30316
30968
  if (!body || typeof body !== "object" || !validEditText(body.text)) return;
30317
- const k = validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
30318
- const sc = body.sc === void 0 ? void 0 : readStatusCard(body.sc);
30319
- if (!validEditNumber(raw.v) && !sc) return;
30969
+ if (body.rm !== void 0 && body.rm !== true) return;
30970
+ const rm = body.rm === true;
30971
+ if (!rm && !cardEditNumber(raw.v)) return;
30972
+ const k = rm ? [] : validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
30973
+ const sc = rm || body.sc === void 0 ? void 0 : readStatusCard(body.sc);
30974
+ if (!rm && !validEditNumber(raw.v) && !sc) return;
30320
30975
  const copy = this.kept().find((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n);
30321
30976
  const first = copy && readFirstPlace(copy.o, copy.e);
30322
30977
  await this.hooks.edit?.({
@@ -30326,7 +30981,8 @@ var GroupSession = class {
30326
30981
  ts: raw.ts,
30327
30982
  m: body.text,
30328
30983
  ...k.length ? { k } : {},
30329
- ...sc ? { sc } : {}
30984
+ ...sc ? { sc } : {},
30985
+ ...rm ? { rm: true } : {}
30330
30986
  });
30331
30987
  if (this.keepEdit(raw)) {
30332
30988
  await this.persist();
@@ -31122,12 +31778,16 @@ var FRESH = /* @__PURE__ */ new Set([
31122
31778
  * history keeps room for everyone else to get out after it: two commits a member (a leave or a remove is one, and a
31123
31779
  * leaving admin hands the role over first). The history is never compacted, and one that filled with people in it
31124
31780
  * took no leave, remove or handover any more. Its own rule: a history up to `COMMUNITY_LIMITS.chain` verifies as before.
31781
+ * A member takes in such a commit from someone else only when it keeps that room too (`receiveCommit`): an app that
31782
+ * does not keep it could otherwise fill the history for everyone.
31125
31783
  */
31126
31784
  var GROWS = /* @__PURE__ */ new Set([
31127
31785
  "add",
31128
31786
  "rotate",
31129
31787
  "link"
31130
31788
  ]);
31789
+ /** Whether a history whose last commit is at `epoch`, with `roster` in it, still has room for everyone else to get out. */
31790
+ var keepsRoom = (epoch, roster) => epoch + 1 + 2 * (roster.length - 1) <= COMMUNITY_LIMITS.chain;
31131
31791
  /**
31132
31792
  * Kinds only the admin commits. They are final: a branch that drops one never replaces the branch
31133
31793
  * that has it, however long, so no member can undo a removal, a hand-over, a rotation or a link change
@@ -31189,6 +31849,30 @@ var leftStatement = (g, h, hi) => utf8Encode(JSON.stringify([
31189
31849
  Object.entries(hi).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)
31190
31850
  ]));
31191
31851
  var LEFT_EPOCH = /^\d{1,15}:[a-f0-9]{16}$/;
31852
+ /** A leave of one admission: `h` is the hash of the commit that last put `s` in the roster (its `add`, or the `create` it signed). */
31853
+ var leaveStatement3 = (g, s, h) => utf8Encode(JSON.stringify([
31854
+ "ghostly-group/3 leave",
31855
+ g,
31856
+ s,
31857
+ h
31858
+ ]));
31859
+ /**
31860
+ * Whether a leave holds after `before` (the commits before it, newest first): its `ls3` names the commit that last
31861
+ * admitted the leaver, or, from an app that signs no such statement, no earlier leave carries its `ls`. `ls` says the
31862
+ * same for every admission of a member, so by itself it ends one admission only.
31863
+ */
31864
+ function leaveStands(leave, before) {
31865
+ if (!leave.s || !leave.ls) return false;
31866
+ let admitted = false;
31867
+ for (const c of before) {
31868
+ if (!admitted && (c.k === "add" && c.s === leave.s || c.k === "create" && c.by === leave.s)) {
31869
+ admitted = true;
31870
+ if (leave.ls3 && SIG.test(leave.ls3) && verify(fromBase64Url(leave.ls3), leaveStatement3(leave.g, leave.s, communityCommitHash(c)), publicKeyFromZ32(leave.s))) return true;
31871
+ }
31872
+ if (c.k === "leave" && c.ls === leave.ls) return false;
31873
+ }
31874
+ return true;
31875
+ }
31192
31876
  /** The secret of an epoch that adds, re-roles or re-links: from the previous one and the commit. */
31193
31877
  function derivedSecret(previous, untaggedHash) {
31194
31878
  return hkdf(sha256, previous, utf8Encode(untaggedHash), utf8Encode("ghostly-group/2 derived"), 32);
@@ -31214,6 +31898,7 @@ function parseCommit(raw) {
31214
31898
  if (c.x !== void 0) out.x = c.x;
31215
31899
  if (c.n !== void 0) out.n = c.n;
31216
31900
  if (c.ls !== void 0) out.ls = c.ls;
31901
+ if (out.k === "leave" && typeof c.ls3 === "string" && SIG.test(c.ls3)) out.ls3 = c.ls3;
31217
31902
  return out;
31218
31903
  }
31219
31904
  /**
@@ -31246,15 +31931,18 @@ function communityRoster(previous, c, trusted = false) {
31246
31931
  /**
31247
31932
  * One commit against its parent (null for a genesis) and the parent's roster: shape, id, link,
31248
31933
  * authority, roster arithmetic, roster hash and signature. The confirmation tag is checked once
31249
- * the secret is known.
31934
+ * the secret is known. `before`: the commits before it on its branch, newest first; given, a `leave` is held to the
31935
+ * admission it ends (`leaveStands`). A member gives it for every commit it takes in after its own admission; the chain
31936
+ * of a welcome is not held to it (`verifyCommunityChain`).
31250
31937
  */
31251
- function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
31938
+ function verifyCommunityCommit(raw, parent, parentRoster, groupId, before) {
31252
31939
  const commit = parseCommit(raw);
31253
31940
  if (!commit) return { error: "Malformed membership commit" };
31254
31941
  if (groupId && commit.g !== groupId) return { error: "Commit for another group" };
31255
31942
  if (parent) {
31256
31943
  if (commit.g !== parent.g) return { error: "Commit for another group" };
31257
31944
  if (commit.e !== parent.e + 1) return { error: "Commit out of sequence" };
31945
+ if (commit.e >= COMMUNITY_LIMITS.chain) return { error: "Membership chain too long" };
31258
31946
  if (commit.p !== communityCommitHash(parent)) return { error: "Commit does not follow its parent" };
31259
31947
  } else {
31260
31948
  if (commit.e !== 0 || commit.p !== "" || commit.k !== "create") return { error: "The chain does not start with the creation of the group" };
@@ -31264,6 +31952,7 @@ function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
31264
31952
  if (commit.k !== "leave" && commit.ls !== void 0) return { error: "Malformed membership commit" };
31265
31953
  const roster = communityRoster(parent ? parentRoster : null, commit);
31266
31954
  if (!roster) return { error: "Unauthorized or inconsistent membership change" };
31955
+ if (commit.k === "leave" && before && !leaveStands(commit, before)) return { error: "This leave is not for the member's current admission" };
31267
31956
  if (rosterHash(roster) !== commit.m) return { error: "The roster hash does not match the change" };
31268
31957
  if (!verify(fromBase64Url(commit.sig), utf8Encode(tuple(commit)), publicKeyFromZ32(commit.by))) return { error: "Membership commit signature is invalid" };
31269
31958
  return {
@@ -31271,7 +31960,11 @@ function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
31271
31960
  roster
31272
31961
  };
31273
31962
  }
31274
- /** A whole chain from its genesis; the rosters after each commit and the entry key at the end. */
31963
+ /**
31964
+ * A whole chain from its genesis; the rosters after each commit and the entry key at the end. What a newcomer is
31965
+ * handed: a `leave` in it is not held to the admission it ends, since a chain from before 2026-10-10 may hold a
31966
+ * member's second leave under the one statement there was, and no newcomer could enter that group again.
31967
+ */
31275
31968
  function verifyCommunityChain(raw, groupId) {
31276
31969
  if (!Array.isArray(raw) || raw.length === 0 || raw.length > COMMUNITY_LIMITS.chain) return { error: "Malformed membership chain" };
31277
31970
  const chain = [], rosters = [];
@@ -31762,13 +32455,17 @@ var CommunitySession = class {
31762
32455
  placeSide(commit) {
31763
32456
  const parent = this.known.get(commit.p), parentRoster = parent ? this.rosterAt(commit.p) : void 0;
31764
32457
  if (!parentRoster || !parent) return false;
31765
- const result = verifyCommunityCommit(commit, parent, parentRoster, this.id);
32458
+ const result = verifyCommunityCommit(commit, parent, parentRoster, this.id, this.ancestry(commit.p));
31766
32459
  if ("error" in result) return false;
31767
32460
  const h = communityCommitHash(result.commit);
31768
32461
  this.known.set(h, result.commit);
31769
32462
  this.rosters.set(h, result.roster);
31770
32463
  return true;
31771
32464
  }
32465
+ /** The commit `h` and those before it on its branch, newest first. */
32466
+ *ancestry(h) {
32467
+ for (let c = this.known.get(h); c; c = this.known.get(c.p)) yield c;
32468
+ }
31772
32469
  rosterOf(h) {
31773
32470
  return this.rosterAt(h);
31774
32471
  }
@@ -31891,8 +32588,9 @@ var CommunitySession = class {
31891
32588
  }
31892
32589
  const parsed = parseCommit(raw);
31893
32590
  if (!parsed || this.known.has(communityCommitHash(parsed))) return false;
31894
- const result = verifyCommunityCommit(raw, parent, parentRoster, this.id);
32591
+ const result = verifyCommunityCommit(raw, parent, parentRoster, this.id, this.ancestry(p));
31895
32592
  if ("error" in result) return false;
32593
+ if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
31896
32594
  const commit = result.commit, h = communityCommitHash(commit);
31897
32595
  const admin = rosterAdmin(parentRoster);
31898
32596
  if (commit.by === admin) {
@@ -32123,8 +32821,8 @@ var CommunitySession = class {
32123
32821
  ts: now
32124
32822
  };
32125
32823
  const roster = communityRoster(this.roster, draftBase);
32126
- if (!roster) throw new Error("This change is not allowed");
32127
- if (GROWS.has(kind) && this.state.chain.length + 1 + 2 * (roster.length - 1) > COMMUNITY_LIMITS.chain) throw new Error("This group has reached its membership history limit. Create a new group.");
32824
+ if (!roster || kind === "leave" && !leaveStands(draftBase, this.ancestry(parentHash))) throw new Error("This change is not allowed");
32825
+ if (GROWS.has(kind) && !keepsRoom(draftBase.e, roster)) throw new Error("This group has reached its membership history limit. Create a new group.");
32128
32826
  const draft = {
32129
32827
  ...draftBase,
32130
32828
  m: rosterHash(roster)
@@ -32294,6 +32992,10 @@ var CommunitySession = class {
32294
32992
  s: this.myKey,
32295
32993
  ls: toBase64Url(sign(leaveStatement(this.id, this.myKey), this.identity.seed))
32296
32994
  };
32995
+ for (const c of this.ancestry(this.topHash)) if (c.k === "add" && c.s === this.myKey || c.k === "create" && c.by === this.myKey) {
32996
+ frame.ls3 = toBase64Url(sign(leaveStatement3(this.id, this.myKey, communityCommitHash(c)), this.identity.seed));
32997
+ break;
32998
+ }
32297
32999
  this.hooks.broadcast(frame);
32298
33000
  this.out("left", "You left this group");
32299
33001
  await this.persist();
@@ -32315,7 +33017,8 @@ var CommunitySession = class {
32315
33017
  try {
32316
33018
  const { hash } = await this.commit("leave", {
32317
33019
  s: request.s,
32318
- ls: request.ls
33020
+ ls: request.ls,
33021
+ ...request.ls3 ? { ls3: request.ls3 } : {}
32319
33022
  }, now);
32320
33023
  this.markLeft(hash, request.s);
32321
33024
  done++;
@@ -32453,17 +33156,18 @@ var CommunitySession = class {
32453
33156
  return this.serialize(async () => {
32454
33157
  if (!this.isMember) return { error: this.state.statusReason ?? "You are not in this group" };
32455
33158
  if (communityMessageAuthor(edit.id) !== this.myKey) return { error: "Only your own messages can be edited" };
32456
- if (!(edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
33159
+ if (!(edit.remove ? validRemovalNumber(edit.v) : edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
32457
33160
  const text = edit.text.trim();
32458
33161
  if (!validEditText(text)) return { error: text ? "Message exceeds 16 KiB" : "An edit cannot be empty" };
32459
- const named = validMentions(wireMentions(edit.mentions ?? []), text, false);
33162
+ const named = edit.remove ? [] : validMentions(wireMentions(edit.mentions ?? []), text, false);
32460
33163
  const frame = communityEditFrame({
32461
33164
  id: edit.id,
32462
33165
  e: edit.v,
32463
33166
  ts: edit.ts,
32464
33167
  m: text,
32465
33168
  k: named,
32466
- ...edit.card && { sc: edit.card }
33169
+ ...edit.card && !edit.remove && { sc: edit.card },
33170
+ ...edit.remove && { rm: true }
32467
33171
  });
32468
33172
  const room = COMMUNITY_LIMITS.textBytes + 256, clean = sanitizeNick(nick);
32469
33173
  const size = (withNick) => utf8Encode(JSON.stringify(withNick && clean ? {
@@ -32713,11 +33417,27 @@ var CommunitySession = class {
32713
33417
  receiveLeave(frame) {
32714
33418
  const s = frame.s, ls = frame.ls;
32715
33419
  if (typeof s !== "string" || !MEMBER_KEY.test(s) || typeof ls !== "string" || !SIG.test(ls) || !rosterHas(this.roster, s)) return false;
32716
- if (this.state.pendingLeaves.some((r) => r.s === s)) return false;
33420
+ const ls3 = typeof frame.ls3 === "string" && SIG.test(frame.ls3) ? frame.ls3 : void 0;
33421
+ let held = this.state.pendingLeaves.find((r) => r.s === s);
33422
+ if (held && !leaveStands({
33423
+ g: this.id,
33424
+ ...held
33425
+ }, this.ancestry(this.topHash))) {
33426
+ this.state.pendingLeaves = this.state.pendingLeaves.filter((r) => r !== held);
33427
+ held = void 0;
33428
+ }
33429
+ if (held && (held.ls3 || !ls3)) return false;
32717
33430
  if (!verify(fromBase64Url(ls), leaveStatement(this.id, s), publicKeyFromZ32(s))) return false;
32718
- this.state.pendingLeaves = [...this.state.pendingLeaves, {
33431
+ if (!leaveStands({
33432
+ g: this.id,
33433
+ s,
33434
+ ls,
33435
+ ls3
33436
+ }, this.ancestry(this.topHash))) return false;
33437
+ this.state.pendingLeaves = [...this.state.pendingLeaves.filter((r) => r !== held), {
32719
33438
  s,
32720
- ls
33439
+ ls,
33440
+ ...ls3 ? { ls3 } : {}
32721
33441
  }].slice(-COMMUNITY_LIMITS.pendingLeaves);
32722
33442
  this.persistSoon();
32723
33443
  return true;
@@ -34466,6 +35186,6 @@ function x401ApprovalDigest(subject) {
34466
35186
  return toBase64Url(sha256(utf8Encode(canonical)));
34467
35187
  }
34468
35188
  //#endregion
34469
- export { COMMUNITY_LIMITS as $, publicKeyFromZ32 as $S, ENROLL_PROOF as $_, PAIRING_ATTEMPT_MS as $a, verifyDeviceTransports as $b, APPS_CAPABILITY as $c, recordingMime as $d, reactionIsNewer as $f, handoffContext as $g, waitForIceGathering as $h, sparkNetworkOf as $i, CAPS_LABEL as $l, TRANSPORTS_GONE_MS as $m, bip322ToSpend as $n, wireHubPolicy as $o, commitUntaggedHash as $p, didGhostlyServiceEntry as $r, mayPin as $s, communityMessageAuthor as $t, proofHash as $u, readLinkRecord as $v, GROUP_BURST_MS as $x, previewable as $y, readX401ProofResponseHeader as A, __esmMin as AC, budgetRetryMs as AS, readHandoffManifest as A_, fedimintRequestPayload as Aa, inviteQrSegments as Ab, encryptPushPayload as Ac, LIVE_POLL_MS as Ad, linkEnd as Af, HANDOFF_HELLO as Ag, RTC_SIGNAL_FUTURE_MS as Ah, signDidDhtPacket as Ai, DNS_TYPE as Al, REANSWERS as Am, parseGroupMetaTag as An, readGroupHave as Ao, readStatusCard as Ap, AtprotoProofError as Ar, transferStalled as As, GROUP_WAKE_FRAME as At, identityPresentationBytes as Au, LINK_RECORD_LABEL as Av, sealTurnBody as Ax, appFingerprint as Ay, APP_STORE_KINDS as B, newerPacket as BS, encodeSetSlots as B_, CROSSED_WAIT_MS as Ba, deviceEchoFrame as Bb, APP_RESUME_GRACE_MS as Bc, safeBlobType as Bd, GROUP_REACTION_FRAME as Bf, HANDOFF_TIMINGS as Bg, answersOffer as Bh, arkAddressPrefix as Bi, domainWellKnownFile as Bl, DHT_POLL_INTERVALS as Bm, parseSshSignature as Bn, SIGNAL_HOLD_MS as Bo, receivedTimestamp as Bp, unsignedCommitBytes as Br, TypingSender as Bs, GROUP_LIMITS as Bt, IDENTITY_TIMELINE_MAX as Bu, STAMP_BITS_MAX as Bv, turnSequence as Bx, readAppRevocation as By, buildX401TokenObject as C, randomBytes as CC, traceLink as CS, readHandoffBusy as C_, requestLnurlInvoice as Ca, createChatInvite as Cb, wakeFrame as Cc, ACTIVE_DHT_POLL_MS as Cd, parseEditFrame as Cf, HANDOFF_CANCEL as Cg, decodeControl as Ch, didDhtKey as Ci, HOLD_LIMITS as Cl, ANSWER_REFUSED_REDIALS as Cm, groupName as Cn, GROUP_VERSION_FILES as Co, buttonLabelClash as Cp, atprotoProofRkey as Cr, FILE_DATA_KIND as Cs, encodeGroupEntryLink as Ct, IDENTITY_REVOCATION_LABEL as Cu, settleRequest as Cv, TurnRecordError as Cx, readAppBundle as Cy, readX401ProofRequest as D, utf8Decode as DC, BREAKER_THRESHOLD as DS, readHandoffFileFrame as D_, findBolt11 as Da, encodeInviteCode as Db, WebPushError as Dc, DHT_TEXT_BYTES as Dd, LINK_MAX_CHARS as Df, HANDOFF_FILE_MISSING as Dg, wrapDataChannel as Dh, jwkThumbprint as Di, newMailbox as Dl, GATHER_ATTEMPTS as Dm, parseGroupMetaBody as Dn, groupFileFallback as Do, cardTimeUtc as Dp, parseAtprotoDidDocument as Dr, encodeFileData as Ds, knockRecords as Dt, IdentityExchange as Du, ContactRequestError as Dv, openTurnValue as Dx, APP_NAME as Dy, isX401Protocol as E, toZ32 as EC, BREAKER_MAX_MS as ES, readHandoffDone as E_, decodeBolt11 as Ea, encodeGhostlyInvite as Eb, PUSH_SERVICE_HOSTS as Ec, DHT_MESSAGE_TTL as Ed, validEditNumber as Ef, HANDOFF_DONE as Eg, sendBody as Eh, encodeDidDhtPacket as Ei, isHoldUrl as El, DataLink as Em, openGroupMeta as En, fetchesByItself as Eo, cardLinkHost as Ep, normalizeAtprotoHandle as Er, decodeFileData as Es, knockIdentity as Et, IdentityCheckUnavailable as Eu, CONTACT_RECORD_TTL as Ev, nextTurnPosition as Ex, yieldThread as Ey, appRevocationFor as F, PKARR_FUTURE_SKEW_MS as FS, sameDigest as F_, ANSWERS_REFUSED_PAUSES as Fa, DEVICE_CAPABILITIES as Fb, APP_DATA_MAX_BYTES as Fc, dhtFileId as Fd, FORWARD_LIMITS as Ff, HANDOFF_PAKE as Fg, parseRtcSignal as Fh, SEPOLIA_TEST_USDT as Fi, NIP05_PATH as Fl, DirectPathWatch as Fm, SSHSIG_NAMESPACE as Fn, GROUP_SIGNAL_FRAME as Fo, usageLeft as Fp, findInMst as Fr, TYPING_REFRESH_MS as Fs, GroupWakeLimiter as Ft, newIdentityBinding as Fu, REQUEST_LIFETIME_MS as Fv, turnKeys as Fx, checkAppRevokeStatement as Fy, readAppStore as G, decodeDnsAnswers as GS, signTombstone as G_, GhostLink as Ga, deviceLinkParams as Gb, appDataBytes as Gc, VOICE_LIMITS as Gd, ReactionWindow as Gf, filePartDigest as Gg, decompressSdp as Gh, parsePaymentAmount as Gi, parseDomainTxt as Gl, MAX_DHT_TEXT_BYTES as Gm, verifySshSignature as Gn, GROUP_VERSION_HUBS as Go, GROUP_VERSION_LARGE as Gp, DID_GHOSTLY_SERVICE as Gr, typingFrame as Gs, chainPieces as Gt, PeerProofs as Gu, knockSlotOf as Gv, BACKGROUND_WHILE_SIGNALING as Gx, signAppRevocation as Gy, checkAppListing as H, parseRelayPayload as HS, setAckFrame as H_, DEMOTE_MS as Ha, deviceFrameCapability as Hb, APP_VERSION_MAX as Hc, sanitizeMime as Hd, REACTED_FRAME as Hf, HANDOFF_VERSION as Hg, callRtcConfig as Hh, assertWholeSats as Hi, isPublicAddress as Hl, FIRST_PUBLISH_MAX_MS as Hm, sshFingerprint as Hn, SIGNAL_REPLY_MS as Ho, GROUP_ADMIN_OFF_ERROR as Hp, verifyAtprotoSignature as Hr, parseTypingFrame as Hs, GROUP_READ_NOTE as Ht, lastSharedWithMe as Hu, contactDay as Hv, turnStatedVerifier as Hx, readAppRevocations as Hy, appStoreDecision as I, PacketTooLargeError as IS, sealHandoffPiece as I_, ANSWERS_REFUSED_PAUSE_MS as Ia, DEVICE_ECHO_FRAME as Ib, APP_FRAME as Ic, readDhtFile as Id, forwardedAgain as If, HANDOFF_PIECE_BYTES as Ig, CALL_SIGNAL_FUTURE_MS as Ih, SEPOLIA_TEST_USDT_FAUCET as Ii, WELL_KNOWN_PATH as Il, directBlocked as Im, SSH_KEY_TYPES as In, GROUP_VERSION_SIGNALS as Io, MESSAGE_CLOCK_SKEW_MS as Ip, parseAtprotoCar as Ir, TYPING_SEND_LIMIT as Is, groupWakeFrame as It, receivedIdentityStatus as Iu, REQUEST_NAME_UNITS as Iv, turnName as Ix, isAppHash as Iy, GROUP_TYPING_FRAME as J, readDnsName as JS, ENROLL_CANCEL as J_, INVITE_TAKEN as Ja, deviceLinkSecret as Jb, chatAppId as Jc, downsamplePeaks as Jd, parseReactionFrame as Jf, handoffAttemptAllowed as Jg, isGlobalIpv4Host as Jh, SPARK_NETWORKS as Ji, recordsName as Jl, OFFER_STEP_MAX as Jm, verifyBitcoinMessage as Jn, mayBeHub as Jo, MAX_GROUP_MEMBERS as Jp, DID_MAX_LENGTH as Jr, GROUP_PIN_FRAME as Js, COMMUNITY_EDIT_FRAME as Jt, emptyProofLedger as Ju, makeStamp as Jv, CHAT_RESERVE_PER_CHAT as Jx, verifyAppStatementBytes as Jy, readAppStoreSteps as K, decodeTxtPacket as KS, verifySetUpdate as K_, HANDLED_WAIT_MS as Ka, deviceLinkRendezvousSeed as Kb, appDataFrame as Kc, VOICE_METER as Kd, nextReactionNumber as Kf, filePartName as Kg, extractParamsFromSdp as Kh, validatePaymentTarget as Ki, recordsFromTxt as Kl, OFFER_FAST_MS as Km, isLegacySignature as Kn, MESH_HUBS as Ko, LEGACY_GROUP_MEMBERS as Kp, DID_JWS_ALGS as Kr, typingKindOf as Ks, frameBytes as Kt, STORAGE_LIFETIME as Ku, knockSlotRecords as Kv, CHAT_RESERVE as Kx, verifyAppRevocation as Ky, appUpdateDecision as L, RELAY_PAYLOAD_MAX_BYTES as LS, sortParts as L_, BLOCKED_DIAL_WAIT_MS as La, DEVICE_PING_FRAME as Lb, APP_PEER_OPEN_MAX as Lc, FileTransfers as Ld, forwardedMany as Lf, HANDOFF_PIECE_OVERHEAD as Lg, CALL_SIGNAL_MAX_AGE_MS as Lh, TEST_USDT_FAUCET_AMOUNT as Li, decodeDnsResponse as Ll, symmetricNat as Lm, SSH_PUBLIC_KEY_MAX as Ln, SIGNALS_PER_MINUTE as Lo, arrivalKey as Lp, parseAtprotoDidKey as Lr, TYPING_STATUS_MAX as Ls, groupWakes as Lt, revokesIdentity as Lu, REQUEST_PACKET_BYTES as Lv, turnPacket as Lx, isAppKey as Ly, readX401ProofResultHeader as M, __require as MC, isDiscoveryBudgetError as MS, readHandoffRelease as M_, isFederationId as Ma, ownInviteRefusal as Mb, pushRequest as Mc, peekDhtMailbox as Md, parseLinkPreview as Mf, HANDOFF_LIST_PER_FRAME as Mg, buildDataSdp as Mh, EVM_TEST_CHAINS as Mi, DOMAIN_MAX_RECORDS as Ml, DIRECT_EVIDENCE_MS as Mm, verifyGroupMetaSignature as Mn, readGroupWantNo as Mo, statusCardBytes as Mp, decodeAtprotoCommit as Mr, TYPING_KINDS as Ms, GROUP_WAKE_GROUP_WINDOW_MS as Mt, identityStatement as Mu, MAX_SLOT_KNOCKS as Mv, signTurnPacket as Mx, appRefPublisher as My, x401AnswerableRequests as N, __toCommonJS as NC, withRequestOptions as NS, readHandoffTurnFrame as N_, parseCashuRequestPayload as Na, readInviteCode as Nb, vapidAuthorization as Nc, DHT_FILE_CAPABILITY as Nd, previewImageSize as Nf, HANDOFF_MANIFEST as Ng, extractRtcParams as Nh, ONCHAIN_PROVIDER as Ni, DOMAIN_METHODS as Nl, DIRECT_OWN_ATTEMPTS as Nm, wrapGroupMeta as Nn, CARRIED_DEFER_MS as No, statusCardText as Np, decodeDagCbor as Nr, TYPING_RATE_LIMIT as Ns, GROUP_WAKE_MEMBER_INTERVAL_MS as Nt, identityStatementText as Nu, REQUEST_CLOCK_SKEW_MS as Nv, signTurnRelease as Nx, appRevocationId as Ny, readX401ProofRequestHeader as O, utf8Encode as OC, RelayBreaker as OS, readHandoffHave as O_, ENDPOINT as Oa, inviteLink as Ob, checkPushEndpoint as Oc, DHT_TEXT_REFUSED as Od, LINK_PREVIEW_LIMITS as Of, HANDOFF_FILE_REQUEST as Og, DATA_CHANNEL_ID as Oh, openDidDhtPayload as Oi, readManifest as Ol, GATHER_STALL_MS as Om, parseGroupMetaFrame as On, isGroupMessageId as Oo, cardUrl as Op, shortAtprotoDid as Or, refusalText as Os, mergeKnocks as Ot, boundVerifiedIdentity as Ou, KNOCK_SLOTS as Ov, readTurnBody as Ox, APP_PREFIXES as Oy, addedAppPermissions as P, MAX_DNS_PACKET_BYTES as PS, readHandoffVerified as P_, parseFedimintRequestPayload as Pa, DEVICES_CAPABILITY as Pb, vapidKeysMatch as Pc, dhtFileElements as Pd, sanitizePreviewImage as Pf, HANDOFF_OFFER as Pg, offerIsFresh as Ph, PaymentPreflightError as Pi, DOMAIN_TXT_MAX_BYTES as Pl, DIRECT_PEERS as Pm, SSHSIG_MAX_ARMOR as Pn, CarriedTransport as Po, taskProgress as Pp, encodeDagCbor as Pr, TYPING_RATE_WINDOW_MS as Ps, GROUP_WAKE_RECEIVE_LIMIT as Pt, isIdentityBinding as Pu, REQUEST_LABEL as Pv, turnInstance as Px, appSignedBytes as Py, sealGroupTyping as Q, identityFromSeedB64 as QS, ENROLL_HELLO as Q_, PAIRED_FRAME_TOO_LARGE as Qa, unsignedDeviceTransports as Qb, readAppFrame as Qc, parseVoiceMeta as Qd, reactionFrame as Qf, handoffCancelFrame as Qg, signalHasVideo as Qh, sparkInvoiceDetails as Qi, CAPS_ISSUED_BACK_MS as Ql, STALLED_LOOK_MS as Qm, bip322ToSign as Qn, pickMeshHubs as Qo, commitHash as Qp, checkDidSignature as Qr, PIN_LIMITS as Qs, communityEditFrame as Qt, proofCapability as Qu, readKnockSlot as Qv, FRESH_READ_MS as Qx, parseImageMeta as Qy, checkAppBeforeRun as R, createRelayPayload as RS, SET_ACK as R_, CROSSED_FRESH_MS as Ra, ENROLL_CAPABILITY as Rb, APP_RATE_LIMIT as Rc, PREVIEWABLE_IMAGE as Rd, readForwarded as Rf, HANDOFF_RELEASE as Rg, PAIRED_CALL_CANDIDATES as Rh, USDT_PUBLIC_RPC as Ri, dnsProofName as Rl, AWAITING_PEER_MS as Rm, SshSigError as Rn, SIGNAL_CARRIERS as Ro, claimedTime as Rp, parseAtprotoVerificationKey as Rr, TYPING_TIMEOUT_MS as Rs, mentionedMembers as Rt, signIdentityPresentation as Ru, REQUEST_TEXT_BYTES as Rv, turnPayloadSequence as Rx, isAppRef as Ry, buildX401ResultArtifact as S, isZ32Key as SC, setLinkTraceSink as SS, readHandoffAck as S_, parsePayParams as Sa, OwnInviteError as Sb, relayRequest as Sc, transportOrder as Sd, editedFrame as Sf, HANDOFF_BUSY_REASONS as Sg, decodeChunk as Sh, didDhtFromPublicKey as Si, HOLD_DATED_BACK_MS as Sl, sha256Hex as Sm, groupMetaToHand as Sn, GROUP_HAVE_FRAME as So, appCardId as Sp, atprotoProofRecord as Sr, ChatFiles as Ss, decodeGroupEntryLink as St, IDENTITY_PROVIDER_ID as Su, planKnocks as Sv, TURN_VERSION as Sx, pacer as Sy, encodeX401Header as T, toBase64Url as TC, BREAKER_BASE_MS as TS, readHandoffData as T_, BOLT11_PATTERN as Ta, decodeInviteCode as Tb, wakeRequest as Tc, DHT_FILE_TOO_LARGE as Td, validEditMessage as Tf, HANDOFF_DATA as Tg, encodeControl as Th, encodeDidDhtDeactivated as Ti, HoldRefusedError as Tl, DATA_SETTLE_MS as Tm, nextGroupMetaRevision as Tn, GROUP_WANT_NO_FRAME as To, cardLine as Tp, isAtprotoDid as Tr, FILE_LIMITS as Ts, groupEntryUrl as Tt, IDENTITY_SUBJECT as Tu, turnOff as Tv, firstDeviceSetSecret as Tx, sha256Paced as Ty, checkAppStoreIndex as U, readOwnRelayPayload as US, setUpdateFrame as U_, DHT_PIN_GRACE_MS as Ua, deviceKeyZ32 as Ub, AppSessions as Uc, PLAYABLE_AUDIO as Ud, REACTION_FRAME as Uf, HANDOFF_WINDOW as Ug, callSignalHeardAt as Uh, formatPaymentAmount as Ui, nip05RootKey as Ul, IDLE_THRESHOLD as Um, sshKeyDigestHex as Un, groupSignalFrame as Uo, GROUP_ID as Up, DID_DOCUMENT_MAX_BYTES as Ur, sanitizeTypingStatus as Us, GroupSession as Ut, PROOF_ADAPTERS as Uu, knockHolds as Uv, turnVerifierMark as Ux, readAppSignature as Uy, APP_STORE_LIMITS as V, openRelayPayload as VS, readSetUpdate as V_, DEMOTE_AFTER_FAILURES as Va, deviceEchoNonce as Vb, APP_SEND_LIMIT as Vc, sanitizeFileName as Vd, QUICK_REACTIONS as Vf, HANDOFF_VERIFIED as Vg, buildSdpFromSignal as Vh, assertTokenUnits as Vi, encodeDnsQuery as Vl, EXPECT_PEER_MS as Vm, sameSshKey as Vn, SIGNAL_PROVEN_MS as Vo, shownTime as Vp, verifyAtprotoRecordProof as Vr, parseTypingActivity as Vs, GROUP_REACTED_FRAME as Vt, applyIdentityEvent as Vu, STAMP_BITS_MIN as Vv, turnSignedMessage as Vx, readAppRevocationShape as Vy, readAppListing as W, signRelayPayload as WS, setUpdateMessage as W_, EARLY_DIAL_JOIN_MS as Wa, deviceLinkPairing as Wb, appCloseFrame as Wc, RECORDING_TYPES as Wd, REACTION_LIMITS as Wf, NO_ATTEMPTS as Wg, compressSdp as Wh, isWalletNetwork as Wi, normalizeDomain as Wl, LinkSession as Wm, sshSignCommand as Wn, readGroupSignal as Wo, GROUP_MEMBER_CAP as Wp, DID_FILE_MAX_BYTES as Wr, typingActivity as Ws, asWritten as Wt, PROOF_CAPABILITY as Wu, knockSlotIdentity as Wv, BACKGROUND_REQUESTS_PER_MINUTE as Wx, signAppObject as Wy, groupTypingEpoch as X, createIdentity as XS, ENROLL_DONE as X_, LIVENESS_PING_MS as Xa, newDeviceSetSecret as Xb, isChatAppId as Xc, formatVoiceDuration as Xd, reactedFrame as Xf, handoffAttemptSucceeded as Xg, pickCallCandidates as Xh, isSparkAddress as Xi, validDomainRecord as Xl, PRESENCE_WINDOW as Xm, MessageRefusal as Xn, meshRendezvous as Xo, OWN_FRAME_LIMIT as Xp, DidError as Xr, PIN_CLOCK_SKEW_MS as Xs, GROUP_EDIT_TEXT_BYTES as Xt, isProofAdapter as Xu, mergeContactKnocks as Xv, DEFAULT_RELAYS as Xx, imageSize as Xy, GroupTypingBoard as Y, IDENTITY_MEMO_SIZE as YS, ENROLL_CANCEL_REASONS as Y_, LIVENESS_MISSED_PINGS as Ya, devicePingFrame as Yb, isAppVersion as Yc, fileMessageText as Yd, queueReaction as Yf, handoffAttemptFailed as Yg, parseCallSignal as Yh, SPARK_PROVIDER as Yi, txtValue as Yl, PRESENCE_HEARTBEAT as Ym, BIP322_REVISION as Yn, meshHubs as Yo, MEMBER_KEY as Yp, DID_METHODS as Yr, PINNED_FRAME as Ys, GROUP_EDIT_FRAME as Yt, importedProof as Yu, makeStampPaced as Yv, CHAT_WATCH_SHARE as Yx, IMAGE_LIMITS as Yy, openGroupTyping as Z, identityFromSeed as ZS, ENROLL_GRANT as Z_, MAX_PAIRED_MESSAGE_FRAME as Za, signDeviceTransports as Zb, parseAppFrame as Zc, isPlayableAudioType as Zd, reactionEmoji as Zf, handoffBusyFrame as Zg, sdpHasCandidates as Zh, sparkAddressKind as Zi, wellKnownUrl as Zl, RELAY_POLL_INTERVALS as Zm, bip322MessageHash as Zn, parseHubPolicy as Zo, SAID_AGAIN as Zp, checkDidJws as Zr, PIN_FRAME as Zs, carryMentions as Zt, nostrProofTemplate as Zu, openRequest as Zv, DEPARTED_READS as Zx, isImageMime as Zy, X401_PROTOCOLS as _, bytesEqual as _C, WAY_BACK_SHARE as _S, handoffVerifiedMessage as __, fetchLnurlJson as _a, DEVICE_INVITE_VERSION as _b, deviceWakeRequest as _c, checkedDescriptors as _d, EDIT_SEND_LIMIT as _f, servicesToWire as _g, CHUNK_FLAG_END as _h, DID_DHT_TTL as _i, PAIRED_PROFILE as _l, newEpochSecret as _m, groupMetaBody as _n, engineError as _o, PR_STATES as _p, ATPROTO_DECLARED_SCOPE as _r, validHead as _s, verifyCommunityChain as _t, IDENTITY_MAX_EVIDENCE as _u, REOPEN_BELOW as _v, TURN_REV_LIMIT as _x, checkAppManifest as _y, X401_DCQL_LIMITS as a, sealedLength as aC, HEDGE_MS as aS, handoffFileMissingFrame as a_, isPubkyProofFolder as aa, CONTACT_LINK_VERSION as ab, pinNumberHolds as ac, verifyNostrProof as ad, PLAYABLE_VIDEO as af, isEmptyLinkPacket as ag, unusedInviteWait as ah, didWebFileUrl as ai, KNOWN_SESSION_CAPABILITIES as al, signCommit as am, mentionsBytes as an, REDESCRIBED_GRACE_MS as ao, REPLY_ID as ap, decodeAnyBitcoinAddress as ar, hubRank as as, communityHasFrame as at, CapsRefusedError as au, enrollHelloFrame as av, TURN_VISIBLE_MS as ax, APP_BUNDLE_MAGIC as ay, buildX401ProofRequest as b, fromBase64Url as bC, normalizeRelayUrl as bS, newHandoffId as b_, parseInvoiceCallback as ba, INVITE_MAX_LENGTH as bb, readWake as bc, rankTransports as bd, dhtEditId as bf, HANDOFF_ATTEMPTS as bg, MAX_CHUNK_PAYLOAD_BYTES as bh, decodeDidDhtPacket as bi, SESSION_RECEIVE_PENDING as bl, sealPair as bm, groupMetaPicture as bn, PairingTracker as bo, STATUS_CARD_LIMITS as bp, ATPROTO_PROOF_SCOPE as br, PairedCalls as bs, KNOCK_TTL_MS as bt, IDENTITY_MAX_VALIDITY as bu, inboxRecord as bv, TURN_SLOTS as bx, isAppPath as by, readX401DcqlQuery as c, MAX_AVATAR_SIDE as cC, REQUESTS_PER_MINUTE as cS, handoffHelloFrame as c_, pubkyProofCapability as ca, readContactLink as cb, DEVICE_WAKE_TTL_SECONDS as cc, ringAuthorization as cd, isPlayableVideoType as cf, LEGACY_SERVICES as cg, HttpHost as ch, parseDid as ci, SERVICES_CAPABILITY as cl, verifyCommit as cm, wireMentions as cn, SWITCH_RETIRE_MS as co, pairedReplyAuthor as cp, decodeWitness as cr, mergeBeacon as cs, communityUntaggedHash as ct, dialDescriptors as cu, formatEnrollDigits as cv, turnPutSummary as cx, APP_FORBIDDEN_KEYS as cy, newX401HolderKey as d, MAX_NICK_LENGTH as dC, SIGNALING_ALLOWANCE_SHARE as dS, handoffPakeFrame as d_, decodeSvcbRecords as da, DEVICE_INVITE_OWN_DEVICE as db, WAKE_CALL_WAIT_MS as dc, validRingKey as dd, EDITED_FRAME as df, decodeServices as dg, relativizeLocation as dh, parseDidSignaturePaste as di, SessionCapabilities as dl, confirmationMatches as dm, MAX_GROUP_META_BODY as dn, pairedMessageFits as do, wireReply as dp, hash160 as dr, pickHubs as ds, encodeCommunityLink as dt, parsePacketTransports as du, verifyEnrollProof as dv, TURN_BODY_BYTES as dx, APP_SCREENSHOTS_DIR as dy, sign as eC, GROUP_BURST_ONE_LINK as eS, handoffContextProof as e_, BITCOIN_NETWORKS as ea, readImageMeta as eb, nextPinNumber as ec, proofStatement as ed, voiceDownloadName as ef, LABEL$1 as eg, UNUSED_INVITE_READS_PER_MINUTE as eh, didJwsAlg as ei, BUTTONS_CAPABILITY as el, expectedRoster as em, meshMessageRef as en, PAIRING_RETRY_MS as eo, readDhtReactions as ep, decodeBase64 as er, COMMUNITY_TOPOLOGY as es, COMMUNITY_PROFILE as et, CAPS_LIMITS as eu, enrollCancelFrame as ev, seedSigner as ex, requestPlaintextBytes as ey, readX401SdJwtVc as f, hasVisible as fC, SIGNALING_WINDOW_MS as fS, handoffReleaseFrame as f_, encodeSvcbPacket as fa, createDeviceInvite as fb, WAKE_FRAME as fc, verifyRingAuthorization as fd, EDIT_BUFFER_MAX as ff, encodeServices as fg, resolveTargetUrl as fh, signingKeys as fi, TYPING_CAPABILITY as fl, confirmationTag as fm, MAX_GROUP_NAME_BYTES as fn, pairedMessageFrame as fo, ACTIVE_TASK_STATUSES as fp, sha256d as fr, rankHubs as fs, leaveStatement as ft, IDENTITY_CHALLENGE_WINDOW as fu, FLOOD_PER_DAY as fv, TURN_LABEL as fx, APP_VIEWS as fy, X401_LIMITS as g, trimEndOf as gC, WATCH_SHARE as gS, handoffVerifiedFrame as g_, LNURL_LIMITS as ga, readDeviceInvite as gb, WakeLimiter as gc, automaticTransport as gd, EDIT_RECEIVE_LIMIT as gf, servicesFromWire as gg, webLocalFetch as gh, DID_DHT_PREFIX as gi, sessionCapabilitiesFrame as gl, epochKeys as gm, groupDisplayName as gn, EngineError as go, PR_CHECKS as gp, varBytes as gr, shouldBeHub as gs, signCommunity as gt, IDENTITY_FRAME_WINDOW_MS as gu, NEW_PER_HOUR as gv, TURN_NO_ACTIVE as gx, buildAppBundle as gy, X401_HEADERS as h, stripHidden as hC, TURN_SOURCE_TIMEOUT_MS as hS, handoffStreamKey as h_, LIGHTNING_DESTINATION_PATTERN as ha, encodeDeviceInvite as hb, WAKE_TTL_SECONDS as hc, TRANSPORTS as hd, EDIT_RATE_WINDOW_MS as hf, serviceIdFromName as hg, viewerResponseHeaders as hh, DID_DHT_MAX_PAYLOAD as hi, parseSessionCapabilities as hl, encryptText as hm, encodeGroupMetaBody as hn, ENGINE_ERRORS as ho, ITEM_STATES as hp, u64 as hr, readLobby as hs, shortHash as ht, IDENTITY_FRAME_LIMIT as hu, MAX_WAITING as hv, TURN_NAME_BYTES as hx, assembleAppBundle as hy, x401ApprovalDigest as i, generateEncryptionKey as iC, HEDGE_MISSING_MS as iS, handoffEphemeral as i_, isPubkyKey as ia, CONTACT_LINK_BYTES as ib, pinIsNewer as ic, validExternalKey as id, voicePeaksOf as if, emptyLinkRecords as ig, presenceSeenAt as ih, didWebFileNames as ii, FILES_CAPABILITY as il, rosterHas as im, MENTION_LIMITS as in, RACE_RELAYED_MS as io, PAIRED_REPLY_AUTHORS as ip, compactSize as ir, freshHubs as is, communityGroupId as it, CapsKeys as iu, enrollGrantFrame as iv, TURN_SETTLE_MS as ix, APP_BUNDLE_LIMITS as iy, readX401ProofResult as j, __exportAll as jC, heldBackError as jS, readHandoffPake as j_, findEndpoint as ja, inviteQrText as jb, generateVapidKeys as jc, emptyDhtDeliveryState as jd, linksIn as jf, HANDOFF_LATER_BYTES as jg, RTC_SIGNAL_MAX_AGE_MS as jh, ETHEREUM_USDT as ji, DOMAIN_FILE_MAX_BYTES as jl, STALLED_EVIDENCE_MS as jm, signGroupMeta as jn, readGroupWant as jo, sameButtonText as jp, atprotoCidFor as jr, TYPING_FRAME as js, GROUP_WAKE_GROUP_LIMIT as jt, identityRevocationValue as ju, MAX_SEEN as jv, signTurnBody as jx, appRef as jy, readX401ProofResponse as k, __commonJSMin as kC, DiscoveryBudgetError as kS, readHandoffHello as k_, cashuRequestPayload as ka, inviteOwnership as kb, decryptPushPayload as kc, DhtDelivery as kd, canonicalUrl as kf, HANDOFF_HAVE as kg, DATA_CHANNEL_LABEL as kh, resolveDidDht as ki, DNS_LABEL as kl, OFFER_HOST_GATHER_MS as km, parseGroupMetaStatement as kn, readGroupFileMeta as ko, checkStatusCard as kp, AtprotoCid as kr, transferEnded as ks, readKnocks as kt, emptyIdentityLedger as ku, KNOCK_SLOT_LABEL as kv, readTurnPacket as kx, APP_STATEMENT_LIMITS as ky, x401VpToken as l, jpegSize$1 as lC, RelayTransport as lS, handoffManifestFrames as l_, pubkyProofFile as la, DEVICE_INVITE_BYTES as lb, WAKE_CALL_INTERVAL_MS as lc, ringClaims as ld, isVideoMime as lf, MAX_SERVICES as lg, formatLocalTarget as lh, parseDidDocument as li, SESSION_CAPABILITIES_FRAME as ll, verifyCommitSignature as lm, GROUP_META_PAST as ln, UNPROVEN_AUTH_MS as lo, readReply as lp, encodeTx as lr, mergeLobby as ls, decodeCommunityLink as lt, emptyCapsState as lu, readEnrollGrant as lv, TOMBSTONE_SEQUENCE as lx, APP_ICON_PATH as ly, x401HolderJwk as m, sanitizeNick as mC, SLOW_MS as mS, handoffRetryAfter as m_, pubkyHomeserverOf as ma, deviceInviteJoinerParams as mb, WAKE_SUBJECT as mc, RELAY_URL as md, EDIT_FRAME as mf, isViewerTag as mg, sanitizeResponseHeaders as mh, strictBase64Url as mi, WAKE_SESSION_CAPABILITY as ml, edgeParams as mm, MAX_GROUP_PICTURE_LENGTH as mn, publishFailure as mo, BUTTON_STYLES as mp, u32$1 as mr, readBeaconHead as ms, rosterHash as mt, IDENTITY_CLOCK_SKEW as mu, MAX_MISSED as mv, TURN_MAX as mx, appViewOf as my, X401_RESPONSE_MODES as n, decrypt as nC, GROUP_RATION_WINDOW_MS as nS, handoffDigest as n_, PUBKY_PROOF_MAX_BYTES as na, canonicalJsonBytes as nb, parsePinnedFrame as nc, storageProofBody as nd, voiceLevel as nf, RECORD_TTL as ng, WATCH_PEER_MS as nh, didWebDocumentUrl as ni, EDIT_CAPABILITY as nl, rememberAlone as nm, validEditText as nn, RACE_ANSWERED_MS as no, validReactionNumber as np, BitcoinAddressError as nr, beaconRecords as ns, GROUP_READ_NOTE_COMMUNITY as nt, CAPS_REFRESH_MS as nu, enrollDigits as nv, TURN_PUT_WINDOW_MS as nx, seenEntry as ny, matchX401Dcql as o, tryDecrypt as oC, PREVIOUS_DEFAULT_RELAYS as oS, handoffFileRequestFrame as o_, newPubkyProofFolder as oa, createContactLink as ob, pinnedFrame as oc, verifyPeerProof as od, VIDEO_LIMITS as of, parseLinkRecords as og, GhostlyHttpError as oh, didWebHost as oi, PIN_CAPABILITY as ol, sortRoster as om, mentionsMember as on, RESUME_WAIT_MS as oo, REPLY_LIMITS as op, decodeBitcoinAddress as or, lobbyKeys as os, communityMessageId as ot, DHT_TEXT_CAPABILITY as ou, enrollMessage as ov, classifyTurnRead as ox, APP_CLIENTS as oy, sameX401HolderJwk as p, sanitizeDisplayText as pC, SLOW_DEMOTE_MS as pS, handoffRequestFrame as p_, homeserverWebEndpoint as pa, deviceInviteJoinerKeyZ32 as pb, WAKE_INTERVAL_MS as pc, verifyRingEvidence as pd, EDIT_BUFFER_MS as pf, isValidServiceId as pg, sanitizeRequestHeaders as ph, staticDidDocument as pi, UPGRADE_CAPABILITY as pl, decryptText as pm, MAX_GROUP_NAME_LENGTH as pn, parsePaymentNetworks as po, BUTTON_ID as pp, txHash as pr, readBeacon as ps, leftStatement as pt, IDENTITY_CHECK_UNAVAILABLE as pu, MAX_DONE as pv, TURN_LAST_SEQUENCE as px, appDigest as py, signAppStore as q, encodeTxtPacket as qS, DEVICE_KINDS as q_, INVITER_DIAL_GRACE_MS as qa, deviceLinkSealKey as qb, appOpenFrame as qc, baseMime as qd, parseReactedFrame as qf, handoffAckFrame as qg, heardCallSignal as qh, walletNetworkOf as qi, recordsFromWellKnown as ql, OFFER_LOOK_MS as qm, legacyMessageHash as qn, NO_HUB_POLICY as qo, MAX_GROUP_CHAIN as qp, DID_JWS_MAX_LENGTH as qr, COMMUNITY_PIN_FRAME as qs, groupMessageId as qt, STORAGE_ROOT as qu, linkRecords as qv, CHAT_RESERVE_MOST_SHARE as qx, verifyAppSignature as qy, readX401OpenId4VpRequest as r, encrypt as rC, GROUP_SIGNALING_ALLOWANCE_SHARE as rS, handoffDoneFrame as r_, PUBKY_PROOF_ROOT as ra, readCanonicalJson as rb, pinFrame as rc, storageProofPath as rd, voiceLevelsOf as rf, buildLinkRecords as rg, countUnusedInvite as rh, didWebFile as ri, FILES_BINARY_CAPABILITY as rl, rosterAdmin as rm, MENTION_EVERYONE as rn, RACE_DIRECT_MS as ro, wireReaction as rp, ByteReader as rr, doorHubs as rs, communityCommitHash as rt, CapsExchange as ru, enrollDoneFrame as rv, TURN_RAISE_READ_TIMEOUT_MS as rx, stampHolds as ry, presentX401SdJwtVc as s, MAX_AVATAR_LENGTH as sC, RELAY_REQUESTS_PER_MINUTE as sS, handoffHaveFrames as s_, normalizePubkyKey as sa, encodeContactLink as sb, readPin as sc, RING_LIFETIME as sd, formatVideoDuration as sf, HTTP_SERVICE_PROTO as sg, HttpClient as sh, normalizeDid as si, REACTIONS_CAPABILITY as sl, verifyChain as sm, validMentions as sn, RTC_UNSTARTED_MS as so, groupReplyAuthor as sp, decodeTx as sr, lobbyRecords as ss, communityRoster as st, capsDescriptors as su, enrollProofFrame as sv, keptAtEqualSequence as sx, APP_CLIENT_NAME as sy, X401_REQUEST_LIMITS as t, verify as tC, GROUP_OVER_PACE_MS as tS, handoffDataFrame as t_, isBitcoinAddress as ta, canonicalJson as tb, parsePinFrame as tc, storageProof as td, voiceFileName as tf, MAX_MSGS_PAYLOAD_B64 as tg, UNUSED_INVITE_WAIT_MAX_MS as th, didSignedMessages as ti, CALLS_CAPABILITY as tl, parseGroupCommit as tm, parseCommunityEdit as tn, PONG_WAIT_MS as to, readReaction as tp, verifyBip322 as tr, beaconKeys as ts, CommunitySession as tt, CAPS_PUBLISH_SPACING_MS as tu, enrollCancelReason as tv, webCryptoSigner as tx, requestRecords as ty, X401_CREDENTIAL_LIMITS as u, sanitizeAvatar as uC, RelaysFailedError as uS, handoffOfferFrame as u_, pubkyProofPath as ua, DEVICE_INVITE_LIFETIME_S as ub, WAKE_CALL_TTL_SECONDS as uc, ringEvidence as ud, parseVideoMeta as uf, SERVICES_VERSION as ug, parseLocalTarget as uh, parseDidJws as ui, STATUS_CARD_CAPABILITY as ul, GROUP_PROFILE as um, GROUP_META_PAST_CHARS as un, WAKE_LOST_MS as uo, replySnippet as up, encodeWitness as ur, newerHead as us, derivedSecret as ut, encodePacketTransports as uu, readEnrollHello as uv, TOMBSTONE_TURN as ux, APP_PERMISSIONS as uy, X401_SCHEME as v, concatBytes as vC, WRITE_FIRST_MS as vS, handoffVersions as v_, findLightningDestination as va, INVITE_HRP as vb, newWakeToken as vc, irohDescriptor as vd, MAX_EDITS_PER_MESSAGE as vf, viewerTag as vg, CHUNK_KIND as vh, DID_DHT_VERSION as vi, PairedSession as vl, openPair as vm, groupMetaChange as vn, engineText as vo, ROUTINE_STATES as vp, ATPROTO_FULL_SCOPE as vr, MAX_PAIRED_CALL_SIGNAL as vs, verifyCommunityCommit as vt, IDENTITY_MAX_FRAME as vu, clearMissed as vv, TURN_SEALED_BYTES as vx, findAppForbiddenKey as vy, decodeX401Header as w, toBase64 as wC, BREAKER_ALL_DOWN_PROBE_MS as wS, readHandoffCancel as w_, resolveLightningDestination as wa, createLink as wb, wakePayload as wc, DHT_FILE_REFUSED as wd, parseEditedFrame as wf, HANDOFF_CANCEL_REASONS as wg, encodeChunk as wh, didDhtRecords as wi, HoldKeys as wl, CONNECT_TIMEOUT_MS as wm, keepPastGroupMeta as wn, GROUP_WANT_FRAME as wo, cardEditNumber as wp, checkAtprotoProofRecord as wr, FILE_FRAMES as ws, entryParams as wt, IDENTITY_STATEMENT_PREFIX as wu, takeRequest as wv, encodeTurnFields as wx, readAppBundleAsync as wy, buildX401ProofResult as x, fromZ32 as xC, readRelayBody as xS, openHandoffPiece as x_, parseLightningDestination as xa, INVITE_VERSION as xb, readWakePayload as xc, relayedTransports as xd, editFrame as xf, HANDOFF_BUSY as xg, PROTOCOL_VERSION as xh, didDhtDocument as xi, HOLD_CAPABILITY as xl, sealSecret as xm, groupMetaTag as xn, GROUP_FILE_LIMITS as xo, TASK_STATUSES as xp, atprotoDidMethod as xr, parsePairedCallFrame as xs, MAX_KNOCKS as xt, IDENTITY_PROOF_CAPABILITY as xu, newInbox as xv, TURN_TTL as xx, isAppUrl as xy, X401_VERSION as y, fromBase64 as yC, currentRelays as yS, isHandoffPartName as y_, invoiceCallbackUrl as ya, INVITE_LINK_ORIGIN as yb, parseWakeFrame as yc, irohRelayUrl as yd, RateWindow as yf, HANDOFF_ACK as yg, LIMITS as yh, DidDhtError as yi, SESSION_FRAME_MAX as yl, openSecret as ym, groupMetaNewer as yn, parseEngineError as yo, RUN_RESULTS as yp, ATPROTO_PROOF_COLLECTION as yr, PAIRED_CALL_FRAME as ys, GROUP_ENTRY_PROFILE as yt, IDENTITY_MAX_RECEIVED as yu, endedRequests as yv, TURN_SIGNED_BYTES as yx, isAppLicense as yy, planAppUpdate as z, measureRecords as zS, SET_UPDATE as z_, CROSSED_PROBE_MS as za, HANDOFF_CAPABILITY as zb, APP_RATE_WINDOW_MS as zc, formatFileSize as zd, COMMUNITY_REACTION_FRAME as zf, HANDOFF_REQUEST as zg, RTC_CONFIG as zh, WALLET_NETWORKS as zi, domainTxtRecord as zl, DEPARTED_READ_MS as zm, parseSshPublicKey as zn, SIGNAL_FRESH_MS as zo, heardTime as zp, readAtprotoCid as zr, TypingReceiver as zs, parseGroupWakeFrame as zt, verifyIdentityPresentation as zu, STAMP_BITS_DEFAULT as zv, turnReleaseMessage as zx, isAppSignature as zy };
35189
+ export { COMMUNITY_LIMITS as $, toZ32 as $C, BREAKER_MAX_MS as $S, readHandoffDone as $_, MAX_PAIRED_MESSAGE_FRAME as $a, encodeGhostlyInvite as $b, APP_DATA_MAX_BYTES as $c, dhtFileElements as $d, linksIn as $f, HANDOFF_DONE as $g, DATA_CHANNEL_ID as $h, sparkAddressKind as $i, DOMAIN_TXT_MAX_BYTES as $l, GATHER_STALL_MS as $m, bip322MessageHash as $n, parseHubPolicy as $o, checkStatusCard as $p, checkDidJws as $r, PIN_FRAME as $s, carryMentions as $t, isIdentityBinding as $u, CONTACT_RECORD_TTL as $v, nextTurnPosition as $x, yieldThread as $y, readX401ProofResponseHeader as A, encrypt as AC, GROUP_SIGNALING_ALLOWANCE_SHARE as AS, handoffDoneFrame as A_, ENDPOINT as Aa, readCanonicalJson as Ab, checkPushEndpoint as Ac, validRingKey as Ad, EDITED_FRAME as Af, buildLinkRecords as Ag, unusedInviteWait as Ah, openDidDhtPayload as Ai, SessionCapabilities as Al, signCommit as Am, parseGroupMetaFrame as An, isGroupMessageId as Ao, pairedReplyAuthor as Ap, shortAtprotoDid as Ar, refusalText as As, mergeKnocks as At, parsePacketTransports as Au, enrollDoneFrame as Av, TURN_RAISE_READ_TIMEOUT_MS as Ax, stampHolds as Ay, APP_STORE_KINDS as B, sanitizeDisplayText as BC, SLOW_DEMOTE_MS as BS, handoffRequestFrame as B_, CROSSED_FRESH_MS as Ba, deviceInviteJoinerKeyZ32 as Bb, APP_RANGE_LIMITS as Bc, relayedTransports as Bd, RateWindow as Bf, isValidServiceId as Bg, viewerResponseHeaders as Bh, USDT_PUBLIC_RPC as Bi, HOLD_CAPABILITY as Bl, encryptText as Bm, SshSigError as Bn, SIGNAL_CARRIERS as Bo, PR_STATES as Bp, parseAtprotoVerificationKey as Br, TYPING_TIMEOUT_MS as Bs, mentionedMembers as Bt, IDENTITY_PROOF_CAPABILITY as Bu, MAX_DONE as Bv, TURN_LAST_SEQUENCE as Bx, appDigest as By, buildX401TokenObject as C, createIdentity as CC, DEFAULT_RELAYS as CS, handoffAttemptSucceeded as C_, parseLightningDestination as Ca, imageSize as Cb, readWakePayload as Cc, validExternalKey as Cd, voicePeaksOf as Cf, pickCallCandidates as Cg, STALLED_LOOK_MS as Ch, didDhtDocument as Ci, FILES_CAPABILITY as Cl, commitHash as Cm, groupMetaTag as Cn, GROUP_FILE_LIMITS as Co, readReaction as Cp, atprotoDidMethod as Cr, parsePairedCallFrame as Cs, MAX_KNOCKS as Ct, CapsKeys as Cu, ENROLL_DONE as Cv, newDeviceSetSecret as Cx, mergeContactKnocks as Cy, readX401ProofRequest as D, sign as DC, GROUP_BURST_ONE_LINK as DS, handoffContextProof as D_, BOLT11_PATTERN as Da, readImageMeta as Db, wakeRequest as Dc, ringAuthorization as Dd, isPlayableVideoType as Df, LABEL$1 as Dg, WATCH_PEER_MS as Dh, encodeDidDhtDeactivated as Di, SERVICES_CAPABILITY as Dl, rememberAlone as Dm, nextGroupMetaRevision as Dn, GROUP_WANT_NO_FRAME as Do, REPLY_ID as Dp, isAtprotoDid as Dr, FILE_LIMITS as Ds, groupEntryUrl as Dt, dialDescriptors as Du, enrollCancelFrame as Dv, seedSigner as Dx, requestPlaintextBytes as Dy, isX401Protocol as E, publicKeyFromZ32 as EC, GROUP_BURST_MS as ES, handoffContext as E_, resolveLightningDestination as Ea, previewable as Eb, wakePayload as Ec, RING_LIFETIME as Ed, formatVideoDuration as Ef, waitForIceGathering as Eg, UNUSED_INVITE_WAIT_MAX_MS as Eh, didDhtRecords as Ei, REACTIONS_CAPABILITY as El, parseGroupCommit as Em, keepPastGroupMeta as En, GROUP_WANT_FRAME as Eo, PAIRED_REPLY_AUTHORS as Ep, checkAtprotoProofRecord as Er, FILE_FRAMES as Es, entryParams as Et, capsDescriptors as Eu, ENROLL_PROOF as Ev, verifyDeviceTransports as Ex, readLinkRecord as Ey, appRevocationFor as F, MAX_AVATAR_SIDE as FC, REQUESTS_PER_MINUTE as FS, handoffHelloFrame as F_, parseCashuRequestPayload as Fa, readContactLink as Fb, vapidAuthorization as Fc, automaticTransport as Fd, EDIT_RECEIVE_LIMIT as Ff, LEGACY_SERVICES as Fg, parseLocalTarget as Fh, ONCHAIN_PROVIDER as Fi, sessionCapabilitiesFrame as Fl, GROUP_PROFILE as Fm, wrapGroupMeta as Fn, CARRIED_DEFER_MS as Fo, BUTTON_ID as Fp, decodeDagCbor as Fr, TYPING_RATE_LIMIT as Fs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ft, IDENTITY_FRAME_WINDOW_MS as Fu, formatEnrollDigits as Fv, turnPutSummary as Fx, APP_FORBIDDEN_KEYS as Fy, readAppStore as G, concatBytes as GC, WRITE_FIRST_MS as GS, handoffVersions as G_, DHT_PIN_GRACE_MS as Ga, INVITE_HRP as Gb, appRangeEndFrame as Gc, DHT_MESSAGE_TTL as Gd, parseEditedFrame as Gf, viewerTag as Gg, MAX_CHUNK_PAYLOAD_BYTES as Gh, formatPaymentAmount as Gi, isHoldUrl as Gl, sealPair as Gm, sshKeyDigestHex as Gn, groupSignalFrame as Go, TASK_STATUSES as Gp, DID_DOCUMENT_MAX_BYTES as Gr, sanitizeTypingStatus as Gs, GroupSession as Gt, IdentityCheckUnavailable as Gu, clearMissed as Gv, TURN_SEALED_BYTES as Gx, findAppForbiddenKey as Gy, checkAppListing as H, stripHidden as HC, TURN_SOURCE_TIMEOUT_MS as HS, handoffStreamKey as H_, CROSSED_WAIT_MS as Ha, encodeDeviceInvite as Hb, appRangeCancelFrame as Hc, ACTIVE_DHT_POLL_MS as Hd, editFrame as Hf, serviceIdFromName as Hg, CHUNK_FLAG_END as Hh, arkAddressPrefix as Hi, HOLD_LIMITS as Hl, newEpochSecret as Hm, parseSshSignature as Hn, SIGNAL_HOLD_MS as Ho, ROUTINE_STATES as Hp, unsignedCommitBytes as Hr, TypingSender as Hs, GROUP_LIMITS as Ht, IDENTITY_REVOCATION_LABEL as Hu, MAX_WAITING as Hv, TURN_NAME_BYTES as Hx, assembleAppBundle as Hy, appStoreDecision as I, jpegSize$1 as IC, RelayTransport as IS, handoffManifestFrames as I_, parseFedimintRequestPayload as Ia, DEVICE_INVITE_BYTES as Ib, vapidKeysMatch as Ic, checkedDescriptors as Id, EDIT_SEND_LIMIT as If, MAX_SERVICES as Ig, relativizeLocation as Ih, PaymentPreflightError as Ii, PAIRED_PROFILE as Il, confirmationMatches as Im, SSHSIG_MAX_ARMOR as In, CarriedTransport as Io, BUTTON_STYLES as Ip, encodeDagCbor as Ir, TYPING_RATE_WINDOW_MS as Is, GROUP_WAKE_RECEIVE_LIMIT as It, IDENTITY_MAX_EVIDENCE as Iu, readEnrollGrant as Iv, TOMBSTONE_SEQUENCE as Ix, APP_ICON_PATH as Iy, GROUP_TYPING_FRAME as J, fromZ32 as JC, readRelayBody as JS, openHandoffPiece as J_, HANDLED_WAIT_MS as Ja, INVITE_VERSION as Jb, decodeAppRangeData as Jc, DhtDelivery as Jd, validRemovalNumber as Jf, HANDOFF_BUSY as Jg, decodeControl as Jh, validatePaymentTarget as Ji, DNS_LABEL as Jl, ANSWER_REFUSED_REDIALS as Jm, isLegacySignature as Jn, MESH_HUBS as Jo, cardEditNumber as Jp, DID_JWS_ALGS as Jr, typingKindOf as Js, frameBytes as Jt, emptyIdentityLedger as Ju, newInbox as Jv, TURN_TTL as Jx, isAppUrl as Jy, readAppStoreSteps as K, fromBase64 as KC, currentRelays as KS, isHandoffPartName as K_, EARLY_DIAL_JOIN_MS as Ka, INVITE_LINK_ORIGIN as Kb, appRangeErrorFrame as Kc, DHT_TEXT_BYTES as Kd, validEditMessage as Kf, HANDOFF_ACK as Kg, PROTOCOL_VERSION as Kh, isWalletNetwork as Ki, newMailbox as Kl, sealSecret as Km, sshSignCommand as Kn, readGroupSignal as Ko, appCardId as Kp, DID_FILE_MAX_BYTES as Kr, typingActivity as Ks, asWritten as Kt, IdentityExchange as Ku, endedRequests as Kv, TURN_SIGNED_BYTES as Kx, isAppLicense as Ky, appUpdateDecision as L, sanitizeAvatar as LC, RelaysFailedError as LS, handoffOfferFrame as L_, ANSWERS_REFUSED_PAUSES as La, DEVICE_INVITE_LIFETIME_S as Lb, APP_RANGE_DATA_KIND as Lc, irohDescriptor as Ld, MAX_EDITS_PER_MESSAGE as Lf, SERVICES_VERSION as Lg, resolveTargetUrl as Lh, SEPOLIA_TEST_USDT as Li, PairedSession as Ll, confirmationTag as Lm, SSHSIG_NAMESPACE as Ln, GROUP_SIGNAL_FRAME as Lo, CRON_LINE as Lp, findInMst as Lr, TYPING_REFRESH_MS as Ls, GroupWakeLimiter as Lt, IDENTITY_MAX_FRAME as Lu, readEnrollHello as Lv, TOMBSTONE_TURN as Lx, APP_PERMISSIONS as Ly, readX401ProofResultHeader as M, sealedLength as MC, HEDGE_MS as MS, handoffFileMissingFrame as M_, fedimintRequestPayload as Ma, CONTACT_LINK_VERSION as Mb, encryptPushPayload as Mc, verifyRingEvidence as Md, EDIT_BUFFER_MS as Mf, isEmptyLinkPacket as Mg, HttpClient as Mh, signDidDhtPacket as Mi, UPGRADE_CAPABILITY as Ml, verifyChain as Mm, parseGroupMetaTag as Mn, readGroupHave as Mo, replySnippet as Mp, AtprotoProofError as Mr, transferStalled as Ms, GROUP_WAKE_FRAME as Mt, IDENTITY_CHECK_UNAVAILABLE as Mu, enrollHelloFrame as Mv, TURN_VISIBLE_MS as Mx, APP_BUNDLE_MAGIC as My, x401AnswerableRequests as N, tryDecrypt as NC, PREVIOUS_DEFAULT_RELAYS as NS, handoffFileRequestFrame as N_, findEndpoint as Na, createContactLink as Nb, generateVapidKeys as Nc, RELAY_URL as Nd, EDIT_FRAME as Nf, parseLinkRecords as Ng, HttpHost as Nh, ETHEREUM_USDT as Ni, WAKE_SESSION_CAPABILITY as Nl, verifyCommit as Nm, signGroupMeta as Nn, readGroupWant as No, wireReply as Np, atprotoCidFor as Nr, TYPING_FRAME as Ns, GROUP_WAKE_GROUP_LIMIT as Nt, IDENTITY_CLOCK_SKEW as Nu, enrollMessage as Nv, classifyTurnRead as Nx, APP_CLIENTS as Ny, readX401ProofRequestHeader as O, verify as OC, GROUP_OVER_PACE_MS as OS, handoffDataFrame as O_, decodeBolt11 as Oa, canonicalJson as Ob, PUSH_SERVICE_HOSTS as Oc, ringClaims as Od, isVideoMime as Of, MAX_MSGS_PAYLOAD_B64 as Og, countUnusedInvite as Oh, encodeDidDhtPacket as Oi, SESSION_CAPABILITIES_FRAME as Ol, rosterAdmin as Om, openGroupMeta as On, fetchesByItself as Oo, REPLY_LIMITS as Op, normalizeAtprotoHandle as Or, decodeFileData as Os, knockIdentity as Ot, emptyCapsState as Ou, enrollCancelReason as Ov, webCryptoSigner as Ox, requestRecords as Oy, addedAppPermissions as P, MAX_AVATAR_LENGTH as PC, RELAY_REQUESTS_PER_MINUTE as PS, handoffHaveFrames as P_, isFederationId as Pa, encodeContactLink as Pb, pushRequest as Pc, TRANSPORTS as Pd, EDIT_RATE_WINDOW_MS as Pf, HTTP_SERVICE_PROTO as Pg, formatLocalTarget as Ph, EVM_TEST_CHAINS as Pi, parseSessionCapabilities as Pl, verifyCommitSignature as Pm, verifyGroupMetaSignature as Pn, readGroupWantNo as Po, ACTIVE_TASK_STATUSES as Pp, decodeAtprotoCommit as Pr, TYPING_KINDS as Ps, GROUP_WAKE_GROUP_WINDOW_MS as Pt, IDENTITY_FRAME_LIMIT as Pu, enrollProofFrame as Pv, keptAtEqualSequence as Px, APP_CLIENT_NAME as Py, sealGroupTyping as Q, toBase64Url as QC, BREAKER_BASE_MS as QS, readHandoffData as Q_, LIVENESS_PING_MS as Qa, decodeInviteCode as Qb, readAppRangeFrame as Qc, DHT_FILE_CAPABILITY as Qd, linkEnd as Qf, HANDOFF_DATA as Qg, wrapDataChannel as Qh, isSparkAddress as Qi, DOMAIN_METHODS as Ql, GATHER_ATTEMPTS as Qm, MessageRefusal as Qn, meshRendezvous as Qo, cardUrl as Qp, DidError as Qr, PIN_CLOCK_SKEW_MS as Qs, GROUP_EDIT_TEXT_BYTES as Qt, identityStatementText as Qu, turnOff as Qv, firstDeviceSetSecret as Qx, sha256Paced as Qy, checkAppBeforeRun as R, MAX_NICK_LENGTH as RC, SIGNALING_ALLOWANCE_SHARE as RS, handoffPakeFrame as R_, ANSWERS_REFUSED_PAUSE_MS as Ra, DEVICE_INVITE_OWN_DEVICE as Rb, APP_RANGE_ERRORS as Rc, irohRelayUrl as Rd, MAX_REMOVAL_NUMBER as Rf, decodeServices as Rg, sanitizeRequestHeaders as Rh, SEPOLIA_TEST_USDT_FAUCET as Ri, SESSION_FRAME_MAX as Rl, decryptText as Rm, SSH_KEY_TYPES as Rn, GROUP_VERSION_SIGNALS as Ro, ITEM_STATES as Rp, parseAtprotoCar as Rr, TYPING_SEND_LIMIT as Rs, groupWakeFrame as Rt, IDENTITY_MAX_RECEIVED as Ru, verifyEnrollProof as Rv, TURN_BODY_BYTES as Rx, APP_SCREENSHOTS_DIR as Ry, buildX401ResultArtifact as S, IDENTITY_MEMO_SIZE as SC, CHAT_WATCH_SHARE as SS, handoffAttemptFailed as S_, parseInvoiceCallback as Sa, IMAGE_LIMITS as Sb, readWake as Sc, storageProofPath as Sd, voiceLevelsOf as Sf, parseCallSignal as Sg, RELAY_POLL_INTERVALS as Sh, decodeDidDhtPacket as Si, FILES_BINARY_CAPABILITY as Sl, SAID_AGAIN as Sm, groupMetaPicture as Sn, PairingTracker as So, readDhtReactions as Sp, ATPROTO_PROOF_SCOPE as Sr, PairedCalls as Ss, KNOCK_TTL_MS as St, CapsExchange as Su, ENROLL_CANCEL_REASONS as Sv, devicePingFrame as Sx, makeStampPaced as Sy, encodeX401Header as T, identityFromSeedB64 as TC, FRESH_READ_MS as TS, handoffCancelFrame as T_, requestLnurlInvoice as Ta, parseImageMeta as Tb, wakeFrame as Tc, verifyPeerProof as Td, VIDEO_LIMITS as Tf, signalHasVideo as Tg, UNUSED_INVITE_READS_PER_MINUTE as Th, didDhtKey as Ti, PIN_CAPABILITY as Tl, expectedRoster as Tm, groupName as Tn, GROUP_VERSION_FILES as To, wireReaction as Tp, atprotoProofRkey as Tr, FILE_DATA_KIND as Ts, encodeGroupEntryLink as Tt, DHT_TEXT_CAPABILITY as Tu, ENROLL_HELLO as Tv, unsignedDeviceTransports as Tx, readKnockSlot as Ty, checkAppStoreIndex as U, trimEndOf as UC, WATCH_SHARE as US, handoffVerifiedFrame as U_, DEMOTE_AFTER_FAILURES as Ua, readDeviceInvite as Ub, appRangeChunk as Uc, DHT_FILE_REFUSED as Ud, editedFrame as Uf, servicesFromWire as Ug, CHUNK_KIND as Uh, assertTokenUnits as Ui, HoldKeys as Ul, openPair as Um, sameSshKey as Un, SIGNAL_PROVEN_MS as Uo, RUN_RESULTS as Up, verifyAtprotoRecordProof as Ur, parseTypingActivity as Us, GROUP_REACTED_FRAME as Ut, IDENTITY_STATEMENT_PREFIX as Uu, NEW_PER_HOUR as Uv, TURN_NO_ACTIVE as Ux, buildAppBundle as Uy, APP_STORE_LIMITS as V, sanitizeNick as VC, SLOW_MS as VS, handoffRetryAfter as V_, CROSSED_PROBE_MS as Va, deviceInviteJoinerParams as Vb, AppRanges as Vc, transportOrder as Vd, dhtEditId as Vf, isViewerTag as Vg, webLocalFetch as Vh, WALLET_NETWORKS as Vi, HOLD_DATED_BACK_MS as Vl, epochKeys as Vm, parseSshPublicKey as Vn, SIGNAL_FRESH_MS as Vo, REMOVABLE_KINDS as Vp, readAtprotoCid as Vr, TypingReceiver as Vs, parseGroupWakeFrame as Vt, IDENTITY_PROVIDER_ID as Vu, MAX_MISSED as Vv, TURN_MAX as Vx, appViewOf as Vy, readAppListing as W, bytesEqual as WC, WAY_BACK_SHARE as WS, handoffVerifiedMessage as W_, DEMOTE_MS as Wa, DEVICE_INVITE_VERSION as Wb, appRangeDataFrame as Wc, DHT_FILE_TOO_LARGE as Wd, parseEditFrame as Wf, servicesToWire as Wg, LIMITS as Wh, assertWholeSats as Wi, HoldRefusedError as Wl, openSecret as Wm, sshFingerprint as Wn, SIGNAL_REPLY_MS as Wo, STATUS_CARD_LIMITS as Wp, verifyAtprotoSignature as Wr, parseTypingFrame as Ws, GROUP_READ_NOTE as Wt, IDENTITY_SUBJECT as Wu, REOPEN_BELOW as Wv, TURN_REV_LIMIT as Wx, checkAppManifest as Wy, groupTypingEpoch as X, randomBytes as XC, traceLink as XS, readHandoffBusy as X_, INVITE_TAKEN as Xa, createChatInvite as Xb, isServeId as Xc, emptyDhtDeliveryState as Xd, LINK_PREVIEW_LIMITS as Xf, HANDOFF_CANCEL as Xg, encodeControl as Xh, SPARK_NETWORKS as Xi, DOMAIN_FILE_MAX_BYTES as Xl, DATA_SETTLE_MS as Xm, verifyBitcoinMessage as Xn, mayBeHub as Xo, cardLinkHost as Xp, DID_MAX_LENGTH as Xr, GROUP_PIN_FRAME as Xs, COMMUNITY_EDIT_FRAME as Xt, identityRevocationValue as Xu, settleRequest as Xv, TurnRecordError as Xx, readAppBundle as Xy, GroupTypingBoard as Y, isZ32Key as YC, setLinkTraceSink as YS, readHandoffAck as Y_, INVITER_DIAL_GRACE_MS as Ya, OwnInviteError as Yb, encodeAppRangeData as Yc, LIVE_POLL_MS as Yd, LINK_MAX_CHARS as Yf, HANDOFF_BUSY_REASONS as Yg, encodeChunk as Yh, walletNetworkOf as Yi, DNS_TYPE as Yl, CONNECT_TIMEOUT_MS as Ym, legacyMessageHash as Yn, NO_HUB_POLICY as Yo, cardLine as Yp, DID_JWS_MAX_LENGTH as Yr, COMMUNITY_PIN_FRAME as Ys, groupMessageId as Yt, identityPresentationBytes as Yu, planKnocks as Yv, TURN_VERSION as Yx, pacer as Yy, openGroupTyping as Z, toBase64 as ZC, BREAKER_ALL_DOWN_PROBE_MS as ZS, readHandoffCancel as Z_, LIVENESS_MISSED_PINGS as Za, createLink as Zb, parseAppRangeFrame as Zc, peekDhtMailbox as Zd, canonicalUrl as Zf, HANDOFF_CANCEL_REASONS as Zg, sendBody as Zh, SPARK_PROVIDER as Zi, DOMAIN_MAX_RECORDS as Zl, DataLink as Zm, BIP322_REVISION as Zn, meshHubs as Zo, cardTimeUtc as Zp, DID_METHODS as Zr, PINNED_FRAME as Zs, GROUP_EDIT_FRAME as Zt, identityStatement as Zu, takeRequest as Zv, encodeTurnFields as Zx, readAppBundleAsync as Zy, X401_PROTOCOLS as _, signRelayPayload as _C, BACKGROUND_REQUESTS_PER_MINUTE as _S, NO_ATTEMPTS as __, LIGHTNING_DESTINATION_PATTERN as _a, signAppObject as _b, WAKE_TTL_SECONDS as _c, proofCapability as _d, parseVoiceMeta as _f, decompressSdp as _g, OFFER_FAST_MS as _h, DID_DHT_MAX_PAYLOAD as _i, APPS_CAPABILITY as _l, LEGACY_GROUP_MEMBERS as _m, encodeGroupMetaBody as _n, ENGINE_ERRORS as _o, queueReaction as _p, u64 as _r, readLobby as _s, shortHash as _t, CAPS_ISSUED_BACK_MS as _u, setUpdateMessage as _v, deviceLinkPairing as _x, knockSlotIdentity as _y, X401_DCQL_LIMITS as a, isDiscoveryBudgetError as aC, signTurnPacket as aS, HANDOFF_LIST_PER_FRAME as a_, PUBKY_PROOF_ROOT as aa, appRefPublisher as ab, pinFrame as ac, IDENTITY_TIMELINE_MAX as ad, safeBlobType as af, offerIsFresh as ag, DIRECT_PEERS as ah, didWebFile as ai, APP_SEND_LIMIT as al, taskProgress as am, MENTION_EVERYONE as an, RACE_DIRECT_MS as ao, forwardedMany as ap, ByteReader as ar, doorHubs as as, communityHasFrame as at, domainWellKnownFile as au, readHandoffRelease as av, __require as aw, ownInviteRefusal as ax, MAX_SLOT_KNOCKS as ay, buildX401ProofRequest as b, encodeTxtPacket as bC, CHAT_RESERVE_MOST_SHARE as bS, handoffAckFrame as b_, findLightningDestination as ba, verifyAppSignature as bb, newWakeToken as bc, storageProof as bd, voiceFileName as bf, isGlobalIpv4Host as bg, PRESENCE_HEARTBEAT as bh, DID_DHT_VERSION as bi, CALLS_CAPABILITY as bl, MEMBER_KEY as bm, groupMetaChange as bn, engineText as bo, reactionFrame as bp, ATPROTO_FULL_SCOPE as br, MAX_PAIRED_CALL_SIGNAL as bs, verifyCommunityCommit as bt, CAPS_PUBLISH_SPACING_MS as bu, DEVICE_KINDS as bv, deviceLinkSealKey as bx, linkRecords as by, readX401DcqlQuery as c, PKARR_FUTURE_SKEW_MS as cC, turnKeys as cS, HANDOFF_PAKE as c_, newPubkyProofFolder as ca, checkAppRevokeStatement as cb, pinnedFrame as cc, PROOF_ADAPTERS as cd, PLAYABLE_AUDIO as cf, CALL_SIGNAL_MAX_AGE_MS as cg, symmetricNat as ch, didWebHost as ci, appCloseFrame as cl, arrivalKey as cm, mentionsMember as cn, RESUME_WAIT_MS as co, GROUP_REACTION_FRAME as cp, decodeBitcoinAddress as cr, lobbyKeys as cs, communityUntaggedHash as ct, nip05RootKey as cu, sameDigest as cv, DEVICE_CAPABILITIES as cx, REQUEST_LIFETIME_MS as cy, newX401HolderKey as d, createRelayPayload as dC, turnPayloadSequence as dS, HANDOFF_RELEASE as d_, pubkyProofFile as da, isAppRef as db, WAKE_CALL_INTERVAL_MS as dc, STORAGE_LIFETIME as dd, VOICE_METER as df, answersOffer as dg, DHT_POLL_INTERVALS as dh, parseDidDocument as di, appOpenFrame as dl, receivedTimestamp as dm, GROUP_META_PAST as dn, UNPROVEN_AUTH_MS as do, REACTION_FRAME as dp, encodeTx as dr, mergeLobby as ds, encodeCommunityLink as dt, recordsFromTxt as du, SET_ACK as dv, ENROLL_CAPABILITY as dx, REQUEST_TEXT_BYTES as dy, BREAKER_THRESHOLD as eC, openTurnValue as eS, HANDOFF_FILE_MISSING as e_, sparkInvoiceDetails as ea, APP_NAME as eb, PIN_LIMITS as ec, newIdentityBinding as ed, dhtFileId as ef, DATA_CHANNEL_LABEL as eg, OFFER_HOST_GATHER_MS as eh, checkDidSignature as ei, APP_FRAME as el, readStatusCard as em, communityEditFrame as en, PAIRED_FRAME_TOO_LARGE as eo, parseLinkPreview as ep, bip322ToSign as er, pickMeshHubs as es, COMMUNITY_PROFILE as et, NIP05_PATH as eu, readHandoffFileFrame as ev, utf8Decode as ew, encodeInviteCode as ex, ContactRequestError as ey, readX401SdJwtVc as f, measureRecords as fC, turnReleaseMessage as fS, HANDOFF_REQUEST as f_, pubkyProofPath as fa, isAppSignature as fb, WAKE_CALL_TTL_SECONDS as fc, STORAGE_ROOT as fd, baseMime as ff, buildSdpFromSignal as fg, EXPECT_PEER_MS as fh, parseDidJws as fi, chatAppId as fl, shownTime as fm, GROUP_META_PAST_CHARS as fn, WAKE_LOST_MS as fo, REACTION_LIMITS as fp, encodeWitness as fr, newerHead as fs, leaveStands as ft, recordsFromWellKnown as fu, SET_UPDATE as fv, HANDOFF_CAPABILITY as fx, STAMP_BITS_DEFAULT as fy, X401_LIMITS as g, readOwnRelayPayload as gC, turnVerifierMark as gS, HANDOFF_WINDOW as g_, pubkyHomeserverOf as ga, readAppSignature as gb, WAKE_SUBJECT as gc, nostrProofTemplate as gd, isPlayableAudioType as gf, contactRtcConfig as gg, MAX_DHT_TEXT_BYTES as gh, strictBase64Url as gi, readAppFrame as gl, GROUP_VERSION_LARGE as gm, MAX_GROUP_PICTURE_LENGTH as gn, publishFailure as go, parseReactionFrame as gp, u32$1 as gr, readBeaconHead as gs, rosterHash as gt, wellKnownUrl as gu, setUpdateFrame as gv, deviceKeyZ32 as gx, knockHolds as gy, X401_HEADERS as h, parseRelayPayload as hC, turnStatedVerifier as hS, HANDOFF_VERSION as h_, homeserverWebEndpoint as ha, readAppRevocations as hb, WAKE_INTERVAL_MS as hc, isProofAdapter as hd, formatVoiceDuration as hf, compressSdp as hg, LinkSession as hh, staticDidDocument as hi, parseAppFrame as hl, GROUP_MEMBER_CAP as hm, MAX_GROUP_NAME_LENGTH as hn, parsePaymentNetworks as ho, parseReactedFrame as hp, txHash as hr, readBeacon as hs, leftStatement as ht, validDomainRecord as hu, setAckFrame as hv, deviceFrameCapability as hx, contactDay as hy, x401ApprovalDigest as i, heldBackError as iC, signTurnBody as iS, HANDOFF_LATER_BYTES as i_, PUBKY_PROOF_MAX_BYTES as ia, appRef as ib, parsePinnedFrame as ic, verifyIdentityPresentation as id, formatFileSize as if, extractRtcParams as ig, DIRECT_OWN_ATTEMPTS as ih, didWebDocumentUrl as ii, APP_RESUME_GRACE_MS as il, statusCardText as im, validEditText as in, RACE_ANSWERED_MS as io, forwardedAgain as ip, BitcoinAddressError as ir, beaconRecords as is, communityGroupId as it, domainTxtRecord as iu, readHandoffPake as iv, __exportAll as iw, inviteQrText as ix, MAX_SEEN as iy, readX401ProofResult as j, generateEncryptionKey as jC, HEDGE_MISSING_MS as jS, handoffEphemeral as j_, cashuRequestPayload as ja, CONTACT_LINK_BYTES as jb, decryptPushPayload as jc, verifyRingAuthorization as jd, EDIT_BUFFER_MAX as jf, emptyLinkRecords as jg, GhostlyHttpError as jh, resolveDidDht as ji, TYPING_CAPABILITY as jl, sortRoster as jm, parseGroupMetaStatement as jn, readGroupFileMeta as jo, readReply as jp, AtprotoCid as jr, transferEnded as js, readKnocks as jt, IDENTITY_CHALLENGE_WINDOW as ju, enrollGrantFrame as jv, TURN_SETTLE_MS as jx, APP_BUNDLE_LIMITS as jy, readX401ProofResponse as k, decrypt as kC, GROUP_RATION_WINDOW_MS as kS, handoffDigest as k_, findBolt11 as ka, canonicalJsonBytes as kb, WebPushError as kc, ringEvidence as kd, parseVideoMeta as kf, RECORD_TTL as kg, presenceSeenAt as kh, jwkThumbprint as ki, STATUS_CARD_CAPABILITY as kl, rosterHas as km, parseGroupMetaBody as kn, groupFileFallback as ko, groupReplyAuthor as kp, parseAtprotoDidDocument as kr, encodeFileData as ks, knockRecords as kt, encodePacketTransports as ku, enrollDigits as kv, TURN_PUT_WINDOW_MS as kx, seenEntry as ky, x401VpToken as l, PacketTooLargeError as lC, turnName as lS, HANDOFF_PIECE_BYTES as l_, normalizePubkyKey as la, isAppHash as lb, readPin as lc, PROOF_CAPABILITY as ld, RECORDING_TYPES as lf, PAIRED_CALL_CANDIDATES as lg, AWAITING_PEER_MS as lh, normalizeDid as li, appDataBytes as ll, claimedTime as lm, validMentions as ln, RTC_UNSTARTED_MS as lo, QUICK_REACTIONS as lp, decodeTx as lr, lobbyRecords as ls, decodeCommunityLink as lt, normalizeDomain as lu, sealHandoffPiece as lv, DEVICE_ECHO_FRAME as lx, REQUEST_NAME_UNITS as ly, x401HolderJwk as m, openRelayPayload as mC, turnSignedMessage as mS, HANDOFF_VERIFIED as m_, encodeSvcbPacket as ma, readAppRevocationShape as mb, WAKE_FRAME as mc, importedProof as md, fileMessageText as mf, callSignalHeardAt as mg, IDLE_THRESHOLD as mh, signingKeys as mi, isChatAppId as ml, GROUP_ID as mm, MAX_GROUP_NAME_BYTES as mn, pairedMessageFrame as mo, nextReactionNumber as mp, sha256d as mr, rankHubs as ms, leaveStatement3 as mt, txtValue as mu, readSetUpdate as mv, deviceEchoNonce as mx, STAMP_BITS_MIN as my, X401_RESPONSE_MODES as n, DiscoveryBudgetError as nC, readTurnPacket as nS, HANDOFF_HAVE as n_, BITCOIN_NETWORKS as na, APP_STATEMENT_LIMITS as nb, nextPinNumber as nc, revokesIdentity as nd, FileTransfers as nf, RTC_SIGNAL_MAX_AGE_MS as ng, STALLED_EVIDENCE_MS as nh, didJwsAlg as ni, APP_RATE_LIMIT as nl, sameButtonText as nm, meshMessageRef as nn, PAIRING_RETRY_MS as no, sanitizePreviewImage as np, decodeBase64 as nr, COMMUNITY_TOPOLOGY as ns, GROUP_READ_NOTE_COMMUNITY as nt, decodeDnsResponse as nu, readHandoffHello as nv, __commonJSMin as nw, inviteOwnership as nx, KNOCK_SLOT_LABEL as ny, matchX401Dcql as o, withRequestOptions as oC, signTurnRelease as oS, HANDOFF_MANIFEST as o_, isPubkyKey as oa, appRevocationId as ob, pinIsNewer as oc, applyIdentityEvent as od, sanitizeFileName as of, parseRtcSignal as og, DirectPathWatch as oh, didWebFileNames as oi, APP_VERSION_MAX as ol, usageLeft as om, MENTION_LIMITS as on, RACE_RELAYED_MS as oo, readForwarded as op, compactSize as or, freshHubs as os, communityMessageId as ot, encodeDnsQuery as ou, readHandoffTurnFrame as ov, __toCommonJS as ow, readInviteCode as ox, REQUEST_CLOCK_SKEW_MS as oy, sameX401HolderJwk as p, newerPacket as pC, turnSequence as pS, HANDOFF_TIMINGS as p_, decodeSvcbRecords as pa, readAppRevocation as pb, WAKE_CALL_WAIT_MS as pc, emptyProofLedger as pd, downsamplePeaks as pf, callRtcConfig as pg, FIRST_PUBLISH_MAX_MS as ph, parseDidSignaturePaste as pi, isAppVersion as pl, GROUP_ADMIN_OFF_ERROR as pm, MAX_GROUP_META_BODY as pn, pairedMessageFits as po, ReactionWindow as pp, hash160 as pr, pickHubs as ps, leaveStatement as pt, recordsName as pu, encodeSetSlots as pv, deviceEchoFrame as px, STAMP_BITS_MAX as py, signAppStore as q, fromBase64Url as qC, normalizeRelayUrl as qS, newHandoffId as q_, GhostLink as qa, INVITE_MAX_LENGTH as qb, appRangeGetFrame as qc, DHT_TEXT_REFUSED as qd, validEditNumber as qf, HANDOFF_ATTEMPTS as qg, decodeChunk as qh, parsePaymentAmount as qi, readManifest as ql, sha256Hex as qm, verifySshSignature as qn, GROUP_VERSION_HUBS as qo, buttonLabelClash as qp, DID_GHOSTLY_SERVICE as qr, typingFrame as qs, chainPieces as qt, boundVerifiedIdentity as qu, inboxRecord as qv, TURN_SLOTS as qx, isAppPath as qy, readX401OpenId4VpRequest as r, budgetRetryMs as rC, sealTurnBody as rS, HANDOFF_HELLO as r_, isBitcoinAddress as ra, appFingerprint as rb, parsePinFrame as rc, signIdentityPresentation as rd, PREVIEWABLE_IMAGE as rf, buildDataSdp as rg, DIRECT_EVIDENCE_MS as rh, didSignedMessages as ri, APP_RATE_WINDOW_MS as rl, statusCardBytes as rm, parseCommunityEdit as rn, PONG_WAIT_MS as ro, FORWARD_LIMITS as rp, verifyBip322 as rr, beaconKeys as rs, communityCommitHash as rt, dnsProofName as ru, readHandoffManifest as rv, __esmMin as rw, inviteQrSegments as rx, LINK_RECORD_LABEL as ry, presentX401SdJwtVc as s, MAX_DNS_PACKET_BYTES as sC, turnInstance as sS, HANDOFF_OFFER as s_, isPubkyProofFolder as sa, appSignedBytes as sb, pinNumberHolds as sc, lastSharedWithMe as sd, sanitizeMime as sf, CALL_SIGNAL_FUTURE_MS as sg, directBlocked as sh, didWebFileUrl as si, AppSessions as sl, MESSAGE_CLOCK_SKEW_MS as sm, mentionsBytes as sn, REDESCRIBED_GRACE_MS as so, COMMUNITY_REACTION_FRAME as sp, decodeAnyBitcoinAddress as sr, hubRank as ss, communityRoster as st, isPublicAddress as su, readHandoffVerified as sv, DEVICES_CAPABILITY as sx, REQUEST_LABEL as sy, X401_REQUEST_LIMITS as t, RelayBreaker as tC, readTurnBody as tS, HANDOFF_FILE_REQUEST as t_, sparkNetworkOf as ta, APP_PREFIXES as tb, mayPin as tc, receivedIdentityStatus as td, readDhtFile as tf, RTC_SIGNAL_FUTURE_MS as tg, REANSWERS as th, didGhostlyServiceEntry as ti, APP_PEER_OPEN_MAX as tl, removedCardText as tm, communityMessageAuthor as tn, PAIRING_ATTEMPT_MS as to, previewImageSize as tp, bip322ToSpend as tr, wireHubPolicy as ts, CommunitySession as tt, WELL_KNOWN_PATH as tu, readHandoffHave as tv, utf8Encode as tw, inviteLink as tx, KNOCK_SLOTS as ty, X401_CREDENTIAL_LIMITS as u, RELAY_PAYLOAD_MAX_BYTES as uC, turnPacket as uS, HANDOFF_PIECE_OVERHEAD as u_, pubkyProofCapability as ua, isAppKey as ub, DEVICE_WAKE_TTL_SECONDS as uc, PeerProofs as ud, VOICE_LIMITS as uf, RTC_CONFIG as ug, DEPARTED_READ_MS as uh, parseDid as ui, appDataFrame as ul, heardTime as um, wireMentions as un, SWITCH_RETIRE_MS as uo, REACTED_FRAME as up, decodeWitness as ur, mergeBeacon as us, derivedSecret as ut, parseDomainTxt as uu, sortParts as uv, DEVICE_PING_FRAME as ux, REQUEST_PACKET_BYTES as uy, X401_SCHEME as v, decodeDnsAnswers as vC, BACKGROUND_WHILE_SIGNALING as vS, filePartDigest as v_, LNURL_LIMITS as va, signAppRevocation as vb, WakeLimiter as vc, proofHash as vd, recordingMime as vf, extractParamsFromSdp as vg, OFFER_LOOK_MS as vh, DID_DHT_PREFIX as vi, APP_RANGES_CAPABILITY as vl, MAX_GROUP_CHAIN as vm, groupDisplayName as vn, EngineError as vo, reactedFrame as vp, varBytes as vr, shouldBeHub as vs, signCommunity as vt, CAPS_LABEL as vu, signTombstone as vv, deviceLinkParams as vx, knockSlotOf as vy, decodeX401Header as w, identityFromSeed as wC, DEPARTED_READS as wS, handoffBusyFrame as w_, parsePayParams as wa, isImageMime as wb, relayRequest as wc, verifyNostrProof as wd, PLAYABLE_VIDEO as wf, sdpHasCandidates as wg, TRANSPORTS_GONE_MS as wh, didDhtFromPublicKey as wi, KNOWN_SESSION_CAPABILITIES as wl, commitUntaggedHash as wm, groupMetaToHand as wn, GROUP_HAVE_FRAME as wo, validReactionNumber as wp, atprotoProofRecord as wr, ChatFiles as ws, decodeGroupEntryLink as wt, CapsRefusedError as wu, ENROLL_GRANT as wv, signDeviceTransports as wx, openRequest as wy, buildX401ProofResult as x, readDnsName as xC, CHAT_RESERVE_PER_CHAT as xS, handoffAttemptAllowed as x_, invoiceCallbackUrl as xa, verifyAppStatementBytes as xb, parseWakeFrame as xc, storageProofBody as xd, voiceLevel as xf, keepsToRelays as xg, PRESENCE_WINDOW as xh, DidDhtError as xi, EDIT_CAPABILITY as xl, OWN_FRAME_LIMIT as xm, groupMetaNewer as xn, parseEngineError as xo, reactionIsNewer as xp, ATPROTO_PROOF_COLLECTION as xr, PAIRED_CALL_FRAME as xs, GROUP_ENTRY_PROFILE as xt, CAPS_REFRESH_MS as xu, ENROLL_CANCEL as xv, deviceLinkSecret as xx, makeStamp as xy, X401_VERSION as y, decodeTxtPacket as yC, CHAT_RESERVE as yS, filePartName as y_, fetchLnurlJson as ya, verifyAppRevocation as yb, deviceWakeRequest as yc, proofStatement as yd, voiceDownloadName as yf, heardCallSignal as yg, OFFER_STEP_MAX as yh, DID_DHT_TTL as yi, BUTTONS_CAPABILITY as yl, MAX_GROUP_MEMBERS as ym, groupMetaBody as yn, engineError as yo, reactionEmoji as yp, ATPROTO_DECLARED_SCOPE as yr, validHead as ys, verifyCommunityChain as yt, CAPS_LIMITS as yu, verifySetUpdate as yv, deviceLinkRendezvousSeed as yx, knockSlotRecords as yy, planAppUpdate as z, hasVisible as zC, SIGNALING_WINDOW_MS as zS, handoffReleaseFrame as z_, BLOCKED_DIAL_WAIT_MS as za, createDeviceInvite as zb, APP_RANGE_FRAMES as zc, rankTransports as zd, REMOVED_TEXT as zf, encodeServices as zg, sanitizeResponseHeaders as zh, TEST_USDT_FAUCET_AMOUNT as zi, SESSION_RECEIVE_PENDING as zl, edgeParams as zm, SSH_PUBLIC_KEY_MAX as zn, SIGNALS_PER_MINUTE as zo, PR_CHECKS as zp, parseAtprotoDidKey as zr, TYPING_STATUS_MAX as zs, groupWakes as zt, IDENTITY_MAX_VALIDITY as zu, FLOOD_PER_DAY as zv, TURN_LABEL as zx, APP_VIEWS as zy };
34470
35190
 
34471
- //# sourceMappingURL=src-BkkTL_0F.js.map
35191
+ //# sourceMappingURL=src-D9oJLTXM.js.map