@ghostlytools/cli 1.9.0 → 1.10.1

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 (118) hide show
  1. package/README.md +35 -27
  2. package/SKILL.md +7 -3
  3. package/dist/assets/api-BOWLZYXM.js +3 -0
  4. package/dist/assets/{api-DFCgr6RH.js → api-Bi6hCcwG.js} +100 -47
  5. package/dist/assets/api-Bi6hCcwG.js.map +1 -0
  6. package/dist/assets/{apiKit-CCavJJcl.js → apiKit-DzXHZojD.js} +26 -9
  7. package/dist/assets/apiKit-DzXHZojD.js.map +1 -0
  8. package/dist/assets/{apps-B7o2BPj6.js → apps-0Ks6KjqS.js} +1 -1
  9. package/dist/assets/{apps-DmxEG147.js → apps-DIQbzG08.js} +33 -10
  10. package/dist/assets/apps-DIQbzG08.js.map +1 -0
  11. package/dist/assets/{arkade-DtYR9H0c.js → arkade-zozCldAE.js} +2 -2
  12. package/dist/assets/{arkade-DtYR9H0c.js.map → arkade-zozCldAE.js.map} +1 -1
  13. package/dist/assets/{backup-YIB2XIES.js → backup-BL49Kt-T.js} +7 -6
  14. package/dist/assets/{backup-YIB2XIES.js.map → backup-BL49Kt-T.js.map} +1 -1
  15. package/dist/assets/{backup-BserdrNk.js → backup-BvIFcZM7.js} +1 -1
  16. package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
  17. package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
  18. package/dist/assets/{blobFiles-DOQDRdDI.js → blobFiles-BnjN_Vrz.js} +3 -3
  19. package/dist/assets/{blobFiles-DOQDRdDI.js.map → blobFiles-BnjN_Vrz.js.map} +1 -1
  20. package/dist/assets/buttons-CAW5v5EE.js +332 -0
  21. package/dist/assets/buttons-CAW5v5EE.js.map +1 -0
  22. package/dist/assets/buttons-oJI5mHSL.js +2 -0
  23. package/dist/assets/childEnv-BVOQK9EA.js +21 -0
  24. package/dist/assets/childEnv-BVOQK9EA.js.map +1 -0
  25. package/dist/assets/client-CyApKBEw.js +473 -0
  26. package/dist/assets/client-CyApKBEw.js.map +1 -0
  27. package/dist/assets/codec-DqFxxB_q.js +13 -0
  28. package/dist/assets/codec-DqFxxB_q.js.map +1 -0
  29. package/dist/assets/{endpoint-BdaeBw2L.js → endpoint-DWHkXWVM.js} +101 -16
  30. package/dist/assets/endpoint-DWHkXWVM.js.map +1 -0
  31. package/dist/assets/{envelope-Dt75vrmY.js → envelope-CMUgz31I.js} +3 -12
  32. package/dist/assets/envelope-CMUgz31I.js.map +1 -0
  33. package/dist/assets/fedimint_client_wasm_bg-BtHHlFpp.js.map +1 -1
  34. package/dist/assets/{fileBytes-BPDKufla.js → fileBytes-DMzrIdCu.js} +1 -1
  35. package/dist/assets/{fileBytes-DNgrRL0R.js → fileBytes-DjBYYyXT.js} +3 -3
  36. package/dist/assets/{fileBytes-DNgrRL0R.js.map → fileBytes-DjBYYyXT.js.map} +1 -1
  37. package/dist/assets/{fileBytes-Q3ehcEr8.js → fileBytes-Douk1yOp.js} +2 -2
  38. package/dist/assets/{fileBytes-Q3ehcEr8.js.map → fileBytes-Douk1yOp.js.map} +1 -1
  39. package/dist/assets/fileBytesIdb-CD5Uv490.js +2 -0
  40. package/dist/assets/{fileBytesIdb-Dm1EyEbT.js → fileBytesIdb-CkClu9YI.js} +3 -3
  41. package/dist/assets/{fileBytesIdb-Dm1EyEbT.js.map → fileBytesIdb-CkClu9YI.js.map} +1 -1
  42. package/dist/assets/{fileBytesOpfs-ZGD21c4Q.js → fileBytesOpfs-WryQuOgK.js} +3 -3
  43. package/dist/assets/{fileBytesOpfs-ZGD21c4Q.js.map → fileBytesOpfs-WryQuOgK.js.map} +1 -1
  44. package/dist/assets/{fixedHosts-B598JzbC.js → fixedHosts-C2hdCfzK.js} +4 -4
  45. package/dist/assets/{fixedHosts-B598JzbC.js.map → fixedHosts-C2hdCfzK.js.map} +1 -1
  46. package/dist/assets/{groupFiles-FXel6zIc.js → groupFiles-BAQIt_bJ.js} +404 -161
  47. package/dist/assets/groupFiles-BAQIt_bJ.js.map +1 -0
  48. package/dist/assets/{host-DIBeK_c_.js → host-CaRlDMTd.js} +206 -49
  49. package/dist/assets/host-CaRlDMTd.js.map +1 -0
  50. package/dist/assets/{hyperdhtRelay-D185dETu.js → hyperdhtRelay-BxADl3SG.js} +2 -2
  51. package/dist/assets/{hyperdhtRelay-D185dETu.js.map → hyperdhtRelay-BxADl3SG.js.map} +1 -1
  52. package/dist/assets/{idb-BkOJES5_.js → idb-BHsAqENE.js} +37 -6
  53. package/dist/assets/idb-BHsAqENE.js.map +1 -0
  54. package/dist/assets/{irohWeb-BSv_BWyG.js → irohWeb-D2sh6EWp.js} +65 -7
  55. package/dist/assets/irohWeb-D2sh6EWp.js.map +1 -0
  56. package/dist/assets/{main-BbhfMTt8.js → main-Bc4Ow56Z.js} +221 -287
  57. package/dist/assets/main-Bc4Ow56Z.js.map +1 -0
  58. package/dist/assets/{mainline-9Vc3c3SA.js → mainline-DWh4Ccri.js} +2 -2
  59. package/dist/assets/{mainline-9Vc3c3SA.js.map → mainline-DWh4Ccri.js.map} +1 -1
  60. package/dist/assets/networkReason-DT_D_Wpc.js +474 -0
  61. package/dist/assets/networkReason-DT_D_Wpc.js.map +1 -0
  62. package/dist/assets/{nwc-QX3Yt1Sb.js → nwc-DoSEhUKb.js} +3 -3
  63. package/dist/assets/{nwc-QX3Yt1Sb.js.map → nwc-DoSEhUKb.js.map} +1 -1
  64. package/dist/assets/{nwcProvider-CzX3xH47.js → nwcProvider-CGWqUjpB.js} +2 -2
  65. package/dist/assets/{nwcProvider-CzX3xH47.js.map → nwcProvider-CGWqUjpB.js.map} +1 -1
  66. package/dist/assets/{ownDid-D8z5gwGI.js → ownDid-CbGjRLBn.js} +3 -3
  67. package/dist/assets/ownDid-CbGjRLBn.js.map +1 -0
  68. package/dist/assets/{profiles-MFtCmJwK.js → profiles-DgIfvBeN.js} +47 -4
  69. package/dist/assets/profiles-DgIfvBeN.js.map +1 -0
  70. package/dist/assets/{registry-B2Dtnibo.js → registry-BSyxGjN6.js} +11 -9
  71. package/dist/assets/registry-BSyxGjN6.js.map +1 -0
  72. package/dist/assets/{registry-PTtBMaYZ.js → registry-C5cn80Rw.js} +1 -1
  73. package/dist/assets/{resolve-ZxVzwFNA.js → resolve-D-9YRFhl.js} +2 -2
  74. package/dist/assets/{resolve-ZxVzwFNA.js.map → resolve-D-9YRFhl.js.map} +1 -1
  75. package/dist/assets/{restoredRows-BCRCjhdF.js → restoredRows-CRYwIx3g.js} +2 -2
  76. package/dist/assets/{restoredRows-BCRCjhdF.js.map → restoredRows-CRYwIx3g.js.map} +1 -1
  77. package/dist/assets/{buttons-CuRfKnPI.js → secretGuard-CSVNxXVW.js} +80 -330
  78. package/dist/assets/secretGuard-CSVNxXVW.js.map +1 -0
  79. package/dist/assets/secretGuard-Q2BKq0q0.js +2 -0
  80. package/dist/assets/{server-Dw1o8z1o.js → server-BufntkX8.js} +1734 -369
  81. package/dist/assets/server-BufntkX8.js.map +1 -0
  82. package/dist/assets/{src-BD8RBVEp.js → src-CCt5s4DK.js} +3073 -1890
  83. package/dist/assets/src-CCt5s4DK.js.map +1 -0
  84. package/dist/assets/{sshForges-DWrESWkK.js → sshForges-D8CPaIbR.js} +16 -9
  85. package/dist/assets/{sshForges-DWrESWkK.js.map → sshForges-D8CPaIbR.js.map} +1 -1
  86. package/dist/assets/{translate-D1uP0q32.js → translate-Cb-6hMhD.js} +17 -12
  87. package/dist/assets/translate-Cb-6hMhD.js.map +1 -0
  88. package/dist/assets/{usdt-DhVN8geQ.js → usdt-ds461mzA.js} +3 -3
  89. package/dist/assets/{usdt-DhVN8geQ.js.map → usdt-ds461mzA.js.map} +1 -1
  90. package/dist/assets/{words-DdXPkB3n.js → words-B1ylON2h.js} +4 -2
  91. package/dist/assets/words-B1ylON2h.js.map +1 -0
  92. package/dist/ghostly.mjs +1 -1
  93. package/package.json +1 -1
  94. package/dist/assets/api-DFCgr6RH.js.map +0 -1
  95. package/dist/assets/api-raWw9j_m.js +0 -3
  96. package/dist/assets/apiKit-CCavJJcl.js.map +0 -1
  97. package/dist/assets/apps-DmxEG147.js.map +0 -1
  98. package/dist/assets/buttons-CuRfKnPI.js.map +0 -1
  99. package/dist/assets/buttons-De3LPdSG.js +0 -2
  100. package/dist/assets/daemonProof-DtrL5lE5.js +0 -236
  101. package/dist/assets/daemonProof-DtrL5lE5.js.map +0 -1
  102. package/dist/assets/endpoint-BdaeBw2L.js.map +0 -1
  103. package/dist/assets/envelope-Dt75vrmY.js.map +0 -1
  104. package/dist/assets/fileBytesIdb-DZcESfTt.js +0 -2
  105. package/dist/assets/groupFiles-FXel6zIc.js.map +0 -1
  106. package/dist/assets/host-DIBeK_c_.js.map +0 -1
  107. package/dist/assets/idb-BkOJES5_.js.map +0 -1
  108. package/dist/assets/irohWeb-BSv_BWyG.js.map +0 -1
  109. package/dist/assets/main-BbhfMTt8.js.map +0 -1
  110. package/dist/assets/networkReason-BncJ9KSM.js +0 -154
  111. package/dist/assets/networkReason-BncJ9KSM.js.map +0 -1
  112. package/dist/assets/ownDid-D8z5gwGI.js.map +0 -1
  113. package/dist/assets/profiles-MFtCmJwK.js.map +0 -1
  114. package/dist/assets/registry-B2Dtnibo.js.map +0 -1
  115. package/dist/assets/server-Dw1o8z1o.js.map +0 -1
  116. package/dist/assets/src-BD8RBVEp.js.map +0 -1
  117. package/dist/assets/translate-D1uP0q32.js.map +0 -1
  118. package/dist/assets/words-DdXPkB3n.js.map +0 -1
@@ -1,3 +0,0 @@
1
- import { c as findGroup, o as findChat } from "./apiKit-CCavJJcl.js";
2
- import { a as hideStateSecrets, i as groupSendRefused, n as SETTABLE, o as mentionsFor, r as callApi, s as redactSettings, t as API_METHODS } from "./api-DFCgr6RH.js";
3
- export { API_METHODS, SETTABLE, callApi, findChat, findGroup, groupSendRefused, hideStateSecrets, mentionsFor, redactSettings };
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiKit-CCavJJcl.js","names":[],"sources":["../../src/apiKit.ts"],"sourcesContent":["import { INVITE_TAKEN, isZ32Key, type PairedTransport } from \"@ghostly/core\";\nimport type { GhostlyNode } from \"@ghostly/browser/engine/node\";\nimport type { EngineState, GroupView, LinkView, StoredMessage } from \"@ghostly/browser/shared/types\";\nimport { CliError } from \"./errors\";\nimport type { CallManager } from \"./calls/manager\";\nimport type { EventHub } from \"./events\";\nimport type { Runtime } from \"./runtime/engine\";\n\n/**\n * The methods of the local control API (WISP 1100): the daemon answers them over its socket, and a one-shot\n * command calls them in its own process. Parameters come from JSON: every one is checked here.\n */\nexport interface ApiContext {\n runtime: Runtime;\n hub: EventHub;\n /** Voice calls (WISP 1100 § Calls). */\n calls: CallManager;\n /** How the host runs: a daemon stays; a one-shot leaves when its command is done. */\n mode: \"daemon\" | \"one-shot\";\n version: string;\n /** The daemon asks to stop (answered first). */\n stop?: () => void;\n /** The daemon is a `listen` that found none and runs the profile itself: a stop ends that listen too. */\n listen?: true;\n}\n\nexport type Params = Record<string, unknown>;\nexport type Method = (ctx: ApiContext, params: Params) => Promise<unknown>;\n\nexport const node = (ctx: ApiContext): GhostlyNode => ctx.runtime.server.node;\nexport const state = (ctx: ApiContext): EngineState => node(ctx).getState();\n\n/**\n * The time of a send the engine names its row after (`me_<timestamp>`: a file, a payment, a request), its own even\n * within one millisecond (a bot paying or sending several times at once over the socket, `file send` run in\n * parallel), or the chat keeps only one. One clock for all of them: they share the row names. A file's resend after a\n * drop finds its row by it, as a forward does.\n */\nlet lastSentAt = 0;\nexport const sentAt = () => (lastSentAt = Math.max(Date.now(), lastSentAt + 1));\n\n// ---------- parameters ----------\n\nexport function str(params: Params, name: string, required: true): string;\nexport function str(params: Params, name: string, required?: false): string | undefined;\nexport function str(params: Params, name: string, required = false): string | undefined {\n const value = params[name];\n if (value === undefined || value === null || value === \"\") {\n if (required) throw new CliError(\"bad_request\", `${name} is required`);\n return undefined;\n }\n if (typeof value !== \"string\") throw new CliError(\"bad_request\", `${name} must be a string`);\n return value;\n}\n/** A number in `[min, max]`; `whole` takes only whole ones (a count of messages), as the engine needs them. */\nexport function num(params: Params, name: string, fallback: number, { min = 0, max = Number.MAX_SAFE_INTEGER, whole = false } = {}): number {\n const value = params[name];\n if (value === undefined || value === null) return fallback;\n if (typeof value !== \"number\" || !Number.isFinite(value) || value < min || value > max) throw new CliError(\"bad_request\", `${name} must be a ${whole ? \"whole \" : \"\"}number from ${min} to ${max}`);\n if (whole && !Number.isSafeInteger(value)) throw new CliError(\"bad_request\", `${name} must be a whole number from ${min} to ${max}`);\n return value;\n}\nexport function bool(params: Params, name: string): boolean {\n const value = params[name];\n if (value === undefined || value === null) return false;\n if (typeof value !== \"boolean\") throw new CliError(\"bad_request\", `${name} must be true or false`);\n return value;\n}\nexport function list(params: Params, name: string): string[] {\n const value = params[name];\n if (value === undefined || value === null) return [];\n if (!Array.isArray(value) || value.some((item) => typeof item !== \"string\")) throw new CliError(\"bad_request\", `${name} must be a list of strings`);\n return value as string[];\n}\n/**\n * One of `values`; `fallback` when it was left out. Given empty (an unset variable in a script: `wallet remove \"\"`), it\n * is refused like any other wrong choice, never read as left out: that acted on the default (the Cashu wallet).\n */\nexport function oneOf<T extends string>(params: Params, name: string, values: readonly T[], fallback: T): T {\n const value = params[name] === \"\" ? \"\" : str(params, name) ?? fallback;\n if (!values.includes(value as T)) throw new CliError(\"bad_request\", `${name} must be one of ${values.join(\", \")}`);\n return value as T;\n}\n\n// ---------- finding things ----------\n\nconst KEY_SHAPED = /^[ybndrfg8ejkmcpqxot1uwisza345h769]{52}$/;\n/**\n * A contact key as chats show it (`peer`): 52 characters of z-base-32, in its one canonical spelling. The same 52\n * characters with the last one respelled decode to the same bytes but are no key (WISP 02): refused here, so that\n * they never fall through to a chat's name, which its contact chooses.\n */\nexport const CONTACT_KEY = {\n test(ref: string): boolean {\n if (isZ32Key(ref)) return true;\n if (KEY_SHAPED.test(ref)) throw new CliError(\"bad_request\", `${JSON.stringify(ref)} is not a contact key: a key has one spelling, and its last character is not this one`);\n return false;\n },\n};\n\n/**\n * A chat by its id; by its contact's key (only by the key: a name is never taken for one); by the label this side gave\n * it; and only when no label matches, by a unique prefix of its id or the name the contact gave itself. The contact\n * controls both of those (a joiner's chat id is made from the inviter's code), so neither wins over a label, and a ref\n * that fits one chat's prefix and another's name is refused.\n */\nexport function findChat(links: readonly LinkView[], ref: string): LinkView {\n return chatBy(links, ref).link;\n}\n\n/** `findChat`, and whether only what the contact controls (`theirName`: a prefix of the id, its own name) found the chat. */\nfunction chatBy(links: readonly LinkView[], ref: string): { link: LinkView; theirName: boolean } {\n // \"\" (an unset variable in a script) is a prefix of every id: it took the only chat.\n if (!ref.trim()) throw new CliError(\"bad_request\", `${JSON.stringify(ref)} names no chat`);\n const exact = links.find((link) => link.id === ref);\n if (exact) return { link: exact, theirName: false };\n if (CONTACT_KEY.test(ref)) {\n const byKey = links.filter((link) => link.peerPubKeyZ32 === ref);\n if (byKey.length === 1) return { link: byKey[0], theirName: false };\n if (byKey.length > 1) throw new CliError(\"bad_request\", `${JSON.stringify(ref)} names more than one chat: use its id`, { matches: byKey.map((link) => link.id) });\n throw new CliError(\"not_found\", `No chat with ${JSON.stringify(ref)} (ghostly chat list)`);\n }\n const lower = ref.toLowerCase();\n const named = (name: string | null | undefined) => name?.trim().toLowerCase() === lower;\n const byLabel = links.filter((link) => named(link.label));\n const found = byLabel.length ? byLabel : [...new Set([...links.filter((link) => link.id.startsWith(ref)), ...links.filter((link) => named(link.peerNick))])];\n if (found.length === 1) return { link: found[0], theirName: !byLabel.length };\n if (found.length > 1) throw new CliError(\"bad_request\", `${JSON.stringify(ref)} names more than one chat: use its id`, { matches: found.map((link) => link.id) });\n throw new CliError(\"not_found\", `No chat ${JSON.stringify(ref)} (ghostly chat list)`);\n}\n\n/**\n * `findChat` for a grant the daemon keeps acting on (`call auto on --from`): only the chat's id, its contact's key or the\n * label this side gave it name the chat. A prefix of its id or the name its contact gave itself is refused, with the\n * chat it found: the contact chose those, so another contact could take the grant by calling itself that name.\n */\nexport function findOwnNamedChat(links: readonly LinkView[], ref: string): LinkView {\n const chat = chatBy(links, ref);\n if (chat.theirName) throw namedByThem(ref, { chat: chat.link.id, name: chat.link.peerNick ?? null, contact: chat.link.peerPubKeyZ32 });\n return chat.link;\n}\n\n/** `findOwnNamedChat`'s refusal: `ref` found `chat` only by what its contact chose. */\nexport function namedByThem(ref: string, chat: { chat: string; name: string | null; contact: string | undefined }): CliError {\n return new CliError(\"bad_request\", `${JSON.stringify(ref)} names a chat only by what its contact chose (a prefix of its id, its own name): use the chat's id, its contact's key or a label given here (ghostly chat rename <chat> <name>)`, chat);\n}\n\n/** Only an invitation so far: this profile is not in the group (yet), and whoever invited chose its name. */\nconst invitedOnly = (group: GroupView) => group.status === undefined && !!group.invitation;\n\n/**\n * A group by its id, by its name, or (only when no name matches) by a unique prefix of its id: whoever created a group\n * chose its id, so a prefix never wins over a name. A group this profile is in wins over an invitation with the same\n * name or prefix (the one who invites chooses those); an invitation is still found by its id, and by name or prefix\n * where no group of this profile has it.\n */\nexport function findGroup(groups: readonly GroupView[], ref: string): GroupView {\n if (!ref.trim()) throw new CliError(\"bad_request\", `${JSON.stringify(ref)} names no group`);\n const exact = groups.find((group) => group.id === ref);\n if (exact) return exact;\n const lower = ref.toLowerCase();\n for (const among of [groups.filter((group) => !invitedOnly(group)), groups.filter(invitedOnly)]) {\n const byName = among.filter((group) => group.name.trim().toLowerCase() === lower);\n const found = byName.length ? byName : among.filter((group) => group.id.startsWith(ref));\n if (found.length === 1) return found[0];\n if (found.length > 1) throw new CliError(\"bad_request\", `${JSON.stringify(ref)} names more than one group: use its id`, { matches: found.map((group) => group.id) });\n }\n throw new CliError(\"not_found\", `No group ${JSON.stringify(ref)} (ghostly group list)`);\n}\n\n/**\n * A chat or a group, where a command takes either: `group:<id>` is a group; anything else a chat first (`findChat`),\n * then a group. A chat found only by what its contact chose (a prefix of its id, its own name) never takes what also\n * names a group: a group's\n * own id is that group, and a prefix or the name of a group this profile is in is refused, with both ids. With neither,\n * one `not_found` names both and where to look (a contact's key: no chat with it); a name that matches more than one\n * chat or group stays that error.\n */\nexport function findChatOrGroup(links: readonly LinkView[], groups: readonly GroupView[], ref: string): { link: LinkView } | { group: GroupView } {\n if (ref.startsWith(\"group:\")) return { group: findGroup(groups, ref.slice(\"group:\".length)) };\n let chat: ReturnType<typeof chatBy>;\n try {\n chat = chatBy(links, ref);\n } catch (error) {\n if (!(error instanceof CliError) || error.code !== \"not_found\") throw error;\n try { return { group: findGroup(groups, ref) }; } catch (inner) {\n if (!(inner instanceof CliError) || inner.code !== \"not_found\") throw inner;\n if (CONTACT_KEY.test(ref)) throw error;\n throw new CliError(\"not_found\", `No chat or group ${JSON.stringify(ref)} (ghostly chat list, ghostly group list)`);\n }\n }\n if (!chat.theirName) return { link: chat.link };\n const exact = groups.find((group) => group.id === ref);\n if (exact) return { group: exact };\n const lower = ref.toLowerCase();\n const also = groups.filter((group) => !invitedOnly(group) && (group.id.startsWith(ref) || group.name.trim().toLowerCase() === lower));\n if (also.length) throw new CliError(\"bad_request\", `${JSON.stringify(ref)} names a chat (by what its contact chose) and a group: use the chat's id or group:<id>`, { chat: chat.link.id, groups: also.map((group) => group.id) });\n return { link: chat.link };\n}\n\nexport const chatOf = (ctx: ApiContext, params: Params) => findChat(state(ctx).links, str(params, \"chat\", true));\n\n/**\n * A chat whose invite nobody took yet: nobody is there to pay or to dial, and its stage says so. Before, `chat pay`\n * waited 15 s and `chat connect` 25 s for the contact, then answered `engine`. A chat whose invite someone else used\n * first is refused too, with the sentence `send` gives: its contact seals everything to them (`connect` waited 120 s,\n * then answered `timeout`, a code a bot retries).\n */\nexport function inviteTaken(link: LinkView): void {\n if (link.profile && link.inviteCode && !link.peerParticipationKey) throw new CliError(\"unavailable\", \"Nobody joined this chat yet: its invite is still waiting to be taken\");\n if (link.dhtDelivery?.inviteTaken && link.textDelivery !== \"stream\") throw new CliError(\"refused\", INVITE_TAKEN);\n}\n\n/**\n * A chat on DHT only opens no live session: the engine refused `chat connect` as `engine`, \"Both peers must choose a\n * live method first\", which read as if this side had to change something. Refused instead, naming whose choice it is\n * (`details.reason`): the contact's (`peer-dht-only`, nothing to do here but wait), or this side's (`dht-only`).\n */\nexport function dhtOnly(link: LinkView): void {\n if (link.deliveryMode === \"dht\") throw new CliError(\"refused\", \"This chat is on DHT only on this side: choose a live method first (chat transport auto)\", { reason: \"dht-only\" });\n if (link.dhtDelivery?.peerMode === \"dht\") throw new CliError(\"refused\", \"Your contact keeps this chat on DHT only: it goes live once they choose a live method. Short texts still go on the DHT\", { reason: \"peer-dht-only\" });\n}\n\nconst TRANSPORT_TITLES: Record<PairedTransport, string> = { \"webrtc/1\": \"WebRTC\", \"iroh/1\": \"Iroh\", \"hyperdht/1\": \"HyperDHT\" };\n\n/**\n * A transport the chat's Connection menu offers: one this app runs (on DHT only, one it can start), and the contact's\n * app too, by its last word. `chat transport` took any: toward a contact with no WebRTC (`GHOSTLY_WEBRTC=0`) the choice\n * was kept and the chat stayed where it was, saying nothing; for one this app lacks, the engine answered `engine`,\n * \"Transport unavailable\". Refused instead, saying whose app lacks it (`details.reason`, as a chat's wait says it).\n */\nexport function transportOffered(link: LinkView, transport: PairedTransport): void {\n const mine = (link.deliveryMode === \"dht\" ? link.runnableTransports : undefined) ?? link.availableTransports;\n const title = TRANSPORT_TITLES[transport], error = link.transportErrors?.[transport];\n if (mine && !mine.includes(transport)) throw new CliError(\"refused\", `This app has no ${title} running${error ? `: ${error}` : \"\"}`, { reason: \"app-lacks\", transport });\n if (link.peerTransports?.length && !link.peerTransports.includes(transport)) throw new CliError(\"refused\", `Your contact's app doesn't have ${title}: choose another, or auto`, { reason: \"contact-lacks\", transport });\n}\n\n/** A chat or a group as `findChatOrGroup` reads it. `linkId` is what the engine calls it. */\nexport function chatOrGroup(ctx: ApiContext, ref: string): { id: string; linkId: string; group: boolean } {\n const found = findChatOrGroup(state(ctx).links, state(ctx).groups, ref);\n return \"group\" in found ? { id: found.group.id, linkId: `group:${found.group.id}`, group: true } : { id: found.link.id, linkId: found.link.id, group: false };\n}\n\n/**\n * The group a group command names. A chat's id, key or name says it is a chat, with `twin`, the chat command that takes\n * it (`group send` on a chat, where `send` is meant; `<chat>` stands for the ref), else where the groups are listed.\n * It read \"No group\" before. A name nothing has stays that error.\n */\nexport function groupOf(ctx: ApiContext, params: Params, twin?: string): GroupView {\n const ref = str(params, \"group\", true);\n try { return findGroup(state(ctx).groups, ref); } catch (error) {\n if (!(error instanceof CliError) || error.code !== \"not_found\") throw error;\n let chat: LinkView;\n try { chat = findChat(state(ctx).links, ref); } catch { throw error; }\n const shown = /^[\\w.:-]+$/.test(ref) ? ref : JSON.stringify(ref);\n throw new CliError(\"not_found\", `${JSON.stringify(ref)} is a chat, not a group${twin ? `: ghostly ${twin.replace(\"<chat>\", shown)}` : \" (ghostly group list)\"}`, { chat: chat.id });\n }\n}\n\n/**\n * A message of a chat or a group (`group:<id>`) named by its id here, read as one row; only a name that is no such\n * row's key (the id both sides know, `wireId`) reads the whole history. `keep`: only a message it accepts (mine, or\n * someone else's). The history is synchronous work on the daemon's one thread, about 120 ms at 10,000 messages.\n */\nexport async function messageOf(ctx: ApiContext, linkId: string, ref: string, keep: (message: StoredMessage) => boolean = () => true): Promise<StoredMessage | undefined> {\n const found = await node(ctx).getMessage(linkId, ref);\n if (found && keep(found)) return found;\n const all = linkId.startsWith(\"group:\") ? await node(ctx).groupMessages({ groupId: linkId.slice(\"group:\".length) }) : await node(ctx).getMessages(linkId);\n return all.find((m) => keep(m) && m.wireId === ref);\n}\n\n// ---------- waiting ----------\n\n/**\n * Resolves with `check`'s first defined answer: now, or on a later state; `timeout` error after `ms`. A check that\n * throws on a later state (`chat wait`'s chat removed) ends the wait with its error: the hub swallows what its\n * listeners throw, and the wait went on to its timeout.\n */\nexport function waitForState<T>(ctx: ApiContext, check: (state: EngineState) => T | undefined, ms: number, what: string): Promise<T> {\n const now = check(state(ctx));\n if (now !== undefined) return Promise.resolve(now);\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => { off(); reject(new CliError(\"timeout\", `Timed out after ${Math.round(ms / 1000)} s waiting for ${what}`)); }, ms);\n const off = ctx.hub.onState((next) => {\n let value: T | undefined;\n try { value = check(next); } catch (error) { clearTimeout(timer); off(); reject(error); return; }\n if (value === undefined) return;\n clearTimeout(timer);\n off();\n resolve(value);\n });\n });\n}\n\n"],"mappings":";;;AA6BA,IAAa,QAAQ,QAAiC,IAAI,QAAQ,OAAO;AACzE,IAAa,SAAS,QAAiC,KAAK,GAAG,CAAC,CAAC,SAAS;;;;;;;AAQ1E,IAAI,aAAa;AACjB,IAAa,eAAgB,aAAa,KAAK,IAAI,KAAK,IAAI,GAAG,aAAa,CAAC;AAM7E,SAAgB,IAAI,QAAgB,MAAc,WAAW,OAA2B;CACtF,MAAM,QAAQ,OAAO;CACrB,IAAI,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU,IAAI;EACzD,IAAI,UAAU,MAAM,IAAI,SAAS,eAAe,GAAG,KAAK,aAAa;EACrE;CACF;CACA,IAAI,OAAO,UAAU,UAAU,MAAM,IAAI,SAAS,eAAe,GAAG,KAAK,kBAAkB;CAC3F,OAAO;AACT;;AAEA,SAAgB,IAAI,QAAgB,MAAc,UAAkB,EAAE,MAAM,GAAG,MAAM,OAAO,kBAAkB,QAAQ,UAAU,CAAC,GAAW;CAC1I,MAAM,QAAQ,OAAO;CACrB,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO;CAClD,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,KAAK,QAAQ,OAAO,QAAQ,KAAK,MAAM,IAAI,SAAS,eAAe,GAAG,KAAK,aAAa,QAAQ,WAAW,GAAG,cAAc,IAAI,MAAM,KAAK;CAClM,IAAI,SAAS,CAAC,OAAO,cAAc,KAAK,GAAG,MAAM,IAAI,SAAS,eAAe,GAAG,KAAK,+BAA+B,IAAI,MAAM,KAAK;CACnI,OAAO;AACT;A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ACJ,IAAI;IAAE,QAAQ,MAAM,IAAI;GAAG,SAAS,OAAO;IAAE,aAAa,KAAK;IAAG,IAAI;IAAG,OAAO,KAAK;IAAG;GAAQ;GAChG,IAAI,UAAU,KAAA,GAAW;GACzB,aAAa,KAAK;GAClB,IAAI;GACJ,QAAQ,KAAK;EACf,CAAC;CACH,CAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"apps-DmxEG147.js","names":[],"sources":["../../src/appTemplate.ts","../../src/nativeEd25519.ts","../../src/apps.ts"],"sourcesContent":["/*\n * What `ghostly app init` writes (WISP 1200, Apps · Publishing): the smallest app that does something with a contact.\n * Three files, each whole in this module, so the CLI's one built file carries them: the manifest as a publisher writes\n * it, a page that says hello to the same app on the contact's side, and a README with the way from here to a store.\n */\n\nexport interface AppTemplate { name: string; title: string }\n\nconst html = (text: string) => text.replace(/[&<>\"]/g, (c) => ({ \"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\" })[c]!);\n\n/** `ghostly-app.json`: the manifest without `publisher`, `sequence` and `files`, which `app publish` writes. */\nexport function templateManifest({ name, title }: AppTemplate): Record<string, unknown> {\n return {\n name,\n version: \"0.1.0\",\n kind: \"mini-app\",\n title,\n tagline: \"Say hello to a contact\",\n description: \"Open it in a chat and your contact gets a card to join. Each side can then say hello to the other.\",\n entry: \"index.html\",\n permissions: [\"chat\"],\n view: \"chat\",\n runtime: { host: \">=1.2\", clients: [\"web\", \"desktop\"] },\n license: \"MIT\",\n };\n}\n\n/**\n * `index.html`: the whole app in one file, as the sandbox needs it (no network, so nothing is loaded from elsewhere).\n * Its script is plain JavaScript typed with JSDoc against `@ghostlytools/sdk/app`, so it runs as written and still type\n * checks (test/appInit.test.ts does). The title is the only thing put into it, as text. Its type imports are in single\n * quotes: they are text of the page, not imports of the CLI's own build (test/packageDeps.test.ts reads those).\n */\nexport function templatePage({ title }: AppTemplate): string {\n return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>${html(title)}</title>\n<style>\n :root { color-scheme: light dark; --bg: #ffffff; --fg: #16181d; --muted: #5b6270; --line: #d9dde3; --accent: #2f6fed; }\n :root[data-theme=\"dark\"] { --bg: #16181d; --fg: #f2f4f7; --muted: #a3abb8; --line: #343a45; --accent: #7aa5ff; }\n body { margin: 0; padding: 20px; background: var(--bg); color: var(--fg); font: 16px/1.4 system-ui, sans-serif; }\n h1 { margin: 0 0 4px; font-size: 20px; }\n #status { margin: 0 0 16px; color: var(--muted); }\n button { font: inherit; padding: 8px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--bg); }\n button:disabled { opacity: 0.5; }\n ul { margin: 16px 0 0; padding: 0; list-style: none; }\n li { padding: 8px 0; border-top: 1px solid var(--line); }\n</style>\n</head>\n<body>\n<h1>${html(title)}</h1>\n<p id=\"status\" role=\"status\">Starting</p>\n<button id=\"hello\" type=\"button\" disabled>Say hello</button>\n<ul id=\"log\" aria-label=\"Messages\"></ul>\n<script type=\"module\">\n// The types of the API come from the SDK (npm install --save-dev --prefix .. @ghostlytools/sdk); nothing of it runs here.\n/** @typedef {import('@ghostlytools/sdk/app').MiniAppApi} MiniAppApi */\n/** @typedef {import('@ghostlytools/sdk/app').MiniAppJson} MiniAppJson */\n\n/** The longest text shown from a contact's frame. */\nconst MAX_TEXT = 200;\n\nconst status = /** @type {HTMLElement} */ (document.getElementById(\"status\"));\nconst button = /** @type {HTMLButtonElement} */ (document.getElementById(\"hello\"));\nconst log = /** @type {HTMLElement} */ (document.getElementById(\"log\"));\n\n/** @param {string} text */\nfunction show(text) {\n const line = document.createElement(\"li\");\n line.textContent = text;\n log.append(line);\n}\n\n/**\n * What the contact's app sent, when it is a hello. A frame comes from another device: read only what this app sends,\n * and never put it in the page as HTML.\n * @param {MiniAppJson} data\n * @returns {string | null}\n */\nfunction helloOf(data) {\n if (!data || typeof data !== \"object\" || Array.isArray(data) || data.type !== \"hello\") return null;\n return typeof data.text === \"string\" && data.text.length <= MAX_TEXT ? data.text : null;\n}\n\n/**\n * Why a send was refused, in words. The code is the rejection's message (MINI_APP_ERROR_CODES in the SDK); a later\n * client may add one.\n * @param {unknown} error\n */\nfunction refusal(error) {\n switch (error instanceof Error ? error.message : \"\") {\n case \"offline\": return \"Not sent: you are not both online\";\n case \"peer-closed\": case \"not-open\": return \"Not sent: your contact has not opened this app\";\n case \"not-allowed\": return \"Open this app in a chat to say hello\";\n default: return \"Not sent\";\n }\n}\n\n/** @param {MiniAppApi} ghostly */\nasync function start(ghostly) {\n // Listen before anything is awaited, so no frame is missed.\n ghostly.chat.on(\"message\", (data) => {\n const text = helloOf(data);\n if (text !== null) show(\"Your contact: \" + text);\n });\n ghostly.chat.on(\"peer\", (peer) => {\n status.textContent = peer.open ? \"Your contact has this app open\" : \"Waiting for your contact to open this app\";\n });\n\n const context = await ghostly.context();\n const dark = context.theme ? context.theme === \"dark\" : matchMedia(\"(prefers-color-scheme: dark)\").matches;\n document.documentElement.dataset.theme = dark ? \"dark\" : \"light\";\n status.textContent = !context.inChat ? \"Open this app in a chat to say hello\"\n : context.peer ? \"Your contact has this app open\" : \"Waiting for your contact to open this app\";\n\n button.disabled = false;\n button.addEventListener(\"click\", async () => {\n try {\n await ghostly.chat.send({ type: \"hello\", text: \"Hello!\" });\n show(\"You: Hello!\");\n } catch (error) {\n show(refusal(error));\n }\n });\n}\n\n/** Ghostly's runner gives the app \\`window.ghostly\\`; a browser tab has none. */\nconst ghostly = /** @type {{ ghostly?: MiniAppApi }} */ (window).ghostly;\nif (ghostly) void start(ghostly);\nelse status.textContent = \"This page is a Ghostly app: publish it and open it in Ghostly\";\n</script>\n</body>\n</html>\n`;\n}\n\n/** `README.md`: what the folder holds and the way from it to a store. */\nexport function templateReadme({ name, title }: AppTemplate): string {\n return `# ${title}\n\nA [Ghostly](https://github.com/MiguelMedeiros/ghostly) app, started with \\`ghostly app init\\`. Opened in a 1:1 chat, it\ngives your contact a card to join, and each side can say hello to the other.\n\nA Ghostly app ([WISP 1200](https://github.com/MiguelMedeiros/ghostly/blob/dev/docs/wisps/1200-marketplace.md)) is a\npage that runs in the client's sandbox. It has no network, and talks to Ghostly only through \\`window.ghostly\\`:\nframes of at most 32 KiB to the same app on the contact's side (\\`chat.send\\`, \\`chat.on\\`), storage per app and per\nchat, and the files of its own bundle. Apps run in Ghostly from release 1.2.\n\n| File | What it is |\n|---|---|\n| \\`ghostly-app.json\\` | The manifest, without \\`publisher\\`, \\`sequence\\` and \\`files\\`: \\`ghostly app publish\\` writes those |\n| \\`index.html\\` | The app, whole: styles and script inline |\n| \\`README.md\\` | This file |\n\n## Write it\n\n\\`index.html\\` is plain JavaScript, typed with JSDoc against \\`@ghostlytools/sdk/app\\`: \\`MiniAppApi\\` is\n\\`window.ghostly\\`, and the same module has the limits (\\`MINI_APP_LIMITS\\`) and the codes a refused call rejects with\n(\\`MINI_APP_ERROR_CODES\\`). For the types in your editor, install it in the folder above this one, where your editor\nstill finds it: \\`ghostly app publish\\` takes every file of this folder, so \\`node_modules\\` and \\`package.json\\` stay\nout of it.\n\n\\`\\`\\`sh\nnpm install --save-dev --prefix .. @ghostlytools/sdk\n\\`\\`\\`\n\n- What a contact's app sends is untrusted: check its shape, bound its size, and show it as text, never as HTML.\n- \\`\"view\": \"chat\"\\` runs the app inside a chat with one contact. \\`\"full\"\\` is a full-screen app opened from the Apps page.\n- \\`permissions\\` lists what the person is asked for: \\`chat\\` (frames to the contact's app), \\`name\\` (the person's\n display name) and \\`internet\\`. Adding one later makes every install ask before it updates.\n\n## Build\n\nThere is nothing to build yet: the page is the app. Once it grows into several source files, or TypeScript, build it\ninto one self-contained \\`index.html\\` (scripts, styles and images inline) and put that file and \\`ghostly-app.json\\`\nalone in a folder of their own, which is the folder you publish.\n[ghostly-chess](https://github.com/MiguelMedeiros/ghostly-chess) does it with Vite and a small\n\\`scripts/stage.mjs\\`. \\`ghostly app publish\\` takes every file of the folder it is given but dot files, this README\nincluded, so do not run it on a repository with sources, \\`node_modules\\` or anything private in it.\n\n## Publish\n\n\\`\\`\\`sh\nghostly app publish . --key ~/ghostly-keys/${name}-publisher.key\nghostly app verify app.ghostlyapp\n\\`\\`\\`\n\n\\`publish\\` signs the folder into \\`app.ghostlyapp\\`. The first run makes the publisher key at the path you name:\n\n- Keep it **outside this folder** and its repository (\\`publish\\` refuses a key inside it), and never commit it.\n- Back it up. An app is updated only with the key that signed it; a lost key means a new app.\n\n\\`verify\\` checks the bundle as Ghostly will and prints its \\`ref\\` (\\`<publisher key>/${name}\\`), \\`sequence\\` and\n\\`digest\\`. For the next version, raise \\`version\\` in \\`ghostly-app.json\\` and publish again: the sequence goes up\nby one by itself.\n\n## Try it\n\nCommit \\`app.ghostlyapp\\` to a public GitHub repository, then in Ghostly open Apps, choose Add, and paste its URL\n(\\`https://raw.githubusercontent.com/<owner>/<repo>/HEAD/app.ghostlyapp\\`). Set \\`sources\\` in \\`ghostly-app.json\\`\nto that URL, in a list, so installs made from it find your updates. Open the app from a chat's + menu; your contact\ngets a card to install and open it.\n\n## List it in a store\n\nA store is a signed list of apps. The official one is a Git repository,\n[ghostly-store](https://github.com/MiguelMedeiros/ghostly-store), and apps enter it by pull request:\n\n1. Commit \\`app.ghostlyapp\\` to your public repository and note that commit.\n2. Add \\`apps/${name}.<first 16 characters of your publisher key>/listing.json\\` with the \\`ref\\`, \\`sequence\\`\n and \\`digest\\` that \\`ghostly app verify\\` printed. Its \\`urls\\` start with a jsDelivr URL pinned to the full commit\n (\\`https://cdn.jsdelivr.net/gh/<owner>/<repo>@<40-character commit>/app.ghostlyapp\\`).\n3. Open the pull request. Its check verifies the bundle; a maintainer reviews the app and the owner signs the index.\n\nThe store's [CONTRIBUTING](https://github.com/MiguelMedeiros/ghostly-store/blob/main/CONTRIBUTING.md) has the rules.\nAn app installed from a store updates only to the version that store lists, so each new version is a pull request too.\n\n## If something goes wrong\n\nIf a version is harmful, \\`ghostly app revoke . --key <your key> --up-to <sequence>\\` writes \\`ghostly-revoke.json\\`;\npublish it beside \\`app.ghostlyapp\\` and Ghostly stops those versions.\n`;\n}\n","import { createPublicKey, verify, type KeyObject } from \"node:crypto\";\nimport type { AppSignatureFastPath } from \"@ghostly/core\";\n\n/*\n * Node's Ed25519 (OpenSSL's): a signature in tens of microseconds, where the core's portable check takes most of a\n * millisecond, so a list of 4096 revocations is checked in a fraction of a second. OpenSSL verifies as RFC 8032 writes it\n * without the cofactor and compares R byte for byte, which is what the core's fast path asks (see AppSignatureFastPath).\n */\n\n/** SubjectPublicKeyInfo of an Ed25519 key (RFC 8410), before its 32 bytes. */\nconst SPKI_PREFIX = Buffer.from(\"302a300506032b6570032100\", \"hex\");\n/** The key objects of the keys seen lately: a list repeats its publishers. */\nconst keys = new Map<string, KeyObject>();\n\nexport const nativeEd25519: AppSignatureFastPath = (signature, message, publicKey) => {\n const id = Buffer.from(publicKey).toString(\"hex\");\n let key = keys.get(id);\n if (!key) {\n key = createPublicKey({ key: Buffer.concat([SPKI_PREFIX, publicKey]), format: \"der\", type: \"spki\" });\n if (keys.size >= 256) keys.clear();\n keys.set(id, key);\n }\n return verify(null, message, key, signature);\n};\n","import { createHash, createPrivateKey, generateKeyPairSync } from \"node:crypto\";\nimport { closeSync, existsSync, lstatSync, mkdirSync, openSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync, writeSync } from \"node:fs\";\nimport { basename, dirname, isAbsolute, join, relative, sep } from \"node:path\";\nimport {\n APP_BUNDLE_LIMITS, APP_PREFIXES, appFingerprint, appRef, appRevocationFor, appStoreDecision, assembleAppBundle, canonicalJson, canonicalJsonBytes,\n APP_STATEMENT_LIMITS, checkAppManifest, checkAppRevokeStatement, checkAppStoreIndex, fromBase64Url, isAppUrl, readAppBundle,\n readAppRevocations, readAppStore, seedSigner, setAppSignatureFastPath, signAppObject, signAppRevocation, signAppStore, toBase64Url, toZ32, type AppBundle,\n type AppManifest, type AppRevokeStatement, type AppStoreIndex, type AppStoreReading, type SignedAppRevocation, type Signer,\n} from \"@ghostly/core\";\nimport { templateManifest, templatePage, templateReadme } from \"./appTemplate\";\nimport { CliError, localFileError } from \"./errors\";\nimport { nativeEd25519 } from \"./nativeEd25519\";\nimport { userPath } from \"./profiles\";\n\n/*\n * The publisher tools of WISP 1200 (Apps · Publishing): `app init` writes a folder to start from, `app publish` bundles\n * and signs a folder, `app verify` checks a bundle as a client would, `store sign` signs a store index. They run here, on files: no profile, no daemon, no\n * network but the one read `app verify` makes of a URL.\n *\n * Keys. A publisher key and a store key are Ed25519 keys of their own, never a profile's (WISP 1200 · Publisher\n * identity). Each lives in a file the command names with `--key`: a PKCS #8 PEM block (what `openssl genpkey -algorithm\n * ed25519` writes, so secret scanners know it for a private key), after one line that says which kind it is. The file\n * is made owner-only (0600) when a command makes it, and refused when anyone else may read it. A key is never printed:\n * only its public key and fingerprint are.\n */\n\nexport const APP_SOURCE = \"ghostly-app.json\";\nexport const APP_BUNDLE_FILE = \"app.ghostlyapp\";\nexport const APP_REVOKE_FILE = \"ghostly-revoke.json\";\nexport const STORE_INDEX_FILE = \"ghostly-store.json\";\nexport const STORE_SIG_FILE = \"ghostly-store.sig\";\n\n// Every signature the publisher tools check (bundles, revocation lists, store indexes) goes through Node's Ed25519 first.\nsetAppSignatureFastPath(nativeEd25519);\n\n/** How long `app verify` waits for a URL, and how many redirects it follows (each checked as the first). */\nconst FETCH_TIMEOUT_MS = 60_000;\nconst MAX_REDIRECTS = 5;\n\n// ---------- keys ----------\n\nexport type KeyKind = \"publisher\" | \"store\";\n\nconst KEY_HEADER: Record<KeyKind, string> = {\n publisher: \"Ghostly publisher key (WISP 1200). Secret: never share or commit it. Back it up: an app signed with it is updated only with it.\",\n store: \"Ghostly store key (WISP 1200). Secret: keep it offline, never share or commit it. Back it up: a store is its key.\",\n};\nconst PEM = /-----BEGIN PRIVATE KEY-----\\r?\\n([A-Za-z0-9+/=\\r\\n]+)-----END PRIVATE KEY-----/;\n\nexport interface LoadedKey { signer: Signer; key: string; created: boolean }\n\n/** Refuses a key file that is not a plain file of this user's, or that anyone else may read or write. */\nfunction checkKeyFile(path: string): void {\n const info = statSync(path);\n if (!info.isFile()) throw new CliError(\"bad_request\", `${path} is not a file: --key names a key file`);\n if (process.platform === \"win32\") return;\n if (process.getuid && info.uid !== process.getuid()) throw new CliError(\"refused\", `${path} is not this user's: a key file must be yours alone`);\n if ((info.mode & 0o077) !== 0) {\n throw new CliError(\"refused\", `${path} may be read by others (mode ${(info.mode & 0o777).toString(8)}): run chmod 600 ${path}, and think whether the key was seen`);\n }\n}\n\n/** Reads a key file: the PEM block, an Ed25519 key, and the kind its first line names (when it names one). */\nfunction readKey(path: string, kind: KeyKind): LoadedKey {\n checkKeyFile(path);\n const text = readFileSync(path, \"utf8\");\n const other: KeyKind = kind === \"publisher\" ? \"store\" : \"publisher\";\n if (text.startsWith(`Ghostly ${other} key`)) {\n throw new CliError(\"refused\", `${path} is a ${other} key: ${kind === \"publisher\" ? \"a store key never signs an app\" : \"a publisher key never signs a store index\"} (WISP 1200 · Stores)`);\n }\n const block = PEM.exec(text);\n let seed: Uint8Array | undefined;\n if (block) {\n try {\n const key = createPrivateKey(block[0]);\n const d = key.asymmetricKeyType === \"ed25519\" ? key.export({ format: \"jwk\" }).d : undefined;\n if (d) seed = fromBase64Url(d);\n } catch { /* said below, without the file's text */ }\n }\n if (!seed || seed.length !== 32) throw new CliError(\"bad_request\", `${path} holds no Ed25519 private key (a PEM \"PRIVATE KEY\" block, as openssl genpkey -algorithm ed25519 writes)`);\n const signer = seedSigner(seed);\n return { signer, key: toZ32(signer.publicKey), created: false };\n}\n\n/** Makes a key file: owner-only from the start, never over a file that is there. */\nfunction makeKey(path: string, kind: KeyKind): LoadedKey {\n mkdirSync(dirname(path), { recursive: true, mode: 0o700 });\n const { privateKey } = generateKeyPairSync(\"ed25519\");\n const pem = privateKey.export({ type: \"pkcs8\", format: \"pem\" }) as string;\n const fd = openSync(path, \"wx\", 0o600);\n try { writeSync(fd, `${KEY_HEADER[kind]}\\n${pem}`); } finally { closeSync(fd); }\n return { ...readKey(path, kind), created: true };\n}\n\n/** What the person is told on stderr when a key was made: where, which, and to back it up. Never the key. */\nfunction madeKeyNote(path: string, kind: KeyKind, key: string): string {\n return kind === \"publisher\"\n ? `new publisher key written to ${path}; back it up (${appFingerprint(key)}: an app is updated only with the key that signed it, and phase 1 has no recovery)`\n : `new store key written to ${path}; back it up and keep it offline (${appFingerprint(key)}: a store is its key)`;\n}\n\n// ---------- reading bundles ----------\n\nconst refused = (what: string, reading: { reason: string; detail?: string }, extra: Record<string, unknown> = {}) =>\n new CliError(\"refused\", `${what} (${reading.reason}${reading.detail ? `: ${reading.detail}` : \"\"})`, { reason: reading.reason, ...(reading.detail ? { detail: reading.detail } : {}), ...extra });\n\n/** A bundle file's bytes: its size is checked before it is read, so a huge file is refused unread. */\nfunction readBundleFile(path: string): Uint8Array {\n const info = statSync(path);\n if (info.isDirectory()) throw new CliError(\"bad_request\", `${path} is a folder: name a .ghostlyapp file`);\n if (info.size > APP_BUNDLE_LIMITS.bundleBytes) throw refused(`${path} is not a valid bundle`, { reason: \"too-large\", detail: `${info.size} bytes` });\n return new Uint8Array(readFileSync(path));\n}\n\n/**\n * A bundle at an https URL, as a client fetches one: `https:` only, no user or password, jsDelivr only at a full\n * commit (WISP 1200 · Manifest, \"Every URL\"); every redirect is held to the same rule, and the download stops past\n * 16 MiB.\n */\nasync function fetchBundle(url: string): Promise<Uint8Array> {\n let at = url;\n for (let hop = 0; ; hop++) {\n if (!isAppUrl(at)) {\n throw new CliError(hop ? \"refused\" : \"usage\", hop\n ? `${url} redirects to ${at}, which a client does not read (https only, no user or password, jsDelivr only at a full commit)`\n : `Not a URL a client reads: https only, at most ${APP_BUNDLE_LIMITS.url} characters, no user or password, and jsDelivr only as https://cdn.jsdelivr.net/gh/<owner>/<repo>@<40-hex commit>/<path>`);\n }\n let response: Response;\n try {\n response = await fetch(at, { redirect: \"manual\", signal: AbortSignal.timeout(FETCH_TIMEOUT_MS) });\n } catch (error) {\n if (error instanceof Error && error.name === \"TimeoutError\") throw new CliError(\"timeout\", `${at} did not answer in ${FETCH_TIMEOUT_MS / 1000} s`);\n throw new CliError(\"unavailable\", `Could not read ${at}: ${error instanceof Error ? error.message : String(error)}`);\n }\n if (response.status >= 300 && response.status < 400 && response.headers.get(\"location\")) {\n await response.body?.cancel();\n if (hop >= MAX_REDIRECTS) throw new CliError(\"refused\", `${url} redirects more than ${MAX_REDIRECTS} times`);\n at = new URL(response.headers.get(\"location\")!, at).href;\n continue;\n }\n if (response.status === 404 || response.status === 410) { await response.body?.cancel(); throw new CliError(\"not_found\", `${at} answered ${response.status}`); }\n if (!response.ok || !response.body) { await response.body?.cancel(); throw new CliError(\"unavailable\", `${at} answered ${response.status}`); }\n const limit = APP_BUNDLE_LIMITS.bundleBytes;\n const tooLarge = (bytes: number | string) => refused(`${url} is not a valid bundle`, { reason: \"too-large\", detail: `${bytes} bytes` });\n const length = Number(response.headers.get(\"content-length\"));\n if (Number.isFinite(length) && length > limit) { await response.body.cancel(); throw tooLarge(length); }\n const chunks: Uint8Array[] = [];\n let total = 0;\n const reader = response.body.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n total += value.length;\n if (total > limit) { await reader.cancel(); throw tooLarge(`more than ${limit}`); }\n chunks.push(value);\n }\n } catch (error) {\n if (error instanceof CliError) throw error;\n if (error instanceof Error && error.name === \"TimeoutError\") throw new CliError(\"timeout\", `${at} did not finish in ${FETCH_TIMEOUT_MS / 1000} s`);\n throw new CliError(\"unavailable\", `Could not read ${at}: ${error instanceof Error ? error.message : String(error)}`);\n }\n const out = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) { out.set(chunk, offset); offset += chunk.length; }\n return out;\n }\n}\n\n/** What a checked bundle is, as `app verify` and `app publish` print it. */\nfunction described(bundle: AppBundle, bytes: Uint8Array) {\n const m = bundle.manifest;\n return {\n ref: appRef(m.publisher, m.name), publisher: m.publisher, fingerprint: appFingerprint(m.publisher), name: m.name,\n title: m.title, version: m.version, sequence: m.sequence, digest: bundle.digest, bytes: bytes.length,\n sha256: toBase64Url(createHash(\"sha256\").update(bytes).digest()),\n };\n}\n\n/** `app verify <bundle|url>`: every check a client makes before it stores a bundle (WISP 1200 · Reading a bundle). */\nexport async function verifyApp(source: string): Promise<Record<string, unknown>> {\n const { bundle, bytes } = await checkedBundle(source);\n return { valid: true, ...described(bundle, bytes), manifest: bundle.manifest };\n}\n\n/**\n * The `ghostly-revoke.json` beside a bundle, as a client reads it beside each bundle URL: beside the URL (without its\n * query), or beside the file. None there, one that does not answer, or one a client would not read, revokes nothing.\n */\nasync function revocationsBeside(source: string, isUrl: boolean): Promise<{ file: string; revocations: SignedAppRevocation[] }> {\n let file: string;\n let bytes: Uint8Array;\n try {\n if (isUrl) {\n const at = new URL(source);\n at.search = \"\";\n at.hash = \"\";\n file = new URL(APP_REVOKE_FILE, at).href;\n bytes = await fetchBundle(file);\n } else {\n file = join(dirname(userPath(source)), APP_REVOKE_FILE);\n if (!existsSync(file)) return { file, revocations: [] };\n bytes = readBundleFile(file);\n }\n } catch { return { file: source, revocations: [] }; }\n const read = readAppRevocations(bytes);\n return { file, revocations: read.ok ? read.revocations : [] };\n}\n\n/**\n * A bundle from a file or an https URL, with every check of `app verify`; `url` when it came from one. A version its\n * publisher revoked in the `ghostly-revoke.json` beside it is refused: a client stops it, with no \"Run anyway\".\n */\nexport async function checkedBundle(source: string): Promise<{ bundle: AppBundle; bytes: Uint8Array; url?: string }> {\n const isUrl = /^[a-z][a-z0-9+.-]*:\\/\\//i.test(source);\n const bytes = isUrl ? await fetchBundle(source) : readBundleFile(userPath(source));\n const read = readAppBundle(bytes);\n if (!read.ok) throw refused(`${source} is not a valid bundle`, read);\n const m = read.bundle.manifest;\n const { file, revocations } = await revocationsBeside(source, isUrl);\n const revocation = appRevocationFor({ ref: appRef(m.publisher, m.name), sequence: m.sequence, digest: read.bundle.digest }, revocations);\n if (revocation) {\n throw refused(`${source} is a version its publisher revoked in ${file}: a client stops it`, { reason: \"revoked\", ...(revocation.statement.reason !== undefined && { detail: revocation.statement.reason }) }, { file });\n }\n return { bundle: read.bundle, bytes, ...(isUrl && { url: source }) };\n}\n\n// ---------- starting an app ----------\n\n/** A folder's name as an app's: lower case, anything else a hyphen (`My App` is `my-app`). */\nconst nameFrom = (folder: string) => folder.toLowerCase().replace(/[^a-z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\");\n/** An app's name as a title: `my-app` is `My app`. */\nconst titleFrom = (name: string) => (name[0]!.toUpperCase() + name.slice(1)).replace(/-/g, \" \");\n\n/**\n * `app init <dir> [--name <name>] [--title <title>] [--force]`: a small working app in `<dir>` (made when missing),\n * which `app publish <dir>` signs as it is: `ghostly-app.json`, an `index.html` that says hello to the contact, and a\n * README with the way to a store (./appTemplate.ts). The name is `--name`, else the folder's; the title `--title`, else\n * the name's. Nothing is written when one of the three files is there, unless `--force`, which replaces those three only.\n */\nexport async function initApp(dirArg: string, what: { name?: string; title?: string; force?: boolean } = {}): Promise<Record<string, unknown>> {\n const usage = \"ghostly app init <dir> [--name <name>] [--title <title>] [--force]\";\n const dir = userPath(dirArg);\n const name = what.name ?? nameFrom(basename(dir));\n const title = what.title ?? (name ? titleFrom(name) : \"\");\n const page = templatePage({ name, title });\n // Checked as publish will check it, under a key of zeros and the page's own entry: what is written always publishes.\n const pageBytes = new TextEncoder().encode(page);\n const checked = checkAppManifest({\n ...templateManifest({ name, title }), ghostlyApp: 1, publisher: toZ32(new Uint8Array(32)), sequence: 1,\n files: [{ path: \"index.html\", size: pageBytes.length, sha256: toBase64Url(createHash(\"sha256\").update(pageBytes).digest()) }],\n }, { strict: true });\n if (!checked.ok) {\n if (checked.detail === \"name is not valid\") {\n throw new CliError(\"usage\", what.name === undefined\n ? `The folder's name gives no app name (${JSON.stringify(basename(dir))}): give --name, a lowercase letter then up to 31 lowercase letters, digits or hyphens: ${usage}`\n : `--name is a lowercase letter then up to 31 lowercase letters, digits or hyphens, not ${JSON.stringify(what.name)}`);\n }\n if (checked.detail === \"title is not valid\") throw new CliError(\"usage\", `--title is one line of 1 to ${APP_BUNDLE_LIMITS.title} characters, not ${JSON.stringify(title)}`);\n throw refused(\"The template makes no valid manifest\", checked);\n }\n\n if (existsSync(dir) && !statSync(dir).isDirectory()) throw new CliError(\"bad_request\", `${dir} is a file: name a folder for the app`);\n const files: [string, string][] = [\n [APP_SOURCE, `${JSON.stringify(templateManifest({ name, title }), null, 2)}\\n`],\n [\"index.html\", page],\n [\"README.md\", templateReadme({ name, title })],\n ];\n const held = files.map(([path]) => path).filter((path) => existsSync(join(dir, path)));\n if (held.length && !what.force) {\n throw refused(`${dir} already holds ${held.join(\", \")}: nothing was written (--force replaces ${held.length > 1 ? \"them\" : \"it\"})`, { reason: \"exists\" }, { files: held });\n }\n mkdirSync(dir, { recursive: true });\n for (const [path, text] of files) writeWhole(join(dir, path), new TextEncoder().encode(text));\n return {\n dir, name, title, files: files.map(([path]) => path), ...(held.length ? { replaced: held } : {}),\n next: `ghostly app publish ${dirArg} --key <a key file outside ${dirArg}>`,\n };\n}\n\n// ---------- publishing ----------\n\n/** Every file of the folder, as the bundle names it; dot files and folders are left out and listed. */\nfunction collectFiles(dir: string, leaveOut: Set<string>): { files: { path: string; full: string; size: number }[]; skipped: string[] } {\n const files: { path: string; full: string; size: number }[] = [];\n const skipped: string[] = [];\n let bytes = 0;\n const walk = (folder: string) => {\n for (const name of readdirSync(folder).sort()) {\n const full = join(folder, name);\n const path = relative(dir, full).split(sep).join(\"/\");\n if (leaveOut.has(full)) continue;\n if (name.startsWith(\".\")) { skipped.push(path); continue; }\n const info = lstatSync(full);\n if (info.isSymbolicLink()) throw new CliError(\"bad_request\", `${path} is a link: a bundle holds the folder's own files (copy it in, or remove it)`);\n if (info.isDirectory()) { walk(full); continue; }\n if (!info.isFile()) throw new CliError(\"bad_request\", `${path} is not a file`);\n files.push({ path, full, size: info.size });\n bytes += info.size;\n if (files.length > APP_BUNDLE_LIMITS.files) throw refused(`${dir} holds more files than a bundle may`, { reason: \"too-many-files\", detail: `more than ${APP_BUNDLE_LIMITS.files}` });\n if (bytes > APP_BUNDLE_LIMITS.bundleBytes) throw refused(`${dir} holds more than a bundle may`, { reason: \"too-large\", detail: `more than ${APP_BUNDLE_LIMITS.bundleBytes} bytes of files` });\n }\n };\n walk(dir);\n // The manifest lists every path in code-unit order, across folders: `lib-extra.js` before `lib/x.js`, which the walk\n // reaches first (`-` and `.` sort before `/`).\n files.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));\n return { files, skipped };\n}\n\n/**\n * A private key in a file: a PEM private key block with its body (PKCS #8, OpenSSH, RSA, EC, encrypted, the traditional\n * encrypted one's \"Proc-Type: 4,ENCRYPTED\" headers included), an OpenPGP \"PRIVATE KEY BLOCK\" (its \"Version: GnuPG\n * v2.4.5\" headers included), or a Ghostly key file's first line. A library that only names the block's header in its\n * code does not match.\n */\nconst PRIVATE_KEY = /-----BEGIN [A-Z0-9 ]*PRIVATE KEY( BLOCK)?-----\\r?\\n[A-Za-z0-9+/=\\r\\n :,.-]{40,}-----END [A-Z0-9 ]*PRIVATE KEY( BLOCK)?-----|^Ghostly (publisher|store) key \\(WISP 1200\\)/;\n\n/** Whether `path` is `dir` or anything under it (a name like `..k.key` is under it: only a `..` segment leaves). */\nconst isInside = (dir: string, path: string) => { const rel = relative(dir, path); return rel !== \"..\" && !rel.startsWith(`..${sep}`) && !isAbsolute(rel); };\n\n/** Fields of `ghostly-app.json` the command writes itself. */\nconst WRITTEN = [\"publisher\", \"files\"] as const;\n\nfunction readSource(path: string): Record<string, unknown> {\n if (!existsSync(path)) throw new CliError(\"not_found\", `No ${APP_SOURCE} in ${dirname(path)}: it holds the manifest's fields (name, version, title, tagline, entry, permissions, runtime, license, ...) but publisher, sequence and files, which publish writes`);\n let value: unknown;\n try { value = JSON.parse(readFileSync(path, \"utf8\")); } catch (error) { throw new CliError(\"bad_request\", `${path} is not JSON: ${error instanceof Error ? error.message : String(error)}`); }\n if (!value || typeof value !== \"object\" || Array.isArray(value)) throw new CliError(\"bad_request\", `${path} is not a JSON object`);\n const draft = value as Record<string, unknown>;\n const written = WRITTEN.filter((k) => k in draft);\n if (written.length) throw new CliError(\"bad_request\", `${path} has ${written.join(\" and \")}: publish writes ${written.length > 1 ? \"them\" : \"it\"} from the key and the folder's files`);\n if (draft.ghostlyApp !== undefined && draft.ghostlyApp !== 1) throw refused(`${path} is not a manifest this release makes`, { reason: \"unsupported-format\", detail: \"ghostlyApp is not 1\" });\n if (draft.sequence !== undefined && !(Number.isSafeInteger(draft.sequence) && (draft.sequence as number) >= 1)) {\n throw new CliError(\"bad_request\", `${path}: sequence is a whole number from 1 (or leave it out: publish raises it by itself)`);\n }\n return draft;\n}\n\n/** Writes a file whole or not at all: a reader never sees half a bundle (and a dot file left by a crash is never bundled). */\nfunction writeWhole(path: string, bytes: Uint8Array): void {\n const tmp = join(dirname(path), `.${basename(path)}.${process.pid}.tmp`);\n writeFileSync(tmp, bytes);\n renameSync(tmp, path);\n}\n\n/**\n * `app publish <dir> --key <file> [--out <file>] [--sequence n]`:`<dir>/ghostly-app.json` (the manifest without `publisher`,\n * `sequence` and `files`) and every other file in `<dir>` (but its bundles and revocations) become one signed bundle, by default `<dir>/app.ghostlyapp`.\n * The sequence is `--sequence` (higher than the bundle already at `--out`'s), else one more than that bundle's (or\n * the source's `sequence`, if higher, else 1). The\n * key file is made when it is missing and no earlier bundle is there to update.\n */\nexport async function publishApp(dirArg: string, keyArg: string, outArg?: string, sequenceArg?: number): Promise<Record<string, unknown>> {\n if (sequenceArg !== undefined && !(Number.isSafeInteger(sequenceArg) && sequenceArg >= 1)) throw new CliError(\"usage\", `--sequence takes a whole number from 1, not ${sequenceArg}`);\n const dir = userPath(dirArg);\n if (!statSync(dir).isDirectory()) throw new CliError(\"bad_request\", `${dir} is not a folder`);\n const keyPath = userPath(keyArg);\n // Every file of the folder is published, and the folder is often the repository the bundle is committed to.\n if (isInside(dir, keyPath)) {\n throw refused(`${keyPath} is inside ${dir}, which is published: keep the publisher key outside the app's folder (and its repository)`, { reason: \"private-key\" });\n }\n const out = userPath(outArg ?? join(dir, APP_BUNDLE_FILE));\n const sourcePath = join(dir, APP_SOURCE);\n const draft = readSource(sourcePath);\n\n // The version this one follows: the bundle already at the output, which only its own key may follow.\n let previous: AppManifest | null = null;\n if (existsSync(out)) {\n const read = readAppBundle(readBundleFile(out));\n if (!read.ok) throw refused(`${out} is there and is not a valid bundle: move it away, or name another --out`, read);\n previous = read.bundle.manifest;\n }\n\n let key: LoadedKey;\n if (existsSync(keyPath)) key = readKey(keyPath, \"publisher\");\n else if (previous) {\n throw new CliError(\"not_found\", `No key file ${keyPath}: ${out} is signed by ${appFingerprint(previous.publisher)}, and only that key publishes its next version`);\n } else key = makeKey(keyPath, \"publisher\");\n\n if (previous && previous.publisher !== key.key) {\n throw refused(`${out} is ${appRef(previous.publisher, previous.name)}, signed by another key (${appFingerprint(previous.publisher)}): a version of an app is signed by its own key`, { reason: \"other-app\" }, { publisher: previous.publisher });\n }\n if (previous && previous.name !== draft.name) {\n throw refused(`${out} is the app ${JSON.stringify(previous.name)}, not ${JSON.stringify(draft.name)}: name another --out for another app`, { reason: \"other-app\" });\n }\n\n if (sequenceArg !== undefined && previous && sequenceArg <= previous.sequence) {\n throw refused(`--sequence ${sequenceArg} is not higher than the ${previous.sequence} of ${out}: every client refuses a lower one, and the same one with other content is equivocation`, { reason: sequenceArg < previous.sequence ? \"rollback\" : \"equivocation\" }, { previous: previous.sequence });\n }\n const sequence = sequenceArg ?? Math.max(previous ? previous.sequence + 1 : 1, (draft.sequence as number | undefined) ?? 1);\n // The bundle at the folder's default name is this command's own output too: published into another --out, the\n // version an earlier publish left there went into the new bundle as one of its files.\n const { files, skipped } = collectFiles(dir, new Set([sourcePath, out, join(dir, APP_BUNDLE_FILE), join(dir, APP_REVOKE_FILE)]));\n const contents = files.map((f) => ({ path: f.path, bytes: new Uint8Array(readFileSync(f.full)) }));\n // A bundle is public: a private key found in the folder (an old key, a store key, any PEM) stops the publish.\n const keyFile = contents.find((f) => PRIVATE_KEY.test(Buffer.from(f.bytes).toString(\"latin1\")));\n if (keyFile) throw refused(`${keyFile.path} in ${dir} holds a private key, and a bundle is public: move it out of the app's folder`, { reason: \"private-key\", detail: keyFile.path });\n const manifest = {\n ...draft,\n ghostlyApp: 1,\n publisher: key.key,\n sequence,\n files: contents.map((f) => ({ path: f.path, size: f.bytes.length, sha256: toBase64Url(createHash(\"sha256\").update(f.bytes).digest()) })),\n };\n const checked = checkAppManifest(JSON.parse(JSON.stringify(manifest)), { strict: true });\n if (!checked.ok) throw refused(`${sourcePath} and the folder's files make no valid manifest`, checked);\n\n const { bytes: manifestBytes, signature } = await signAppObject(APP_PREFIXES.app, checked.manifest, key.signer);\n const bundle = assembleAppBundle(manifestBytes, canonicalJsonBytes(signature), contents.map((f) => f.bytes));\n // Read back as a client would (the icon's header, the bundle's size): what is written is never a bundle it refuses.\n const read = readAppBundle(bundle);\n if (!read.ok) throw refused(\"The bundle made is not valid\", read);\n // Nor one the folder's own revocations already stop: every client that reads them would refuse it, for good.\n const ref = appRef(key.key, checked.manifest.name);\n const revocations = existsSync(join(dir, APP_REVOKE_FILE)) ? readAppRevocations(new Uint8Array(readFileSync(join(dir, APP_REVOKE_FILE)))) : null;\n const held = revocations?.ok ? revocations.revocations : [];\n if (appRevocationFor({ ref, sequence, digest: read.bundle.digest }, held)) {\n const clear = Math.max(sequence, ...held.map((r) => r.statement.app === ref && \"upTo\" in r.statement ? r.statement.upTo : 0)) + 1;\n throw refused(`${join(dir, APP_REVOKE_FILE)} already revokes version ${sequence} of ${ref}, and every client that reads it would stop it: give --sequence ${clear}`, { reason: \"revoked\" }, { sequence: clear });\n }\n mkdirSync(dirname(out), { recursive: true });\n writeWhole(out, bundle);\n\n return {\n ...described(read.bundle, bundle),\n previous: previous?.sequence ?? null,\n out,\n files: contents.map((f) => f.path),\n ...(skipped.length ? { skipped } : {}),\n keyCreated: key.created,\n ...(key.created ? { warning: madeKeyNote(keyPath, \"publisher\", key.key) } : {}),\n };\n}\n\n// ---------- revocations ----------\n\n/**\n * `app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>]`: a\n * `ghostly-revoke/1` statement (WISP 1200 · Publisher keys, Revocation) for the app whose bundle is `<dir>/app.ghostlyapp`\n * (or `--bundle`), signed by that app's publisher key and added to `<dir>/ghostly-revoke.json`, which stays canonical.\n * The key is never made here: only the key that signed the app may revoke its versions.\n */\nexport async function revokeApp(dirArg: string, keyArg: string, what: { digests?: string[]; upTo?: number; reason?: string; bundle?: string; force?: boolean }): Promise<Record<string, unknown>> {\n const dir = userPath(dirArg);\n const bundlePath = userPath(what.bundle ?? join(dir, APP_BUNDLE_FILE));\n const listPath = join(dir, APP_REVOKE_FILE);\n const usage = \"ghostly app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>] [--force]\";\n const digests = what.digests ?? [];\n if ((digests.length > 0) === (what.upTo !== undefined)) throw new CliError(\"usage\", `Give --digest (again for each) or --up-to, one of the two: ${usage}`);\n if (what.upTo !== undefined && !(Number.isSafeInteger(what.upTo) && what.upTo >= 1)) throw new CliError(\"usage\", `--up-to takes a sequence, a whole number from 1, not ${what.upTo}`);\n\n if (!existsSync(bundlePath)) throw new CliError(\"not_found\", `No bundle ${bundlePath}: a revocation names the app of the bundle in <dir> (or --bundle)`);\n const read = readAppBundle(readBundleFile(bundlePath));\n if (!read.ok) throw refused(`${bundlePath} is not a valid bundle`, read);\n const manifest = read.bundle.manifest;\n const ref = appRef(manifest.publisher, manifest.name);\n // Clients keep a revocation for good: past the newest version (a typo, 30 for 3), it stops versions not made yet.\n if (what.upTo !== undefined && what.upTo > manifest.sequence && !what.force) {\n throw new CliError(\"usage\", `--up-to ${what.upTo} is past ${bundlePath}'s version, ${manifest.sequence}: it would also stop versions ${manifest.sequence + 1} to ${what.upTo} before they exist, for good. Give --up-to ${manifest.sequence}, or --force if versions up to ${what.upTo} were published from elsewhere`);\n }\n\n const keyPath = userPath(keyArg);\n if (!existsSync(keyPath)) throw new CliError(\"not_found\", `No key file ${keyPath}: only the key that signed ${ref} (${appFingerprint(manifest.publisher)}) revokes its versions`);\n const key = readKey(keyPath, \"publisher\");\n if (key.key !== manifest.publisher) {\n throw refused(`${keyPath} is not the publisher key of ${ref} (${appFingerprint(manifest.publisher)}): a revocation by any other key is refused by every client`, { reason: \"signature-key\" });\n }\n\n const statement = (digests.length\n ? { ghostlyRevoke: 1, app: ref, digests }\n : { ghostlyRevoke: 1, app: ref, upTo: what.upTo }) as AppRevokeStatement;\n if (what.reason !== undefined) statement.reason = what.reason;\n const problem = checkAppRevokeStatement(statement);\n if (problem) throw refused(\"Not a revocation a client reads\", { reason: \"bad-revocation\", detail: problem });\n\n // Each revocation's signature is checked once: the held list's are not checked again when the new list is read back.\n const checked = new Set<string>();\n let list: SignedAppRevocation[] = [];\n if (existsSync(listPath)) {\n const held = readAppRevocations(new Uint8Array(readFileSync(listPath)), checked);\n if (!held.ok) throw refused(`${listPath} is there and is not a valid ghostly-revoke.json: fix or move it first`, held);\n list = held.revocations;\n }\n const signed = await signAppRevocation(statement, key.signer);\n const same = list.some((r) => canonicalJson(r.statement) === canonicalJson(signed.statement));\n if (!same) {\n if (list.length >= APP_STATEMENT_LIMITS.revocations) throw refused(`${listPath} holds ${list.length} revocations already`, { reason: \"bad-revocation\", detail: `at most ${APP_STATEMENT_LIMITS.revocations}` });\n list = [...list, signed];\n const bytes = canonicalJsonBytes(list);\n const check = readAppRevocations(bytes, checked);\n if (!check.ok) throw refused(\"The revocation list made is not valid\", check);\n writeWhole(listPath, bytes);\n }\n const covers = digests.length\n ? { digests, current: digests.includes(read.bundle.digest) }\n : { upTo: what.upTo, current: manifest.sequence <= what.upTo! };\n return { app: ref, ...covers, ...(what.reason !== undefined ? { reason: what.reason } : {}), added: !same, revocations: list.length, file: listPath };\n}\n\n// ---------- store indexes ----------\n\n/**\n * `store sign <index> --key <file> [--out <dir>]`: a store index written by hand (any JSON layout; `key` may be left\n * out and is then the signing key's) becomes `ghostly-store.json`, canonical, and `ghostly-store.sig`, in `--out` or\n * beside the index. It is read back as a client reads it (`expires` at most 90 days ahead), and refused when the index\n * already there has a higher `sequence`, or the same one with other content, or is signed by another key (another\n * store is another `--out`). The key is made only when no signed index is there.\n */\nexport async function signStore(indexArg: string, keyArg: string, outArg?: string, now = Math.floor(Date.now() / 1000)): Promise<Record<string, unknown>> {\n const indexPath = userPath(indexArg);\n const keyPath = userPath(keyArg);\n const outDir = userPath(outArg ?? dirname(indexPath));\n let value: unknown;\n try { value = JSON.parse(readFileSync(indexPath, \"utf8\")); } catch (error) {\n if (error instanceof SyntaxError) throw new CliError(\"bad_request\", `${indexPath} is not JSON: ${error.message}`);\n throw localFileError(error, indexPath) ?? error;\n }\n if (!value || typeof value !== \"object\" || Array.isArray(value)) throw new CliError(\"bad_request\", `${indexPath} is not a JSON object`);\n const index = value as Record<string, unknown>;\n\n // The index this one follows, when the folder holds a signed one: a store is its key, so only that key signs over it.\n const indexOut = join(outDir, STORE_INDEX_FILE), sigOut = join(outDir, STORE_SIG_FILE);\n // Each revocation's signature is checked once, though the held index, the new one and its read-back all carry it.\n const checked = new Set<string>();\n let held: AppStoreReading | null = null;\n if (existsSync(indexOut) && existsSync(sigOut)) {\n const read = readAppStore(new Uint8Array(readFileSync(indexOut)), new Uint8Array(readFileSync(sigOut)), now, undefined, checked);\n if (read.ok) held = read.store;\n }\n\n let key: LoadedKey;\n if (existsSync(keyPath)) key = readKey(keyPath, \"store\");\n else if (index.key !== undefined) throw new CliError(\"not_found\", `No key file ${keyPath}: the index names the store key ${typeof index.key === \"string\" ? appFingerprint(index.key) : JSON.stringify(index.key)}`);\n else if (held) throw new CliError(\"not_found\", `No key file ${keyPath}: ${indexOut} is signed by ${appFingerprint(held.index.key)}, and only that key signs its next index`);\n else key = makeKey(keyPath, \"store\");\n if (index.key !== undefined && index.key !== key.key) {\n throw refused(`${indexPath} names another store key than ${keyPath}'s (${appFingerprint(key.key)})`, { reason: \"store-key\" });\n }\n if (held && held.index.key !== key.key) {\n throw refused(`${indexOut} is signed by another store key (${appFingerprint(held.index.key)}) than ${keyPath}'s (${appFingerprint(key.key)}): a store is its key; sign with that key, or give another --out for another store`, { reason: \"store-key\" }, { held: held.index.key });\n }\n index.key = key.key;\n\n const valid = checkAppStoreIndex(index, { strict: true }, checked);\n if (!valid.ok) throw refused(`${indexPath} is not a valid store index`, valid);\n const { indexBytes, sigBytes } = await signAppStore(index as unknown as AppStoreIndex, key.signer, checked);\n const read = readAppStore(indexBytes, sigBytes, now, key.key, checked);\n if (!read.ok) throw refused(`${indexPath} would be refused by a client`, read);\n const store = read.store;\n\n let previous: number | null = null;\n if (held) {\n previous = held.index.sequence;\n const decision = appStoreDecision(\n { key: key.key, sequence: held.index.sequence, digest: held.digest },\n { key: key.key, sequence: store.index.sequence, digest: store.digest },\n );\n if (decision === \"rollback\" || decision === \"equivocation\") {\n throw refused(`${indexOut} already holds sequence ${held.index.sequence} of this store: ${decision === \"rollback\" ? \"a lower one is refused by every client\" : \"the same one with other content is refused as equivocation\"}; raise sequence`, { reason: decision }, { held: held.index.sequence });\n }\n }\n\n mkdirSync(outDir, { recursive: true });\n writeWhole(indexOut, indexBytes);\n writeWhole(sigOut, sigBytes);\n const notes = [\n ...(key.created ? [madeKeyNote(keyPath, \"store\", key.key)] : []),\n ...(store.expired ? [`expires (${new Date(store.index.expires * 1000).toISOString()}) is past: clients still install from it and say the store was not updated since then`] : []),\n ];\n return {\n key: key.key, fingerprint: appFingerprint(key.key), name: store.index.name, kind: store.index.kind,\n sequence: store.index.sequence, previous, expires: store.index.expires, expired: store.expired,\n apps: store.index.apps.length, removed: store.index.removed.length, revoked: store.index.revoked.length,\n digest: store.digest, index: indexOut, sig: sigOut, keyCreated: key.created,\n ...(notes.length ? { warning: notes.join(\";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AAK,IAAI,EAAE,IAAI,CAAC;CACtD;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"buttons-CuRfKnPI.js","names":["portuguese","spanish","french","italian","japanese","simplifiedChinese","traditionalChinese","goesOnIn"],"sources":["../../../../apps/ui/src/lib/parse/monero-seed-lists.ts","../../../../apps/ui/src/lib/parse/monero-words.ts","../../../../apps/ui/src/lib/parse/secrets.ts","../../../../apps/ui/src/lib/parse/seedLists.ts","../../src/waits.ts","../../src/buttons.ts"],"sourcesContent":["/**\n * Monero's seed words in the app's languages besides English (src/mnemonics/*.h in monero-project/monero, tag\n * v0.18.4.3), in their order: a word's place is its value. Monero GUI and monero-wallet-cli write a 25-word seed in\n * any of them; only `seedLists.ts` imports this, so none of it is in the app's first download.\n *\n * The French and Italian lists (Italian by Shrikez) are Copyright (c) 2014-2022, The Monero Project, under the BSD\n * 3-Clause licence their files carry: redistributions keep this notice, and the project's name may not endorse this app.\n * The Spanish, Portuguese, Japanese and Chinese lists were originally created by dabura667 and released under The MIT\n * License (MIT):\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/** spanish.h. */\nexport const MONERO_SPANISH = `\nábaco abdomen abeja abierto abogado abono aborto abrazo abrir abuelo abuso acabar academia acceso acción aceite acelga\nacento aceptar ácido aclarar acné acoger acoso activo acto actriz actuar acudir acuerdo acusar adicto admitir adoptar\nadorno aduana adulto aéreo afectar afición afinar afirmar ágil agitar agonía agosto agotar agregar agrio agua agudo\náguila aguja ahogo ahorro aire aislar ajedrez ajeno ajuste alacrán alambre alarma alba álbum alcalde aldea alegre\nalejar alerta aleta alfiler alga algodón aliado aliento alivio alma almeja almíbar altar alteza altivo alto altura\nalumno alzar amable amante amapola amargo amasar ámbar ámbito ameno amigo amistad amor amparo amplio ancho anciano\nancla andar andén anemia ángulo anillo ánimo anís anotar antena antiguo antojo anual anular anuncio añadir añejo año\napagar aparato apetito apio aplicar apodo aporte apoyo aprender aprobar apuesta apuro arado araña arar árbitro árbol\narbusto archivo arco arder ardilla arduo área árido aries armonía arnés aroma arpa arpón arreglo arroz arruga arte\nartista asa asado asalto ascenso asegurar aseo asesor asiento asilo asistir asno asombro áspero astilla astro astuto\nasumir asunto atajo ataque atar atento ateo ático atleta átomo atraer atroz atún audaz audio auge aula aumento ausente\nautor aval avance avaro ave avellana avena avestruz avión aviso ayer ayuda ayuno azafrán azar azote azúcar azufre azul\nbaba babor bache bahía baile bajar balanza balcón balde bambú banco banda baño barba barco barniz barro báscula bastón\nbasura batalla batería batir batuta baúl bazar bebé bebida bello besar beso bestia bicho bien bingo blanco bloque\nblusa boa bobina bobo boca bocina boda bodega boina bola bolero bolsa bomba bondad bonito bono bonsái borde borrar\nbosque bote botín bóveda bozal bravo brazo brecha breve brillo brinco brisa broca broma bronce brote bruja brusco\nbruto buceo bucle bueno buey bufanda bufón búho buitre bulto burbuja burla burro buscar butaca buzón caballo cabeza\ncabina cabra cacao cadáver cadena caer café caída caimán caja cajón cal calamar calcio caldo calidad calle calma calor\ncalvo cama cambio camello camino campo cáncer candil canela canguro canica canto caña cañón caoba caos capaz capitán\ncapote captar capucha cara carbón cárcel careta carga cariño carne carpeta carro carta casa casco casero caspa castor\ncatorce catre caudal causa cazo cebolla ceder cedro celda célebre celoso célula cemento ceniza centro cerca cerdo\ncereza cero cerrar certeza césped cetro chacal chaleco champú chancla chapa charla chico chiste chivo choque choza\nchuleta chupar ciclón ciego cielo cien cierto cifra cigarro cima cinco cine cinta ciprés circo ciruela cisne cita\nciudad clamor clan claro clase clave cliente clima clínica cobre cocción cochino cocina coco código codo cofre coger\ncohete cojín cojo cola colcha colegio colgar colina collar colmo columna combate comer comida cómodo compra conde\nconejo conga conocer consejo contar copa copia corazón corbata corcho cordón corona correr coser cosmos costa cráneo\ncráter crear crecer creído crema cría crimen cripta crisis cromo crónica croqueta crudo cruz cuadro cuarto cuatro cubo\ncubrir cuchara cuello cuento cuerda cuesta cueva cuidar culebra culpa culto cumbre cumplir cuna cuneta cuota cupón\ncúpula curar curioso curso curva cutis dama danza dar dardo dátil deber débil década decir dedo defensa definir dejar\ndelfín delgado delito demora denso dental deporte derecho derrota desayuno deseo desfile desnudo destino desvío\ndetalle detener deuda día diablo diadema diamante diana diario dibujo dictar diente dieta diez difícil digno dilema\ndiluir dinero directo dirigir disco diseño disfraz diva divino doble doce dolor domingo don donar dorado dormir dorso\ndos dosis dragón droga ducha duda duelo dueño dulce dúo duque durar dureza duro ébano ebrio echar eco ecuador edad\nedición edificio editor educar efecto eficaz eje ejemplo elefante elegir elemento elevar elipse élite elixir elogio\neludir embudo emitir emoción empate empeño empleo empresa enano encargo enchufe encía enemigo enero enfado enfermo\nengaño enigma enlace enorme enredo ensayo enseñar entero entrar envase envío época equipo erizo escala escena escolar\nescribir escudo esencia esfera esfuerzo espada espejo espía esposa espuma esquí estar este estilo estufa etapa eterno\nética etnia evadir evaluar evento evitar exacto examen exceso excusa exento exigir exilio existir éxito experto\nexplicar exponer extremo fábrica fábula fachada fácil factor faena faja falda fallo falso faltar fama familia famoso\nfaraón farmacia farol farsa fase fatiga fauna favor fax febrero fecha feliz feo feria feroz fértil fervor festín\nfiable fianza fiar fibra ficción ficha fideo fiebre fiel fiera fiesta figura fijar fijo fila filete filial filtro fin\nfinca fingir finito firma flaco flauta flecha flor flota fluir flujo flúor fobia foca fogata fogón folio folleto fondo\nforma forro fortuna forzar fosa foto fracaso frágil franja frase fraude freír freno fresa frío frito fruta fuego\nfuente fuerza fuga fumar función funda furgón furia fusil fútbol futuro gacela gafas gaita gajo gala galería gallo\ngamba ganar gancho ganga ganso garaje garza gasolina gastar gato gavilán gemelo gemir gen género genio gente geranio\ngerente germen gesto gigante gimnasio girar giro glaciar globo gloria gol golfo goloso golpe goma gordo gorila gorra\ngota goteo gozar grada gráfico grano grasa gratis grave grieta grillo gripe gris grito grosor grúa grueso grumo grupo\nguante guapo guardia guerra guía guiño guion guiso guitarra gusano gustar haber hábil hablar hacer hacha hada hallar\nhamaca harina haz hazaña hebilla hebra hecho helado helio hembra herir hermano héroe hervir hielo hierro hígado\nhigiene hijo himno historia hocico hogar hoguera hoja hombre hongo honor honra hora hormiga horno hostil hoyo hueco\nhuelga huerta hueso huevo huida huir humano húmedo humilde humo hundir huracán hurto icono ideal idioma ídolo iglesia\niglú igual ilegal ilusión imagen imán imitar impar imperio imponer impulso incapaz índice inerte infiel informe\ningenio inicio inmenso inmune innato insecto instante interés íntimo intuir inútil invierno ira iris ironía isla\nislote jabalí jabón jamón jarabe jardín jarra jaula jazmín jefe jeringa jinete jornada joroba joven joya juerga jueves\njuez jugador jugo juguete juicio junco jungla junio juntar júpiter jurar justo juvenil juzgar kilo koala labio lacio\nlacra lado ladrón lagarto lágrima laguna laico lamer lámina lámpara lana lancha langosta lanza lápiz largo larva\nlástima lata látex latir laurel lavar lazo leal lección leche lector leer legión legumbre lejano lengua lento leña\nleón leopardo lesión letal letra leve leyenda libertad libro licor líder lidiar lienzo liga ligero lima límite limón\nlimpio lince lindo línea lingote lino linterna líquido liso lista litera litio litro llaga llama llanto llave llegar\nllenar llevar llorar llover lluvia lobo loción loco locura lógica logro lombriz lomo lonja lote lucha lucir lugar lujo\nluna lunes lupa lustro luto luz maceta macho madera madre maduro maestro mafia magia mago maíz maldad maleta malla\nmalo mamá mambo mamut manco mando manejar manga maniquí manjar mano manso manta mañana mapa máquina mar marco marea\nmarfil margen marido mármol marrón martes marzo masa máscara masivo matar materia matiz matriz máximo mayor mazorca\nmecha medalla medio médula mejilla mejor melena melón memoria menor mensaje mente menú mercado merengue mérito mes\nmesón meta meter método metro mezcla miedo miel miembro miga mil milagro militar millón mimo mina minero mínimo minuto\nmiope mirar misa miseria misil mismo mitad mito mochila moción moda modelo moho mojar molde moler molino momento momia\nmonarca moneda monja monto moño morada morder moreno morir morro morsa mortal mosca mostrar motivo mover móvil mozo\nmucho mudar mueble muela muerte muestra mugre mujer mula muleta multa mundo muñeca mural muro músculo museo musgo\nmúsica muslo nácar nación nadar naipe naranja nariz narrar nasal natal nativo natural náusea naval nave navidad necio\nnéctar negar negocio negro neón nervio neto neutro nevar nevera nicho nido niebla nieto niñez niño nítido nivel\nnobleza noche nómina noria norma norte nota noticia novato novela novio nube nuca núcleo nudillo nudo nuera nueve nuez\nnulo número nutria oasis obeso obispo objeto obra obrero observar obtener obvio oca ocaso océano ochenta ocho ocio\nocre octavo octubre oculto ocupar ocurrir odiar odio odisea oeste ofensa oferta oficio ofrecer ogro oído oír ojo ola\noleada olfato olivo olla olmo olor olvido ombligo onda onza opaco opción ópera opinar oponer optar óptica opuesto\noración orador oral órbita orca orden oreja órgano orgía orgullo oriente origen orilla oro orquesta oruga osadía\noscuro osezno oso ostra otoño otro oveja óvulo óxido oxígeno oyente ozono pacto padre paella página pago país pájaro\npalabra palco paleta pálido palma paloma palpar pan panal pánico pantera pañuelo papá papel papilla paquete parar\nparcela pared parir paro párpado parque párrafo parte pasar paseo pasión paso pasta pata patio patria pausa pauta pavo\npayaso peatón pecado pecera pecho pedal pedir pegar peine pelar peldaño pelea peligro pellejo pelo peluca pena pensar\npeñón peón peor pepino pequeño pera percha perder pereza perfil perico perla permiso perro persona pesa pesca pésimo\npestaña pétalo petróleo pez pezuña picar pichón pie piedra pierna pieza pijama pilar piloto pimienta pino pintor pinza\npiña piojo pipa pirata pisar piscina piso pista pitón pizca placa plan plata playa plaza pleito pleno plomo pluma\nplural pobre poco poder podio poema poesía poeta polen policía pollo polvo pomada pomelo pomo pompa poner porción\nportal posada poseer posible poste potencia potro pozo prado precoz pregunta premio prensa preso previo primo príncipe\nprisión privar proa probar proceso producto proeza profesor programa prole promesa pronto propio próximo prueba\npúblico puchero pudor pueblo puerta puesto pulga pulir pulmón pulpo pulso puma punto puñal puño pupa pupila puré\nquedar queja quemar querer queso quieto química quince quitar rábano rabia rabo ración radical raíz rama rampa rancho\nrango rapaz rápido rapto rasgo raspa rato rayo raza razón reacción realidad rebaño rebote recaer receta rechazo\nrecoger recreo recto recurso red redondo reducir reflejo reforma refrán refugio regalo regir regla regreso rehén reino\nreír reja relato relevo relieve relleno reloj remar remedio remo rencor rendir renta reparto repetir reposo reptil res\nrescate resina respeto resto resumen retiro retorno retrato reunir revés revista rey rezar rico riego rienda riesgo\nrifa rígido rigor rincón riñón río riqueza risa ritmo rito\n`.trim().split(/\\s+/);\n\n/** portuguese.h. */\nexport const MONERO_PORTUGUESE = `\nabaular abdominal abeto abissinio abjeto ablucao abnegar abotoar abrutalhar absurdo abutre acautelar accessorios\nacetona achocolatado acirrar acne acovardar acrostico actinomicete acustico adaptavel adeus adivinho adjunto admoestar\nadnominal adotivo adquirir adriatico adsorcao adutora advogar aerossol afazeres afetuoso afixo afluir afortunar\nafrouxar aftosa afunilar agentes agito aglutinar aiatola aimore aino aipo airoso ajeitar ajoelhar ajudante ajuste\nalazao albumina alcunha alegria alexandre alforriar alguns alhures alivio almoxarife alotropico alpiste alquimista\nalsaciano altura aluviao alvura amazonico ambulatorio ametodico amizades amniotico amovivel amurada anatomico ancorar\nanexo anfora aniversario anjo anotar ansioso anturio anuviar anverso anzol aonde apaziguar apito aplicavel apoteotico\naprimorar aprumo apto apuros aquoso arauto arbusto arduo aresta arfar arguto aritmetico arlequim armisticio aromatizar\narpoar arquivo arrumar arsenio arturiano aruaque arvores asbesto ascorbico aspirina asqueroso assustar astuto atazanar\nativo atletismo atmosferico atormentar atroz aturdir audivel auferir augusto aula aumento aurora autuar avatar avexar\navizinhar avolumar avulso axiomatico azerbaijano azimute azoto azulejo bacteriologista badulaque baforada baixote\nbajular balzaquiana bambuzal banzo baoba baqueta barulho bastonete batuta bauxita bavaro bazuca bcrepuscular beato\nbeduino begonia behaviorista beisebol belzebu bemol benzido beocio bequer berro besuntar betume bexiga bezerro biatlon\nbiboca bicuspide bidirecional bienio bifurcar bigorna bijuteria bimotor binormal bioxido bipolarizacao biquini\nbirutice bisturi bituca biunivoco bivalve bizarro blasfemo blenorreia blindar bloqueio blusao boazuda bofete bojudo\nbolso bombordo bonzo botina boquiaberto bostoniano botulismo bourbon bovino boximane bravura brevidade britar broxar\nbruno bruxuleio bubonico bucolico buda budista bueiro buffer bugre bujao bumerangue burundines busto butique buzios\ncaatinga cabuqui cacunda cafuzo cajueiro camurca canudo caquizeiro carvoeiro casulo catuaba cauterizar cebolinha\ncedula ceifeiro celulose cerzir cesto cetro ceus cevar chavena cheroqui chita chovido chuvoso ciatico cibernetico\ncicuta cidreira cientistas cifrar cigarro cilio cimo cinzento cioso cipriota cirurgico cisto citrico ciumento civismo\nclavicula clero clitoris cluster coaxial cobrir cocota codorniz coexistir cogumelo coito colusao compaixao comutativo\ncontentamento convulsivo coordenativa coquetel correto corvo costureiro cotovia covil cozinheiro cretino cristo crivo\ncrotalo cruzes cubo cucuia cueiro cuidar cujo cultural cunilingua cupula curvo custoso cutucar czarismo dablio dacota\ndados daguerreotipo daiquiri daltonismo damista dantesco daquilo darwinista dasein dativo deao debutantes decurso\ndeduzir defunto degustar dejeto deltoide demover denunciar deputado deque dervixe desvirtuar deturpar deuteronomio\ndevoto dextrose dezoito diatribe dicotomico didatico dietista difuso digressao diluvio diminuto dinheiro dinossauro\ndioxido diplomatico dique dirimivel disturbio diurno divulgar dizivel doar dobro docura dodoi doer dogue doloso domo\ndonzela doping dorsal dossie dote doutro doze dravidico dreno driver dropes druso dubnio ducto dueto dulija dundum\nduodeno duquesa durou duvidoso duzia ebano ebrio eburneo echarpe eclusa ecossistema ectoplasma ecumenismo eczema eden\neditorial edredom edulcorar efetuar efigie efluvio egiptologo egresso egua einsteiniano eira eivar eixos ejetar\nelastomero eldorado elixir elmo eloquente elucidativo emaranhar embutir emerito emfa emitir emotivo empuxo emulsao\nenamorar encurvar enduro enevoar enfurnar enguico enho enigmista enlutar enormidade enpreendimento enquanto enriquecer\nenrugar entusiastico enunciar envolvimento enxuto enzimatico eolico epiteto epoxi epura equivoco erario erbio ereto\nerguido erisipela ermo erotizar erros erupcao ervilha esburacar escutar esfuziante esguio esloveno esmurrar esoterismo\nesperanca espirito espurio essencialmente esturricar esvoacar etario eterno etiquetar etnologo etos etrusco euclidiano\neuforico eugenico eunuco europio eustaquio eutanasia evasivo eventualidade evitavel evoluir exaustor excursionista\nexercito exfoliado exito exotico expurgo exsudar extrusora exumar fabuloso facultativo fado fagulha faixas fajuto\nfaltoso famoso fanzine fapesp faquir fartura fastio faturista fausto favorito faxineira fazer fealdade febril fecundo\nfedorento feerico feixe felicidade felpudo feltro femur fenotipo fervura festivo feto feudo fevereiro fezinha fiasco\nfibra ficticio fiduciario fiesp fifa figurino fijiano filtro finura fiorde fiquei firula fissurar fitoteca fivela fixo\nflavio flexor flibusteiro flotilha fluxograma fobos foco fofura foguista foie foliculo fominha fonte forum fosso\nfotossintese foxtrote fraudulento frevo frivolo frouxo frutose fuba fucsia fugitivo fuinha fujao fulustreco fumo\nfunileiro furunculo fustigar futurologo fuxico fuzue gabriel gado gaelico gafieira gaguejo gaivota gajo\ngalvanoplastico gamo ganso garrucha gastronomo gatuno gaussiano gaviao gaxeta gazeteiro gear geiser geminiano generoso\ngenuino geossinclinal gerundio gestual getulista gibi gigolo gilete ginseng giroscopio glaucio glacial gleba glifo\nglote glutonia gnostico goela gogo goitaca golpista gomo gonzo gorro gostou goticula gourmet governo gozo graxo\ngrevista grito grotesco gruta guaxinim gude gueto guizo guloso gume guru gustativo grelhado gutural habitue haitiano\nhalterofilista hamburguer hanseniase happening harpista hastear haveres hebreu hectometro hedonista hegira helena\nhelminto hemorroidas henrique heptassilabo hertziano hesitar heterossexual heuristico hexagono hiato hibrido\nhidrostatico hieroglifo hifenizar higienizar hilario himen hino hippie hirsuto historiografia hitlerista hodometro\nhoje holograma homus honroso hoquei horto hostilizar hotentote huguenote humilde huno hurra hutu iaia ialorixa iambico\niansa iaque iara iatista iberico ibis icar iceberg icosagono idade ideologo idiotice idoso iemenita iene igarape iglu\nignorar igreja iguaria iidiche ilativo iletrado ilharga ilimitado ilogismo ilustrissimo imaturo imbuzeiro imerso\nimitavel imovel imputar imutavel inaveriguavel incutir induzir inextricavel infusao ingua inhame iniquo injusto inning\ninoxidavel inquisitorial insustentavel intumescimento inutilizavel invulneravel inzoneiro iodo iogurte ioio ionosfera\nioruba iota ipsilon irascivel iris irlandes irmaos iroques irrupcao isca isento islandes isotopo isqueiro israelita\nisso isto iterbio itinerario itrio iuane iugoslavo jabuticabeira jacutinga jade jagunco jainista jaleco jambo\njantarada japones jaqueta jarro jasmim jato jaula javel jazz jegue jeitoso jejum jenipapo jeova jequitiba jersei jesus\njetom jiboia jihad jilo jingle jipe jocoso joelho joguete joio jojoba jorro jota joule joviano jubiloso judoca jugular\njuizo jujuba juliano jumento junto jururu justo juta juventude labutar laguna laico lajota lanterninha lapso laquear\nlastro lauto lavrar laxativo lazer leasing lebre lecionar ledo leguminoso leitura lele lemure lento leonardo leopardo\nlepton leque leste letreiro leucocito levitico lexicologo lhama lhufas liame licoroso lidocaina liliputiano limusine\nlinotipo lipoproteina liquidos lirismo lisura liturgico livros lixo lobulo locutor lodo logro lojista lombriga lontra\nloop loquaz lorota losango lotus louvor luar lubrificavel lucros lugubre luis luminoso luneta lustroso luto luvas\nluxuriante luzeiro maduro maestro mafioso magro maiuscula majoritario malvisto mamute manutencao mapoteca maquinista\nmarzipa masturbar matuto mausoleu mavioso maxixe mazurca meandro mecha medusa mefistofelico megera meirinho melro\nmemorizar menu mequetrefe mertiolate mestria metroviario mexilhao mezanino miau microssegundo midia migratorio mimosa\nminuto miosotis mirtilo misturar mitzvah miudos mixuruca mnemonico moagem mobilizar modulo moer mofo mogno moita\nmolusco monumento moqueca morubixaba mostruario motriz mouse movivel mozarela muarra muculmano mudo mugir muitos\nmumunha munir muon muquira murros musselina nacoes nado naftalina nago naipe naja nalgum namoro nanquim napolitano\nnaquilo nascimento nautilo navios nazista nebuloso nectarina nefrologo negus nelore nenufar nepotismo nervura neste\nnetuno neutron nevoeiro newtoniano nexo nhenhenhem nhoque nigeriano niilista ninho niobio niponico niquelar nirvana\nnisto nitroglicerina nivoso nobreza nocivo noel nogueira noivo nojo nominativo nonuplo noruegues nostalgico noturno\nnouveau nuanca nublar nucleotideo nudista nulo numismatico nunquinha nupcias nutritivo nuvens oasis obcecar obeso\nobituario objetos oblongo obnoxio obrigatorio obstruir obtuso obus obvio ocaso occipital oceanografo ocioso oclusivo\nocorrer ocre octogono odalisca odisseia odorifico oersted oeste ofertar ofidio oftalmologo ogiva ogum oigale oitavo\noitocentos ojeriza olaria oleoso olfato olhos oliveira olmo olor olvidavel ombudsman omeleteira omitir omoplata\nonanismo ondular oneroso onomatopeico ontologico onus onze opalescente opcional operistico opio oposto oprobrio\noptometrista opusculo oratorio orbital orcar orfao orixa orla ornitologo orquidea ortorrombico orvalho osculo osmotico\nossudo ostrogodo otario otite ouro ousar outubro ouvir ovario overnight oviparo ovni ovoviviparo ovulo oxala oxente\noxiuro oxossi ozonizar paciente pactuar padronizar paete pagodeiro paixao pajem paludismo pampas panturrilha papudo\npaquistanes pastoso patua paulo pauzinhos pavoroso paxa pazes peao pecuniario pedunculo pegaso peixinho pejorativo\npelvis penuria pequno petunia pezada piauiense pictorico pierro pigmeu pijama pilulas pimpolho pintura piorar pipocar\npiqueteiro pirulito pistoleiro pituitaria pivotar pixote pizzaria plistoceno plotar pluviometrico pneumonico poco\npodridao poetisa pogrom pois polvorosa pomposo ponderado pontudo populoso poquer porvir posudo potro pouso povoar\nprazo prezar privilegios proximo prussiano pseudopode psoriase pterossauros ptialina ptolemaico pudor pueril pufe\npugilista puir pujante pulverizar pumba punk purulento pustula putsch puxe quatrocentos quetzal quixotesco quotizavel\nrabujice racista radonio rafia ragu rajado ralo rampeiro ranzinza raptor raquitismo raro rasurar ratoeira ravioli\nrazoavel reavivar rebuscar recusavel reduzivel reexposicao refutavel regurgitar reivindicavel rejuvenescimento relva\nremuneravel renunciar reorientar repuxo requisito resumo returno reutilizar revolvido rezonear riacho ribossomo ricota\nridiculo rifle rigoroso rijo rimel rins rios riqueza respeito rissole ritualistico rivalizar rixa robusto rococo\nrodoviario roer rogo rojao rolo rompimento ronronar roqueiro rorqual rosto rotundo rouxinol roxo royal ruas rucula\nrudimentos ruela rufo rugoso ruivo rule rumoroso runico ruptura rural rustico rutilar saariano sabujo sacudir\nsadomasoquista safra sagui sais samurai santuario sapo saquear sartriano saturno saude sauva saveiro saxofonista\nsazonal scherzo script seara seborreia secura seduzir sefardim seguro seja selvas sempre senzala sepultura sequoia\nsestercio setuplo seus seviciar sezonismo shalom siames sibilante sicrano sidra sifilitico signos silvo simultaneo\nsinusite sionista sirio sisudo situar sivan slide slogan soar sobrio socratico sodomizar soerguer software sogro soja\nsolver somente sonso sopro soquete sorveteiro sossego soturno sousafone sovinice sozinho suavizar subverter sucursal\nsudoriparo sufragio sugestoes suite sujo sultao sumula suntuoso suor supurar suruba susto suturar suvenir tabuleta\ntaco tadjique tafeta tagarelice taitiano talvez tampouco tanzaniano taoista tapume taquion tarugo tascar tatuar\ntautologico tavola taxionomista tchecoslovaco teatrologo tectonismo tedioso teflon tegumento teixo telurio temporas\ntenue teosofico tepido tequila terrorista testosterona tetrico teutonico teve texugo tiara tibia tiete tifoide tigresa\ntijolo tilintar timpano tintureiro tiquete tiroteio tisico titulos tive toar toboga tofu togoles toicinho tolueno\ntomografo tontura toponimo toquio torvelinho tostar toto touro toxina trazer trezentos trivialidade trovoar truta\ntuaregue tubular tucano tudo tufo tuiste tulipa tumultuoso tunisino tupiniquim turvo tutu ucraniano udenista ufanista\nufologo ugaritico uiste uivo ulceroso ulema ultravioleta umbilical umero umido umlaut unanimidade unesco ungulado\nunheiro univoco untuoso urano urbano urdir uretra urgente urinol urna urologo urro ursulina urtiga urupe usavel\nusbeque usei usineiro usurpar utero utilizar utopico uvular uxoricidio vacuo vadio vaguear vaivem valvula vampiro\nvantajoso vaporoso vaquinha varziano vasto vaticinio vaudeville vazio veado vedico veemente vegetativo veio veja\nveludo venusiano verdade verve vestuario vetusto vexatorio vezes viavel vibratorio victor vicunha vidros vietnamita\nvigoroso vilipendiar vime vintem violoncelo viquingue virus visualizar vituperio viuvo vivo vizir voar vociferar vodu\nvogar voile volver vomito vontade vortice vosso voto vovozinha voyeuse vozes vulva vupt western xadrez xale xampu\nxango xarope xaual xavante xaxim xenonio xepa xerox xicara xifopago xiita xilogravura xinxim xistoso xixi xodo xogum\nxucro zabumba zagueiro zambiano zanzar zarpar zebu zefiro zeloso zenite zumbi\n`.trim().split(/\\s+/);\n\n/** french.h. */\nexport const MONERO_FRENCH = `\nabandon abattre aboi abolir aborder abri absence absolu abuser acacia acajou accent accord accrocher accuser acerbe\nachat acheter acide acier acquis acte action adage adepte adieu admettre admis adorer adresser aduler affaire affirmer\nafin agacer agent agir agiter agonie agrafe agrume aider aigle aigre aile ailleurs aimant aimer ainsi aise ajouter\nalarme album alcool alerte algue alibi aller allumer alors amande amener amie amorcer amour ample amuser ananas ancien\nanglais angoisse animal anneau annoncer apercevoir apparence appel apporter apprendre appuyer arbre arcade arceau\narche ardeur argent argile aride arme armure arracher arriver article asile aspect assaut assez assister assurer astre\nastuce atlas atroce attacher attente attirer aube aucun audace auparavant auquel aurore aussi autant auteur autoroute\nautre aval avant avec avenir averse aveu avide avion avis avoir avouer avril azote azur badge bagage bague bain\nbaisser balai balcon balise balle bambou banane banc bandage banjo banlieue bannir banque baobab barbe barque barrer\nbassine bataille bateau battre baver bavoir bazar beau beige berger besoin beurre biais biceps bidule bien bijou bilan\nbillet blanc blason bleu bloc blond bocal boire boiserie boiter bonbon bondir bonheur bordure borgne borner bosse\nbouche bouder bouger boule bourse bout boxe brader braise branche braquer bras brave brebis brevet brider briller brin\nbrique briser broche broder bronze brosser brouter bruit brute budget buffet bulle bureau buriner buste buter butiner\ncabas cabinet cabri cacao cacher cadeau cadre cage caisse caler calme camarade camion campagne canal canif capable\ncapot carat caresser carie carpe cartel casier casque casserole cause cavale cave ceci cela celui cendre cent\ncependant cercle cerise cerner certes cerveau cesser chacun chair chaleur chamois chanson chaque charge chasse chat\nchaud chef chemin cheveu chez chicane chien chiffre chiner chiot chlore choc choix chose chou chute cibler cidre ciel\ncigale cinq cintre cirage cirque ciseau citation citer citron civet clairon clan classe clavier clef climat cloche\ncloner clore clos clou club cobra cocon coiffer coin colline colon combat comme compte conclure conduire confier connu\nconseil contre convenir copier cordial cornet corps cosmos coton couche coude couler coupure cour couteau couvrir\ncrabe crainte crampe cran creuser crever crier crime crin crise crochet croix cruel cuisine cuite culot culte cumul\ncure curieux cuve dame danger dans davantage debout dedans dehors delta demain demeurer demi dense dent depuis dernier\ndescendre dessus destin dette deuil deux devant devenir devin devoir dicton dieu difficile digestion digue diluer\ndimanche dinde diode dire diriger discours disposer distance divan divers docile docteur dodu dogme doigt dominer\ndonation donjon donner dopage dorer dormir doseur douane double douche douleur doute doux douzaine draguer drame drap\ndresser droit duel dune duper durant durcir durer eaux effacer effet effort effrayant elle embrasser emmener emparer\nempire employer emporter enclos encore endive endormir endroit enduit enfant enfermer enfin enfler enfoncer enfuir\nengager engin enjeu enlever ennemi ennui ensemble ensuite entamer entendre entier entourer entre envelopper envie\nenvoyer erreur escalier espace espoir esprit essai essor essuyer estimer exact examiner excuse exemple exiger exil\nexister exode expliquer exposer exprimer extase fable facette facile fade faible faim faire fait falloir famille faner\nfarce farine fatigue faucon faune faute faux faveur favori faxer feinter femme fendre fente ferme festin feuille\nfeutre fiable fibre ficher fier figer figure filet fille filmer fils filtre final finesse finir fiole firme fixe\nflacon flair flamme flan flaque fleur flocon flore flot flou fluide fluor flux focus foin foire foison folie fonction\nfondre fonte force forer forger forme fort fosse fouet fouine foule four foyer frais franc frapper freiner frimer\nfriser frite froid froncer fruit fugue fuir fuite fumer fureur furieux fuser fusil futile futur gagner gain gala galet\ngalop gamme gant garage garde garer gauche gaufre gaule gaver gazon geler genou genre gens gercer germer geste gibier\ngicler gilet girafe givre glace glisser globe gloire gluant gober golf gommer gorge gosier goutte grain gramme grand\ngras grave gredin griffure griller gris gronder gros grotte groupe grue guerrier guetter guider guise habiter hache\nhaie haine halte hamac hanche hangar hanter haras hareng harpe hasard hausse haut havre herbe heure hibou hier\nhistoire hiver hochet homme honneur honte horde horizon hormone houle housse hublot huile huit humain humble humide\nhumour hurler idole igloo ignorer illusion image immense immobile imposer impression incapable inconnu index indiquer\ninfime injure inox inspirer instant intention intime inutile inventer inviter iode iris issue ivre jade jadis jamais\njambe janvier jardin jauge jaunisse jeter jeton jeudi jeune joie joindre joli joueur journal judo juge juillet juin\njument jungle jupe jupon jurer juron jury jusque juste kayak ketchup kilo kiwi koala label lacet lacune laine laisse\nlait lame lancer lande laque lard largeur larme larve lasso laver lendemain lentement lequel lettre leur lever levure\nliane libre lien lier lieutenant ligne ligoter liguer limace limer limite lingot lion lire lisser litre livre lobe\nlocal logis loin loisir long loque lors lotus louer loup lourd louve loyer lubie lucide lueur luge luire lundi lune\nlustre lutin lutte luxe machine madame magie magnifique magot maigre main mairie maison malade malheur malin manche\nmanger manier manoir manquer marche mardi marge mariage marquer mars masque masse matin mauvais meilleur melon membre\nmenacer mener mensonge mentir menu merci merlu mesure mettre meuble meunier meute miche micro midi miel miette mieux\nmilieu mille mimer mince mineur ministre minute mirage miroir miser mite mixte mobile mode module moins mois moment\nmomie monde monsieur monter moquer moral morceau mordre morose morse mortier morue motif motte moudre moule mourir\nmousse mouton mouvement moyen muer muette mugir muguet mulot multiple munir muret muse musique muter nacre nager nain\nnaissance narine narrer naseau nasse nation nature naval navet naviguer navrer neige nerf nerveux neuf neutre neuve\nneveu niche nier niveau noble noce nocif noir nomade nombre nommer nord norme notaire notice notre nouer nougat\nnourrir nous nouveau novice noyade noyer nuage nuance nuire nuit nulle nuque oasis objet obliger obscur observer\nobtenir obus occasion occuper ocre octet odeur odorat offense officier offrir ogive oiseau olive ombre onctueux\nonduler ongle onze opter option orageux oral orange orbite ordinaire ordre oreille organe orgie orgueil orient origan\norner orteil ortie oser osselet otage otarie ouate oublier ouest ours outil outre ouvert ouvrir ovale ozone pacte page\npaille pain paire paix palace palissade palmier palpiter panda panneau papa papier paquet parc pardi parfois parler\nparmi parole partir parvenir passer pastel patin patron paume pause pauvre paver pavot payer pays peau peigne peinture\npelage pelote pencher pendre penser pente percer perdu perle permettre personne perte peser pesticide petit peuple\npeur phase photo phrase piano pied pierre pieu pile pilier pilote pilule piment pincer pinson pinte pion piquer pirate\npire piste piton pitre pivot pizza placer plage plaire plan plaque plat plein pleurer pliage plier plonger plot pluie\nplume plus pneu poche podium poids poil point poire poison poitrine poivre police pollen pomme pompier poncer pondre\npont portion poser position possible poste potage potin pouce poudre poulet poumon poupe pour pousser poutre pouvoir\nprairie premier prendre presque preuve prier primeur prince prison priver prix prochain produire profond proie projet\npromener prononcer propre prose prouver prune public puce pudeur puiser pull pulpe puma punir purge putois quand\nquartier quasi quatre quel question queue quiche quille quinze quitter quoi rabais raboter race racheter racine racler\nraconter radar radio rafale rage ragot raideur raie rail raison ramasser ramener rampe rance rang rapace rapide\nrapport rarement rasage raser rasoir rassurer rater ratio rature ravage ravir rayer rayon rebond recevoir recherche\nrecord reculer redevenir refuser regard regretter rein rejeter rejoindre relation relever religion remarquer remettre\nremise remonter remplir remuer rencontre rendre renier renoncer rentrer renverser repas repli reposer reproche requin\nrespect ressembler reste retard retenir retirer retour retrouver revenir revoir revue rhume ricaner riche rideau\nridicule rien rigide rincer rire risquer rituel rivage rive robe robot robuste rocade roche rodeur rogner roman rompre\nronce rondeur ronger roque rose rosir rotation rotule roue rouge rouler route ruban rubis ruche rude ruelle ruer rugby\nrugir ruine rumeur rural ruse rustre sable sabot sabre sacre sage saint saisir salade salive salle salon salto salut\nsalve samba sandale sanguin sapin sarcasme satisfaire sauce sauf sauge saule sauna sauter sauver savoir science scoop\nscore second secret secte seigneur sein seize selle selon semaine sembler semer semis sensuel sentir sept serpe serrer\nsertir service seuil seulement short sien sigle signal silence silo simple singe sinon sinus sioux sirop site\nsituation skier snob sobre social socle sodium soigner soir soixante soja solaire soldat soleil solide solo solvant\nsombre somme somnoler sondage songeur sonner sorte sosie sottise souci soudain souffrir souhaiter soulever soumettre\nsoupe sourd soustraire soutenir souvent soyeux spectacle sport stade stagiaire stand star statue stock stop store\nstyle suave subir sucre suer suffire suie suite suivre sujet sulfite supposer surf surprendre surtout surveiller tabac\ntable tabou tache tacler tacot tact taie taille taire talon talus tandis tango tanin tant taper tapis tard tarif tarot\ntarte tasse taureau taux taverne taxer taxi tellement temple tendre tenir tenter tenu terme ternir terre test texte\nthym tibia tiers tige tipi tique tirer tissu titre toast toge toile toiser toiture tomber tome tonne tonte toque torse\ntortue totem toucher toujours tour tousser tout toux trace train trame tranquille travail trembler trente tribu trier\ntrio tripe triste troc trois tromper tronc trop trotter trouer truc truite tuba tuer tuile turbo tutu tuyau type union\nunique unir unisson untel urne usage user usiner usure utile vache vague vaincre valeur valoir valser valve vampire\nvaseux vaste veau veille veine velours velu vendre venir vent venue verbe verdict version vertige verve veste veto\nvexer vice victime vide vieil vieux vigie vigne ville vingt violent virer virus visage viser visite visuel vitamine\nvitrine vivant vivre vocal vodka vogue voici voile voir voisin voiture volaille volcan voler volt votant votre vouer\nvouloir vous voyage voyou vrac vrai yacht yeti yeux yoga zeste zinc zone zoom\n`.trim().split(/\\s+/);\n\n/** italian.h. */\nexport const MONERO_ITALIAN = `\nabbinare abbonato abisso abitare abominio accadere accesso acciaio accordo accumulo acido acqua acrobata acustico\nadattare addetto addio addome adeguato aderire adorare adottare adozione adulto aereo aerobica affare affetto affidare\naffogato affronto africano afrodite agenzia aggancio aggeggio aggiunta agio agire agitare aglio agnello agosto aiutare\nalbero albo alce alchimia alcool alfabeto algebra alimento allarme alleanza allievo alloggio alluce alpi alterare\naltro aluminio amante amarezza ambiente ambrosia america amico ammalare ammirare amnesia amnistia amore ampliare\namputare analisi anamnesi ananas anarchia anatra anca ancorato andare androide aneddoto anello angelo angolino\nanguilla anidride anima annegare anno annuncio anomalia antenna anticipo aperto apostolo appalto appello appiglio\napplauso appoggio appurare aprile aquila arabo arachidi aragosta arancia arbitrio archivio arco argento argilla aria\nariete arma armonia aroma arrivare arrosto arsenale arte artiglio asfalto asfissia asino asparagi aspirina assalire\nassegno assolto assurdo asta astratto atlante atletica atomo atropina attacco attesa attico atto attrarre auguri aula\naumento aurora auspicio autista auto autunno avanzare avarizia avere aviatore avido avorio avvenire avviso avvocato\nazienda azione azzardo azzurro babbuino bacio badante baffi bagaglio bagliore bagno balcone balena ballare balordo\nbalsamo bambola bancomat banda barato barba barista barriera basette basilico bassista bastare battello bavaglio\nbeccare beduino bellezza bene benzina berretto bestia bevitore bianco bibbia biberon bibita bici bidone bilancia\nbiliardo binario binocolo biologia biondina biopsia biossido birbante birra biscotto bisogno bistecca bivio blindare\nbloccare bocca bollire bombola bonifico borghese borsa bottino botulino braccio bradipo branco bravo bresaola bretelle\nbrevetto briciola brigante brillare brindare brivido broccoli brontolo bruciare brufolo bucare buddista budino bufera\nbuffo bugiardo buio buono burrone bussola bustina buttare cabernet cabina cacao cacciare cactus cadavere caffe\ncalamari calcio caldaia calmare calunnia calvario calzone cambiare camera camion cammello campana canarino cancello\ncandore cane canguro cannone canoa cantare canzone caos capanna capello capire capo capperi capra capsula caraffa\ncarbone carciofo cardigan carenza caricare carota carrello carta casa cascare caserma cashmere casino cassetta\ncastello catalogo catena catorcio cattivo causa cauzione cavallo caverna caviglia cavo cazzotto celibato cemento\ncenare centrale ceramica cercare ceretta cerniera certezza cervello cessione cestino cetriolo chiave chiedere chilo\nchimera chiodo chirurgo chitarra chiudere ciabatta ciao cibo ciccia cicerone ciclone cicogna cielo cifra cigno\nciliegia cimitero cinema cinque cintura ciondolo ciotola cipolla cippato circuito cisterna citofono ciuccio civetta\ncivico clausola cliente clima clinica cobra coccole cocktail cocomero codice coesione cogliere cognome colla colomba\ncolpire coltello comando comitato commedia comodino compagna comune concerto condotto conforto congiura coniglio\nconsegna conto convegno coperta copia coprire corazza corda corleone cornice corona corpo corrente corsa cortesia\ncorvo coso costume cotone cottura cozza crampo cratere cravatta creare credere crema crescere crimine criterio croce\ncrollare cronaca crostata croupier cubetto cucciolo cucina cultura cuoco cuore cupido cupola cura curva cuscino\ncustode danzare data decennio decidere decollo dedicare dedurre definire delegare delfino delitto demone dentista\ndenuncia deposito derivare deserto designer destino detonare dettagli diagnosi dialogo diamante diario diavolo\ndicembre difesa digerire digitare diluvio dinamica dipinto diploma diramare dire dirigere dirupo discesa disdetta\ndisegno disporre dissenso distacco dito ditta diva divenire dividere divorare docente dolcetto dolore domatore\ndomenica dominare donatore donna dorato dormire dorso dosaggio dottore dovere download dragone dramma dubbio dubitare\nduetto durata ebbrezza eccesso eccitare eclissi economia edera edificio editore edizione educare effetto egitto\negiziano elastico elefante eleggere elemento elenco elezione elmetto elogio embrione emergere emettere eminenza\nemisfero emozione empatia energia enfasi enigma entrare enzima epidemia epilogo episodio epoca equivoco erba erede\neroe erotico errore eruzione esaltare esame esaudire eseguire esempio esigere esistere esito esperto espresso essere\nestasi esterno estrarre eterno etica euforico europa evacuare evasione evento evidenza evitare evolvere fabbrica\nfacciata fagiano fagotto falco fame famiglia fanale fango fantasia farfalla farmacia faro fase fastidio faticare fatto\nfavola febbre femmina femore fenomeno fermata feromoni ferrari fessura festa fiaba fiamma fianco fiat fibbia fidare\nfieno figa figlio figura filetto filmato filosofo filtrare finanza finestra fingere finire finta finzione fiocco\nfioraio firewall firmare fisico fissare fittizio fiume flacone flagello flirtare flusso focaccia foglio fognario\nfollia fonderia fontana forbici forcella foresta forgiare formare fornace foro fortuna forzare fosforo fotoni fracasso\nfragola frantumi fratello frazione freccia freddo frenare fresco friggere frittata frivolo frizione fronte frullato\nfrumento frusta frutto fucile fuggire fulmine fumare funzione fuoco furbizia furgone furia furore fusibile fuso futuro\ngabbiano galassia gallina gamba gancio garanzia garofano gasolio gatto gazebo gazzetta gelato gemelli generare\ngenitori gennaio geologia germania gestire gettare ghepardo ghiaccio giaccone giaguaro giallo giappone giardino\ngigante gioco gioiello giorno giovane giraffa giudizio giurare giusto globo gloria glucosio gnocca gocciola godere\ngomito gomma gonfiare gorilla governo gradire graffiti granchio grappolo grasso grattare gridare grissino grondaia\ngrugnito gruppo guadagno guaio guancia guardare gufo guidare guscio gusto icona idea identico idolo idoneo idrante\nidrogeno igiene ignoto imbarco immagine immobile imparare impedire impianto importo impresa impulso incanto incendio\nincidere incontro incrocia incubo indagare indice indotto infanzia inferno infinito infranto ingerire inglese ingoiare\ningresso iniziare innesco insalata inserire insicuro insonnia insulto interno introiti invasori inverno invito\ninvocare ipnosi ipocrita ipotesi ironia irrigare iscritto isola ispirare isterico istinto istruire italiano jazz\nlabbra labrador ladro lago lamento lampone lancetta lanterna lapide larva lasagne lasciare lastra latte laurea lavagna\nlavorare leccare legare leggere lenzuolo leone lepre letargo lettera levare levitare lezione liberare libidine libro\nlicenza lievito limite lince lingua liquore lire listino litigare litro locale lottare lucciola lucidare luglio luna\nmacchina madama madre maestro maggio magico maglione magnolia mago maialino maionese malattia male malloppo mancare\nmandorla mangiare manico manopola mansarda mantello manubrio manzo mappa mare margine marinaio marmotta marocco\nmartello marzo maschera matrice maturare mazzetta meandri medaglia medico medusa megafono melone membrana menta\nmercato meritare merluzzo mese mestiere metafora meteo metodo mettere miele miglio miliardo mimetica minatore minuto\nmiracolo mirtillo missile mistero misura mito mobile moda moderare moglie molecola molle momento moneta mongolia\nmonologo montagna morale morbillo mordere mosaico mosca mostro motivare moto mulino mulo muovere muraglia muscolo\nmuseo musica mutande nascere nastro natale natura nave navigare negare negozio nemico nero nervo nessuno nettare\nneutroni neve nevicare nicotina nido nipote nocciola noleggio nome nonno norvegia notare notizia nove nucleo nuda\nnuotare nutrire obbligo occhio occupare oceano odissea odore offerta officina offrire oggetto oggi olfatto olio oliva\nombelico ombrello omuncolo ondata onore opera opinione opuscolo opzione orario orbita orchidea ordine orecchio orgasmo\norgoglio origine orologio oroscopo orso oscurare ospedale ospite ossigeno ostacolo ostriche ottenere ottimo ottobre\novest pacco pace pacifico padella pagare pagina pagnotta palazzo palestra palpebre pancetta panfilo panino pannello\npanorama papa paperino paradiso parcella parente parlare parodia parrucca partire passare pasta patata patente\npatogeno patriota pausa pazienza peccare pecora pedalare pelare pena pendenza penisola pennello pensare pentirsi\npercorso perdono perfetto perizoma perla permesso persona pesare pesce peso petardo petrolio pezzo piacere pianeta\npiastra piatto piazza piccolo piede piegare pietra pigiama pigliare pigrizia pilastro pilota pinguino pioggia piombo\npionieri piovra pipa pirata pirolisi piscina pisolino pista pitone piumino pizza plastica platino poesia poiana\npolaroid polenta polimero pollo polmone polpetta poltrona pomodoro pompa popolo porco porta porzione possesso postino\npotassio potere poverino pranzo prato prefisso prelievo premio prendere prestare pretesa prezzo primario privacy\nproblema processo prodotto profeta progetto promessa pronto proposta proroga prossimo proteina prova prudenza pubblico\npudore pugilato pulire pulsante puntare pupazzo puzzle quaderno qualcuno quarzo quercia quintale rabbia racconto\nradice raffica ragazza ragione rammento ramo rana randagio rapace rapinare rapporto rasatura ravioli reagire realista\nreattore reazione recitare recluso record recupero redigere regalare regina regola relatore reliquia remare rendere\nreparto resina resto rete retorica rettile revocare riaprire ribadire ribelle ricambio ricetta richiamo ricordo\nridurre riempire riferire riflesso righello rilancio rilevare rilievo rimanere rimborso rinforzo rinuncia riparo\nripetere riposare ripulire risalita riscatto riserva riso rispetto ritaglio ritmo ritorno ritratto rituale riunione\nriuscire riva robotica rondine rosa rospo rosso rotonda rotta roulotte rubare rubrica ruffiano rumore ruota ruscello\nsabbia sacco saggio sale salire salmone salto salutare salvia sangue sanzioni sapere sapienza sarcasmo sardine\nsartoria sbalzo sbarcare sberla sborsare scadenza scafo scala scambio scappare scarpa scatola scelta scena sceriffo\nscheggia schiuma sciarpa scienza scimmia sciopero scivolo sclerare scolpire sconto scopa scordare scossa scrivere\nscrupolo scuderia scultore scuola scusare sdraiare secolo sedativo sedere sedia segare segreto seguire semaforo seme\nsenape seno sentiero separare sepolcro sequenza serata serpente servizio sesso seta settore sfamare sfera sfidare\nsfiorare sfogare sgabello sicuro siepe sigaro silenzio silicone simbiosi simpatia simulare sinapsi sindrome sinergia\nsinonimo sintonia sirena siringa sistema sito smalto smentire smontare soccorso socio soffitto software soggetto\nsogliola sognare soldi sole sollievo solo sommario sondare sonno sorpresa sorriso sospiro sostegno sovrano spaccare\nspada spagnolo spalla sparire spavento spazio specchio spedire spegnere spendere speranza spessore spezzare spiaggia\nspiccare spiegare spiffero spingere sponda sporcare spostare spremuta spugna spumante spuntare squadra squillo\nstaccare stadio stagione stallone stampa stancare starnuto statura stella stendere sterzo stilista stimolo stinco\nstiva stoffa storia strada stregone striscia studiare stufa stupendo subire successo sudare suono superare supporto\nsurfista sussurro svelto svenire sviluppo svolta svuotare tabacco tabella tabu tacchino tacere taglio talento tangente\ntappeto tartufo tassello tastiera tavolo tazza teatro tedesco telaio telefono tema temere tempo tendenza tenebre\ntensione tentare teologia teorema termica terrazzo teschio tesi tesoro tessera testa thriller tifoso tigre timbrare\ntimido tinta tirare tisana titano titolo toccare togliere topolino torcia torrente tovaglia traffico tragitto training\ntramonto transito trapezio trasloco trattore trazione treccia tregua treno triciclo tridente trilogia tromba troncare\ntrota trovare trucco tubo tulipano tumulto tunisia tuono turista tuta tutelare tutore ubriaco uccello udienza udito\nuffa umanoide umore unghia unguento unicorno unione universo uomo uragano uranio urlare uscire utente utilizzo vacanza\nvacca vaglio vagonata valle valore valutare valvola vampiro vaniglia vanto vapore variante vasca vaselina vassoio\nvedere vegetale veglia veicolo vela veleno velivolo velluto vendere venerare venire vento veranda verbo verdura\nvergine verifica vernice vero verruca versare vertebra vescica vespaio vestito vesuvio veterano vetro vetta viadotto\nviaggio vibrare vicenda vichingo vietare vigilare vigneto villa vincere violino vipera virgola virtuoso visita vita\nvitello vittima vivavoce vivere viziato voglia volare volpe volto volume vongole voragine vortice votare vulcano\nvuotare zabaione zaffiro zainetto zampa zanzara zattera zavorra zenzero zero zingaro zittire zoccolo zolfo zombie\nzucchero\n`.trim().split(/\\s+/);\n\n/** japanese.h. */\nexport const MONERO_JAPANESE = `\nあいこくしん あいさつ あいだ あおぞら あかちゃん あきる あけがた あける あこがれる あさい あさひ あしあと あじわう あずかる あずき あそぶ あたえる あたためる あたりまえ あたる あつい あつかう あっしゅく あつまり\nあつめる あてな あてはまる あひる あぶら あぶる あふれる あまい あまど あまやかす あまり あみもの あめりか あやまる あゆむ あらいぐま あらし あらすじ あらためる あらゆる あらわす ありがとう あわせる あわてる\nあんい あんがい あんこ あんぜん あんてい あんない あんまり いいだす いおん いがい いがく いきおい いきなり いきもの いきる いくじ いくぶん いけばな いけん いこう いこく いこつ いさましい いさん いしき いじゅう\nいじょう いじわる いずみ いずれ いせい いせえび いせかい いせき いぜん いそうろう いそがしい いだい いだく いたずら いたみ いたりあ いちおう いちじ いちど いちば いちぶ いちりゅう いつか いっしゅん いっせい\nいっそう いったん いっち いってい いっぽう いてざ いてん いどう いとこ いない いなか いねむり いのち いのる いはつ いばる いはん いびき いひん いふく いへん いほう いみん いもうと いもたれ いもり いやがる\nいやす いよかん いよく いらい いらすと いりぐち いりょう いれい いれもの いれる いろえんぴつ いわい いわう いわかん いわば いわゆる いんげんまめ いんさつ いんしょう いんよう うえき うえる うおざ うがい うかぶ\nうかべる うきわ うくらいな うくれれ うけたまわる うけつけ うけとる うけもつ うける うごかす うごく うこん うさぎ うしなう うしろがみ うすい うすぎ うすぐらい うすめる うせつ うちあわせ うちがわ うちき うちゅう\nうっかり うつくしい うったえる うつる うどん うなぎ うなじ うなずく うなる うねる うのう うぶげ うぶごえ うまれる うめる うもう うやまう うよく うらがえす うらぐち うらない うりあげ うりきれ うるさい うれしい\nうれゆき うれる うろこ うわき うわさ うんこう うんちん うんてん うんどう えいえん えいが えいきょう えいご えいせい えいぶん えいよう えいわ えおり えがお えがく えきたい えくせる えしゃく えすて えつらん えのぐ\nえほうまき えほん えまき えもじ えもの えらい えらぶ えりあ えんえん えんかい えんぎ えんげき えんしゅう えんぜつ えんそく えんちょう えんとつ おいかける おいこす おいしい おいつく おうえん おうさま おうじ\nおうせつ おうたい おうふく おうべい おうよう おえる おおい おおう おおどおり おおや おおよそ おかえり おかず おがむ おかわり おぎなう おきる おくさま おくじょう おくりがな おくる おくれる おこす おこなう おこる\nおさえる おさない おさめる おしいれ おしえる おじぎ おじさん おしゃれ おそらく おそわる おたがい おたく おだやか おちつく おっと おつり おでかけ おとしもの おとなしい おどり おどろかす おばさん おまいり おめでとう\nおもいで おもう おもたい おもちゃ おやつ おやゆび およぼす おらんだ おろす おんがく おんけい おんしゃ おんせん おんだん おんちゅう おんどけい かあつ かいが がいき がいけん がいこう かいさつ かいしゃ かいすいよく\nかいぜん かいぞうど かいつう かいてん かいとう かいふく がいへき かいほう かいよう がいらい かいわ かえる かおり かかえる かがく かがし かがみ かくご かくとく かざる がぞう かたい かたち がちょう がっきゅう\nがっこう がっさん がっしょう かなざわし かのう がはく かぶか かほう かほご かまう かまぼこ かめれおん かゆい かようび からい かるい かろう かわく かわら がんか かんけい かんこう かんしゃ かんそう かんたん かんち\nがんばる きあい きあつ きいろ ぎいん きうい きうん きえる きおう きおく きおち きおん きかい きかく きかんしゃ ききて きくばり きくらげ きけんせい きこう きこえる きこく きさい きさく きさま きさらぎ ぎじかがく\nぎしき ぎじたいけん ぎじにってい ぎじゅつしゃ きすう きせい きせき きせつ きそう きぞく きぞん きたえる きちょう きつえん ぎっちり きつつき きつね きてい きどう きどく きない きなが きなこ きぬごし きねん きのう\nきのした きはく きびしい きひん きふく きぶん きぼう きほん きまる きみつ きむずかしい きめる きもだめし きもち きもの きゃく きやく ぎゅうにく きよう きょうりゅう きらい きらく きりん きれい きれつ きろく\nぎろん きわめる ぎんいろ きんかくじ きんじょ きんようび ぐあい くいず くうかん くうき くうぐん くうこう ぐうせい くうそう ぐうたら くうふく くうぼ くかん くきょう くげん ぐこう くさい くさき くさばな くさる\nくしゃみ くしょう くすのき くすりゆび くせげ くせん ぐたいてき くださる くたびれる くちこみ くちさき くつした ぐっすり くつろぐ くとうてん くどく くなん くねくね くのう くふう くみあわせ くみたてる くめる\nくやくしょ くらす くらべる くるま くれる くろう くわしい ぐんかん ぐんしょく ぐんたい ぐんて けあな けいかく けいけん けいこ けいさつ げいじゅつ けいたい げいのうじん けいれき けいろ けおとす けおりもの げきか\nげきげん げきだん げきちん げきとつ げきは げきやく げこう げこくじょう げざい けさき げざん けしき けしごむ けしょう げすと けたば けちゃっぷ けちらす けつあつ けつい けつえき けっこん けつじょ けっせき けってい\nけつまつ げつようび げつれい けつろん げどく けとばす けとる けなげ けなす けなみ けぬき げねつ けねん けはい げひん けぶかい げぼく けまり けみかる けむし けむり けもの けらい けろけろ けわしい けんい けんえつ\nけんお けんか げんき けんげん けんこう けんさく けんしゅう けんすう げんそう けんちく けんてい けんとう けんない けんにん げんぶつ けんま けんみん けんめい けんらん けんり こあくま こいぬ こいびと ごうい こうえん\nこうおん こうかん ごうきゅう ごうけい こうこう こうさい こうじ こうすい ごうせい こうそく こうたい こうちゃ こうつう こうてい こうどう こうない こうはい ごうほう ごうまん こうもく こうりつ こえる こおり ごかい\nごがつ ごかん こくご こくさい こくとう こくない こくはく こぐま こけい こける ここのか こころ こさめ こしつ こすう こせい こせき こぜん こそだて こたい こたえる こたつ こちょう こっか こつこつ こつばん こつぶ\nこてい こてん ことがら ことし ことば ことり こなごな こねこね このまま このみ このよ ごはん こひつじ こふう こふん こぼれる ごまあぶら こまかい ごますり こまつな こまる こむぎこ こもじ こもち こもの こもん\nこやく こやま こゆう こゆび こよい こよう こりる これくしょん ころっけ こわもて こわれる こんいん こんかい こんき こんしゅう こんすい こんだて こんとん こんなん こんびに こんぽん こんまけ こんや こんれい こんわく\nざいえき さいかい さいきん ざいげん ざいこ さいしょ さいせい ざいたく ざいちゅう さいてき ざいりょう さうな さかいし さがす さかな さかみち さがる さぎょう さくし さくひん さくら さこく さこつ さずかる ざせき\nさたん さつえい ざつおん ざっか ざつがく さっきょく ざっし さつじん ざっそう さつたば さつまいも さてい さといも さとう さとおや さとし さとる さのう さばく さびしい さべつ さほう さほど さます さみしい さみだれ\nさむけ さめる さやえんどう さゆう さよう さよく さらだ ざるそば さわやか さわる さんいん さんか さんきゃく さんこう さんさい ざんしょ さんすう さんせい さんそ さんち さんま さんみ さんらん しあい しあげ\nしあさって しあわせ しいく しいん しうち しえい しおけ しかい しかく じかん しごと しすう じだい したうけ したぎ したて したみ しちょう しちりん しっかり しつじ しつもん してい してき してつ じてん じどう\nしなぎれ しなもの しなん しねま しねん しのぐ しのぶ しはい しばかり しはつ しはらい しはん しひょう しふく じぶん しへい しほう しほん しまう しまる しみん しむける じむしょ しめい しめる しもん しゃいん\nしゃうん しゃおん じゃがいも しやくしょ しゃくほう しゃけん しゃこ しゃざい しゃしん しゃせん しゃそう しゃたい しゃちょう しゃっきん じゃま しゃりん しゃれい じゆう じゅうしょ しゅくはく じゅしん しゅっせき しゅみ\nしゅらば じゅんばん しょうかい しょくたく しょっけん しょどう しょもつ しらせる しらべる しんか しんこう じんじゃ しんせいじ しんちく しんりん すあげ すあし すあな ずあん すいえい すいか すいとう ずいぶん\nすいようび すうがく すうじつ すうせん すおどり すきま すくう すくない すける すごい すこし ずさん すずしい すすむ すすめる すっかり ずっしり ずっと すてき すてる すねる すのこ すはだ すばらしい ずひょう ずぶぬれ\nすぶり すふれ すべて すべる ずほう すぼん すまい すめし すもう すやき すらすら するめ すれちがう すろっと すわる すんぜん すんぽう せあぶら せいかつ せいげん せいじ せいよう せおう せかいかん せきにん せきむ\nせきゆ せきらんうん せけん せこう せすじ せたい せたけ せっかく せっきゃく ぜっく せっけん せっこつ せっさたくま せつぞく せつだん せつでん せっぱん せつび せつぶん せつめい せつりつ せなか せのび せはば せびろ\nせぼね せまい せまる せめる せもたれ せりふ ぜんあく せんい せんえい せんか せんきょ せんく せんげん ぜんご せんさい せんしゅ せんすい せんせい せんぞ せんたく せんちょう せんてい せんとう せんぬき せんねん\nせんぱい ぜんぶ ぜんぽう せんむ せんめんじょ せんもん せんやく せんゆう せんよう ぜんら ぜんりゃく せんれい せんろ そあく そいとげる そいね そうがんきょう そうき そうご そうしん そうだん そうなん そうび そうめん\nそうり そえもの そえん そがい そげき そこう そこそこ そざい そしな そせい そせん そそぐ そだてる そつう そつえん そっかん そつぎょう そっけつ そっこう そっせん そっと そとがわ そとづら そなえる そなた そふぼ\nそぼく そぼろ そまつ そまる そむく そむりえ そめる そもそも そよかぜ そらまめ そろう そんかい そんけい そんざい そんしつ そんぞく そんちょう ぞんび ぞんぶん そんみん たあい たいいん たいうん たいえき たいおう\nだいがく たいき たいぐう たいけん たいこ たいざい だいじょうぶ だいすき たいせつ たいそう だいたい たいちょう たいてい だいどころ たいない たいねつ たいのう たいはん だいひょう たいふう たいへん たいほ たいまつばな\nたいみんぐ たいむ たいめん たいやき たいよう たいら たいりょく たいる たいわん たうえ たえる たおす たおる たおれる たかい たかね たきび たくさん たこく たこやき たさい たしざん だじゃれ たすける たずさわる\nたそがれ たたかう たたく ただしい たたみ たちばな だっかい だっきゃく だっこ だっしゅつ だったい たてる たとえる たなばた たにん たぬき たのしみ たはつ たぶん たべる たぼう たまご たまる だむる ためいき ためす\nためる たもつ たやすい たよる たらす たりきほんがん たりょう たりる たると たれる たれんと たろっと たわむれる だんあつ たんい たんおん たんか たんき たんけん たんご たんさん たんじょうび だんせい たんそく\nたんたい だんち たんてい たんとう だんな たんにん だんねつ たんのう たんぴん だんぼう たんまつ たんめい だんれつ だんろ だんわ ちあい ちあん ちいき ちいさい ちえん ちかい ちから ちきゅう ちきん ちけいず ちけん\nちこく ちさい ちしき ちしりょう ちせい ちそう ちたい ちたん ちちおや ちつじょ ちてき ちてん ちぬき ちぬり ちのう ちひょう ちへいせん ちほう ちまた ちみつ ちみどろ ちめいど ちゃんこなべ ちゅうい ちゆりょく\nちょうし ちょさくけん ちらし ちらみ ちりがみ ちりょう ちるど ちわわ ちんたい ちんもく ついか ついたち つうか つうじょう つうはん つうわ つかう つかれる つくね つくる つけね つける つごう つたえる つづく つつじ\nつつむ つとめる つながる つなみ つねづね つのる つぶす つまらない つまる つみき つめたい つもり つもる つよい つるぼ つるみく つわもの つわり てあし てあて てあみ ていおん ていか ていき ていけい ていこく\nていさつ ていし ていせい ていたい ていど ていねい ていひょう ていへん ていぼう てうち ておくれ てきとう てくび でこぼこ てさぎょう てさげ てすり てそう てちがい てちょう てつがく てつづき でっぱ てつぼう てつや\nでぬかえ てぬき てぬぐい てのひら てはい てぶくろ てふだ てほどき てほん てまえ てまきずし てみじか てみやげ てらす てれび てわけ てわたし でんあつ てんいん てんかい てんき てんぐ てんけん てんごく てんさい\nてんし てんすう でんち てんてき てんとう てんない てんぷら てんぼうだい てんめつ てんらんかい でんりょく でんわ どあい といれ どうかん とうきゅう どうぐ とうし とうむぎ とおい とおか とおく とおす とおる とかい\nとかす ときおり ときどき とくい とくしゅう とくてん とくに とくべつ とけい とける とこや とさか としょかん とそう とたん とちゅう とっきゅう とっくん とつぜん とつにゅう とどける ととのえる とない となえる となり\nとのさま とばす どぶがわ とほう とまる とめる ともだち ともる どようび とらえる とんかつ どんぶり ないかく ないこう ないしょ ないす ないせん ないそう なおす ながい なくす なげる なこうど なさけ なたでここ\nなっとう なつやすみ ななおし なにごと なにもの なにわ なのか なふだ なまいき なまえ なまみ なみだ なめらか なめる なやむ ならう ならび ならぶ なれる なわとび なわばり にあう にいがた にうけ におい にかい にがて\nにきび にくしみ にくまん にげる にさんかたんそ にしき にせもの にちじょう にちようび にっか にっき にっけい にっこう にっさん にっしょく にっすう にっせき にってい になう にほん にまめ にもつ にやり にゅういん\nにりんしゃ にわとり にんい にんか にんき にんげん にんしき にんずう にんそう にんたい にんち にんてい にんにく にんぷ にんまり にんむ にんめい にんよう ぬいくぎ ぬかす ぬぐいとる ぬぐう ぬくもり ぬすむ ぬまえび\nぬめり ぬらす ぬんちゃく ねあげ ねいき ねいる ねいろ ねぐせ ねくたい ねくら ねこぜ ねこむ ねさげ ねすごす ねそべる ねだん ねつい ねっしん ねつぞう ねったいぎょ ねぶそく ねふだ ねぼう ねほりはほり ねまき ねまわし\nねみみ ねむい ねむたい ねもと ねらう ねわざ ねんいり ねんおし ねんかん ねんきん ねんぐ ねんざ ねんし ねんちゃく ねんど ねんぴ ねんぶつ ねんまつ ねんりょう ねんれい のいず のおづま のがす のきなみ のこぎり のこす\nのこる のせる のぞく のぞむ のたまう のちほど のっく のばす のはら のべる のぼる のみもの のやま のらいぬ のらねこ のりもの のりゆき のれん のんき ばあい はあく ばあさん ばいか ばいく はいけん はいご はいしん\nはいすい はいせん はいそう はいち ばいばい はいれつ はえる はおる はかい ばかり はかる はくしゅ はけん はこぶ はさみ はさん はしご ばしょ はしる はせる ぱそこん はそん はたん はちみつ はつおん はっかく はづき\nはっきり はっくつ はっけん はっこう はっさん はっしん はったつ はっちゅう はってん はっぴょう はっぽう はなす はなび はにかむ はぶらし はみがき はむかう はめつ はやい はやし はらう はろうぃん はわい はんい\nはんえい はんおん はんかく はんきょう ばんぐみ はんこ はんしゃ はんすう はんだん ぱんち ぱんつ はんてい はんとし はんのう はんぱ はんぶん はんぺん はんぼうき はんめい はんらん はんろん ひいき ひうん ひえる ひかく\nひかり ひかる ひかん ひくい ひけつ ひこうき ひこく ひさい ひさしぶり ひさん びじゅつかん ひしょ\n`.trim().split(/\\s+/);\n\n/** chinese_simplified.h. */\nexport const MONERO_CHINESE_SIMPLIFIED = `\n的 一 是 在 不 了 有 和 人 这 中 大 为 上 个 国 我 以 要 他 时 来 用 们 生 到 作 地 于 出 就 分 对 成 会 可 主 发 年 动 同 工 也 能 下 过 子 说 产 种 面 而 方 后 多 定 行 学 法\n所 民 得 经 十 三 之 进 着 等 部 度 家 电 力 里 如 水 化 高 自 二 理 起 小 物 现 实 加 量 都 两 体 制 机 当 使 点 从 业 本 去 把 性 好 应 开 它 合 还 因 由 其 些 然 前 外 天 政\n四 日 那 社 义 事 平 形 相 全 表 间 样 与 关 各 重 新 线 内 数 正 心 反 你 明 看 原 又 么 利 比 或 但 质 气 第 向 道 命 此 变 条 只 没 结 解 问 意 建 月 公 无 系 军 很 情 者 最\n立 代 想 已 通 并 提 直 题 党 程 展 五 果 料 象 员 革 位 入 常 文 总 次 品 式 活 设 及 管 特 件 长 求 老 头 基 资 边 流 路 级 少 图 山 统 接 知 较 将 组 见 计 别 她 手 角 期 根\n论 运 农 指 几 九 区 强 放 决 西 被 干 做 必 战 先 回 则 任 取 据 处 队 南 给 色 光 门 即 保 治 北 造 百 规 热 领 七 海 口 东 导 器 压 志 世 金 增 争 济 阶 油 思 术 极 交 受 联\n什 认 六 共 权 收 证 改 清 美 再 采 转 更 单 风 切 打 白 教 速 花 带 安 场 身 车 例 真 务 具 万 每 目 至 达 走 积 示 议 声 报 斗 完 类 八 离 华 名 确 才 科 张 信 马 节 话 米 整\n空 元 况 今 集 温 传 土 许 步 群 广 石 记 需 段 研 界 拉 林 律 叫 且 究 观 越 织 装 影 算 低 持 音 众 书 布 复 容 儿 须 际 商 非 验 连 断 深 难 近 矿 千 周 委 素 技 备 半 办 青\n省 列 习 响 约 支 般 史 感 劳 便 团 往 酸 历 市 克 何 除 消 构 府 称 太 准 精 值 号 率 族 维 划 选 标 写 存 候 毛 亲 快 效 斯 院 查 江 型 眼 王 按 格 养 易 置 派 层 片 始 却 专\n状 育 厂 京 识 适 属 圆 包 火 住 调 满 县 局 照 参 红 细 引 听 该 铁 价 严 首 底 液 官 德 随 病 苏 失 尔 死 讲 配 女 黄 推 显 谈 罪 神 艺 呢 席 含 企 望 密 批 营 项 防 举 球 英\n氧 势 告 李 台 落 木 帮 轮 破 亚 师 围 注 远 字 材 排 供 河 态 封 另 施 减 树 溶 怎 止 案 言 士 均 武 固 叶 鱼 波 视 仅 费 紧 爱 左 章 早 朝 害 续 轻 服 试 食 充 兵 源 判 护 司\n足 某 练 差 致 板 田 降 黑 犯 负 击 范 继 兴 似 余 坚 曲 输 修 故 城 夫 够 送 笔 船 占 右 财 吃 富 春 职 觉 汉 画 功 巴 跟 虽 杂 飞 检 吸 助 升 阳 互 初 创 抗 考 投 坏 策 古 径\n换 未 跑 留 钢 曾 端 责 站 简 述 钱 副 尽 帝 射 草 冲 承 独 令 限 阿 宣 环 双 请 超 微 让 控 州 良 轴 找 否 纪 益 依 优 顶 础 载 倒 房 突 坐 粉 敌 略 客 袁 冷 胜 绝 析 块 剂 测\n丝 协 诉 念 陈 仍 罗 盐 友 洋 错 苦 夜 刑 移 频 逐 靠 混 母 短 皮 终 聚 汽 村 云 哪 既 距 卫 停 烈 央 察 烧 迅 境 若 印 洲 刻 括 激 孔 搞 甚 室 待 核 校 散 侵 吧 甲 游 久 菜 味\n旧 模 湖 货 损 预 阻 毫 普 稳 乙 妈 植 息 扩 银 语 挥 酒 守 拿 序 纸 医 缺 雨 吗 针 刘 啊 急 唱 误 训 愿 审 附 获 茶 鲜 粮 斤 孩 脱 硫 肥 善 龙 演 父 渐 血 欢 械 掌 歌 沙 刚 攻\n谓 盾 讨 晚 粒 乱 燃 矛 乎 杀 药 宁 鲁 贵 钟 煤 读 班 伯 香 介 迫 句 丰 培 握 兰 担 弦 蛋 沉 假 穿 执 答 乐 谁 顺 烟 缩 征 脸 喜 松 脚 困 异 免 背 星 福 买 染 井 概 慢 怕 磁 倍\n祖 皇 促 静 补 评 翻 肉 践 尼 衣 宽 扬 棉 希 伤 操 垂 秋 宜 氢 套 督 振 架 亮 末 宪 庆 编 牛 触 映 雷 销 诗 座 居 抓 裂 胞 呼 娘 景 威 绿 晶 厚 盟 衡 鸡 孙 延 危 胶 屋 乡 临 陆\n顾 掉 呀 灯 岁 措 束 耐 剧 玉 赵 跳 哥 季 课 凯 胡 额 款 绍 卷 齐 伟 蒸 殖 永 宗 苗 川 炉 岩 弱 零 杨 奏 沿 露 杆 探 滑 镇 饭 浓 航 怀 赶 库 夺 伊 灵 税 途 灭 赛 归 召 鼓 播 盘\n裁 险 康 唯 录 菌 纯 借 糖 盖 横 符 私 努 堂 域 枪 润 幅 哈 竟 熟 虫 泽 脑 壤 碳 欧 遍 侧 寨 敢 彻 虑 斜 薄 庭 纳 弹 饲 伸 折 麦 湿 暗 荷 瓦 塞 床 筑 恶 户 访 塔 奇 透 梁 刀 旋\n迹 卡 氯 遇 份 毒 泥 退 洗 摆 灰 彩 卖 耗 夏 择 忙 铜 献 硬 予 繁 圈 雪 函 亦 抽 篇 阵 阴 丁 尺 追 堆 雄 迎 泛 爸 楼 避 谋 吨 野 猪 旗 累 偏 典 馆 索 秦 脂 潮 爷 豆 忽 托 惊 塑\n遗 愈 朱 替 纤 粗 倾 尚 痛 楚 谢 奋 购 磨 君 池 旁 碎 骨 监 捕 弟 暴 割 贯 殊 释 词 亡 壁 顿 宝 午 尘 闻 揭 炮 残 冬 桥 妇 警 综 招 吴 付 浮 遭 徐 您 摇 谷 赞 箱 隔 订 男 吹 园\n纷 唐 败 宋 玻 巨 耕 坦 荣 闭 湾 键 凡 驻 锅 救 恩 剥 凝 碱 齿 截 炼 麻 纺 禁 废 盛 版 缓 净 睛 昌 婚 涉 筒 嘴 插 岸 朗 庄 街 藏 姑 贸 腐 奴 啦 惯 乘 伙 恢 匀 纱 扎 辩 耳 彪 臣\n亿 璃 抵 脉 秀 萨 俄 网 舞 店 喷 纵 寸 汗 挂 洪 贺 闪 柬 爆 烯 津 稻 墙 软 勇 像 滚 厘 蒙 芳 肯 坡 柱 荡 腿 仪 旅 尾 轧 冰 贡 登 黎 削 钻 勒 逃 障 氨 郭 峰 币 港 伏 轨 亩 毕 擦\n莫 刺 浪 秘 援 株 健 售 股 岛 甘 泡 睡 童 铸 汤 阀 休 汇 舍 牧 绕 炸 哲 磷 绩 朋 淡 尖 启 陷 柴 呈 徒 颜 泪 稍 忘 泵 蓝 拖 洞 授 镜 辛 壮 锋 贫 虚 弯 摩 泰 幼 廷 尊 窗 纲 弄 隶\n疑 氏 宫 姐 震 瑞 怪 尤 琴 循 描 膜 违 夹 腰 缘 珠 穷 森 枝 竹 沟 催 绳 忆 邦 剩 幸 浆 栏 拥 牙 贮 礼 滤 钠 纹 罢 拍 咱 喊 袖 埃 勤 罚 焦 潜 伍 墨 欲 缝 姓 刊 饱 仿 奖 铝 鬼 丽\n跨 默 挖 链 扫 喝 袋 炭 污 幕 诸 弧 励 梅 奶 洁 灾 舟 鉴 苯 讼 抱 毁 懂 寒 智 埔 寄 届 跃 渡 挑 丹 艰 贝 碰 拔 爹 戴 码 梦 芽 熔 赤 渔 哭 敬 颗 奔 铅 仲 虎 稀 妹 乏 珍 申 桌 遵\n允 隆 螺 仓 魏 锐 晓 氮 兼 隐 碍 赫 拨 忠 肃 缸 牵 抢 博 巧 壳 兄 杜 讯 诚 碧 祥 柯 页 巡 矩 悲 灌 龄 伦 票 寻 桂 铺 圣 恐 恰 郑 趣 抬 荒 腾 贴 柔 滴 猛 阔 辆 妻 填 撤 储 签 闹\n扰 紫 砂 递 戏 吊 陶 伐 喂 疗 瓶 婆 抚 臂 摸 忍 虾 蜡 邻 胸 巩 挤 偶 弃 槽 劲 乳 邓 吉 仁 烂 砖 租 乌 舰 伴 瓜 浅 丙 暂 燥 橡 柳 迷 暖 牌 秧 胆 详 簧 踏 瓷 谱 呆 宾 糊 洛 辉 愤\n竞 隙 怒 粘 乃 绪 肩 籍 敏 涂 熙 皆 侦 悬 掘 享 纠 醒 狂 锁 淀 恨 牲 霸 爬 赏 逆 玩 陵 祝 秒 浙 貌\n`.trim().split(/\\s+/);\n","/**\n * Monero's English seed words (src/mnemonics/english.h in monero-project/monero), in their order: a word's place is its\n * value. The classic 25-word seed of Monero GUI and monero-wallet-cli, and MyMonero's 13, are made of these.\n *\n * Copyright (c) 2014-2024, The Monero Project, under the BSD 3-Clause licence that file carries: redistributions keep\n * this notice, and the project's name may not endorse this app.\n */\nexport const MONERO_WORDS = `\nabbey abducts ability ablaze abnormal abort abrasive absorb abyss academy aces aching acidic acoustic acquire across\nactress acumen adapt addicted adept adhesive adjust adopt adrenalin adult adventure aerial afar affair afield afloat\nafoot afraid after against agenda aggravate agile aglow agnostic agony agreed ahead aided ailments aimless airport\naisle ajar akin alarms album alchemy alerts algebra alkaline alley almost aloof alpine already also altitude alumni\nalways amaze ambush amended amidst ammo amnesty among amply amused anchor android anecdote angled ankle annoyed\nanswers antics anvil anxiety anybody apart apex aphid aplomb apology apply apricot aptitude aquarium arbitrary\narcher ardent arena argue arises army around arrow arsenic artistic ascend ashtray aside asked asleep aspire\nassorted asylum athlete atlas atom atrium attire auburn auctions audio august aunt austere autumn avatar avidly\navoid awakened awesome awful awkward awning awoken axes axis axle aztec azure baby bacon badge baffles bagpipe\nbailed bakery balding bamboo banjo baptism basin batch bawled bays because beer befit begun behind being below\nbemused benches berries bested betting bevel beware beyond bias bicycle bids bifocals biggest bikini bimonthly\nbinocular biology biplane birth biscuit bite biweekly blender blip bluntly boat bobsled bodies bogeys boil boldly\nbomb border boss both bounced bovine bowling boxes boyfriend broken brunt bubble buckets budget buffet bugs building\nbulb bumper bunch business butter buying buzzer bygones byline bypass cabin cactus cadets cafe cage cajun cake\ncalamity camp candy casket catch cause cavernous cease cedar ceiling cell cement cent certain chlorine chrome cider\ncigar cinema circle cistern citadel civilian claim click clue coal cobra cocoa code coexist coffee cogs cohesive\ncoils colony comb cool copy corrode costume cottage cousin cowl criminal cube cucumber cuddled cuffs cuisine cunning\ncupcake custom cycling cylinder cynical dabbing dads daft dagger daily damp dangerous dapper darted dash dating\ndauntless dawn daytime dazed debut decay dedicated deepest deftly degrees dehydrate deity dejected delayed\ndemonstrate dented deodorant depth desk devoid dewdrop dexterity dialect dice diet different digit dilute dime\ndinner diode diplomat directed distance ditch divers dizzy doctor dodge does dogs doing dolphin domestic donuts\ndoorway dormant dosage dotted double dove down dozen dreams drinks drowning drunk drying dual dubbed duckling dude\nduets duke dullness dummy dunes duplex duration dusted duties dwarf dwelt dwindling dying dynamite dyslexic each\neagle earth easy eating eavesdrop eccentric echo eclipse economics ecstatic eden edgy edited educated eels efficient\neggs egotistic eight either eject elapse elbow eldest eleven elite elope else eluded emails ember emerge emit\nemotion empty emulate energy enforce enhanced enigma enjoy enlist enmity enough enraged ensign entrance envy epoxy\nequip erase erected erosion error eskimos espionage essential estate etched eternal ethics etiquette evaluate\nevenings evicted evolved examine excess exhale exit exotic exquisite extra exult fabrics factual fading fainted\nfaked fall family fancy farming fatal faulty fawns faxed fazed feast february federal feel feline females fences\nferry festival fetches fever fewest fiat fibula fictional fidget fierce fifteen fight films firm fishing fitting\nfive fixate fizzle fleet flippant flying foamy focus foes foggy foiled folding fonts foolish fossil fountain fowls\nfoxes foyer framed friendly frown fruit frying fudge fuel fugitive fully fuming fungal furnished fuselage future\nfuzzy gables gadget gags gained galaxy gambit gang gasp gather gauze gave gawk gaze gearbox gecko geek gels gemstone\ngeneral geometry germs gesture getting geyser ghetto ghost giant giddy gifts gigantic gills gimmick ginger girth\ngiving glass gleeful glide gnaw gnome goat goblet godfather goes goggles going goldfish gone goodbye gopher gorilla\ngossip gotten gourmet governing gown greater grunt guarded guest guide gulp gumball guru gusts gutter guys gymnast\ngypsy gyrate habitat hacksaw haggled hairy hamburger happens hashing hatchet haunted having hawk haystack hazard\nhectare hedgehog heels hefty height hemlock hence heron hesitate hexagon hickory hiding highway hijack hiker hills\nhimself hinder hippo hire history hitched hive hoax hobby hockey hoisting hold honked hookup hope hornet hospital\nhotel hounded hover howls hubcaps huddle huge hull humid hunter hurried husband huts hybrid hydrogen hyper iceberg\nicing icon identity idiom idled idols igloo ignore iguana illness imagine imbalance imitate impel inactive inbound\nincur industrial inexact inflamed ingested initiate injury inkling inline inmate innocent inorganic input inquest\ninroads insult intended inundate invoke inwardly ionic irate iris irony irritate island isolated issued italics\nitches items itinerary itself ivory jabbed jackets jaded jagged jailed jamming january jargon jaunt javelin jaws\njazz jeans jeers jellyfish jeopardy jerseys jester jetting jewels jigsaw jingle jittery jive jobs jockey jogger\njoining joking jolted jostle journal joyous jubilee judge juggled juicy jukebox july jump junk jury justice juvenile\nkangaroo karate keep kennel kept kernels kettle keyboard kickoff kidneys king kiosk kisses kitchens kiwi knapsack\nknee knife knowledge knuckle koala laboratory ladder lagoon lair lakes lamb language laptop large last later\nlaunching lava lawsuit layout lazy lectures ledge leech left legion leisure lemon lending leopard lesson lettuce\nlexicon liar library licks lids lied lifestyle light likewise lilac limits linen lion lipstick liquid listen lively\nloaded lobster locker lodge lofty logic loincloth long looking lopped lordship losing lottery loudly love lower\nloyal lucky luggage lukewarm lullaby lumber lunar lurk lush luxury lymph lynx lyrics macro madness magically mailed\nmajor makeup malady mammal maps masterful match maul maverick maximum mayor maze meant mechanic medicate meeting\nmegabyte melting memoir menu merger mesh metro mews mice midst mighty mime mirror misery mittens mixture moat mobile\nmocked mohawk moisture molten moment money moon mops morsel mostly motherly mouth movement mowing much muddy muffin\nmugged mullet mumble mundane muppet mural musical muzzle myriad mystery myth nabbing nagged nail names nanny napkin\nnarrate nasty natural nautical navy nearby necklace needed negative neither neon nephew nerves nestle network\nneutral never newt nexus nibs niche niece nifty nightly nimbly nineteen nirvana nitrogen nobody nocturnal nodes\nnoises nomad noodles northern nostril noted nouns novelty nowhere nozzle nuance nucleus nudged nugget nuisance null\nnumber nuns nurse nutshell nylon oaks oars oasis oatmeal obedient object obliged obnoxious observant obtains obvious\noccur ocean october odds odometer offend often oilfield ointment okay older olive olympics omega omission omnibus\nonboard oncoming oneself ongoing onion online onslaught onto onward oozed opacity opened opposite optical opus\norange orbit orchid orders organs origin ornament orphans oscar ostrich otherwise otter ouch ought ounce ourselves\noust outbreak oval oven owed owls owner oxidant oxygen oyster ozone pact paddles pager pairing palace pamphlet\npancakes paper paradise pastry patio pause pavements pawnshop payment peaches pebbles peculiar pedantic peeled pegs\npelican pencil people pepper perfect pests petals phase pheasants phone phrases physics piano picked pierce pigment\npiloted pimple pinched pioneer pipeline pirate pistons pitched pivot pixels pizza playful pledge pliers plotting\nplus plywood poaching pockets podcast poetry point poker polar ponies pool popular portents possible potato pouch\npoverty powder pram present pride problems pruned prying psychic public puck puddle puffin pulp pumpkins punch puppy\npurged push putty puzzled pylons pyramid python queen quick quote rabbits racetrack radar rafts rage railway raking\nrally ramped randomly rapid rarest rash rated ravine rays razor react rebel recipe reduce reef refer regular reheat\nreinvest rejoices rekindle relic remedy renting reorder repent request reruns rest return reunion revamp rewind\nrhino rhythm ribbon richly ridges rift rigid rims ringing riots ripped rising ritual river roared robot rockets\nrodent rogue roles romance roomy roped roster rotate rounded rover rowboat royal ruby rudely ruffled rugged ruined\nruling rumble runway rural rustled ruthless sabotage sack sadness safety saga sailor sake salads sample sanity\nsapling sarcasm sash satin saucepan saved sawmill saxophone sayings scamper scenic school science scoop scrub scuba\nseasons second sedan seeded segments seismic selfish semifinal sensible september sequence serving session setup\nseventh sewage shackles shelter shipped shocking shrugged shuffled shyness siblings sickness sidekick sieve sifting\nsighting silk simplest sincerely sipped siren situated sixteen sizes skater skew skirting skulls skydive slackens\nsleepless slid slower slug smash smelting smidgen smog smuggled snake sneeze sniff snout snug soapy sober soccer\nsoda software soggy soil solved somewhere sonic soothe soprano sorry southern sovereign sowed soya space speedy\nsphere spiders splendid spout sprig spud spying square stacking stellar stick stockpile strained stunning stylishly\nsubtly succeed suddenly suede suffice sugar suitcase sulking summon sunken superior surfer sushi suture swagger\nswept swiftly sword swung syllabus symptoms syndrome syringe system taboo tacit tadpoles tagged tail taken talent\ntamper tanks tapestry tarnished tasked tattoo taunts tavern tawny taxi teardrop technical tedious teeming tell\ntemplate tender tepid tequila terminal testing tether textbook thaw theatrics thirsty thorn threaten thumbs thwart\nticket tidy tiers tiger tilt timber tinted tipsy tirade tissue titans toaster tobacco today toenail toffee together\ntoilet token tolerant tomorrow tonic toolbox topic torch tossed total touchy towel toxic toyed trash trendy tribal\ntrolling truth trying tsunami tubes tucks tudor tuesday tufts tugs tuition tulips tumbling tunnel turnip tusks tutor\ntuxedo twang tweezers twice twofold tycoon typist tyrant ugly ulcers ultimate umbrella umpire unafraid unbending\nuncle under uneven unfit ungainly unhappy union unjustly unknown unlikely unmask unnoticed unopened unplugs unquoted\nunrest unsafe until unusual unveil unwind unzip upbeat upcoming update upgrade uphill upkeep upload upon upper\nupright upstairs uptight upwards urban urchins urgent usage useful usher using usual utensils utility utmost utopia\nuttered vacation vague vain value vampire vane vapidly vary vastness vats vaults vector veered vegan vehicle vein\nvelvet venomous verification vessel veteran vexed vials vibrate victim video viewpoint vigilant viking village\nvinegar violin vipers virtual visited vitals vivid vixen vocal vogue voice volcano vortex voted voucher vowels\nvoyage vulture wade waffle wagtail waist waking wallets wanted warped washing water waveform waxing wayside weavers\nwebsite wedge weekday weird welders went wept were western wetsuit whale when whipped whole wickets width wield wife\nwiggle wildly winter wipeout wiring wise withdrawn wives wizard wobbly woes woken wolf womanly wonders woozy worry\nwounded woven wrap wrist wrong yacht yahoo yanks yard yawning yearbook yellow yesterday yeti yields yodel yoga\nyounger yoyo zapped zeal zebra zero zesty zigzags zinger zippers zodiac zombie zones zoom\n`.trim().split(/\\s+/);\n","import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { createBase58check } from \"@scure/base\";\nimport { wordlist } from \"@scure/bip39/wordlists/english.js\";\nimport { MONERO_WORDS } from \"./monero-words\";\n\n/**\n * What the composer asks about before a message goes: text that looks like a secret someone could take funds or an\n * identity with, or a Cashu token (bearer money: the text box would hand it to whoever reads the chat).\n *\n * Detection is local and synchronous, and a finding never carries the text it found: only what kind it is and, for\n * ecash, the amount decoded here. Ark, Spark and Fedimint wallets are BIP39 seeds or raw keys, caught by the rules\n * below; Fedimint ecash notes are plain base64 with no prefix, so they are not recognised.\n */\nexport type SecretFinding =\n | { kind: \"mnemonic\" | \"nsec\" | \"bitcoin-key\" | \"hex-key\" }\n | { kind: \"cashu\"; amount: number | null; unit: string };\n\nexport type SecretKind = SecretFinding[\"kind\"];\n\ninterface SeedWords {\n /** Each word's place in the list, as `words` spells it. */\n index: () => Map<string, number>;\n /** The words of a text, spelled as `index` keys them. */\n words: (text: string) => string[] | null;\n /** Seed lengths whose checksum is tried on any run of these words. */\n lengths: number[];\n /** A message that is nothing but this many of these words counts, checksum or not. */\n wholeMessage: number[];\n checksumHolds: (indices: number[]) => boolean;\n}\n\nconst englishWords = (text: string) => text.toLowerCase().match(/[a-z]+/g);\n\n/**\n * A word of another language's list as it is matched: decomposed, in lower case and without its marks, so \"ábaco\",\n * \"ABACO\" and \"abaco\" are one word, and a Japanese word is one with or without its voicing marks. No two words of a\n * list are the same once read this way.\n */\nconst fold = (text: string) => text.normalize(\"NFKD\").toLowerCase().replace(/\\p{M}/gu, \"\");\nconst foldedWords = (text: string) => fold(text).match(/\\p{L}+/gu);\n\n/** Built the first time a message is read: most messages never get past English. */\nfunction lazyIndex(list: readonly string[], spell: (word: string) => string): () => Map<string, number> {\n let index: Map<string, number> | undefined;\n return () => (index ??= new Map(list.map((word, i) => [spell(word), i])));\n}\n\nconst MNEMONIC_LENGTHS = [12, 15, 18, 21, 24];\nconst BIP39: SeedWords = {\n index: lazyIndex(wordlist, (word) => word),\n words: englishWords,\n lengths: MNEMONIC_LENGTHS,\n /**\n * BIP39's lengths, and a Polyseed's 16 (Monero's seed in Feather and Cake Wallet, BIP39's English words with a\n * checksum of its own, which BIP39's caught only by chance, about 3 in 10).\n */\n wholeMessage: [...MNEMONIC_LENGTHS, 16],\n checksumHolds: bip39ChecksumHolds,\n};\n/** Monero's classic seed (Monero GUI, monero-wallet-cli): 25 words of its own list, or MyMonero's 13. */\nconst MONERO: SeedWords = {\n index: lazyIndex(MONERO_WORDS, (word) => word),\n words: englishWords,\n lengths: [25, 13],\n wholeMessage: [25, 13],\n checksumHolds: moneroChecksum(MONERO_WORDS, 3),\n};\nlet seeds = [BIP39, MONERO];\n\n/**\n * BIP39's own lists in the app's other languages, which a wallet set to one of them shows its seed in: the same\n * lengths and checksum as the English list. Monero's lists in them too, each with the prefix length its checksum\n * reads. Handed in by `seedLists.ts`, which the composer loads as it opens (83 KB gzipped, kept out of the app's\n * first download) and the CLI with the guard.\n */\nexport function addSeedLists(lists: readonly (readonly string[])[], moneroLists: readonly [list: readonly string[], prefix: number][] = []): void {\n seeds = [BIP39, MONERO, ...lists.map((list): SeedWords => ({\n index: lazyIndex(list, fold),\n words: foldedWords,\n lengths: MNEMONIC_LENGTHS,\n wholeMessage: MNEMONIC_LENGTHS,\n checksumHolds: bip39ChecksumHolds,\n })), ...moneroLists.map(([list, prefix]): SeedWords => ({\n index: lazyIndex(list, fold),\n words: foldedWords,\n lengths: MONERO.lengths,\n wholeMessage: MONERO.wholeMessage,\n checksumHolds: moneroChecksum(list, prefix),\n }))];\n}\n/** Checksums tried per message and word list at most: a 16 KiB run of seed words stays a few milliseconds. */\nconst CHECKSUM_BUDGET = 4096;\n\nconst NSEC = /\\bnsec1[02-9ac-hj-np-z]{58}(?![02-9ac-hj-np-z])/i;\nconst EXTENDED_PRIVATE = /\\b[xtyzuvYZUV]prv[1-9A-HJ-NP-Za-km-z]{100,}/;\nconst WIF = /\\b[59KLc][1-9A-HJ-NP-Za-km-z]{50,51}\\b/g;\nconst HEX_SECRET = /\\b(?:0x)?(?:[0-9a-fA-F]{128}|[0-9a-fA-F]{64})\\b/g;\n/**\n * Monero's keys count too: \"Private spend key\" and \"Spend key (private)\" (Cake Wallet, MyMonero). A bare \"spend key\" or\n * \"view key\" does not, as a wallet's public keys are written that way too.\n */\nconst SECRET_CONTEXT = /priv(?:ate)?[\\s_-]*(?:(?:spend|view)[\\s_-]*)?key|(?:spend|view)[\\s_-]*key[\\s_-]*\\(\\s*private|secret|seed|mnemonic|nsec|xprv|\\bwif\\b|recovery|passphrase/i;\n/** How far from a 64-hex string a word like \"seed\" still counts as saying what it is. */\nconst CONTEXT_REACH = 48;\nconst CASHU_TOKEN = /\\bcashu([AB])([A-Za-z0-9_\\-+/]{20,}={0,2})/g;\n\n/**\n * Characters that take no room on screen: format characters (zero-width space, soft hyphen, word joiner, the joiners,\n * direction marks), control characters that are not white space, variation selectors, the grapheme joiner and the\n * Hangul fillers. A page, a PDF or a terminal puts some of them into long strings as places to break a line.\n */\nconst INVISIBLE = /(?![\\t\\n\\v\\f\\r\\x85])[\\p{Cc}\\p{Cf}]|\\u034f|[\\u115f\\u1160\\u3164\\uffa0]|[\\ufe00-\\ufe0f]|[\\u{e0100}-\\u{e01ef}]/gu;\n\nconst base58check = createBase58check(sha256);\n\n/**\n * The first secret in `text`, keys and seeds before ecash; null for anything else. The text is read as it is and as\n * it reads without its invisible characters: a key with one inside is whole again once the reader takes it out.\n */\nexport function findSecret(text: string): SecretFinding | null {\n const visible = text.replace(INVISIBLE, \"\");\n const readings = visible === text ? [text] : [text, visible];\n if (readings.some((reading) => {\n // A text's words are read once per way of reading them, not once per list: the other languages' 13 lists share one.\n const words = new Map<SeedWords[\"words\"], string[] | null>();\n return seeds.some((seed) => {\n if (!words.has(seed.words)) words.set(seed.words, seed.words(reading));\n return hasMnemonic(words.get(seed.words)!, seed);\n });\n })) return { kind: \"mnemonic\" };\n if (readings.some((reading) => NSEC.test(reading))) return { kind: \"nsec\" };\n if (readings.some((reading) => EXTENDED_PRIVATE.test(reading) || hasWif(reading))) return { kind: \"bitcoin-key\" };\n if (readings.some(hasHexSecret)) return { kind: \"hex-key\" };\n const tokens = readings.map(findCashu);\n return tokens.find((found) => found?.kind === \"cashu\" && found.amount !== null) ?? tokens.find((found) => found) ?? null;\n}\n\n/**\n * 12 to 24 words in a row from the English BIP39 list whose checksum holds, anywhere in the text; or a message that\n * is nothing but 12, 15, 16, 18, 21 or 24 of those words (a seed with one word mistyped is still most of a seed). The\n * same for Monero's English list, 25 or 13 words, and for BIP39's and Monero's lists in the app's other languages.\n * Prose breaks a run at once: \"the\", \"a\", \"is\", \"to\", \"and\", \"of\" and \"I\" are on neither English list, nor \"de\",\n * \"la\", \"a\", \"e\" on the others.\n *\n * One word said over and over is not a seed, though one in 16 such runs passes a 12-word checksum (\"word\" does), and\n * every one passes Monero's: a window of a single word never counts, and a window mostly of one word (\"abandon …\n * about\") counts only when that word does not go on past it on either side.\n */\nfunction hasMnemonic(tokens: string[] | null, seed: SeedWords): boolean {\n const shortest = Math.min(...seed.lengths);\n if (!tokens || tokens.length < shortest) return false;\n const index = seed.index();\n let budget = CHECKSUM_BUDGET;\n let run: number[] = [];\n const seedLike = (start: number, length: number) => {\n const window = run.slice(start, start + length);\n const counts = new Map<number, number>();\n for (const word of window) counts.set(word, (counts.get(word) ?? 0) + 1);\n if (counts.size === 1) return false;\n const [most, times] = [...counts].reduce((a, b) => (b[1] > a[1] ? b : a));\n if (times > length / 2 && (run[start - 1] === most || run[start + length] === most)) return false;\n return seed.checksumHolds(window);\n };\n const check = () => {\n if (run.length >= shortest) {\n for (const length of seed.lengths) {\n for (let start = 0; start + length <= run.length && budget > 0; start++, budget--) {\n if (seedLike(start, length)) return true;\n }\n }\n if (run.length === tokens.length && seed.wholeMessage.includes(run.length) && new Set(run).size > 1) return true;\n }\n run = [];\n return false;\n };\n for (const token of tokens) {\n const at = index.get(token);\n if (at !== undefined) run.push(at);\n else if (check()) return true;\n }\n return check();\n}\n\n/** BIP39: the words' 11-bit indices are the entropy followed by the first bits of its SHA-256. */\nfunction bip39ChecksumHolds(indices: number[]): boolean {\n const bits = indices.length * 11, checksumBits = bits / 33, entropyBytes = (bits - checksumBits) / 8;\n const bytes = new Uint8Array(Math.ceil(bits / 8));\n indices.forEach((index, i) => {\n for (let b = 0; b < 11; b++) if (index & (1 << (10 - b))) { const at = i * 11 + b; bytes[at >> 3] |= 0x80 >> (at & 7); }\n });\n const expected = sha256(bytes.subarray(0, entropyBytes))[0] >> (8 - checksumBits);\n const got = bytes[entropyBytes] >> (8 - checksumBits);\n return expected === got;\n}\n\n/**\n * Monero (src/mnemonics/electrum-words.cpp): the last word repeats the one at CRC-32 of the other words' first\n * `prefix` letters as the list spells them (English 3, Japanese 3, Chinese 1, the others 4), run together in UTF-8,\n * modulo how many they are.\n */\nfunction moneroChecksum(list: readonly string[], prefix: number): (indices: number[]) => boolean {\n let prefixes: string[] | undefined;\n return (indices) => {\n prefixes ??= list.map((word) => Array.from(word).slice(0, prefix).join(\"\"));\n const words = indices.slice(0, -1);\n return words[crc32(words.map((index) => prefixes![index]).join(\"\")) % words.length] === indices[indices.length - 1];\n };\n}\n\nconst CRC32_TABLE = Uint32Array.from({ length: 256 }, (_, n) => {\n let c = n;\n for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;\n return c;\n});\n\nconst utf8 = new TextEncoder();\n\n/** CRC-32 (the zlib one) of text in UTF-8. */\nfunction crc32(text: string): number {\n let crc = 0xffffffff;\n for (const byte of utf8.encode(text)) crc = CRC32_TABLE[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n return (crc ^ 0xffffffff) >>> 0;\n}\n\n/** A WIF private key: base58check with version 0x80 (mainnet) or 0xef (testnet), 32 bytes and an optional 0x01. */\nfunction hasWif(text: string): boolean {\n for (const [candidate] of text.matchAll(WIF)) {\n try {\n const payload = base58check.decode(candidate);\n if ((payload[0] === 0x80 || payload[0] === 0xef) && (payload.length === 33 || (payload.length === 34 && payload[33] === 1))) return true;\n } catch { /* not base58check: an ordinary word */ }\n }\n return false;\n}\n\n/** 64 or 128 hex digits with \"private key\", \"secret\", \"seed\" or the like close by. A bare hash is not asked about. */\nfunction hasHexSecret(text: string): boolean {\n for (const match of text.matchAll(HEX_SECRET)) {\n const before = text.slice(Math.max(0, match.index - CONTEXT_REACH), match.index);\n const after = text.slice(match.index + match[0].length, match.index + match[0].length + CONTEXT_REACH);\n if (SECRET_CONTEXT.test(before) || SECRET_CONTEXT.test(after)) return true;\n }\n return false;\n}\n\n/** Every Cashu token in the text, with their amounts added up when all of them decode and share one unit. */\nfunction findCashu(text: string): SecretFinding | null {\n const tokens = [...text.matchAll(CASHU_TOKEN)].map(([, version, body]) => decodeCashu(version as \"A\" | \"B\", body));\n if (!tokens.length) return null;\n const unit = tokens.find((token) => token)?.unit ?? \"sat\";\n const readable = tokens.every((token) => token && token.unit === unit);\n return { kind: \"cashu\", amount: readable ? tokens.reduce((sum, token) => sum + token!.amount, 0) : null, unit };\n}\n\n/** What a Cashu token is worth, read from the token itself (NUT-00): nothing is asked of the mint. */\nexport function decodeCashu(version: \"A\" | \"B\", body: string): { amount: number; unit: string } | null {\n try {\n const bytes = fromBase64(body);\n if (version === \"A\") {\n const token = JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes)) as { token?: { proofs?: { amount?: unknown }[] }[]; unit?: unknown };\n return total(token.token?.flatMap((entry) => entry.proofs ?? []).map((proof) => proof.amount), token.unit);\n }\n const token = decodeCbor(bytes) as { t?: { p?: { a?: unknown }[] }[]; u?: unknown } | null;\n return total(token?.t?.flatMap((entry) => entry.p ?? []).map((proof) => proof.a), token?.u);\n } catch {\n return null;\n }\n}\n\nfunction total(amounts: unknown[] | undefined, unit: unknown): { amount: number; unit: string } | null {\n if (!amounts?.length || !amounts.every((a): a is number => Number.isSafeInteger(a) && (a as number) >= 0)) return null;\n const amount = amounts.reduce((sum, a) => sum + a, 0);\n return Number.isSafeInteger(amount) ? { amount, unit: typeof unit === \"string\" && unit ? unit : \"sat\" } : null;\n}\n\nfunction fromBase64(text: string): Uint8Array {\n const standard = text.replace(/-/g, \"+\").replace(/_/g, \"/\").replace(/=+$/, \"\");\n const binary = atob(standard + \"=\".repeat((4 - (standard.length % 4)) % 4));\n return Uint8Array.from(binary, (c) => c.charCodeAt(0));\n}\n\n/** Enough CBOR (RFC 8949) for a cashuB token: definite lengths, integers, bytes, text, arrays, maps, tags, simple values. */\nfunction decodeCbor(bytes: Uint8Array): unknown {\n let at = 0, depth = 0;\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const length = (info: number): number => {\n if (info < 24) return info;\n const size = info === 24 ? 1 : info === 25 ? 2 : info === 26 ? 4 : info === 27 ? 8 : 0;\n if (!size || at + size > bytes.length) throw new Error(\"cbor\");\n let value = 0;\n for (let i = 0; i < size; i++) value = value * 256 + bytes[at + i];\n at += size;\n return value;\n };\n const item = (): unknown => {\n if (at >= bytes.length || ++depth > 32) throw new Error(\"cbor\");\n const head = bytes[at++], major = head >> 5, info = head & 31;\n try {\n if (major === 7) {\n if (info === 20) return false;\n if (info === 21) return true;\n if (info === 22 || info === 23) return null;\n if (info === 25) { at += 2; return NaN; } // a half float: never in a token\n if (info === 26) { at += 4; return view.getFloat32(at - 4); }\n if (info === 27) { at += 8; return view.getFloat64(at - 8); }\n throw new Error(\"cbor\");\n }\n const n = length(info);\n switch (major) {\n case 0: return n;\n case 1: return -1 - n;\n case 2: case 3: {\n if (at + n > bytes.length) throw new Error(\"cbor\");\n const slice = bytes.subarray(at, (at += n));\n return major === 2 ? slice : new TextDecoder(\"utf-8\", { fatal: true }).decode(slice);\n }\n case 4: {\n if (n > bytes.length - at) throw new Error(\"cbor\");\n return Array.from({ length: n }, item);\n }\n case 5: {\n if (n > bytes.length - at) throw new Error(\"cbor\");\n const map: Record<string, unknown> = Object.create(null);\n for (let i = 0; i < n; i++) { const key = item(); map[String(key)] = item(); }\n return map;\n }\n default: return item(); // a tag: the value it tags\n }\n } finally { depth--; }\n };\n return item();\n}\n","import { wordlist as french } from \"@scure/bip39/wordlists/french.js\";\nimport { wordlist as italian } from \"@scure/bip39/wordlists/italian.js\";\nimport { wordlist as japanese } from \"@scure/bip39/wordlists/japanese.js\";\nimport { wordlist as portuguese } from \"@scure/bip39/wordlists/portuguese.js\";\nimport { wordlist as simplifiedChinese } from \"@scure/bip39/wordlists/simplified-chinese.js\";\nimport { wordlist as spanish } from \"@scure/bip39/wordlists/spanish.js\";\nimport { wordlist as traditionalChinese } from \"@scure/bip39/wordlists/traditional-chinese.js\";\nimport { MONERO_CHINESE_SIMPLIFIED, MONERO_FRENCH, MONERO_ITALIAN, MONERO_JAPANESE, MONERO_PORTUGUESE, MONERO_SPANISH } from \"./monero-seed-lists\";\nimport { addSeedLists } from \"./secrets\";\n\n/**\n * BIP39's and Monero's lists in the languages the app speaks besides English (Arabic has none), for the secret guard.\n * Imported for its effect: by the composer as it opens, so they are no part of the app's first download, and by the\n * CLI.\n */\naddSeedLists([portuguese, spanish, french, italian, japanese, simplifiedChinese, traditionalChinese], [\n // Monero's in the same languages, with each one's prefix length (its `Base(…, prefix)` in src/mnemonics/*.h).\n [MONERO_PORTUGUESE, 4], [MONERO_SPANISH, 4], [MONERO_FRENCH, 4], [MONERO_ITALIAN, 4], [MONERO_JAPANESE, 3],\n [MONERO_CHINESE_SIMPLIFIED, 1],\n]);\n","import type { StoredMessage } from \"@ghostly/browser/shared/types\";\nimport { node, type ApiContext } from \"./apiKit\";\nimport { CliError } from \"./errors\";\nimport type { GhostlyEvent } from \"./events\";\nimport { goesOn as goesOnIn } from \"./waitNotice\";\n\n/*\n * Waiting on what a command sent (WISP 1100): a message's delivery, an edit's confirmation, a group frame taken by an\n * edge. Shared by the chat, group and status card methods.\n */\n\nconst DELIVERY_RANK: Record<string, number> = { sending: 0, waiting: 1, queued: 1, held: 2, sent: 2, delivered: 3 };\n\n/**\n * What a timed-out wait says of what happens next: a daemon goes on, a one-shot's profile closes now. A one-shot's\n * `edit` and `group edit` said \"while this profile is online\" too, as it was about to leave. Ctrl-C says the same.\n */\nconst goesOn = (ctx: ApiContext) => goesOnIn(ctx.mode);\n\n/** Waits until the contact confirmed the latest edit of one of my messages (it is no longer pending). */\nexport async function waitForEdit(ctx: ApiContext, chat: string, messageId: string, ms: number): Promise<StoredMessage> {\n const until = Date.now() + ms;\n for (;;) {\n const message = await node(ctx).getMessage(chat, messageId);\n if (!message) throw new CliError(\"not_found\", `No message ${messageId} in this chat`);\n if (!message.edit?.pending) return message;\n if (Date.now() >= until) throw new CliError(\"timeout\", `Timed out after ${Math.round(ms / 1000)} s: the contact has not confirmed the edit yet (it needs a live chat and a contact's app that shows edits). It ${goesOn(ctx)}`, { messageId, edits: message.edit.seq });\n await new Promise((resolve) => setTimeout(resolve, 250));\n }\n}\n\n/** Waits until the contact confirmed my removal of a message, which is already gone here. */\nexport async function waitForRemoval(ctx: ApiContext, chat: string, messageId: string, ms: number): Promise<void> {\n const until = Date.now() + ms;\n while (node(ctx).removalPending({ linkId: chat, messageId })) {\n if (Date.now() >= until) throw new CliError(\"timeout\", `Timed out after ${Math.round(ms / 1000)} s: the message is gone here and the contact has not confirmed yet. Its removal ${goesOn(ctx)}`, { messageId });\n await new Promise((resolve) => setTimeout(resolve, 250));\n }\n}\n\n/**\n * Waits until an edge took my group message, or its edit number `edit` (WISP 902: a group has no receipts, so this is\n * as far as the author sees): a member's edge in a private group, an edge to one of my hubs in a community.\n */\nexport async function waitForGroupFrame(ctx: ApiContext, groupId: string, messageId: string, edit: number | undefined, ms: number): Promise<number> {\n const until = Date.now() + ms;\n for (;;) {\n const taken = node(ctx).groupTaken({ groupId, messageId, ...(edit ? { edit } : {}) });\n if (taken > 0) return taken;\n if (Date.now() >= until) throw new CliError(\"timeout\", `Timed out after ${Math.round(ms / 1000)} s: no member's edge took it yet (it stays in the group and goes when one opens). It ${goesOn(ctx)}`, { messageId, ...(edit ? { edits: edit } : {}) });\n await new Promise((resolve) => setTimeout(resolve, 250));\n }\n}\n\n/**\n * A one-shot whose text went over the live link waits this long for its receipt before it leaves (`waitForMessage`).\n * Left at `sent`, the engine stopping took the text for unconfirmed, the next start sent it again on the DHT, and that\n * copy took the chat's one DHT text awaiting a receipt: a script's next one-shot send waited 30 s behind it, every 5-8\n * messages, and the last text showed \"Connection closed before receipt\" though the contact had it (agents#1640).\n */\nexport const ONE_SHOT_RECEIPT_MS = 2_000;\n\n/**\n * Waits until the contact confirmed my reaction or pin in a 1:1 chat (WISP 401): until `pending` no longer finds it in\n * what the contact has not confirmed (`chatUnconfirmed`). It goes on the live session, a reaction also on the DHT\n * envelopes; one not confirmed in time is kept and said again.\n */\nexport async function waitForConfirmed(ctx: ApiContext, chat: string, what: \"reaction\" | \"pin\", pending: (left: { reactions: number[]; pin: number | null }) => boolean, ms: number): Promise<void> {\n const until = Date.now() + ms;\n while (pending(node(ctx).chatUnconfirmed({ linkId: chat }))) {\n if (Date.now() >= until) throw new CliError(\"timeout\", `Timed out after ${Math.round(ms / 1000)} s: the contact has not confirmed the ${what} yet. It is kept here and ${goesOn(ctx)}`, { chat });\n await new Promise((resolve) => setTimeout(resolve, 250));\n }\n}\n\n/**\n * Waits until a message of mine reached `target` (`sent`: on its way to the contact; `delivered`: acknowledged). A\n * one-shot's text sent over the live link waits a moment more for its receipt (`ONE_SHOT_RECEIPT_MS`).\n */\nexport async function waitForMessage(ctx: ApiContext, chat: string, messageId: string, target: \"sent\" | \"delivered\", ms: number): Promise<StoredMessage> {\n const reached = await waitForDelivery(ctx, chat, messageId, target, ms);\n if (ctx.mode !== \"one-shot\" || target !== \"sent\" || reached.delivery !== \"sent\" || reached.via !== \"datalink\") return reached;\n return waitForDelivery(ctx, chat, messageId, \"delivered\", ONE_SHOT_RECEIPT_MS).catch(async () => (await node(ctx).getMessage(chat, messageId)) ?? reached);\n}\n\nasync function waitForDelivery(ctx: ApiContext, chat: string, messageId: string, target: \"sent\" | \"delivered\", ms: number): Promise<StoredMessage> {\n const want = DELIVERY_RANK[target];\n const look = (message: StoredMessage | undefined) => {\n if (!message) return undefined;\n const delivery = message.delivery ?? \"sent\";\n if (delivery === \"failed\") throw new CliError(\"engine\", message.deliveryError ?? \"The message could not be sent\", { messageId, delivery });\n return (DELIVERY_RANK[delivery] ?? 0) >= want ? message : undefined;\n };\n return new Promise<StoredMessage>((resolve, reject) => {\n let settled = false;\n const finish = (error: unknown, message?: StoredMessage) => {\n if (settled) return;\n settled = true; clearTimeout(timer); off();\n if (error) reject(error); else resolve(message!);\n };\n const check = (last = false) => void node(ctx).getMessage(chat, messageId).then((message) => {\n try {\n const done = look(message);\n if (done) finish(null, done);\n else if (last) finish(new CliError(\"timeout\", `Timed out after ${Math.round(ms / 1000)} s: the message is ${message?.delivery ?? \"not sent yet\"} and ${goesOn(ctx)}`, { messageId, delivery: message?.delivery ?? null }));\n } catch (error) { finish(error); }\n }, finish);\n const timer = setTimeout(() => check(true), ms);\n // Any event naming the message: a message first seen already delivered comes as `message.sent`, never as\n // `message.delivery`. Listening before the first read leaves no gap for a change to slip through.\n const off = ctx.hub.onEvent((event: GhostlyEvent) => {\n if (event.chat === chat && (event.messageId === messageId || (event.message as { id?: string } | undefined)?.id === messageId)) check();\n });\n check();\n });\n}\n","import { BUTTONS_CAPABILITY, BUTTON_STYLES, STATUS_CARD_LIMITS, buttonLabelClash, checkStatusCard, randomBytes, toBase64Url, type ButtonsCard } from \"@ghostly/core\";\nimport type { LinkView, StoredMessage } from \"@ghostly/browser/shared/types\";\nimport type { Parsed } from \"./args\";\nimport { bool, chatOrGroup, messageOf, node, num, oneOf, str, type Method, type Params } from \"./apiKit\";\nimport { CliError } from \"./errors\";\nimport { findSecret } from \"./secretGuard\";\nimport { waitForEdit, waitForGroupFrame, waitForMessage } from \"./waits\";\n\n/*\n * Message buttons (WISP 406 · Message Buttons), the bot's side: a message whose text is the question, with up to six\n * buttons under it (`send --button yes:Yes`). A press comes back as a reply whose text is the button's label; the\n * engine marks it (`press`) and `listen` says `button.pressed`. `button update` then shows the answer (`chosen`) and\n * closes the buttons, by editing the message with the same buttons.\n */\n\n/**\n * `--button id:Label` (again for each, 1 to 6), `--style id=primary|neutral|danger`, `--once` and `--id`, as the\n * method's parameters: `buttons` and `buttonsId`. Nothing when no `--button` is given. The label may hold colons: the\n * id ends at the first one. An id given twice, two labels that read the same (ignoring case and spaces at the ends), a\n * label that is another button's id, or a style not listed are a usage error here, before the profile opens; other\n * bounds (ids, labels, how many) are the card's, checked when it is sent.\n */\nexport function buttonsOf(options: Parsed[\"options\"]): { buttons: Record<string, unknown>[]; buttonsId?: string } | undefined {\n const given = Array.isArray(options.button) ? options.button as string[] : [];\n if (!given.length) {\n for (const flag of [\"style\", \"once\", \"id\"] as const)\n if (options[flag] !== undefined) throw new CliError(\"usage\", `--${flag} goes with --button id:Label`);\n return undefined;\n }\n const buttons: Record<string, unknown>[] = given.map((value) => {\n const colon = value.indexOf(\":\");\n if (colon < 1 || colon === value.length - 1) throw new CliError(\"usage\", `--button takes id:Label, like yes:Yes, not ${JSON.stringify(value)}`);\n return { id: value.slice(0, colon), label: value.slice(colon + 1).trim() };\n });\n const twice = buttons.findIndex((button, at) => buttons.findIndex((other) => other.id === button.id) !== at);\n if (twice !== -1) throw new CliError(\"usage\", `--button ${JSON.stringify(given[twice])} repeats the id ${JSON.stringify(buttons[twice].id)}: each button takes its own`);\n // Two buttons a typed answer could not tell apart: the same label, or a label that is another's id (ignoring case).\n const clash = buttonLabelClash(buttons);\n if (clash) {\n const [at, other] = [JSON.stringify(given[clash.at]), JSON.stringify(given[clash.with])];\n throw new CliError(\"usage\", clash.kind === \"label\"\n ? `--button ${at} repeats the label of --button ${other} (ignoring case and spaces): a typed answer could not tell them apart`\n : `--button ${at} has a label that is the id of --button ${other}: a typed answer could not tell them apart`);\n }\n for (const value of Array.isArray(options.style) ? options.style as string[] : []) {\n const eq = value.indexOf(\"=\");\n const button = eq > 0 ? buttons.find((b) => b.id === value.slice(0, eq)) : undefined;\n if (!button) throw new CliError(\"usage\", `--style takes id=primary|neutral|danger for one of the buttons, not ${JSON.stringify(value)}`);\n const style = value.slice(eq + 1);\n if (!(BUTTON_STYLES as readonly string[]).includes(style)) throw new CliError(\"usage\", `--style ${JSON.stringify(value)}: a button's style is ${BUTTON_STYLES.join(\", \")}`);\n button.style = style;\n }\n if (options.once === true) for (const button of buttons) button.once = true;\n return { buttons, ...(options.id !== undefined && { buttonsId: String(options.id) }) };\n}\n\n/** A buttons card checked by the sender's rule, or a `bad_request` that says what is wrong. */\nfunction checked(card: Record<string, unknown>): ButtonsCard {\n const result = checkStatusCard(card);\n if (\"error\" in result) throw new CliError(\"bad_request\", `Buttons: ${result.error}`, { card });\n return result.card as ButtonsCard;\n}\n\n/**\n * The card a send's `buttons` (and `buttonsId`) make, or undefined when it names none. `buttons` is a list of\n * `{id, label, style?, once?}`; the id of the question is made up (`ask-…`) unless given.\n */\nexport function buttonsCard(params: Params): ButtonsCard | undefined {\n const buttons = params.buttons;\n if (buttons === undefined || buttons === null) {\n if (params.buttonsId !== undefined) throw new CliError(\"bad_request\", \"buttonsId goes with buttons\");\n return undefined;\n }\n if (!Array.isArray(buttons)) throw new CliError(\"bad_request\", \"buttons must be a list of {id, label, style?, once?}\");\n const id = str(params, \"buttonsId\") ?? `ask-${toBase64Url(randomBytes(6))}`;\n return checked({ kind: \"buttons\", id, buttons });\n}\n\n/** Whether a 1:1 contact's app shows and presses buttons: null until its app said what it offers. */\nexport function pressable(link: LinkView): boolean | null {\n const peer = link.sessionOffers?.peer;\n return peer ? peer.includes(BUTTONS_CAPABILITY) : null;\n}\n\n/** The message of mine with buttons that `button update` names, by its id here (or the id both sides know). */\nfunction buttonsMessage(message: StoredMessage | undefined, ref: string, group: boolean): StoredMessage & { card: ButtonsCard } {\n if (!message) throw new CliError(\"not_found\", `No message ${JSON.stringify(ref)} of yours in this ${group ? \"group\" : \"chat\"}: the messageId send gave`);\n if (message.card?.kind !== \"buttons\") throw new CliError(\"bad_request\", \"That message has no buttons: send one with send --button id:Label\");\n return message as StoredMessage & { card: ButtonsCard };\n}\n\n/**\n * `button update`: the answer shown on a question's buttons (`chosen`), the buttons closed (`close`), or a new text\n * (`text`), by editing the message with the same buttons. What is not given stays as it was.\n */\nasync function updateButtons(ctx: Parameters<Method>[0], params: Params): Promise<Record<string, unknown>> {\n const target = chatOrGroup(ctx, str(params, \"chat\", true));\n const ref = str(params, \"message\", true);\n const chosen = str(params, \"chosen\");\n const close = bool(params, \"close\");\n const newText = str(params, \"text\");\n if (chosen === undefined && !close && newText === undefined) throw new CliError(\"bad_request\", \"Nothing to update: give chosen, close or text\");\n // A new text is a message like any other: the same guard as `send` and `edit`.\n if (newText !== undefined && !bool(params, \"force\")) {\n const secret = findSecret(newText);\n if (secret) throw new CliError(\"confirm\", `The text looks like ${secret.kind === \"cashu\" ? \"a Cashu token (money anyone who reads it can take)\" : \"a secret (a seed or a private key)\"}; update with --force if you mean to`, { kind: secret.kind });\n }\n const message = buttonsMessage(await messageOf(ctx, target.linkId, ref, (m) => m.sender === \"me\"), ref, target.group);\n if ((message.edit?.seq ?? 0) >= STATUS_CARD_LIMITS.edits)\n throw new CliError(\"refused\", `This message took ${STATUS_CARD_LIMITS.edits} updates, the most one takes: ask again with a new send`, { messageId: message.id, edits: message.edit!.seq });\n const before = message.card;\n // Said here, with the buttons it has, as a press says it: the card's own check names only the field.\n if (chosen !== undefined && !before.buttons.some((b) => b.id === chosen))\n throw new CliError(\"bad_request\", `That message has no button ${JSON.stringify(chosen)}; its buttons: ${before.buttons.map((b) => b.id).join(\", \")}`, { card: before });\n const card = checked({ ...before, ...(chosen !== undefined && { chosen }), ...((close || before.closed) && { closed: true }) });\n const text = newText ?? message.text;\n const wait = oneOf(params, \"wait\", target.group ? [\"none\", \"sent\"] as const : [\"none\", \"confirmed\"] as const, \"none\");\n const ms = num(params, \"timeout\", 30, { min: 1, max: 3600 }) * 1000;\n const result = await node(ctx).editMessage({ linkId: target.linkId, messageId: message.id, text, card });\n if (result.error) throw new CliError(result.refused ? \"refused\" : \"unavailable\", result.error);\n let edited = await node(ctx).getMessage(target.linkId, message.id);\n if (wait === \"confirmed\" && edited?.edit?.pending) edited = await waitForEdit(ctx, target.linkId, message.id, ms);\n const edges = wait === \"sent\" && edited?.edit ? await waitForGroupFrame(ctx, target.id, message.id, edited.edit.seq, ms) : undefined;\n return {\n [target.group ? \"group\" : \"chat\"]: target.id, buttons: card.id, messageId: message.id, card, edits: edited?.edit?.seq ?? 0,\n ...(target.group ? { ...(edges !== undefined && { edges }) } : { confirmed: !!edited && !edited.edit?.pending }),\n };\n}\n\n/**\n * `button press`: the other side of a question, as the app's tap: a press on a button of someone else's message, by\n * its id here (or the id both sides know). The engine sends a reply whose text is the button's label, and refuses what\n * an app would: a button the message does not have, closed buttons, a second answer past `once`, a second press\n * within a second. A one-shot in a chat waits until the press went out, as `send` does.\n */\nasync function pressButton(ctx: Parameters<Method>[0], params: Params): Promise<Record<string, unknown>> {\n const target = chatOrGroup(ctx, str(params, \"chat\", true));\n const ref = str(params, \"message\", true);\n const buttonId = str(params, \"button\", true);\n const where = target.group ? \"group\" : \"chat\";\n const message = await messageOf(ctx, target.linkId, ref, (m) => m.sender !== \"me\");\n if (!message) throw new CliError(\"not_found\", `No message ${JSON.stringify(ref)} from someone else in this ${where}: the id its event or history gave`);\n if (message.card?.kind !== \"buttons\") throw new CliError(\"bad_request\", \"That message has no buttons\");\n const button = message.card.buttons.find((b) => b.id === buttonId);\n if (!button) throw new CliError(\"not_found\", `That message has no button ${JSON.stringify(buttonId)}; its buttons: ${message.card.buttons.map((b) => b.id).join(\", \")}`);\n const wait = target.group\n ? oneOf(params, \"wait\", [\"none\", \"sent\"] as const, \"none\")\n : oneOf(params, \"wait\", [\"none\", \"sent\", \"delivered\"] as const, ctx.mode === \"one-shot\" ? \"sent\" : \"none\");\n const ms = num(params, \"timeout\", 30, { min: 1, max: 3600 }) * 1000;\n const result = await node(ctx).pressButton({ linkId: target.linkId, messageId: message.id, buttonId });\n if (result.error) throw new CliError(result.refused ? \"refused\" : \"unavailable\", result.error, result.paced ? { paced: true } : undefined);\n const replyId = result.messageId ?? null;\n const answer = { [where]: target.id, messageId: message.id, button: button.id, label: button.label, replyId };\n if (!replyId) return answer;\n if (target.group) {\n const edges = wait === \"sent\" ? await waitForGroupFrame(ctx, target.id, replyId, undefined, ms) : node(ctx).groupTaken({ groupId: target.id, messageId: replyId });\n return { ...answer, edges };\n }\n const reply = wait === \"none\" ? await node(ctx).getMessage(target.linkId, replyId) : await waitForMessage(ctx, target.linkId, replyId, wait, ms);\n return { ...answer, delivery: reply?.delivery ?? null };\n}\n\nexport const BUTTON_METHODS: Record<string, Method> = {\n /** WISP 406 · Message Buttons: a press on a button of someone else's message, as the app's tap. */\n \"button.press\": pressButton,\n /** WISP 406 · Message Buttons: the answer chosen on a question of mine, its buttons closed, or its text changed. */\n \"button.update\": updateButtons,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAa,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6F5B,KAAK,CAAC,CAAC,MAAM,KAAK;;AAGpB,IAAa,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmH/B,KAAK,CAAC,CAAC,MAAM,KAAK;;AAGpB,IAAa,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+F3B,KAAK,CAAC,CAAC,MAAM,KAAK;;AAGpB,IAAa,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiH5B,KAAK,CAAC,CAAC,MAAM,KAAK;;AAGpB,IAAa,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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