@ghostlytools/cli 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/assets/{api-C_IHKsrl.js → api-CHD8_kcJ.js} +2 -2
  2. package/dist/assets/{api-ClHM_G5A.js → api-CMohP9Pw.js} +17 -13
  3. package/dist/assets/api-CMohP9Pw.js.map +1 -0
  4. package/dist/assets/{apiKit-gS-yfb25.js → apiKit-CfwVtBcw.js} +17 -3
  5. package/dist/assets/apiKit-CfwVtBcw.js.map +1 -0
  6. package/dist/assets/{apps-DyihkNO-.js → apps-733nXRBy.js} +1 -1
  7. package/dist/assets/{apps-DP8pElH-.js → apps-LG-QOIxs.js} +2 -2
  8. package/dist/assets/{apps-DP8pElH-.js.map → apps-LG-QOIxs.js.map} +1 -1
  9. package/dist/assets/{arkade-GzJoov-w.js → arkade-C8x3Efyj.js} +2 -2
  10. package/dist/assets/{arkade-GzJoov-w.js.map → arkade-C8x3Efyj.js.map} +1 -1
  11. package/dist/assets/{backup-DKDXkaS1.js → backup-CfJenOQo.js} +4 -4
  12. package/dist/assets/{backup-DKDXkaS1.js.map → backup-CfJenOQo.js.map} +1 -1
  13. package/dist/assets/{backup-A_C4hYNO.js → backup-nCbNWJ7-.js} +1 -1
  14. package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
  15. package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
  16. package/dist/assets/{buttons-BDw8cqDq.js → buttons-BC0stvPg.js} +3 -3
  17. package/dist/assets/{buttons-BDw8cqDq.js.map → buttons-BC0stvPg.js.map} +1 -1
  18. package/dist/assets/buttons-BDKeKyKw.js +2 -0
  19. package/dist/assets/{envelope-DEvU5FA9.js → envelope-BbvUBjc5.js} +2 -2
  20. package/dist/assets/{envelope-DEvU5FA9.js.map → envelope-BbvUBjc5.js.map} +1 -1
  21. package/dist/assets/{groupFiles-Cr4Gj9-R.js → groupFiles-Bmo-SkVQ.js} +18 -4
  22. package/dist/assets/{groupFiles-Cr4Gj9-R.js.map → groupFiles-Bmo-SkVQ.js.map} +1 -1
  23. package/dist/assets/{host-D0MIWyOe.js → host-DxDRCRKD.js} +40 -10
  24. package/dist/assets/host-DxDRCRKD.js.map +1 -0
  25. package/dist/assets/{hyperdhtRelay-SBo4aoMk.js → hyperdhtRelay-CZfsPfT9.js} +2 -2
  26. package/dist/assets/{hyperdhtRelay-SBo4aoMk.js.map → hyperdhtRelay-CZfsPfT9.js.map} +1 -1
  27. package/dist/assets/{irohWeb-D2WaYPdN.js → irohWeb-BUvaADop.js} +2 -2
  28. package/dist/assets/{irohWeb-D2WaYPdN.js.map → irohWeb-BUvaADop.js.map} +1 -1
  29. package/dist/assets/{main-DUG0nGLw.js → main-BIXIs84L.js} +14 -14
  30. package/dist/assets/{main-DUG0nGLw.js.map → main-BIXIs84L.js.map} +1 -1
  31. package/dist/assets/{mainline-B8NGRodL.js → mainline-HQVJ5ukA.js} +2 -2
  32. package/dist/assets/{mainline-B8NGRodL.js.map → mainline-HQVJ5ukA.js.map} +1 -1
  33. package/dist/assets/{networkReason-BAnNO1Ji.js → networkReason-CKBiFTwt.js} +2 -2
  34. package/dist/assets/{networkReason-BAnNO1Ji.js.map → networkReason-CKBiFTwt.js.map} +1 -1
  35. package/dist/assets/{nwc-DQT3rx-s.js → nwc-Dm4RSvvF.js} +3 -3
  36. package/dist/assets/{nwc-DQT3rx-s.js.map → nwc-Dm4RSvvF.js.map} +1 -1
  37. package/dist/assets/{nwcProvider-Dq647EAl.js → nwcProvider-yQdL-DfC.js} +2 -2
  38. package/dist/assets/{nwcProvider-Dq647EAl.js.map → nwcProvider-yQdL-DfC.js.map} +1 -1
  39. package/dist/assets/{registry-ieI8INKT.js → registry-C9f2Ogff.js} +3 -3
  40. package/dist/assets/{registry-ieI8INKT.js.map → registry-C9f2Ogff.js.map} +1 -1
  41. package/dist/assets/{registry-DFiOxH5q.js → registry-CHVZ0Jzl.js} +1 -1
  42. package/dist/assets/{resolve-C39pc4Kf.js → resolve-Cqj1jjK2.js} +2 -2
  43. package/dist/assets/{resolve-C39pc4Kf.js.map → resolve-Cqj1jjK2.js.map} +1 -1
  44. package/dist/assets/{server-DIICuvgy.js → server-CcAs54Yb.js} +365 -199
  45. package/dist/assets/{server-DIICuvgy.js.map → server-CcAs54Yb.js.map} +1 -1
  46. package/dist/assets/{src-CwMTZ5Hj.js → src-BLHey3Q1.js} +125 -21
  47. package/dist/assets/src-BLHey3Q1.js.map +1 -0
  48. package/dist/assets/{usdt-CxSyuXq4.js → usdt-DMKpMhdM.js} +3 -3
  49. package/dist/assets/{usdt-CxSyuXq4.js.map → usdt-DMKpMhdM.js.map} +1 -1
  50. package/dist/assets/{words-31VaDW5h.js → words-DUlvkoUT.js} +2 -2
  51. package/dist/assets/{words-31VaDW5h.js.map → words-DUlvkoUT.js.map} +1 -1
  52. package/dist/ghostly.mjs +1 -1
  53. package/package.json +1 -1
  54. package/dist/assets/api-ClHM_G5A.js.map +0 -1
  55. package/dist/assets/apiKit-gS-yfb25.js.map +0 -1
  56. package/dist/assets/buttons-CNkxiN2c.js +0 -2
  57. package/dist/assets/host-D0MIWyOe.js.map +0 -1
  58. package/dist/assets/src-CwMTZ5Hj.js.map +0 -1
@@ -1,15 +1,15 @@
1
1
  import { n as traceJoin } from "./joinTrace-CjRDFy85.js";
2
- import { $a as statusCardText, $c as readDeviceInvite, $l as createIdentity, $o as HANDOFF_VERIFIED, $r as isServeId, $s as newInbox, A as knockRecords, Aa as reactionEmoji, Ac as sha256Paced, Ai as CapsExchange, Al as turnInstance, An as findEndpoint, Ao as RTC_CONFIG, Ar as transferStalled, B as GROUP_READ_NOTE, Bi as emptyIdentityLedger, Bl as currentRelays, Bn as engineError, Bo as HTTP_SERVICE_PROTO, Br as pinIsNewer, Bs as enrollCancelFrame, C as decodeCommunityLink, Ca as readForwarded, Cc as appViewOf, Cl as TURN_LAST_SEQUENCE, Co as formatLocalTarget, Cr as readBeacon, Cs as readHandoffHave, D as encodeGroupEntryLink, Da as ReactionWindow, Dc as pacer, Dl as readTurnPacket, Dn as ENDPOINT, Do as decodeControl, Dr as ChatFiles, Ds as readHandoffVerified, E as decodeGroupEntryLink, Ea as REACTION_LIMITS, Ec as isAppUrl, El as nextTurnPosition, En as decodeBolt11, Eo as LIMITS, Er as shouldBeHub, Es as readHandoffTurnFrame, F as groupWakeFrame, Fa as pairedReplyAuthor, Fl as DEFAULT_RELAYS, Fn as INVITE_TAKEN, Fo as contactRtcConfig, Fr as typingActivity, Fs as verifySetUpdate, G as GROUP_EDIT_TEXT_BYTES, Ga as STATUS_CARD_LIMITS, Gc as canonicalJson, Gi as revokesIdentity, Gl as isDiscoveryBudgetError, Go as HANDOFF_DONE, Gr as deviceWakeRequest, Gs as enrollHelloFrame, Gt as encodeDidDhtPacket, H as frameBytes, Hi as identityStatement, Hn as parseEngineError, Ho as serviceIdFromName, Hr as readPin, Hs as enrollDigits, Ht as didDhtDocument, I as groupWakes, Ia as readReply, Ic as isAppHash, Ii as IDENTITY_REVOCATION_LABEL, In as LIVENESS_PING_MS, J as mentionsMember, Jc as createContactLink, Ji as emptyProofLedger, Jn as groupFileFallback, Jo as HANDOFF_OFFER, Jr as relayRequest, Js as readEnrollHello, Jt as ETHEREUM_USDT, K as carryMentions, Ki as lastSharedWithMe, Kl as withRequestOptions, Ko as HANDOFF_HAVE, Kr as newWakeToken, Ks as enrollProofFrame, L as parseGroupWakeFrame, La as replySnippet, Lc as isAppKey, Ll as RelayTransport, Ln as PAIRED_FRAME_TOO_LARGE, Lo as parseCallSignal, Lr as PIN_LIMITS, M as readKnocks, Ma as readReaction, Mc as APP_STATEMENT_LIMITS, Mi as capsDescriptors, Ml as turnName, Mn as parseCashuRequestPayload, Ms as setAckFrame, Na as validReactionNumber, Nc as appFingerprint, Ni as dialDescriptors, Nl as turnStatedVerifier, Nn as parseFedimintRequestPayload, Nr as TypingSender, Ns as setUpdateFrame, O as entryParams, Oa as nextReactionNumber, Ol as signTurnPacket, On as cashuRequestPayload, Oo as encodeControl, Or as FILE_LIMITS, Os as sealHandoffPiece, P as GroupWakeLimiter, Pa as wireReaction, Pc as appRef, Pl as turnVerifierMark, Pn as GhostLink, Ps as signTombstone, Qa as sameButtonText, Qc as deviceInviteJoinerParams, Qo as HANDOFF_TIMINGS, Qr as APP_RANGE_LIMITS, Qs as inboxRecord, Qt as SEPOLIA_TEST_USDT, R as GROUP_LIMITS, Ra as BUTTON_ID, Rc as isAppRef, Ri as IdentityExchange, Rn as pairedMessageFits, Rr as mayPin, S as communityHasFrame, Sa as forwardedAgain, Sc as appDigest, Sl as turnPutSummary, So as GhostlyHttpError, Sr as rankHubs, Ss as readHandoffDone, Ta as GROUP_REACTION_FRAME, Tl as firstDeviceSetSecret, To as webLocalFetch, Tr as readLobby, Ts as readHandoffPake, Uc as parseImageMeta, Ui as newIdentityBinding, Ul as traceLink, Un as GROUP_FILE_LIMITS, Uo as HANDOFF_ACK, Ur as WAKE_CALL_INTERVAL_MS, Us as enrollDoneFrame, Ut as didDhtFromPublicKey, V as GroupSession, Vi as identityRevocationValue, Vl as normalizeRelayUrl, Vn as engineText, Vo as LEGACY_SERVICES, Vr as pinNumberHolds, Vs as enrollCancelReason, Wi as receivedIdentityStatus, Wl as budgetRetryMs, Wo as HANDOFF_CANCEL, Wr as WakeLimiter, Ws as enrollGrantFrame, Wt as encodeDidDhtDeactivated, Xc as readContactLink, Xi as TRANSPORTS, Xn as readGroupFileMeta, Xo as HANDOFF_PIECE_BYTES, Xr as checkPushEndpoint, Xs as clearMissed, Xt as ONCHAIN_PROVIDER, Y as groupName, Yc as encodeContactLink, Yi as validExternalKey, Yl as createRelayPayload, Yo as HANDOFF_PAKE, Yr as wakeRequest, Ys as verifyEnrollProof, Yt as EVM_TEST_CHAINS, Za as checkStatusCard, Zc as createDeviceInvite, Zi as automaticTransport, Zo as HANDOFF_REQUEST, Zr as vapidKeysMatch, Zs as endedRequests, Zt as PaymentPreflightError, _ as openGroupTyping, _a as MAX_REMOVAL_NUMBER, _c as seenEntry, _l as webCryptoSigner, _o as DHT_POLL_INTERVALS, _r as lobbyRecords, _s as handoffStreamKey, a as appStoreDecision, aa as formatFileSize, ac as REQUEST_LIFETIME_MS, ai as EDIT_CAPABILITY, al as inviteOwnership, an as assertWholeSats, ao as GROUP_ADMIN_OFF_ERROR, ar as groupSignalFrame, as as handoffCancelFrame, au as sanitizeAvatar, b as CommunitySession, ba as dhtEditId, bc as APP_ICON_PATH, bl as TURN_SETTLE_MS, bo as WATCH_PEER_MS, br as newerHead, bs as readHandoffAck, c as planAppUpdate, cc as knockSlotOf, ci as HOLD_CAPABILITY, cl as ENROLL_CAPABILITY, cn as walletNetworkOf, co as MEMBER_KEY, cr as mayBeHub, cs as handoffDataFrame, cu as fromBase64Url, da as fileMessageText, dc as makeStampPaced, di as HoldKeys, dl as deviceEchoNonce, dn as sparkAddressKind, do as rosterAdmin, dr as COMMUNITY_TOPOLOGY, ds as handoffHelloFrame, du as toBase64Url, ec as planKnocks, el as OwnInviteError, en as TEST_USDT_FAUCET_AMOUNT, eo as arrivalKey, er as CarriedTransport, es as filePartName, eu as identityFromSeed, f as readAppStoreSteps, fa as parseVoiceMeta, fc as mergeContactKnocks, fi as HoldRefusedError, fl as deviceKeyZ32, fn as sparkInvoiceDetails, fo as rosterHas, fr as beaconKeys, fs as handoffManifestFrames, fu as toZ32, g as groupTypingEpoch, ga as EDIT_RATE_WINDOW_MS, gc as requestRecords, gl as seedSigner, gr as lobbyKeys, gs as handoffRetryAfter, gt as normalizeAtprotoHandle, h as GroupTypingBoard, ha as EDIT_BUFFER_MS, hc as readLinkRecord, hi as readManifest, hl as newDeviceSetSecret, hn as isPubkyKey, ho as DirectPathWatch, hr as freshHubs, hs as handoffReleaseFrame, ht as isAtprotoDid, i as appRevocationFor, ia as dhtFileId, ic as ContactRequestError, ii as BUTTONS_CAPABILITY, il as inviteLink, in as assertTokenUnits, io as shownTime, is as handoffBusyFrame, j as mergeKnocks, ja as reactionIsNewer, ji as DHT_TEXT_CAPABILITY, jl as turnKeys, jn as isFederationId, js as readSetUpdate, k as knockIdentity, ka as queueReaction, kc as readAppBundleAsync, kl as signTurnRelease, kn as fedimintRequestPayload, kr as transferEnded, l as APP_STORE_LIMITS, lc as knockSlotRecords, li as HOLD_DATED_BACK_MS, ll as HANDOFF_CAPABILITY, ln as SPARK_NETWORKS, lo as commitHash, lr as meshHubs, ls as handoffDigest, ma as parseVideoMeta, mc as readKnockSlot, mi as newMailbox, ml as devicePingFrame, mo as edgeParams, mr as doorHubs, ms as handoffPakeFrame, mu as utf8Encode, n as readX401SdJwtVc, na as peekDhtMailbox, nc as takeRequest, ni as isAppVersion, nl as decodeInviteCode, nn as WALLET_NETWORKS, no as heardTime, ns as handoffAttemptFailed, nu as publicKeyFromZ32, o as appUpdateDecision, oa as sanitizeFileName, oc as contactDay, oi as STATUS_CARD_CAPABILITY, on as formatPaymentAmount, oo as GROUP_MEMBER_CAP, or as readGroupSignal, os as handoffContext, ou as sanitizeDisplayText, pc as openRequest, pi as isHoldUrl, pl as deviceLinkPairing, pn as isBitcoinAddress, po as verifyCommitSignature, pr as beaconRecords, ps as handoffOfferFrame, pu as utf8Decode, q as parseCommunityEdit, qc as readCanonicalJson, qi as PeerProofs, ql as PacketTooLargeError, qo as HANDOFF_HELLO, qr as parseWakeFrame, qs as readEnrollGrant, qt as signDidDhtPacket, r as sameX401HolderJwk, ra as DHT_FILE_CAPABILITY, rc as turnOff, ri as APPS_CAPABILITY, rl as encodeInviteCode, rn as arkAddressPrefix, ro as receivedTimestamp, rs as handoffAttemptSucceeded, ru as verify, s as checkAppBeforeRun, sa as sanitizeMime, sc as knockSlotIdentity, si as UPGRADE_CAPABILITY, sl as DEVICES_CAPABILITY, sn as validatePaymentTarget, sr as MESH_HUBS, ss as handoffContextProof, su as bytesEqual, t as newX401HolderKey, ta as DHT_MESSAGE_TTL, tc as settleRequest, ti as chatAppId, tl as createChatInvite, tn as USDT_PUBLIC_RPC, to as claimedTime, ts as handoffAttemptAllowed, tu as identityFromSeedB64, uc as linkRecords, ui as HOLD_LIMITS, ul as deviceEchoFrame, un as SPARK_PROVIDER, uo as parseGroupCommit, ur as pickMeshHubs, us as handoffEphemeral, uu as randomBytes, v as sealGroupTyping, va as REMOVED_TEXT, vc as APP_BUNDLE_LIMITS, vr as mergeBeacon, vs as handoffVersions, w as encodeCommunityLink, wa as COMMUNITY_REACTION_FRAME, wl as TURN_MAX, wo as parseLocalTarget, wr as readBeaconHead, ws as readHandoffHello, x as GROUP_READ_NOTE_COMMUNITY, xa as parseLinkPreview, xl as classifyTurnRead, xo as presenceSeenAt, xr as pickHubs, xs as readHandoffCancel, y as COMMUNITY_LIMITS, ya as RateWindow, yc as APP_BUNDLE_MAGIC, yl as TURN_RAISE_READ_TIMEOUT_MS, yo as RELAY_POLL_INTERVALS, yr as mergeLobby, ys as newHandoffId, zc as readAppRevocation, zn as pairedMessageFrame, zo as emptyLinkRecords, zr as nextPinNumber } from "./src-CwMTZ5Hj.js";
2
+ import { $a as sameButtonText, $c as deviceInviteJoinerParams, $o as HANDOFF_TIMINGS, $r as isServeId, $s as inboxRecord, A as knockRecords, Aa as queueReaction, Ac as readAppBundleAsync, Ai as CapsExchange, Al as signTurnRelease, An as findEndpoint, Ar as transferStalled, B as GROUP_READ_NOTE, Bc as readAppRevocation, Bi as emptyIdentityLedger, Bn as engineError, Bo as emptyLinkRecords, Br as pinIsNewer, C as decodeCommunityLink, Ca as forwardedAgain, Cc as appDigest, Cl as turnPutSummary, Co as GhostlyHttpError, Cr as readBeacon, Cs as readHandoffDone, D as encodeGroupEntryLink, Da as REACTION_LIMITS, Dc as isAppUrl, Dl as nextTurnPosition, Dn as ENDPOINT, Do as LIMITS, Dr as ChatFiles, Ds as readHandoffTurnFrame, E as decodeGroupEntryLink, Ea as GROUP_REACTION_FRAME, El as firstDeviceSetSecret, En as decodeBolt11, Eo as webLocalFetch, Er as shouldBeHub, Es as readHandoffPake, F as groupWakeFrame, Fa as wireReaction, Fc as appRef, Fl as turnVerifierMark, Fn as INVITE_TAKEN, Fr as typingActivity, Fs as signTombstone, G as GROUP_EDIT_TEXT_BYTES, Gi as revokesIdentity, Gl as budgetRetryMs, Go as HANDOFF_CANCEL, Gr as deviceWakeRequest, Gs as enrollGrantFrame, Gt as encodeDidDhtPacket, H as frameBytes, Hi as identityStatement, Hl as normalizeRelayUrl, Hn as parseEngineError, Ho as LEGACY_SERVICES, Hr as readPin, Hs as enrollCancelReason, Ht as didDhtDocument, I as groupWakes, Ia as pairedReplyAuthor, Ii as IDENTITY_REVOCATION_LABEL, Il as DEFAULT_RELAYS, In as LIVENESS_PING_MS, Io as contactRtcConfig, Is as verifySetUpdate, J as mentionsMember, Jc as readCanonicalJson, Ji as emptyProofLedger, Jl as PacketTooLargeError, Jn as groupFileFallback, Jo as HANDOFF_HELLO, Jr as relayRequest, Js as readEnrollGrant, Jt as ETHEREUM_USDT, K as carryMentions, Ka as STATUS_CARD_LIMITS, Kc as canonicalJson, Ki as lastSharedWithMe, Kl as isDiscoveryBudgetError, Ko as HANDOFF_DONE, Kr as newWakeToken, Ks as enrollHelloFrame, L as parseGroupWakeFrame, La as readReply, Lc as isAppHash, Ln as PAIRED_FRAME_TOO_LARGE, Lr as PIN_LIMITS, M as readKnocks, Ma as reactionIsNewer, Mi as capsDescriptors, Ml as turnKeys, Mn as parseCashuRequestPayload, Ms as readSetUpdate, Na as readReaction, Nc as APP_STATEMENT_LIMITS, Ni as dialDescriptors, Nl as turnName, Nn as parseFedimintRequestPayload, Nr as TypingSender, Ns as setAckFrame, O as entryParams, Oa as ReactionWindow, Oc as pacer, Ol as readTurnPacket, On as cashuRequestPayload, Oo as decodeControl, Or as FILE_LIMITS, Os as readHandoffVerified, P as GroupWakeLimiter, Pa as validReactionNumber, Pc as appFingerprint, Pl as turnStatedVerifier, Pn as GhostLink, Ps as setUpdateFrame, Qa as checkStatusCard, Qc as createDeviceInvite, Qo as HANDOFF_REQUEST, Qr as APP_RANGE_LIMITS, Qs as endedRequests, Qt as SEPOLIA_TEST_USDT, R as GROUP_LIMITS, Ra as replySnippet, Rc as isAppKey, Ri as IdentityExchange, Rl as RelayTransport, Rn as pairedMessageFits, Ro as parseCallSignal, Rr as mayPin, S as communityHasFrame, Sa as parseLinkPreview, Sl as classifyTurnRead, So as presenceSeenAt, Sr as rankHubs, Ss as readHandoffCancel, Ta as COMMUNITY_REACTION_FRAME, Tl as TURN_MAX, To as parseLocalTarget, Tr as readLobby, Ts as readHandoffHello, Ui as newIdentityBinding, Un as GROUP_FILE_LIMITS, Uo as serviceIdFromName, Ur as WAKE_CALL_INTERVAL_MS, Us as enrollDigits, Ut as didDhtFromPublicKey, V as GroupSession, Vi as identityRevocationValue, Vl as currentRelays, Vn as engineText, Vo as HTTP_SERVICE_PROTO, Vr as pinNumberHolds, Vs as enrollCancelFrame, Wc as parseImageMeta, Wi as receivedIdentityStatus, Wl as traceLink, Wo as HANDOFF_ACK, Wr as WakeLimiter, Ws as enrollDoneFrame, Wt as encodeDidDhtDeactivated, Xc as encodeContactLink, Xi as TRANSPORTS, Xl as createRelayPayload, Xn as readGroupFileMeta, Xo as HANDOFF_PAKE, Xr as checkPushEndpoint, Xs as verifyEnrollProof, Xt as ONCHAIN_PROVIDER, Y as groupName, Yc as createContactLink, Yi as validExternalKey, Yo as HANDOFF_OFFER, Yr as wakeRequest, Ys as readEnrollHello, Yt as EVM_TEST_CHAINS, Zc as readContactLink, Zi as automaticTransport, Zo as HANDOFF_PIECE_BYTES, Zr as vapidKeysMatch, Zs as clearMissed, Zt as PaymentPreflightError, _ as openGroupTyping, _a as EDIT_RATE_WINDOW_MS, _c as requestRecords, _l as seedSigner, _r as lobbyRecords, _s as handoffRetryAfter, a as appStoreDecision, aa as formatFileSize, ac as ContactRequestError, ai as EDIT_CAPABILITY, al as inviteLink, an as assertWholeSats, ao as shownTime, ar as groupSignalFrame, as as handoffBusyFrame, b as CommunitySession, ba as RateWindow, bc as APP_BUNDLE_MAGIC, bl as TURN_RAISE_READ_TIMEOUT_MS, bo as RELAY_POLL_INTERVALS, br as newerHead, bs as newHandoffId, c as planAppUpdate, cc as knockSlotIdentity, ci as HOLD_CAPABILITY, cl as DEVICES_CAPABILITY, cn as walletNetworkOf, cr as mayBeHub, cs as handoffContextProof, cu as bytesEqual, da as fileMessageText, dc as linkRecords, di as HoldKeys, dl as deviceEchoFrame, dn as sparkAddressKind, do as parseGroupCommit, dr as COMMUNITY_TOPOLOGY, ds as handoffEphemeral, du as randomBytes, ec as newInbox, el as readDeviceInvite, en as TEST_USDT_FAUCET_AMOUNT, eo as statusCardText, er as CarriedTransport, es as HANDOFF_VERIFIED, eu as createIdentity, f as readAppStoreSteps, fa as parseVoiceMeta, fc as makeStampPaced, fi as HoldRefusedError, fl as deviceEchoNonce, fn as sparkInvoiceDetails, fo as rosterAdmin, fr as beaconKeys, fs as handoffHelloFrame, fu as toBase64Url, g as groupTypingEpoch, ga as EDIT_BUFFER_MS, gc as readLinkRecord, gl as newDeviceSetSecret, go as DirectPathWatch, gr as lobbyKeys, gs as handoffReleaseFrame, gt as normalizeAtprotoHandle, h as GroupTypingBoard, ha as parseVideoMeta, hc as readKnockSlot, hi as readManifest, hl as devicePingFrame, hn as isPubkyKey, ho as edgeParams, hr as freshHubs, hs as handoffPakeFrame, ht as isAtprotoDid, hu as utf8Encode, i as appRevocationFor, ia as dhtFileId, ic as turnOff, ii as BUTTONS_CAPABILITY, il as encodeInviteCode, in as assertTokenUnits, io as receivedTimestamp, is as handoffAttemptSucceeded, iu as verify, j as mergeKnocks, ja as reactionEmoji, jc as sha256Paced, ji as DHT_TEXT_CAPABILITY, jl as turnInstance, jn as isFederationId, jo as RTC_CONFIG, k as knockIdentity, ka as nextReactionNumber, kl as signTurnPacket, kn as fedimintRequestPayload, ko as encodeControl, kr as transferEnded, ks as sealHandoffPiece, l as APP_STORE_LIMITS, lc as knockSlotOf, li as HOLD_DATED_BACK_MS, ll as ENROLL_CAPABILITY, ln as SPARK_NETWORKS, lo as MEMBER_KEY, lr as meshHubs, ls as handoffDataFrame, lu as fromBase64Url, mc as openRequest, mi as newMailbox, ml as deviceLinkPairing, mo as verifyCommitSignature, mr as doorHubs, ms as handoffOfferFrame, mu as utf8Decode, n as readX401SdJwtVc, na as peekDhtMailbox, nc as settleRequest, ni as isAppVersion, nl as createChatInvite, nn as WALLET_NETWORKS, no as claimedTime, ns as handoffAttemptAllowed, nu as identityFromSeedB64, o as appUpdateDecision, oa as sanitizeFileName, oc as REQUEST_LIFETIME_MS, oi as STATUS_CARD_CAPABILITY, ol as inviteOwnership, on as formatPaymentAmount, oo as GROUP_ADMIN_OFF_ERROR, or as readGroupSignal, os as handoffCancelFrame, ou as sanitizeAvatar, pc as mergeContactKnocks, pi as isHoldUrl, pl as deviceKeyZ32, pn as isBitcoinAddress, po as rosterHas, pr as beaconRecords, ps as handoffManifestFrames, pu as toZ32, q as parseCommunityEdit, qi as PeerProofs, ql as withRequestOptions, qo as HANDOFF_HAVE, qr as parseWakeFrame, qs as enrollProofFrame, qt as signDidDhtPacket, r as sameX401HolderJwk, ra as DHT_FILE_CAPABILITY, rc as takeRequest, ri as APPS_CAPABILITY, rl as decodeInviteCode, rn as arkAddressPrefix, ro as heardTime, rs as handoffAttemptFailed, ru as publicKeyFromZ32, s as checkAppBeforeRun, sa as sanitizeMime, sc as contactDay, si as UPGRADE_CAPABILITY, sn as validatePaymentTarget, so as GROUP_MEMBER_CAP, sr as MESH_HUBS, ss as handoffContext, su as sanitizeDisplayText, t as newX401HolderKey, ta as DHT_MESSAGE_TTL, tc as planKnocks, ti as chatAppId, tl as OwnInviteError, tn as USDT_PUBLIC_RPC, to as arrivalKey, ts as filePartName, tu as identityFromSeed, uc as knockSlotRecords, ui as HOLD_LIMITS, ul as HANDOFF_CAPABILITY, un as SPARK_PROVIDER, uo as commitHash, ur as pickMeshHubs, us as handoffDigest, v as sealGroupTyping, va as MAX_REMOVAL_NUMBER, vc as seenEntry, vl as webCryptoSigner, vo as DHT_POLL_INTERVALS, vr as mergeBeacon, vs as handoffStreamKey, w as encodeCommunityLink, wa as readForwarded, wc as appViewOf, wl as TURN_LAST_SEQUENCE, wo as formatLocalTarget, wr as readBeaconHead, ws as readHandoffHave, x as GROUP_READ_NOTE_COMMUNITY, xa as dhtEditId, xc as APP_ICON_PATH, xl as TURN_SETTLE_MS, xo as WATCH_PEER_MS, xr as pickHubs, xs as readHandoffAck, y as COMMUNITY_LIMITS, ya as REMOVED_TEXT, yc as APP_BUNDLE_LIMITS, yr as mergeLobby, ys as handoffVersions, za as BUTTON_ID, zc as isAppRef, zn as pairedMessageFrame, zr as nextPinNumber } from "./src-BLHey3Q1.js";
3
3
  import { i as SourceUnreachableError, n as PROVIDER_PLATFORMS, o as isNothingSpentError, r as SourceConfigError, t as NothingSpentError, u as redact } from "./types-C4_KafL_.js";
4
4
  import { t as bitcoindRpc } from "./bitcoindProvider-DGw3xBSa.js";
5
- import { t as nwc } from "./nwcProvider-Dq647EAl.js";
5
+ import { t as nwc } from "./nwcProvider-yQdL-DfC.js";
6
6
  import { a as clearProfileStores, c as errorLine, d as openDb, f as profileOpenFailure, h as wrap, i as STORES$1, l as fileStore, m as transact, n as APP_STORAGE_SCOPE_INDEX, o as databaseName, p as store, r as CARD_INDEX, s as deleteDatabase, t as APP_STORAGE_CHAT_INDEX, u as newestWalletTx } from "./idb-BJARz3Qi.js";
7
- import { a as sealSeed, i as newDeviceKey, o as unsealSeed, r as intentRepository } from "./networkReason-BAnNO1Ji.js";
8
- import { $ as setAwayWallets, A as LightningCards, B as breezDatabaseInUse, C as FileAppender, D as streamStored, E as storedSize, F as ProviderSources, G as relayOnlyProblem, H as dropBreezDatabase, I as sourceKey, J as WrongNetworkError, K as ModeChanged, L as CASHU_MINT_SOURCE, M as isRecoveryPhrase, N as normalizePhrase, P as lightningPaying, Q as requireTurn, R as cashuMint, S as WALLET_TYPES, T as removeStored, U as iceServerProblem, V as breezDatabasesFor, W as iceServerSetting, X as awayFrom, Y as networkLabel, Z as refuseAway, _ as crossNetwork, a as storedGroupFiles, b as walletInstances, c as receivedPairedReply, d as paymentAlias, et as setSingleWriterGate, f as paymentWireId, g as createTiming, h as createFailure, i as groupOfFile, j as cardsKey, k as CASHU_CARD, l as replyRef, m as assertConfirmedReal, n as groupFileId, o as groupReply, p as WALLET_NAMES, q as ModeGate, r as groupFileText, s as pairedWireReply, t as GroupFileDesk, u as replyTo, v as paymentNetwork, w as readStored$1, y as paymentNetworksOf, z as breezDatabase } from "./groupFiles-Cr4Gj9-R.js";
9
- import { i as fedimintDatabase, n as createIrohWebEndpoint, o as loadFedimintSdk, r as irohRelayProblem, t as DEFAULT_IROH_RELAYS } from "./irohWeb-D2WaYPdN.js";
7
+ import { a as sealSeed, i as newDeviceKey, o as unsealSeed, r as intentRepository } from "./networkReason-CKBiFTwt.js";
8
+ import { $ as setAwayWallets, A as LightningCards, B as breezDatabaseInUse, C as FileAppender, D as streamStored, E as storedSize, F as ProviderSources, G as relayOnlyProblem, H as dropBreezDatabase, I as sourceKey, J as WrongNetworkError, K as ModeChanged, L as CASHU_MINT_SOURCE, M as isRecoveryPhrase, N as normalizePhrase, P as lightningPaying, Q as requireTurn, R as cashuMint, S as WALLET_TYPES, T as removeStored, U as iceServerProblem, V as breezDatabasesFor, W as iceServerSetting, X as awayFrom, Y as networkLabel, Z as refuseAway, _ as crossNetwork, a as storedGroupFiles, b as walletInstances, c as receivedPairedReply, d as paymentAlias, et as setSingleWriterGate, f as paymentWireId, g as createTiming, h as createFailure, i as groupOfFile, j as cardsKey, k as CASHU_CARD, l as replyRef, m as assertConfirmedReal, n as groupFileId, o as groupReply, p as WALLET_NAMES, q as ModeGate, r as groupFileText, s as pairedWireReply, t as GroupFileDesk, u as replyTo, v as paymentNetwork, w as readStored$1, y as paymentNetworksOf, z as breezDatabase } from "./groupFiles-Bmo-SkVQ.js";
9
+ import { i as fedimintDatabase, n as createIrohWebEndpoint, o as loadFedimintSdk, r as irohRelayProblem, t as DEFAULT_IROH_RELAYS } from "./irohWeb-BUvaADop.js";
10
10
  import { c as isTestMint, d as paysItsOwnInvoices, l as isWorthlessMint, n as DEFAULT_MINTS, o as fakesLightning, r as TEST_MINT, t as BITCOIN_INVOICE_ON_TESTNET, u as mintNetwork } from "./mints-BrlY773j.js";
11
- import { _ as reserveAdapterIds, b as testBuild, f as setOwnDidSource, g as registeredOnchainProviders, h as registeredLightningProviders, l as chosenResolver, n as resolveAtprotoDid, p as onAdaptersChanged, t as assertPublicServer, v as boundedIdentityFetch, y as verifyIdentity } from "./resolve-C39pc4Kf.js";
12
- import { i as fromBase64Url$1, n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-DEvU5FA9.js";
11
+ import { _ as reserveAdapterIds, b as testBuild, f as setOwnDidSource, g as registeredOnchainProviders, h as registeredLightningProviders, l as chosenResolver, n as resolveAtprotoDid, p as onAdaptersChanged, t as assertPublicServer, v as boundedIdentityFetch, y as verifyIdentity } from "./resolve-Cqj1jjK2.js";
12
+ import { i as fromBase64Url$1, n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-BbvUBjc5.js";
13
13
  import { c as fileSpace, f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf, u as removeFileBytes } from "./fileBytes-B8eTZfAT.js";
14
14
  import { t as hyperdhtRelayProblem } from "./hyperdhtRelay-BT_wRxab.js";
15
15
  import { sha256 } from "@noble/hashes/sha2.js";
@@ -198,7 +198,7 @@ function viewNews(before, after) {
198
198
  //#endregion
199
199
  //#region ../browser/src/engine/paymentAdapters/usdtWallet.ts
200
200
  /** The Ethereum libraries, a large part of the app: loaded once a USDT wallet is made, opened or restored, not with the engine. */
201
- var loadUsdt = () => import("./usdt-CxSyuXq4.js");
201
+ var loadUsdt = () => import("./usdt-DMKpMhdM.js");
202
202
  /** Every new profile starts with this wallet: an address to receive on, nothing to set up. */
203
203
  var DEFAULT_USDT = {
204
204
  network: "ethereum",
@@ -647,7 +647,7 @@ async function restoreArkDatabase(walletId, snapshot) {
647
647
  //#endregion
648
648
  //#region ../browser/src/engine/paymentAdapters/arkWallet.ts
649
649
  /** The Ark SDK, a large part of the app: loaded once an Ark wallet is made, opened or restored, not with the engine. */
650
- var loadArkade = () => import("./arkade-GzJoov-w.js");
650
+ var loadArkade = () => import("./arkade-C8x3Efyj.js");
651
651
  /** How long a Testnet wallet about to make way for another waits for its server to say what it holds. */
652
652
  var RETIRE_READ_MS = 1e4;
653
653
  /** Every new profile starts with this wallet: nothing to set up before receiving. */
@@ -6813,7 +6813,7 @@ var registry;
6813
6813
  var loading$1;
6814
6814
  var listeners = /* @__PURE__ */ new Set();
6815
6815
  function loadIdentityProviders() {
6816
- return loading$1 ??= import("./registry-DFiOxH5q.js").then((m) => {
6816
+ return loading$1 ??= import("./registry-CHVZ0Jzl.js").then((m) => {
6817
6817
  registry = m;
6818
6818
  for (const listener of listeners) listener();
6819
6819
  return m;
@@ -21605,6 +21605,62 @@ var EditBuffer = class {
21605
21605
  //#region ../browser/src/engine/removals.ts
21606
21606
  /** The removal of a message after its last edit `seq`: one past it, at most `MAX_REMOVAL_NUMBER`. */
21607
21607
  var removalNumber = (seq) => Math.min((seq ?? 0) + 1, MAX_REMOVAL_NUMBER);
21608
+ /** How often a chat is read whole for the quotes of removed messages (`QuoteSweeps`). */
21609
+ var QUOTE_SWEEP_MS = 1e4;
21610
+ /**
21611
+ * The quotes of removed messages, here or not (never came, or deleted here first). The replies that quote one are found
21612
+ * by reading the chat whole, and a contact or a member can send and remove, or remove ids that never were, at its edit
21613
+ * pace. So a chat is read for them at most once a `QUOTE_SWEEP_MS`: the first at once, the ones that come meanwhile
21614
+ * together when the time is up.
21615
+ */
21616
+ var QuoteSweeps = class {
21617
+ sweep;
21618
+ now;
21619
+ chats = /* @__PURE__ */ new Map();
21620
+ constructor(sweep, now = Date.now) {
21621
+ this.sweep = sweep;
21622
+ this.now = now;
21623
+ }
21624
+ add(chat, id, ref) {
21625
+ let state = this.chats.get(chat);
21626
+ if (!state) this.chats.set(chat, state = {
21627
+ due: /* @__PURE__ */ new Map(),
21628
+ at: -Infinity,
21629
+ busy: false
21630
+ });
21631
+ state.due.set(id, ref);
21632
+ this.next(chat);
21633
+ }
21634
+ /** The chat is gone: what waits for it is dropped. */
21635
+ forget(chat) {
21636
+ clearTimeout(this.chats.get(chat)?.timer);
21637
+ this.chats.delete(chat);
21638
+ }
21639
+ stop() {
21640
+ for (const state of this.chats.values()) clearTimeout(state.timer);
21641
+ this.chats.clear();
21642
+ }
21643
+ next(chat) {
21644
+ const state = this.chats.get(chat);
21645
+ if (!state?.due.size || state.busy || state.timer) return;
21646
+ const wait = state.at + QUOTE_SWEEP_MS - this.now();
21647
+ if (wait > 0) {
21648
+ state.timer = setTimeout(() => {
21649
+ state.timer = void 0;
21650
+ this.next(chat);
21651
+ }, wait);
21652
+ return;
21653
+ }
21654
+ const removed = state.due;
21655
+ state.due = /* @__PURE__ */ new Map();
21656
+ state.busy = true;
21657
+ state.at = this.now();
21658
+ this.sweep(chat, removed).catch(() => {}).finally(() => {
21659
+ state.busy = false;
21660
+ if (this.chats.get(chat) === state) this.next(chat);
21661
+ });
21662
+ }
21663
+ };
21608
21664
  /** The row a removal reads as to the edit queues: mine, its fallback text, its edit pending until said. */
21609
21665
  function removalRow(linkId, removal) {
21610
21666
  return {
@@ -22394,6 +22450,8 @@ function settleAhead(history, now) {
22394
22450
  //#endregion
22395
22451
  //#region ../browser/src/engine/reactions.ts
22396
22452
  var isGroup$1 = (chat) => chat.startsWith("group:");
22453
+ /** How often a 1:1 chat is read whole for received reactions its rows' ids did not find (`Reactions.find`). */
22454
+ var REACTION_LOOKUP_MS = 1e4;
22397
22455
  /** The row a reaction names in a chat: the id both sides know it by (`replyRef`). */
22398
22456
  function reactionTarget(messages, id, group) {
22399
22457
  return messages.find((m) => replyRef(m, group) === id);
@@ -22468,6 +22526,8 @@ var Reactions = class {
22468
22526
  * out. It only has to grow, so a row deleted since leaves it too high and nothing is wrong.
22469
22527
  */
22470
22528
  last = /* @__PURE__ */ new Map();
22529
+ /** Per 1:1 chat: when it was last read whole for a received reaction, and the read of those that waited meanwhile. */
22530
+ lookups = /* @__PURE__ */ new Map();
22471
22531
  constructor(host) {
22472
22532
  this.host = host;
22473
22533
  }
@@ -22525,7 +22585,7 @@ var Reactions = class {
22525
22585
  }
22526
22586
  take(chat, by, reaction) {
22527
22587
  return this.run(async () => {
22528
- const target = await this.find(chat, reaction.id);
22588
+ const target = await this.find(chat, reaction.id, true);
22529
22589
  if (!target) return this.wait(chat, by, reaction);
22530
22590
  if (!reactionIsNewer(target.reactions?.[by], reaction.n)) return "stale";
22531
22591
  await this.write(chat, target, by, reaction);
@@ -22592,6 +22652,8 @@ var Reactions = class {
22592
22652
  stop() {
22593
22653
  this.stopped = true;
22594
22654
  this.dropHeld();
22655
+ for (const state of this.lookups.values()) clearTimeout(state.timer);
22656
+ this.lookups.clear();
22595
22657
  }
22596
22658
  dropHeld(chat) {
22597
22659
  for (const [key, timer] of this.heldTimers) if (chat === void 0 || key.startsWith(`${chat}\n`)) {
@@ -22623,9 +22685,11 @@ var Reactions = class {
22623
22685
  /**
22624
22686
  * The row a received reaction names. Most often the row of that id (a group's), or of `peer_` or `me_` and that id (a
22625
22687
  * chat's): those are read alone. Any other (a file's, a payment's, one not here yet) is looked for in the whole chat;
22626
- * in a group there is no other, since a row that takes a reaction goes by its own id there.
22688
+ * in a group there is no other, since a row that takes a reaction goes by its own id there. A `received` one is looked
22689
+ * for so at most once a `REACTION_LOOKUP_MS` per chat, since the contact can name ids that never were: one that comes
22690
+ * meanwhile waits, and the next read finds what waited (`lookUpWaiting`).
22627
22691
  */
22628
- async find(chat, id) {
22692
+ async find(chat, id, received = false) {
22629
22693
  const group = isGroup$1(chat);
22630
22694
  if (this.host.message) {
22631
22695
  for (const rowId of group ? [id] : [`peer_${id}`, `me_${id}`]) {
@@ -22633,14 +22697,54 @@ var Reactions = class {
22633
22697
  if (row && replyRef(row, group) === id) return row;
22634
22698
  }
22635
22699
  if (group) return void 0;
22700
+ if (received && !this.lookupDue(chat)) return void 0;
22636
22701
  }
22637
22702
  return reactionTarget(await this.host.messages(chat), id, group);
22638
22703
  }
22704
+ /** Whether a received reaction may read the chat whole now; if not, a read of those that wait is due when it may. */
22705
+ lookupDue(chat) {
22706
+ const now = this.now();
22707
+ let state = this.lookups.get(chat);
22708
+ if (!state) this.lookups.set(chat, state = { at: -Infinity });
22709
+ if (now - state.at >= 1e4) {
22710
+ state.at = now;
22711
+ return true;
22712
+ }
22713
+ if (!state.timer && !this.stopped) {
22714
+ const due = state;
22715
+ due.timer = setTimeout(() => {
22716
+ due.timer = void 0;
22717
+ this.lookUpWaiting(chat, due).catch(() => {});
22718
+ }, due.at + REACTION_LOOKUP_MS - now);
22719
+ }
22720
+ return false;
22721
+ }
22722
+ /** The chat read whole once for the reactions that wait in it: those whose row it has land, newest last. */
22723
+ lookUpWaiting(chat, due) {
22724
+ return this.run(async () => {
22725
+ const now = this.now(), list = (this.waiting.get(chat) ?? []).filter((w) => w.until > now);
22726
+ if (this.stopped || this.lookups.get(chat) !== due || !list.length) return;
22727
+ due.at = now;
22728
+ const messages = await this.host.messages(chat);
22729
+ const found = list.flatMap((w) => {
22730
+ const target = reactionTarget(messages, w.reaction.id, false);
22731
+ return target ? [{
22732
+ ...w,
22733
+ target
22734
+ }] : [];
22735
+ });
22736
+ if (!found.length) return;
22737
+ this.waiting.set(chat, list.filter((w) => !found.some((f) => f.by === w.by && f.reaction === w.reaction)));
22738
+ for (const { target, by, reaction } of found.sort((a, b) => a.reaction.n - b.reaction.n)) await this.write(chat, target, by, reaction);
22739
+ });
22740
+ }
22639
22741
  /** A chat is gone: nothing waits for it any more, and my highest number in it is read again if it comes back. */
22640
22742
  forget(chat) {
22641
22743
  this.dropHeld(chat);
22642
22744
  this.waiting.delete(chat);
22643
22745
  this.last.delete(chat);
22746
+ clearTimeout(this.lookups.get(chat)?.timer);
22747
+ this.lookups.delete(chat);
22644
22748
  }
22645
22749
  wait(chat, by, reaction) {
22646
22750
  const now = this.now();
@@ -23345,76 +23449,82 @@ var Communities = class {
23345
23449
  return this.stored.get(groupId);
23346
23450
  }
23347
23451
  views() {
23348
- return [...this.stored.values()].flatMap((group) => {
23349
- const live = this.live.get(group.id);
23350
- const base = {
23351
- id: group.id,
23352
- profile: "community",
23353
- createdAt: group.createdAt,
23354
- lastMessageAt: this.lastMessageAt.get(group.id) ?? 0,
23355
- ...peerMessageAt(this.lastPeerMessageAt, group.id),
23356
- ...mentionAt(this.lastMentionAt, group.id),
23357
- invited: [],
23358
- memberLinks: {}
23359
- };
23360
- const invitation = this.knocking(group, live) ? {
23361
- linkId: group.joining.linkId,
23362
- contact: "",
23363
- admin: group.joining.inviter,
23364
- members: 0,
23365
- accepted: true,
23366
- viaLink: true,
23367
- stage: this.joinStage(group),
23368
- since: group.joining.since,
23369
- ...this.knockingWith.get(group.id) ? { waiting: this.knockingWith.get(group.id) } : {}
23370
- } : void 0;
23371
- if (invitation && !this.keptWhileKnocking(live)) return [{
23372
- ...base,
23373
- name: groupName(group.joining.name) ?? live?.session.name ?? "",
23374
- isAdmin: false,
23375
- members: [],
23376
- canSend: false,
23377
- invitation
23378
- }];
23379
- if (!live) return [];
23380
- const s = live.session, edges = this.host.edges(group.id);
23381
- const ready = (key) => {
23382
- const id = edges.get(key);
23383
- return !!id && this.host.linkReady(id, 2);
23384
- };
23385
- const hubs = freshHubs(this.hubs(live), this.now()).map((h) => h.key);
23386
- const former = Object.entries(s.state.nicks).filter(([key]) => !rosterHas(s.roster, key));
23387
- return [{
23388
- ...base,
23389
- name: s.name,
23390
- ...former.length ? { formerNames: Object.fromEntries(former) } : {},
23391
- status: s.status,
23392
- statusReason: s.state.statusReason,
23393
- epoch: s.epoch,
23394
- myKey: s.myKey,
23395
- isAdmin: s.isAdmin,
23396
- ...s.isMember && s.entryKey ? { entryLink: encodeCommunityLink({
23397
- g: s.id,
23398
- host: s.entryKey
23399
- }) } : {},
23400
- canSend: s.canSend,
23401
- ...s.picture ? { picture: s.picture } : {},
23402
- ...invitation ? { invitation } : {},
23403
- community: {
23404
- hub: live.hub,
23405
- hubs: hubs.length,
23406
- connected: [...edges.keys()].filter(ready).length
23407
- },
23408
- members: s.roster.map(([key, role]) => ({
23409
- key,
23410
- role,
23411
- me: key === s.myKey,
23412
- nick: key === s.myKey ? void 0 : edges.get(key) && this.host.edgeNick(edges.get(key)) || s.state.nicks[key],
23413
- online: key === s.myKey || ready(key),
23414
- missing: s.missing(key)
23415
- }))
23416
- }];
23417
- });
23452
+ return [...this.stored.values()].flatMap((group) => this.viewOf(group));
23453
+ }
23454
+ /** One community's view, as `views()` makes it, without building the others' (`Groups.view`). */
23455
+ view(groupId) {
23456
+ const group = this.stored.get(groupId);
23457
+ return group && this.viewOf(group)[0];
23458
+ }
23459
+ viewOf(group) {
23460
+ const live = this.live.get(group.id);
23461
+ const base = {
23462
+ id: group.id,
23463
+ profile: "community",
23464
+ createdAt: group.createdAt,
23465
+ lastMessageAt: this.lastMessageAt.get(group.id) ?? 0,
23466
+ ...peerMessageAt(this.lastPeerMessageAt, group.id),
23467
+ ...mentionAt(this.lastMentionAt, group.id),
23468
+ invited: [],
23469
+ memberLinks: {}
23470
+ };
23471
+ const invitation = this.knocking(group, live) ? {
23472
+ linkId: group.joining.linkId,
23473
+ contact: "",
23474
+ admin: group.joining.inviter,
23475
+ members: 0,
23476
+ accepted: true,
23477
+ viaLink: true,
23478
+ stage: this.joinStage(group),
23479
+ since: group.joining.since,
23480
+ ...this.knockingWith.get(group.id) ? { waiting: this.knockingWith.get(group.id) } : {}
23481
+ } : void 0;
23482
+ if (invitation && !this.keptWhileKnocking(live)) return [{
23483
+ ...base,
23484
+ name: groupName(group.joining.name) ?? live?.session.name ?? "",
23485
+ isAdmin: false,
23486
+ members: [],
23487
+ canSend: false,
23488
+ invitation
23489
+ }];
23490
+ if (!live) return [];
23491
+ const s = live.session, edges = this.host.edges(group.id);
23492
+ const ready = (key) => {
23493
+ const id = edges.get(key);
23494
+ return !!id && this.host.linkReady(id, 2);
23495
+ };
23496
+ const hubs = freshHubs(this.hubs(live), this.now()).map((h) => h.key);
23497
+ const former = Object.entries(s.state.nicks).filter(([key]) => !rosterHas(s.roster, key));
23498
+ return [{
23499
+ ...base,
23500
+ name: s.name,
23501
+ ...former.length ? { formerNames: Object.fromEntries(former) } : {},
23502
+ status: s.status,
23503
+ statusReason: s.state.statusReason,
23504
+ epoch: s.epoch,
23505
+ myKey: s.myKey,
23506
+ isAdmin: s.isAdmin,
23507
+ ...s.isMember && s.entryKey ? { entryLink: encodeCommunityLink({
23508
+ g: s.id,
23509
+ host: s.entryKey
23510
+ }) } : {},
23511
+ canSend: s.canSend,
23512
+ ...s.picture ? { picture: s.picture } : {},
23513
+ ...invitation ? { invitation } : {},
23514
+ community: {
23515
+ hub: live.hub,
23516
+ hubs: hubs.length,
23517
+ connected: [...edges.keys()].filter(ready).length
23518
+ },
23519
+ members: s.roster.map(([key, role]) => ({
23520
+ key,
23521
+ role,
23522
+ me: key === s.myKey,
23523
+ nick: key === s.myKey ? void 0 : edges.get(key) && this.host.edgeNick(edges.get(key)) || s.state.nicks[key],
23524
+ online: key === s.myKey || ready(key),
23525
+ missing: s.missing(key)
23526
+ }))
23527
+ }];
23418
23528
  }
23419
23529
  messages(groupId) {
23420
23530
  return this.store.getMessages(MESSAGE_LINK$1(groupId));
@@ -23449,13 +23559,17 @@ var Communities = class {
23449
23559
  if (existing?.joining && existing.joining.host === link.host) return link.g;
23450
23560
  if (live) {
23451
23561
  const s = live.session;
23562
+ const door = s.entryKey === link.host;
23452
23563
  if (s.status === "active" && s.roster.length === 1) return link.g;
23453
23564
  if (s.status === "active") {
23454
- await this.startJoining(link, s.state.seedB64, this.now(), true);
23565
+ if (s.entryKey) await this.startJoining(door ? link : {
23566
+ g: link.g,
23567
+ host: s.entryKey
23568
+ }, s.state.seedB64, this.now(), true);
23455
23569
  return link.g;
23456
23570
  }
23457
23571
  if (s.status === "removed" || s.status === "lost") {
23458
- await this.startJoining(link, s.state.seedB64, this.now());
23572
+ await this.startJoining(link, door ? s.state.seedB64 : dialedKey(link), this.now());
23459
23573
  return link.g;
23460
23574
  }
23461
23575
  }
@@ -26312,92 +26426,103 @@ var Groups = class {
26312
26426
  return this.isCommunity(groupId) ? this.communities.record(groupId) : this.stored.get(groupId);
26313
26427
  }
26314
26428
  views() {
26315
- return [...this.meshViews(), ...this.communities.views()].map((view) => {
26316
- const pin = pinView(this.record(view.id)?.pin);
26317
- return pin ? {
26318
- ...view,
26319
- pin
26320
- } : view;
26321
- }).sort((a, b) => Math.max(b.lastMessageAt, b.createdAt) - Math.max(a.lastMessageAt, a.createdAt));
26429
+ return [...this.meshViews(), ...this.communities.views()].map((view) => this.pinned(view)).sort((a, b) => Math.max(b.lastMessageAt, b.createdAt) - Math.max(a.lastMessageAt, a.createdAt));
26430
+ }
26431
+ /**
26432
+ * One group's view, as `views()` makes it, without building every other group's: the engine's native-listener
26433
+ * decisions read it per edge, and all groups' views per edge grew with groups × members squared.
26434
+ */
26435
+ view(groupId) {
26436
+ const view = this.isCommunity(groupId) ? this.communities.view(groupId) : this.meshView(this.stored.get(groupId));
26437
+ return view && this.pinned(view);
26438
+ }
26439
+ pinned(view) {
26440
+ const pin = pinView(this.record(view.id)?.pin);
26441
+ return pin ? {
26442
+ ...view,
26443
+ pin
26444
+ } : view;
26322
26445
  }
26323
26446
  meshViews() {
26324
- return [...this.stored.values()].filter((group) => !group.left && (group.invitation || this.sessions.has(group.id))).map((group) => {
26325
- const session = this.sessions.get(group.id);
26326
- const edges = this.host.edges(group.id);
26327
- const contacts = Object.entries(group.contacts ?? {}).filter(([key]) => !session || rosterHas(session.roster, key));
26328
- const base = {
26329
- id: group.id,
26330
- profile: "mesh",
26331
- createdAt: group.createdAt,
26332
- lastMessageAt: this.lastMessageAt.get(group.id) ?? 0,
26333
- ...peerMessageAt(this.lastPeerMessageAt, group.id),
26334
- ...mentionAt(this.lastMentionAt, group.id),
26335
- invited: [...this.invited.get(group.id) ?? []],
26336
- memberLinks: Object.fromEntries(contacts.map(([key, linkId]) => [linkId, key]))
26337
- };
26338
- if (!session) {
26339
- const invitation = group.invitation;
26340
- return {
26341
- ...base,
26342
- name: groupName(invitation.name) ?? "",
26343
- isAdmin: false,
26344
- members: [],
26345
- canSend: false,
26346
- ...group.formerNames ? { formerNames: group.formerNames } : {},
26347
- invitation: {
26348
- linkId: invitation.linkId,
26349
- contact: this.host.contactName(invitation.linkId) ?? "",
26350
- admin: invitation.admin,
26351
- members: Math.min(Math.max(invitation.n, 0), GROUP_MEMBER_CAP.max),
26352
- accepted: !!invitation.seedB64,
26353
- ...this.acceptSaid.get(group.id)?.unanswered ? { unanswered: true } : {},
26354
- ...invitation.takenBack ? { takenBack: true } : {},
26355
- ...invitation.entry ? {
26356
- viaLink: true,
26357
- stage: this.joinStage(group)
26358
- } : {}
26359
- }
26360
- };
26361
- }
26362
- const nicks = session.state.nicks;
26363
- const entry = session.isAdmin ? this.entryOf(group) : void 0;
26364
- const now = this.now(), onHubs = this.hubs.active(group.id, session, now);
26365
- const hubKeys = new Set(onHubs ? this.hubs.hubs(group.id, session, now) : []), policy = session.hubPolicy;
26366
- if (onHubs && this.hubs.isHub(group.id)) hubKeys.add(session.myKey);
26367
- const typing = this.typings.view(session);
26368
- const former = Object.entries(nicks).filter(([key]) => !rosterHas(session.roster, key));
26447
+ return [...this.stored.values()].flatMap((group) => this.meshView(group) ?? []);
26448
+ }
26449
+ meshView(group) {
26450
+ if (!group || group.left || !(group.invitation || this.sessions.has(group.id))) return void 0;
26451
+ const session = this.sessions.get(group.id);
26452
+ const edges = this.host.edges(group.id);
26453
+ const contacts = Object.entries(group.contacts ?? {}).filter(([key]) => !session || rosterHas(session.roster, key));
26454
+ const base = {
26455
+ id: group.id,
26456
+ profile: "mesh",
26457
+ createdAt: group.createdAt,
26458
+ lastMessageAt: this.lastMessageAt.get(group.id) ?? 0,
26459
+ ...peerMessageAt(this.lastPeerMessageAt, group.id),
26460
+ ...mentionAt(this.lastMentionAt, group.id),
26461
+ invited: [...this.invited.get(group.id) ?? []],
26462
+ memberLinks: Object.fromEntries(contacts.map(([key, linkId]) => [linkId, key]))
26463
+ };
26464
+ if (!session) {
26465
+ const invitation = group.invitation;
26369
26466
  return {
26370
26467
  ...base,
26371
- name: session.name,
26372
- ...former.length ? { formerNames: Object.fromEntries(former) } : {},
26373
- status: session.status,
26374
- statusReason: session.state.statusReason,
26375
- epoch: session.epoch,
26376
- myKey: session.myKey,
26377
- isAdmin: session.isAdmin,
26378
- ...entry ? { entryLink: encodeGroupEntryLink(entry.link) } : {},
26379
- ...session.picture ? { picture: session.picture } : {},
26380
- canSend: session.status === "active" && session.readableEpochs.includes(session.epoch),
26381
- ...onHubs ? { hubs: { hub: this.hubs.isHub(group.id) } } : {},
26382
- ...typing ? { typing } : {},
26383
- members: session.roster.map(([key, role]) => {
26384
- const edge = edges.get(key);
26385
- const direct = key === session.myKey || !!edge && this.host.linkReady(edge), viaHub = !direct && onHubs && this.hubs.viaHub(group.id, session, key, now);
26386
- const hubRole = policy.pin.includes(key) ? "pin" : policy.no.includes(key) ? "exclude" : void 0;
26387
- return {
26388
- key,
26389
- role,
26390
- me: key === session.myKey,
26391
- nick: key === session.myKey ? void 0 : edge && this.host.edgeNick(edge) || nicks[key],
26392
- online: direct || viaHub,
26393
- ...viaHub ? { viaHub } : {},
26394
- ...hubKeys.has(key) ? { hub: true } : {},
26395
- ...hubRole ? { hubRole } : {},
26396
- missing: session.missing(key, this.gapsGone.get(group.id)?.get(key)?.[session.epoch])
26397
- };
26398
- })
26468
+ name: groupName(invitation.name) ?? "",
26469
+ isAdmin: false,
26470
+ members: [],
26471
+ canSend: false,
26472
+ ...group.formerNames ? { formerNames: group.formerNames } : {},
26473
+ invitation: {
26474
+ linkId: invitation.linkId,
26475
+ contact: this.host.contactName(invitation.linkId) ?? "",
26476
+ admin: invitation.admin,
26477
+ members: Math.min(Math.max(invitation.n, 0), GROUP_MEMBER_CAP.max),
26478
+ accepted: !!invitation.seedB64,
26479
+ ...this.acceptSaid.get(group.id)?.unanswered ? { unanswered: true } : {},
26480
+ ...invitation.takenBack ? { takenBack: true } : {},
26481
+ ...invitation.entry ? {
26482
+ viaLink: true,
26483
+ stage: this.joinStage(group)
26484
+ } : {}
26485
+ }
26399
26486
  };
26400
- }).sort((a, b) => Math.max(b.lastMessageAt, b.createdAt) - Math.max(a.lastMessageAt, a.createdAt));
26487
+ }
26488
+ const nicks = session.state.nicks;
26489
+ const entry = session.isAdmin ? this.entryOf(group) : void 0;
26490
+ const now = this.now(), onHubs = this.hubs.active(group.id, session, now);
26491
+ const hubKeys = new Set(onHubs ? this.hubs.hubs(group.id, session, now) : []), policy = session.hubPolicy;
26492
+ if (onHubs && this.hubs.isHub(group.id)) hubKeys.add(session.myKey);
26493
+ const typing = this.typings.view(session);
26494
+ const former = Object.entries(nicks).filter(([key]) => !rosterHas(session.roster, key));
26495
+ return {
26496
+ ...base,
26497
+ name: session.name,
26498
+ ...former.length ? { formerNames: Object.fromEntries(former) } : {},
26499
+ status: session.status,
26500
+ statusReason: session.state.statusReason,
26501
+ epoch: session.epoch,
26502
+ myKey: session.myKey,
26503
+ isAdmin: session.isAdmin,
26504
+ ...entry ? { entryLink: encodeGroupEntryLink(entry.link) } : {},
26505
+ ...session.picture ? { picture: session.picture } : {},
26506
+ canSend: session.status === "active" && session.readableEpochs.includes(session.epoch),
26507
+ ...onHubs ? { hubs: { hub: this.hubs.isHub(group.id) } } : {},
26508
+ ...typing ? { typing } : {},
26509
+ members: session.roster.map(([key, role]) => {
26510
+ const edge = edges.get(key);
26511
+ const direct = key === session.myKey || !!edge && this.host.linkReady(edge), viaHub = !direct && onHubs && this.hubs.viaHub(group.id, session, key, now);
26512
+ const hubRole = policy.pin.includes(key) ? "pin" : policy.no.includes(key) ? "exclude" : void 0;
26513
+ return {
26514
+ key,
26515
+ role,
26516
+ me: key === session.myKey,
26517
+ nick: key === session.myKey ? void 0 : edge && this.host.edgeNick(edge) || nicks[key],
26518
+ online: direct || viaHub,
26519
+ ...viaHub ? { viaHub } : {},
26520
+ ...hubKeys.has(key) ? { hub: true } : {},
26521
+ ...hubRole ? { hubRole } : {},
26522
+ missing: session.missing(key, this.gapsGone.get(group.id)?.get(key)?.[session.epoch])
26523
+ };
26524
+ })
26525
+ };
26401
26526
  }
26402
26527
  messages(groupId) {
26403
26528
  return this.store.getMessages(MESSAGE_LINK(groupId));
@@ -26904,26 +27029,26 @@ var Groups = class {
26904
27029
  const commit = frame && typeof frame === "object" && frame.t === "group-commit" ? frame.commit : void 0;
26905
27030
  return typeof commit?.e === "number" && commit.e <= removalEpoch(session.state.chain, key);
26906
27031
  }
26907
- /** My removals on their way in a group (`engine/removals.ts`). */
27032
+ /** My removals on their way in a group (`engine/removals.ts`), a private group's or a community's. */
26908
27033
  removals(groupId) {
26909
- return this.stored.get(groupId)?.removals ?? [];
27034
+ return this.record(groupId)?.removals ?? [];
26910
27035
  }
26911
27036
  async setRemovals(groupId, removals) {
26912
- const group = this.stored.get(groupId);
27037
+ const group = this.record(groupId);
26913
27038
  if (!group) return;
26914
27039
  group.removals = removals;
26915
27040
  await this.store.putGroup(group);
26916
27041
  }
26917
27042
  /** A member's message its author deleted for everyone (WISP 400 § Delete for everyone): a copy that comes again is not kept. */
26918
27043
  isRemoved(groupId, messageId) {
26919
- return !!this.stored.get(groupId)?.removedIds?.includes(messageId);
27044
+ return !!this.record(groupId)?.removedIds?.includes(messageId);
26920
27045
  }
26921
27046
  /**
26922
27047
  * Its author deleted a message for everyone: noted so (the newest `MAX_REMOVED_IDS`, also when the message is not here
26923
27048
  * yet, so it is taken as gone when it comes), and its file goes from this device.
26924
27049
  */
26925
27050
  async removed(groupId, messageId) {
26926
- const group = this.stored.get(groupId);
27051
+ const group = this.record(groupId);
26927
27052
  if (!group) return;
26928
27053
  if (!group.removedIds?.includes(messageId)) {
26929
27054
  group.removedIds = [...group.removedIds ?? [], messageId].slice(-500);
@@ -28847,6 +28972,8 @@ function authoredNote(p, at, all, current, memberOf = () => void 0, federationNe
28847
28972
  var GroupPayments = class {
28848
28973
  host;
28849
28974
  notes = /* @__PURE__ */ new Map();
28975
+ /** Per group, the ids of others' notes still `undescribed`, oldest first. */
28976
+ waiting = /* @__PURE__ */ new Map();
28850
28977
  queue = Promise.resolve();
28851
28978
  constructor(host) {
28852
28979
  this.host = host;
@@ -28930,7 +29057,18 @@ var GroupPayments = class {
28930
29057
  return notes;
28931
29058
  }
28932
29059
  async write(groupId, me, note) {
28933
- this.notes.get(groupId)?.set(note.id, note);
29060
+ const notes = this.notes.get(groupId);
29061
+ notes?.set(note.id, note);
29062
+ let waiting = this.waiting.get(groupId);
29063
+ if (note.undescribed && !note.mine) {
29064
+ if (!waiting) this.waiting.set(groupId, waiting = /* @__PURE__ */ new Set());
29065
+ waiting.add(note.id);
29066
+ for (const id of waiting) {
29067
+ if (waiting.size <= 256) break;
29068
+ waiting.delete(id);
29069
+ notes?.delete(id);
29070
+ }
29071
+ } else waiting?.delete(note.id);
28934
29072
  if (note.undescribed) return;
28935
29073
  const initiator = note.kind === "request" ? note.to : note.from;
28936
29074
  await this.host.putMessage({
@@ -36660,6 +36798,11 @@ var GhostlyNode = class GhostlyNode {
36660
36798
  cardRestores = /* @__PURE__ */ new Map();
36661
36799
  /** The contacts' edits of messages not here yet. */
36662
36800
  editBuffer = new EditBuffer();
36801
+ /** Removals of messages, whose quotes are looked for at most once a while per chat (`forgetQuotes`). */
36802
+ quoteSweeps = new QuoteSweeps(async (chat, removed) => {
36803
+ const ids = await this.forgetQuotes(chat, removed);
36804
+ if (ids.length) await this.messagesChanged(chat, ids);
36805
+ });
36663
36806
  /** Received status card updates, applied at most once a second per message (WISP 405 · Status Cards). */
36664
36807
  cardEdits = new CardEditPacer();
36665
36808
  /** When each message's buttons were last pressed here (`pressButton`). */
@@ -37168,6 +37311,7 @@ var GhostlyNode = class GhostlyNode {
37168
37311
  },
37169
37312
  receivePaymentRequest: (linkId, request) => this.desk.onPaymentRequest(linkId, request, true),
37170
37313
  changed: () => this.emitState(),
37314
+ fetch: (...request) => (this.options.holdFetch ?? globalThis.fetch)(...request),
37171
37315
  loopbackStorage: () => this.options.holdLoopback === true,
37172
37316
  ttlMs: () => {
37173
37317
  try {
@@ -37620,7 +37764,8 @@ var GhostlyNode = class GhostlyNode {
37620
37764
  async forgetGroupMessage(chat, id) {
37621
37765
  await this.groups.removed(chat.slice(6), id);
37622
37766
  await db.deleteMessage(chat, id);
37623
- await this.messagesChanged(chat, [id, ...await this.forgetQuotes(chat, id, id)]);
37767
+ this.quoteSweeps.add(chat, id, id);
37768
+ await this.messagesChanged(chat, [id]);
37624
37769
  this.emitState();
37625
37770
  }
37626
37771
  groupRemovalRows(chat) {
@@ -38485,6 +38630,7 @@ var GhostlyNode = class GhostlyNode {
38485
38630
  for (const queue of this.editQueues.values()) queue.stop();
38486
38631
  for (const restore of this.cardRestores.values()) clearTimeout(restore.timer);
38487
38632
  this.cardRestores.clear();
38633
+ this.quoteSweeps.stop();
38488
38634
  this.groupEdits.stop();
38489
38635
  this.reactions.stop();
38490
38636
  this.cardEdits.stop();
@@ -39493,6 +39639,7 @@ var GhostlyNode = class GhostlyNode {
39493
39639
  this.editQueues.delete(linkId);
39494
39640
  clearTimeout(this.cardRestores.get(linkId)?.timer);
39495
39641
  this.cardRestores.delete(linkId);
39642
+ this.quoteSweeps.forget(linkId);
39496
39643
  this.editBuffer.forget(linkId);
39497
39644
  live.carried?.stop();
39498
39645
  this.links.delete(linkId);
@@ -39946,7 +40093,13 @@ var GhostlyNode = class GhostlyNode {
39946
40093
  const live = this.links.get(linkId);
39947
40094
  if (!live?.stored.profile || live.stored.group) return false;
39948
40095
  const id = `peer_${edit.id}`;
39949
- if (live.stored.deletedIds?.includes(id)) return true;
40096
+ if (live.stored.deletedIds?.includes(id)) {
40097
+ if (edit.rm) this.quoteSweeps.add(linkId, id, replyRef({
40098
+ id,
40099
+ linkId
40100
+ }));
40101
+ return true;
40102
+ }
39950
40103
  if (edit.rm) {
39951
40104
  const message = await db.getMessage(linkId, id);
39952
40105
  if (!message || canRemove(message)) await this.forgetMessage(linkId, id, true);
@@ -40587,27 +40740,35 @@ var GhostlyNode = class GhostlyNode {
40587
40740
  }
40588
40741
  await db.deleteMessage(linkId, messageId);
40589
40742
  live.lastMessageAt = (await db.getMessagePage(linkId, { limit: 1 })).messages[0]?.timestamp ?? 0;
40590
- const quoting = removed ? await this.forgetQuotes(linkId, messageId, replyRef(message ?? {
40743
+ if (removed) this.quoteSweeps.add(linkId, messageId, replyRef(message ?? {
40591
40744
  id: messageId,
40592
40745
  linkId
40593
- })) : [];
40594
- await this.messagesChanged(linkId, [messageId, ...quoting]);
40746
+ }));
40747
+ await this.messagesChanged(linkId, [messageId]);
40595
40748
  this.emitState();
40596
40749
  }
40597
40750
  /**
40598
- * A message deleted for everyone leaves no line of it here (WISP 400 § Delete for everyone): the replies of the chat
40599
- * that quote it keep the quote's id and who wrote it, which say it was deleted, and lose its snippet. The chat is
40600
- * read whole: a removal is rare. The ids of the replies changed.
40751
+ * Messages deleted for everyone leave no line of them here (WISP 400 § Delete for everyone): the replies of the chat
40752
+ * that quote one keep the quote's id and who wrote it, which say it was deleted, and lose its snippet. The chat is
40753
+ * read whole, so removals are gathered (`QuoteSweeps`). The ids of the replies changed.
40601
40754
  */
40602
- async forgetQuotes(linkId, messageId, ref) {
40603
- const quotes = (reply) => !!reply && (reply.messageId === messageId || ref !== void 0 && reply.id === ref);
40604
- const ids = (await db.getMessages(linkId)).filter((m) => quotes(m.replyTo) && (m.replyTo.snippet || m.replyTo.messageId !== messageId)).map((m) => m.id);
40755
+ async forgetQuotes(linkId, removed) {
40756
+ const byRef = /* @__PURE__ */ new Map();
40757
+ for (const [id, ref] of removed) if (ref !== void 0) byRef.set(ref, id);
40758
+ const quoted = (reply) => !reply ? void 0 : reply.messageId !== void 0 && removed.has(reply.messageId) ? reply.messageId : byRef.get(reply.id);
40759
+ const ids = (await db.getMessages(linkId)).filter((m) => {
40760
+ const id = quoted(m.replyTo);
40761
+ return id !== void 0 && (m.replyTo.snippet || m.replyTo.messageId !== id);
40762
+ }).map((m) => m.id);
40605
40763
  if (!ids.length) return [];
40606
- await db.patchMessages(linkId, ids, (m) => quotes(m.replyTo) ? { replyTo: {
40607
- ...m.replyTo,
40608
- snippet: "",
40609
- messageId
40610
- } } : null);
40764
+ await db.patchMessages(linkId, ids, (m) => {
40765
+ const id = quoted(m.replyTo);
40766
+ return id === void 0 ? null : { replyTo: {
40767
+ ...m.replyTo,
40768
+ snippet: "",
40769
+ messageId: id
40770
+ } };
40771
+ });
40611
40772
  return ids;
40612
40773
  }
40613
40774
  /** Local id of a file we send: the id on the wire is ours too, but lives in its own key space. */
@@ -41999,15 +42160,19 @@ var GhostlyNode = class GhostlyNode {
41999
42160
  await this.appChatRunnable(ref, digest);
42000
42161
  return { error: live.link ? live.link.sendAppData(app, data) : "offline" };
42001
42162
  }
42002
- /** Ranges the contact's apps asked, by chat, app and request, until a page answers them. */
42163
+ /** Ranges the contact's apps asked, by chat, app and this engine's number for the ask, until a page answers them. */
42003
42164
  appRanges = /* @__PURE__ */ new Map();
42165
+ nextAppRangeAsk = 0;
42004
42166
  /**
42005
42167
  * Every task stays until a page answers it, live or not: until the link settles it, it holds one of its app's places
42006
42168
  * (WISP 1200: at most 4 in flight), so the contact gets `busy` rather than more reads while a page is still reading.
42169
+ * The page answers under a number of the engine's, not the contact's: a number the contact cancelled is free for it to
42170
+ * ask again while the page still reads the first ask, whose answer must not go out as the second's.
42007
42171
  */
42008
42172
  appRangeAsked(linkId, task) {
42009
- this.appRanges.set(`${linkId} ${task.app} ${task.request}`, task);
42010
- const { app, request, serve, file, offset, length } = task;
42173
+ const request = ++this.nextAppRangeAsk;
42174
+ this.appRanges.set(`${linkId} ${task.app} ${request}`, task);
42175
+ const { app, serve, file, offset, length } = task;
42011
42176
  this.events.onAppRange?.(linkId, {
42012
42177
  app,
42013
42178
  request,
@@ -45139,7 +45304,7 @@ var GhostlyNode = class GhostlyNode {
45139
45304
  get nativeFactories() {
45140
45305
  const relay = this.relaysHyperdht ? this.hyperdhtRelay : "";
45141
45306
  return {
45142
- ...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-SBo4aoMk.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
45307
+ ...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-CZfsPfT9.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
45143
45308
  ...this.options.nativeTransports,
45144
45309
  ...this.ownIrohRelays ? { "iroh/1": (seedB64) => this.options.nativeTransports["iroh/1"](seedB64, this.settings.irohRelays?.length ? { relays: [...this.settings.irohRelays] } : {}) } : {},
45145
45310
  ...this.options.irohWeb ? { "iroh/1": (seedB64) => createIrohWebEndpoint(seedB64, { relays: this.irohRelays }) } : {}
@@ -45315,9 +45480,8 @@ var GhostlyNode = class GhostlyNode {
45315
45480
  if (group && !live.stored.groupEntry && live.link && `group:${group}` !== this.activeLinkId && this.keepsGroupNative(live.stored)) groups.add(group);
45316
45481
  }
45317
45482
  if (!groups.size) return;
45318
- const views = new Map(this.groups.views().map((view) => [view.id, view]));
45319
45483
  for (const groupId of groups) {
45320
- const edges = this.groupEdgesByRank(groupId, views.get(groupId));
45484
+ const edges = this.groupEdgesByRank(groupId, this.groups.view(groupId));
45321
45485
  if (!edges.length || edges.some((live) => live.link.isDataLinkOpen)) continue;
45322
45486
  const [anchor, next] = edges;
45323
45487
  if (next && !this.anchorPassed(next, now) && this.unanswered(anchor, now)) {
@@ -45345,8 +45509,7 @@ var GhostlyNode = class GhostlyNode {
45345
45509
  /** A group opened on screen: its edges with no native listener take one as a chat on screen does, the one it keeps first. */
45346
45510
  groupOnScreen(groupId) {
45347
45511
  const native = Object.keys(this.nativeFactories);
45348
- const view = this.groups.views().find((g) => g.id === groupId);
45349
- for (const live of this.groupEdgesByRank(groupId, view)) {
45512
+ for (const live of this.groupEdgesByRank(groupId, this.groups.view(groupId))) {
45350
45513
  if (native.every((t) => live.link.availableTransports.includes(t))) continue;
45351
45514
  this.ensureNativeEndpoints(live.stored.id);
45352
45515
  }
@@ -45401,8 +45564,11 @@ var GhostlyNode = class GhostlyNode {
45401
45564
  const owners = [...this.links.values()].filter((other) => other.link?.availableTransports.includes(key));
45402
45565
  const slots = this.nativeSlots(key), groups = owners.filter((other) => other.stored.group).length;
45403
45566
  const now = Date.now();
45404
- let views;
45405
- const viewOf = (groupId) => (views ??= new Map(this.groups.views().map((view) => [view.id, view]))).get(groupId);
45567
+ const views = /* @__PURE__ */ new Map();
45568
+ const viewOf = (groupId) => {
45569
+ if (!views.has(groupId)) views.set(groupId, this.groups.view(groupId));
45570
+ return views.get(groupId);
45571
+ };
45406
45572
  const anchors = /* @__PURE__ */ new Map();
45407
45573
  const anchorOf = (groupId) => {
45408
45574
  if (!anchors.has(groupId)) anchors.set(groupId, this.groupEdgesByRank(groupId, viewOf(groupId))[0]);
@@ -46211,4 +46377,4 @@ function signalKind(signal) {
46211
46377
  //#endregion
46212
46378
  export { EngineServer };
46213
46379
 
46214
- //# sourceMappingURL=server-DIICuvgy.js.map
46380
+ //# sourceMappingURL=server-CcAs54Yb.js.map