chirkle 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -201
- package/bin/release/darwin-amd64/chirkle-server +2 -2
- package/bin/release/darwin-arm64/chirkle-server +0 -0
- package/bin/release/linux-amd64/chirkle-server +0 -0
- package/bin/release/linux-arm64/chirkle-server +0 -0
- package/package.json +17 -5
- package/pb_hooks/lib/collections.js +5 -3
- package/pb_hooks/lib/handles.js +24 -2
- package/pb_hooks/lib/http.js +2 -2
- package/pb_hooks/lib/inbox.js +6 -5
- package/pb_hooks/lib/media.js +2 -2
- package/pb_hooks/lib/users.js +33 -2
- package/pb_hooks/main.pb.js +1 -0
- package/pb_hooks/telegram/inbound.js +5 -0
- package/pb_hooks/telegram/links.js +12 -1
- package/pb_hooks/telegram/outbound.js +56 -2
- package/pb_hooks/telegram/worker.js +2 -1
- package/pb_migrations/1760000057_reactions_seen.js +17 -0
- package/pb_migrations/1760000058_users_kind_public.js +20 -0
- package/pb_public/assets/{access-UK3L54NR.js → access-KVSI7EFH.js} +2 -2
- package/pb_public/assets/access-KVSI7EFH.js.br +0 -0
- package/pb_public/assets/access-KVSI7EFH.js.gz +0 -0
- package/pb_public/assets/access-XGNXIUR5.css +2 -0
- package/pb_public/assets/access-XGNXIUR5.css.br +0 -0
- package/pb_public/assets/access-XGNXIUR5.css.gz +0 -0
- package/pb_public/assets/access-XGNXIUR5.css.map +7 -0
- package/pb_public/assets/account-EBCPOLWT.css +2 -0
- package/pb_public/assets/account-EBCPOLWT.css.br +0 -0
- package/pb_public/assets/account-EBCPOLWT.css.gz +0 -0
- package/pb_public/assets/account-EBCPOLWT.css.map +7 -0
- package/pb_public/assets/account-api-J6A6IYVX.js.br +0 -0
- package/pb_public/assets/account-api-J6A6IYVX.js.gz +0 -0
- package/pb_public/assets/app-5JOOV6JX.js +3 -0
- package/pb_public/assets/app-5JOOV6JX.js.br +0 -0
- package/pb_public/assets/app-5JOOV6JX.js.gz +0 -0
- package/pb_public/assets/app-5JOOV6JX.js.map +7 -0
- package/pb_public/assets/app-7OMYYLCI.css +2 -0
- package/pb_public/assets/app-7OMYYLCI.css.br +0 -0
- package/pb_public/assets/app-7OMYYLCI.css.gz +0 -0
- package/pb_public/assets/app-7OMYYLCI.css.map +7 -0
- package/pb_public/assets/chunk-5PKDEWJS.js +2 -0
- package/pb_public/assets/chunk-5PKDEWJS.js.br +0 -0
- package/pb_public/assets/chunk-5PKDEWJS.js.gz +0 -0
- package/pb_public/assets/chunk-5PKDEWJS.js.map +7 -0
- package/pb_public/assets/chunk-AG73QNUN.js.br +0 -0
- package/pb_public/assets/chunk-AG73QNUN.js.gz +0 -0
- package/pb_public/assets/chunk-DCLJRQ53.js.br +0 -0
- package/pb_public/assets/chunk-DCLJRQ53.js.gz +0 -0
- package/pb_public/assets/chunk-EO3AMXJN.js +2 -0
- package/pb_public/assets/chunk-EO3AMXJN.js.br +0 -0
- package/pb_public/assets/chunk-EO3AMXJN.js.gz +0 -0
- package/pb_public/assets/chunk-EO3AMXJN.js.map +7 -0
- package/pb_public/assets/chunk-LDZPNZ2E.js +2 -0
- package/pb_public/assets/chunk-LDZPNZ2E.js.br +0 -0
- package/pb_public/assets/chunk-LDZPNZ2E.js.gz +0 -0
- package/pb_public/assets/chunk-LDZPNZ2E.js.map +7 -0
- package/pb_public/assets/chunk-RPCBA7VF.js.br +0 -0
- package/pb_public/assets/chunk-RPCBA7VF.js.gz +0 -0
- package/pb_public/assets/chunk-RYZHXNLF.js +2 -0
- package/pb_public/assets/chunk-RYZHXNLF.js.br +0 -0
- package/pb_public/assets/chunk-RYZHXNLF.js.gz +0 -0
- package/pb_public/assets/chunk-RYZHXNLF.js.map +7 -0
- package/pb_public/assets/chunk-UZDXAORM.js.br +0 -0
- package/pb_public/assets/chunk-UZDXAORM.js.gz +0 -0
- package/pb_public/assets/chunk-VSHXXDW4.js +2 -0
- package/pb_public/assets/chunk-VSHXXDW4.js.br +0 -0
- package/pb_public/assets/chunk-VSHXXDW4.js.gz +0 -0
- package/pb_public/assets/chunk-VSHXXDW4.js.map +7 -0
- package/pb_public/assets/chunk-VTOUI25E.js.br +0 -0
- package/pb_public/assets/chunk-VTOUI25E.js.gz +0 -0
- package/pb_public/assets/{chunk-DZC4SY4M.js → chunk-Y5MCBN66.js} +2 -2
- package/pb_public/assets/chunk-Y5MCBN66.js.br +0 -0
- package/pb_public/assets/chunk-Y5MCBN66.js.gz +0 -0
- package/pb_public/assets/{chunk-DZC4SY4M.js.map → chunk-Y5MCBN66.js.map} +3 -3
- package/pb_public/assets/collections-FZB6G4W4.css +2 -0
- package/pb_public/assets/collections-FZB6G4W4.css.br +0 -0
- package/pb_public/assets/collections-FZB6G4W4.css.gz +0 -0
- package/pb_public/assets/collections-FZB6G4W4.css.map +7 -0
- package/pb_public/assets/emoji-IHRUMGCY.css +2 -0
- package/pb_public/assets/emoji-IHRUMGCY.css.br +0 -0
- package/pb_public/assets/emoji-IHRUMGCY.css.gz +0 -0
- package/pb_public/assets/emoji-IHRUMGCY.css.map +7 -0
- package/pb_public/assets/{emoji-picker-K6JTK2GV.js → emoji-picker-W27IJER2.js} +2 -2
- package/pb_public/assets/emoji-picker-W27IJER2.js.br +0 -0
- package/pb_public/assets/emoji-picker-W27IJER2.js.gz +0 -0
- package/pb_public/assets/{forward-267HRNPY.js → forward-5TJEYGEV.js} +2 -2
- package/pb_public/assets/forward-5TJEYGEV.js.br +0 -0
- package/pb_public/assets/forward-5TJEYGEV.js.gz +0 -0
- package/pb_public/assets/inbox-2AXY3INA.css +2 -0
- package/pb_public/assets/inbox-2AXY3INA.css.br +0 -0
- package/pb_public/assets/inbox-2AXY3INA.css.gz +0 -0
- package/pb_public/assets/inbox-2AXY3INA.css.map +7 -0
- package/pb_public/assets/{inbox-CLMYESNI.js → inbox-A46J7ZU2.js} +2 -2
- package/pb_public/assets/inbox-A46J7ZU2.js.br +0 -0
- package/pb_public/assets/inbox-A46J7ZU2.js.gz +0 -0
- package/pb_public/assets/{inbox-CLMYESNI.js.map → inbox-A46J7ZU2.js.map} +2 -2
- package/pb_public/assets/{invite-OGT5E2MZ.js → invite-6BCBF4KV.js} +2 -2
- package/pb_public/assets/invite-6BCBF4KV.js.br +0 -0
- package/pb_public/assets/invite-6BCBF4KV.js.gz +0 -0
- package/pb_public/assets/invite-api-7G7XPXQW.js.br +0 -0
- package/pb_public/assets/invite-api-7G7XPXQW.js.gz +0 -0
- package/pb_public/assets/lazy-OVEJT5CP.js +2 -0
- package/pb_public/assets/lazy-OVEJT5CP.js.br +0 -0
- package/pb_public/assets/lazy-OVEJT5CP.js.gz +0 -0
- package/pb_public/assets/lazy-OVEJT5CP.js.map +7 -0
- package/pb_public/assets/{login-TK6K4WGB.js → login-FZY6GOMF.js} +2 -2
- package/pb_public/assets/login-FZY6GOMF.js.br +0 -0
- package/pb_public/assets/login-FZY6GOMF.js.gz +0 -0
- package/pb_public/assets/media-BCKZQR2R.css +2 -0
- package/pb_public/assets/media-BCKZQR2R.css.br +0 -0
- package/pb_public/assets/media-BCKZQR2R.css.gz +0 -0
- package/pb_public/assets/media-BCKZQR2R.css.map +7 -0
- package/pb_public/assets/{media-WZ4653L5.js → media-VCJWBQJZ.js} +2 -2
- package/pb_public/assets/media-VCJWBQJZ.js.br +0 -0
- package/pb_public/assets/media-VCJWBQJZ.js.gz +0 -0
- package/pb_public/assets/{mention-suggest-ODJD2IC5.js → mention-suggest-K3UUHR4D.js} +2 -2
- package/pb_public/assets/mention-suggest-K3UUHR4D.js.br +0 -0
- package/pb_public/assets/mention-suggest-K3UUHR4D.js.gz +0 -0
- package/pb_public/assets/notify-EPDM772N.js.br +0 -0
- package/pb_public/assets/notify-EPDM772N.js.gz +0 -0
- package/pb_public/assets/profile-7KMXLX5U.js +2 -0
- package/pb_public/assets/profile-7KMXLX5U.js.br +0 -0
- package/pb_public/assets/profile-7KMXLX5U.js.gz +0 -0
- package/pb_public/assets/profile-7KMXLX5U.js.map +7 -0
- package/pb_public/assets/rooms-forms-IADHTHBZ.js +2 -0
- package/pb_public/assets/rooms-forms-IADHTHBZ.js.br +0 -0
- package/pb_public/assets/rooms-forms-IADHTHBZ.js.gz +0 -0
- package/pb_public/assets/rooms-forms-IADHTHBZ.js.map +7 -0
- package/pb_public/assets/search-HOPAWIMQ.js +2 -0
- package/pb_public/assets/search-HOPAWIMQ.js.br +0 -0
- package/pb_public/assets/search-HOPAWIMQ.js.gz +0 -0
- package/pb_public/assets/search-HOPAWIMQ.js.map +7 -0
- package/pb_public/assets/sidebar-forms-ETSRVSPY.css +2 -0
- package/pb_public/assets/sidebar-forms-ETSRVSPY.css.br +0 -0
- package/pb_public/assets/sidebar-forms-ETSRVSPY.css.gz +0 -0
- package/pb_public/assets/sidebar-forms-ETSRVSPY.css.map +7 -0
- package/pb_public/assets/stats-5GSWDHZI.css +2 -0
- package/pb_public/assets/stats-5GSWDHZI.css.br +0 -0
- package/pb_public/assets/stats-5GSWDHZI.css.gz +0 -0
- package/pb_public/assets/stats-5GSWDHZI.css.map +7 -0
- package/pb_public/assets/{stats-GTO2H6PG.js → stats-Y3LIXAZR.js} +2 -2
- package/pb_public/assets/stats-Y3LIXAZR.js.br +0 -0
- package/pb_public/assets/stats-Y3LIXAZR.js.gz +0 -0
- package/pb_public/assets/stats-Y3LIXAZR.js.map +7 -0
- package/pb_public/assets/switcher-TFSO45KV.js.br +0 -0
- package/pb_public/assets/switcher-TFSO45KV.js.gz +0 -0
- package/pb_public/assets/user-search-GUNMIBSB.js +2 -0
- package/pb_public/assets/user-search-GUNMIBSB.js.br +0 -0
- package/pb_public/assets/user-search-GUNMIBSB.js.gz +0 -0
- package/pb_public/assets/{viewer-2Y5FJBW4.js → viewer-BHKVAADP.js} +2 -2
- package/pb_public/assets/viewer-BHKVAADP.js.br +0 -0
- package/pb_public/assets/viewer-BHKVAADP.js.gz +0 -0
- package/pb_public/assets/viewer-JBZU46HP.css +2 -0
- package/pb_public/assets/viewer-JBZU46HP.css.br +0 -0
- package/pb_public/assets/viewer-JBZU46HP.css.gz +0 -0
- package/pb_public/assets/{viewer-P7GYCBYM.css.map → viewer-JBZU46HP.css.map} +2 -2
- package/pb_public/index.html +9 -8
- package/pb_public/stats.html +3 -3
- package/scripts/service.mjs +1 -1
- package/scripts/start.mjs +2 -1
- package/pb_public/assets/access-GPRLOZOO.css +0 -2
- package/pb_public/assets/access-GPRLOZOO.css.map +0 -7
- package/pb_public/assets/account-CT2BVMAX.css +0 -2
- package/pb_public/assets/account-CT2BVMAX.css.map +0 -7
- package/pb_public/assets/app-HB3NZHQ2.js +0 -3
- package/pb_public/assets/app-HB3NZHQ2.js.map +0 -7
- package/pb_public/assets/app-XJ73EU5O.css +0 -2
- package/pb_public/assets/app-XJ73EU5O.css.map +0 -7
- package/pb_public/assets/chunk-56ACD3V5.js +0 -2
- package/pb_public/assets/chunk-56ACD3V5.js.map +0 -7
- package/pb_public/assets/chunk-N2OFGBCZ.js +0 -2
- package/pb_public/assets/chunk-N2OFGBCZ.js.map +0 -7
- package/pb_public/assets/chunk-OKIIBH7O.js +0 -2
- package/pb_public/assets/chunk-OKIIBH7O.js.map +0 -7
- package/pb_public/assets/chunk-WR25F7FU.js +0 -2
- package/pb_public/assets/chunk-WR25F7FU.js.map +0 -7
- package/pb_public/assets/collections-DHJEOLHW.css +0 -2
- package/pb_public/assets/collections-DHJEOLHW.css.map +0 -7
- package/pb_public/assets/emoji-WWNPWCF3.css +0 -2
- package/pb_public/assets/emoji-WWNPWCF3.css.map +0 -7
- package/pb_public/assets/inbox-3FSOPY2T.css +0 -2
- package/pb_public/assets/inbox-3FSOPY2T.css.map +0 -7
- package/pb_public/assets/lazy-H3KIJVB5.js +0 -2
- package/pb_public/assets/lazy-H3KIJVB5.js.map +0 -7
- package/pb_public/assets/media-7TCBG7WM.css +0 -2
- package/pb_public/assets/media-7TCBG7WM.css.map +0 -7
- package/pb_public/assets/profile-3R6S5QYS.js +0 -2
- package/pb_public/assets/profile-3R6S5QYS.js.map +0 -7
- package/pb_public/assets/search-WCHOGAJQ.js +0 -2
- package/pb_public/assets/search-WCHOGAJQ.js.map +0 -7
- package/pb_public/assets/stats-A2TBRUI6.css +0 -2
- package/pb_public/assets/stats-A2TBRUI6.css.map +0 -7
- package/pb_public/assets/stats-GTO2H6PG.js.map +0 -7
- package/pb_public/assets/user-search-3HQOCQWL.js +0 -2
- package/pb_public/assets/viewer-P7GYCBYM.css +0 -2
- /package/pb_public/assets/{access-UK3L54NR.js.map → access-KVSI7EFH.js.map} +0 -0
- /package/pb_public/assets/{emoji-picker-K6JTK2GV.js.map → emoji-picker-W27IJER2.js.map} +0 -0
- /package/pb_public/assets/{forward-267HRNPY.js.map → forward-5TJEYGEV.js.map} +0 -0
- /package/pb_public/assets/{invite-OGT5E2MZ.js.map → invite-6BCBF4KV.js.map} +0 -0
- /package/pb_public/assets/{login-TK6K4WGB.js.map → login-FZY6GOMF.js.map} +0 -0
- /package/pb_public/assets/{media-WZ4653L5.js.map → media-VCJWBQJZ.js.map} +0 -0
- /package/pb_public/assets/{mention-suggest-ODJD2IC5.js.map → mention-suggest-K3UUHR4D.js.map} +0 -0
- /package/pb_public/assets/{user-search-3HQOCQWL.js.map → user-search-GUNMIBSB.js.map} +0 -0
- /package/pb_public/assets/{viewer-2Y5FJBW4.js.map → viewer-BHKVAADP.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../web/src/dom.ts", "../../web/src/strings/stats-main.ts", "../../web/src/theme.ts", "../../web/src/strings/stats-data.ts", "../../web/src/stats/data.ts", "../../web/src/stats/main.ts"],
|
|
4
|
-
"sourcesContent": ["// Minimal DOM helpers (\u00A77.3). Strings always become text nodes: there is no HTML parsing anywhere.\n\nexport type Child = Node | string | number | null | undefined | false;\n\ntype Listeners = { [K in keyof HTMLElementEventMap]?: (ev: HTMLElementEventMap[K]) => void };\n\nexport interface Attrs {\n class?: string;\n dataset?: Record<string, string>;\n on?: Listeners;\n /** Removes every `on` listener when aborted. */\n signal?: AbortSignal;\n value?: string;\n checked?: boolean;\n [attr: string]: unknown;\n}\n\nconst PROPS = new Set([\"value\", \"checked\"]);\n\nexport function h<K extends keyof HTMLElementTagNameMap>(tag: K, attrs: Attrs = {}, children?: Child | Child[]): HTMLElementTagNameMap[K] {\n const el = document.createElement(tag);\n const { class: cls, dataset, on: listeners, signal, ...rest } = attrs;\n if (cls) el.className = cls;\n if (dataset) Object.assign(el.dataset, dataset);\n for (const [name, v] of Object.entries(rest)) {\n if (v === undefined || v === null || v === false) continue;\n if (PROPS.has(name)) (el as unknown as Record<string, unknown>)[name] = v;\n else el.setAttribute(name, v === true ? \"\" : String(v));\n }\n if (listeners) {\n for (const [type, fn] of Object.entries(listeners)) {\n el.addEventListener(type, fn as EventListener, signal ? { signal } : undefined);\n }\n }\n append(el, children);\n return el;\n}\n\nexport function append(el: Node, children: Child | Child[]): void {\n for (const c of Array.isArray(children) ? children : [children]) {\n if (c === null || c === undefined || c === false) continue;\n el.appendChild(typeof c === \"object\" ? c : document.createTextNode(String(c)));\n }\n}\n\nlet idSeq = 0;\n\n/** A document-unique id for label/aria wiring, e.g. uniqueId(\"room\") \u2192 \"room-3\". */\nexport function uniqueId(prefix: string): string {\n return `${prefix}-${++idSeq}`;\n}\n\nexport function clear(el: Element): void {\n el.replaceChildren();\n}\n\n/**\n * Make `parent`'s children exactly `nodes`, in order, moving only what differs (\u00A77.5: the message list is\n * never fully re-rendered). Nodes already in place keep their identity, focus and scroll anchoring.\n */\nexport function reconcile(parent: Element, nodes: readonly Node[]): void {\n // Drop what goes first: a replaced node left in place would push every node after it down one, and each of them\n // would then be moved (re-inserted, restyled) instead of left alone.\n const keep = new Set(nodes);\n for (const c of [...parent.childNodes]) if (!keep.has(c)) c.remove();\n nodes.forEach((node, i) => {\n const at = parent.childNodes[i];\n if (at !== node) parent.insertBefore(node, at ?? null);\n });\n}\n\n/**\n * Keep what is typed while a lazy chunk loads (a search field that isn't there yet), for the field once it shows:\n * printable keys and Backspace, not shortcuts, and Enter after some text (as \"\\n\": a name typed and Enter pressed before\n * the field showed went nowhere, QA BUG-272). `take()` stops holding and says what was typed (QA BUG-243, BUG-252).\n */\nexport function holdKeys(signal: AbortSignal): { take(): string } {\n let early = \"\";\n const hold = (e: KeyboardEvent) => {\n if (e.ctrlKey || e.metaKey || e.altKey || e.isComposing) return;\n if (e.key === \"Enter\") {\n if (!early.replace(/\\n/g, \"\")) return;\n early += \"\\n\";\n } else if (e.key.length !== 1 && e.key !== \"Backspace\") return;\n else early = e.key === \"Backspace\" ? early.slice(0, -1) : early + e.key;\n e.preventDefault();\n };\n document.addEventListener(\"keydown\", hold, { capture: true, signal });\n return {\n take() {\n document.removeEventListener(\"keydown\", hold, true);\n return early;\n },\n };\n}\n\n/** Put `text` held by holdKeys() in `input`, as if typed there: its characters, then Enter if one was pressed. */\nexport function typeInto(input: HTMLInputElement | null | undefined, text: string): void {\n if (!text || !input) return;\n const chars = text.replace(/\\n/g, \"\");\n if (chars) {\n input.value += chars;\n input.dispatchEvent(new Event(\"input\", { bubbles: true }));\n }\n if (text.includes(\"\\n\")) input.dispatchEvent(new KeyboardEvent(\"keydown\", { key: \"Enter\", bubbles: true, cancelable: true }));\n}\n\n/**\n * A click on an open modal dialog's backdrop (outside its box) closes it, as Escape does: through a cancelable\n * \"cancel\" event, so a dialog that refuses Escape (busy saving, or closing its people search first) does the same\n * here. Both the press and the release must be outside, so a drag that selects text inside and ends outside doesn't\n * close it. One listener for every dialog, installed once by app.ts: the dialogs are in lazy chunks.\n */\nexport function closeDialogsOnBackdrop(): void {\n const outside = (e: MouseEvent): HTMLDialogElement | null => {\n const d = e.target;\n if (!(d instanceof HTMLDialogElement) || !d.open) return null;\n const r = d.getBoundingClientRect();\n return e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom ? d : null;\n };\n let pressed: HTMLDialogElement | null = null;\n document.addEventListener(\"pointerdown\", (e) => (pressed = outside(e)), true);\n document.addEventListener(\n \"click\",\n (e) => {\n const d = outside(e);\n const was = pressed;\n pressed = null;\n if (!d || d !== was) return;\n if (d.dispatchEvent(new Event(\"cancel\", { cancelable: true }))) d.close();\n },\n true,\n );\n}\n", "// The user-facing text of stats/main.ts (docs/REFACTOR.md item 56): one module per source file, so a lazy\n// screen's text stays in its own chunk. Copy changes here; a translation would replace these.\n\nexport const SHOW_AS_A_TABLE = \"Show as a table\";\nexport const TELEGRAM = \"Telegram\";\nexport const LINKED_INSTANCES = \"Linked instances\";\nexport const LINK_PREVIEWS = \"Link previews\";\nexport const THUMBNAILS_TO_MAKE = \"Thumbnails to make\";\nexport const VIDEO_SHAPES_TO_READ = \"Video shapes to read\";\nexport const FILES_TO_MOVE = \"Files to move\";\nexport const STORAGE_TO_CLEAN_UP = \"Storage to clean up\";\nexport const ACCOUNT_JOBS = \"Exports and deleted accounts\";\nexport const MEDIA = \"Media\";\nexport const DAILY_PRUNE = \"Daily prune\";\nexport const SERVER = \"Server\";\nexport const chirklePocketbase = (version: string | number, pocketbase: string | number) => `Chirkle ${version}, PocketBase ${pocketbase}`;\nexport const UP_FOR = \"Up for\";\nexport const CONNECTIONS = \"Connections\";\nexport const LIVE_EVENTS_WAITING = \"Live events waiting\";\nexport const DATABASE = \"Database\";\nexport const MEMORY = \"Memory\";\nexport const QUEUES = \"Queues\";\nexport const ROWS_WAITING_FOR_A_WORKER = \"Rows waiting for a worker\";\nexport const OLDEST = \"Oldest\";\nexport const FAILED_ONCE_OR_MORE = \"Failed once or more\";\nexport const ROWS = \"Rows\";\nexport const QUEUE = \"Queue\";\nexport const WORKERS = \"Workers\";\nexport const WHEN_EACH_WORKER_LAST_DID_ITS = \"When each worker last did its work\";\nexport const LAST_ERROR = \"Last error\";\nexport const LAST_PASS = \"Last pass\";\nexport const WORKER = \"Worker\";\nexport const ONLY_SUPERUSERS_SEE_THIS_ALSO_AT =\n \"Only superusers see this. Also at /api/chat/metrics, in Prometheus's format with ?format=prometheus.\";\nexport const peopleOnlineOverTheLast = (day: boolean) => `People online over the last ${day ? \"24 hours\" : \"7 days\"}`;\nexport const NOT_RECORDED = \"Not recorded.\";\nexport const NO_SAMPLES_YET_ONE_IS_TAKEN = \"No samples yet: one is taken every 5 minutes.\";\nexport const RANGE = \"Range\";\nexport const MOST_PEOPLE_ONLINE_BY_DAY = \"Most people online, by day\";\nexport const MOST_PEOPLE_ONLINE_BY_HOUR = \"Most people online, by hour\";\nexport const PEOPLE = \"People\";\nexport const HOUR = \"Hour\";\nexport const MESSAGES_PER_DAY_THE_LAST_30 = \"Messages per day, the last 30 days\";\nexport const TODAY = \"Today\";\nexport const MESSAGES_PER_DAY = \"Messages per day\";\nexport const PEOPLE_WHO_POSTED = \"People who posted\";\nexport const MESSAGES = \"Messages\";\nexport const RECORDING_IS_OFF_SITE_SETTINGS_NO =\n \"Recording is off (site settings: no_stats). Live numbers and messages are still shown; what was recorded before is dropped as it ages.\";\nexport const PEOPLE_ONLINE = \"People online\";\nexport const ON_THE_WEB = \"On the web\";\nexport const ON_ANDROID = \"On Android\";\nexport const GUESTS = \"Guests\";\nexport const PEAK_TODAY = \"Peak today\";\nexport const PEAK_7_DAYS = \"Peak, 7 days\";\nexport const USAGE = \"Usage\";\nexport const ACTIVE_24_HOURS = \"Active, 24 hours\";\nexport const ACTIVE_7_DAYS = \"Active, 7 days\";\nexport const ACTIVE_30_DAYS = \"Active, 30 days\";\nexport const TIME_ONLINE_TODAY = \"Time online today\";\nexport const TIME_ONLINE_7_DAYS = \"Time online, 7 days\";\nexport const PER_ACTIVE_PERSON = \"Per active person\";\nexport const ACTIVE_ONLINE_AT_LEAST_ONCE_TIME = \"Active: online at least once. Time online is counted every 5 minutes.\";\nexport const IN_DMS = \"In DMs\";\nexport const FILES_SENT = \"Files sent\";\nexport const REACTIONS = \"Reactions\";\nexport const ACCOUNTS = \"Accounts\";\nexport const NEW_7_DAYS = \"New, 7 days\";\nexport const MODERATORS = \"Moderators\";\nexport const BANNED = \"Banned\";\nexport const updated = (time: string | number) => `Updated ${time}`;\nexport const PAGE_NOT_FOUND = \"Page not found\";\nexport const THERE_IS_NO_SUCH_PAGE_OR = \"There is no such page, or you can't see it.\";\nexport const BACK_TO_THE_APP = \"Back to the app\";\nexport const COULDNT_LOAD_RETRYING = \"Couldn't load. Retrying\u2026\";\nexport const couldntRefreshShowing = (time: string | number) => `Couldn't refresh: showing ${time}`;\nexport const TIP_ONLINE = \"people online\";\nexport const TIP_WEB = \"on the web\";\nexport const TIP_ANDROID = \"on Android\";\nexport const TIP_GUESTS = \"guests\";\nexport const tipMessages = (n: number) => (n === 1 ? \"message\" : \"messages\");\nexport const tipPosted = (n: number) => (n === 1 ? \"person posted\" : \"people posted\");\nexport const GUESTS_NOTE = \"open tabs, not signed in\";\nexport const at = (time: string) => `at ${time}`;\nexport const ALL_PEOPLE = \"all people together\";\nexport const WEEK_AVERAGE = \"a week, on average\";\nexport const running = (busy: boolean) => (busy ? \" (running)\" : \"\");\nexport const REALTIME_INCL_GUESTS = \"realtime, incl. guests\";\nexport const slowClientsDroppedSinceTheStart = (n: number, shown: string) =>\n `${shown} slow ${n === 1 ? \"client\" : \"clients\"} dropped since the start`;\nexport const logs = (size: string | number) => `logs ${size}`;\nexport const fromTheSystem = (size: string | number) => `${size} from the system`;\nexport const ofAccounts = (percent: string | number) => `${percent} of accounts`;\nexport const peoplePosted = (n: number, shown: string) => `${shown} ${n === 1 ? \"person\" : \"people\"} posted`;\nexport const HOURS_24 = \"24 hours\";\nexport const DAYS_7 = \"7 days\";\nexport const DAYS_30 = \"30 days\";\nexport const OF_THE_30_DAYS = \"of the 30 days'\";\nexport const ON_THE_30_DAYS_MESSAGES = \"on the 30 days' messages\";\nexport const DAY = \"Day\";\nexport const NOW = \"Now\";\n", "// Light, dark or the system's (auto) theme (\u00A77.8): this device's choice, kept in localStorage. index.html's inline\n// script sets <html data-theme> before the first paint; this keeps it, and the browser's bar color, up to date.\n\nexport const THEMES = [\"auto\", \"light\", \"dark\"] as const;\nexport type Theme = (typeof THEMES)[number];\n\n/** Must match index.html's inline script. */\nexport const THEME_KEY = \"chat.theme\";\n\n/** --surface of each theme (tokens.css), for <meta name=\"theme-color\">. */\nconst BAR = { light: \"#f1eefc\", dark: \"#111214\" } as const;\n\nfunction safeLocalStorage(): Storage | null {\n try {\n return globalThis.localStorage ?? null;\n } catch {\n return null;\n }\n}\n\nexport function savedTheme(storage: Storage | null = safeLocalStorage()): Theme {\n try {\n const v = storage?.getItem(THEME_KEY);\n return v === \"light\" || v === \"dark\" ? v : \"auto\";\n } catch {\n return \"auto\";\n }\n}\n\n/** Show `theme` here: the stylesheet goes by <html data-theme>, the browser's bar by the theme-color metas. */\nexport function applyTheme(theme: Theme, doc: Document = document): void {\n const html = doc.documentElement;\n if (theme === \"auto\") delete html.dataset.theme;\n else html.dataset.theme = theme;\n for (const meta of doc.querySelectorAll<HTMLMetaElement>('meta[name=\"theme-color\"]')) {\n // Each meta's own media query says which theme it is for; a chosen theme gives both its color.\n const forTheme = meta.media.includes(\"dark\") ? \"dark\" : \"light\";\n meta.content = BAR[theme === \"auto\" ? forTheme : theme];\n }\n}\n\n/** Save and show `theme`. Storage can throw (private window, quota): the theme still changes for this page. */\nexport function setTheme(theme: Theme, storage: Storage | null = safeLocalStorage()): void {\n try {\n if (theme === \"auto\") storage?.removeItem(THEME_KEY);\n else storage?.setItem(THEME_KEY, theme);\n } catch {}\n applyTheme(theme);\n}\n\n/** Apply the saved theme and follow another tab's changes. Returns a function that stops following. */\nexport function startTheme(storage: Storage | null = safeLocalStorage()): () => void {\n applyTheme(savedTheme(storage));\n const ac = new AbortController();\n addEventListener(\n \"storage\",\n (e) => {\n if (e.key === THEME_KEY || e.key === null) applyTheme(savedTheme(storage));\n },\n { signal: ac.signal },\n );\n return () => ac.abort();\n}\n", "// The user-facing text of stats/data.ts (docs/REFACTOR.md item 56): one module per source file, so a lazy\n// screen's text stays in its own chunk. Copy changes here; a translation would replace these.\n\nexport const min = (n: number) => `${n} min`;\nexport const hours = (n: string) => `${n} h`;\nexport const sec = (n: number) => `${n} s`;\nexport const days = (n: number) => `${n} d`;\nexport const ago = (span: string) => `${span} ago`;\nexport const NOT_SINCE_START = \"not since the start\";\n", "import * as S from \"../strings/stats-data.ts\";\n// Usage statistics (DESIGN.md \u00A740): what GET /api/chat/stats answers, and the figures the page works out from it.\n// Pure, so tests/unit can check them.\n\n/** A sample: [time (epoch ms), people online, guests, people on the web, people on Android]. */\nexport type Sample = [number, number, number, number, number];\n\nexport interface Stats {\n at: number;\n /** Recording (samples, activity) is on: site.no_stats isn't ticked. */\n history: boolean;\n sample_minutes: number;\n now: { online: number; guests: number; web: number; android: number };\n /** Accounts online in the last 24 hours, 7 days and 30 days. */\n active: { day: number; week: number; month: number };\n accounts: { total: number; new_week: number; moderators: number; banned: number };\n messages: {\n /** The viewer's days (YYYY-MM-DD) with any messages, the last 30. */\n days: { day: string; messages: number; people: number }[];\n people_week: number;\n people_month: number;\n dms_month: number;\n files_month: number;\n reactions_month: number;\n };\n /** The last 7 days', oldest first. */\n samples: Sample[];\n}\n\nexport const DAY_MS = 86_400_000;\n\n/** `t`'s day in this browser's time zone, as YYYY-MM-DD. */\nexport function dayKey(t: number): string {\n const d = new Date(t);\n return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n}\n\n/** Midnight today in this browser's time zone, `back` days before it. */\nexport function midnight(now: number, back = 0): number {\n const d = new Date(now);\n d.setHours(0, 0, 0, 0);\n d.setDate(d.getDate() - back);\n return d.getTime();\n}\n\n/** The last `n` days, oldest first, each with its messages and posters (none for a day without). */\nexport function lastDays(days: Stats[\"messages\"][\"days\"], now: number, n = 30): { day: string; messages: number; people: number }[] {\n const by = new Map(days.map((d) => [d.day, d]));\n const out = [];\n for (let i = n - 1; i >= 0; i--) {\n const day = dayKey(midnight(now, i) + 12 * 3_600_000); // noon: safe across a DST change\n const d = by.get(day);\n out.push({ day, messages: d?.messages ?? 0, people: d?.people ?? 0 });\n }\n return out;\n}\n\n/** Person-hours online since `from`: each sample stands for its interval. */\nexport function personHours(samples: readonly Sample[], from: number, minutes: number): number {\n let sum = 0;\n for (const s of samples) if (s[0] >= from) sum += s[1];\n return (sum * minutes) / 60;\n}\n\n/** The most people online at once since `from`, and when (the first time it was reached); null without samples. */\nexport function peak(samples: readonly Sample[], from: number): { online: number; at: number } | null {\n let best: { online: number; at: number } | null = null;\n for (const s of samples) if (s[0] >= from && (!best || s[1] > best.online)) best = { online: s[1], at: s[0] };\n // Nobody at any time: no time to name (it said \"0 at 02:45 AM\", QA BUG-263).\n return best && !best.online ? { online: 0, at: 0 } : best;\n}\n\n/**\n * The samples since `from` as runs of a line: a gap longer than two intervals (the server was down, or recording was\n * off) ends a run, so the chart doesn't draw a line across it.\n */\nexport function runs(samples: readonly Sample[], from: number, minutes: number): Sample[][] {\n const out: Sample[][] = [];\n let run: Sample[] = [];\n let last = -Infinity;\n for (const s of samples) {\n if (s[0] < from) continue;\n if (s[0] - last > 2 * minutes * 60_000 && run.length) {\n out.push(run);\n run = [];\n }\n run.push(s);\n last = s[0];\n }\n if (run.length) out.push(run);\n return out;\n}\n\n/** A tidy top for an axis from 0: 1, 2 or 5 times a power of ten, at least `max` (and at least `min`). */\nexport function niceMax(max: number, min = 4): number {\n const v = Math.max(max, min);\n const p = 10 ** Math.floor(Math.log10(v));\n for (const m of [1, 2, 5, 10]) if (m * p >= v) return m * p;\n return 10 * p;\n}\n\n/** \"1.5 h\", \"40 min\", \"12 h\": person-time for a tile. */\nexport function formatHours(h: number): string {\n if (h < 1) return `${Math.round(h * 60)} min`;\n if (h < 10) return S.hours((Math.round(h * 10) / 10).toLocaleString());\n return `${Math.round(h).toLocaleString()} h`;\n}\n\n/** `part` of `whole` as a whole percent (\"\u2013\" with nothing to divide). */\nexport function percent(part: number, whole: number): string {\n return whole > 0 ? `${Math.round((part / whole) * 100)}%` : \"\u2013\";\n}\n\n/** What GET /api/chat/metrics answers a superuser (REFACTOR item 51, server/metrics.go). */\nexport interface Metrics {\n at: string;\n version: string;\n pocketbase: string;\n uptime_seconds: number;\n queues: Record<string, { rows: number; failing: number; oldest_seconds: number }>;\n /** last_pass, last_error_at: RFC 3339, \"\" for not since the start. */\n workers: Record<string, { last_pass: string; last_error: string; last_error_at: string; running: boolean }>;\n realtime: { clients: number; senders: number; queued: number; dropped: number };\n db: Record<string, number>;\n process: { goroutines: number; heap_bytes: number; sys_bytes: number; gc_runs: number };\n}\n\n/** \"12 KB\", \"3.4 MB\", \"1.2 GB\". */\nexport function formatBytes(n: number): string {\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n let i = 0;\n while (n >= 1024 && i < units.length - 1) {\n n /= 1024;\n i++;\n }\n return `${i && n < 10 ? (Math.round(n * 10) / 10).toLocaleString() : Math.round(n).toLocaleString()} ${units[i]}`;\n}\n\n/** A span of seconds, short: \"40 s\", \"12 min\", \"5 h\", \"3 d\". */\nexport function formatSpan(s: number): string {\n if (s < 60) return `${Math.round(s)} s`;\n if (s < 3600) return S.min(Math.round(s / 60));\n if (s < 86_400) return S.hours(String(Math.round(s / 3600)));\n return S.days(Math.round(s / 86_400));\n}\n\n/** How long before `now` (epoch ms) an RFC 3339 time was, \"12 min ago\"; `never` when there is none. */\nexport function ago(at: string, now: number, never = \"not since the start\"): string {\n const t = Date.parse(at);\n return at && !Number.isNaN(t) ? S.ago(formatSpan(Math.max(0, (now - t) / 1000))) : never;\n}\n", "// The usage statistics page (DESIGN.md \u00A740), /stats: a page of its own (stats.html), not the app's. It asks\n// GET /api/chat/stats with the session this browser has: the app's (a moderator), else the admin UI's (a superuser,\n// signed in at /_/ on this server). Anyone else is told there is no such page. Counts only; refreshed every 30 s\n// while the tab is visible. A superuser also sees the server's state (GET /api/chat/metrics, REFACTOR item 51).\n\nimport { type Child, clear, h } from \"../dom.ts\";\nimport * as S from \"../strings/stats-main.ts\";\nimport { applyTheme, savedTheme } from \"../theme.ts\";\nimport {\n ago,\n DAY_MS,\n formatBytes,\n formatHours,\n formatSpan,\n lastDays,\n type Metrics,\n midnight,\n niceMax,\n peak,\n percent,\n personHours,\n runs,\n type Sample,\n type Stats,\n} from \"./data.ts\";\n\nconst REFRESH_MS = 30_000;\n/** The app's session (web/src/pb.ts), and PocketBase's admin UI's (0.40: \"__pb_superusers__\" + its base path). */\nconst SESSIONS = [\"pocketbase_auth\", \"__pb_superusers__/_\"];\nconst SVG = \"http://www.w3.org/2000/svg\";\n\nconst root = document.getElementById(\"stats\") as HTMLElement;\nconst updated = document.getElementById(\"stats-updated\") as HTMLElement;\nconst num = new Intl.NumberFormat();\nconst time = new Intl.DateTimeFormat(undefined, { hour: \"2-digit\", minute: \"2-digit\" });\nconst dayTime = new Intl.DateTimeFormat(undefined, { weekday: \"short\", hour: \"2-digit\", minute: \"2-digit\" });\nconst dayName = new Intl.DateTimeFormat(undefined, { weekday: \"short\", day: \"numeric\", month: \"short\" });\nconst shortDay = new Intl.DateTimeFormat(undefined, { day: \"numeric\", month: \"short\" });\n\nlet range: \"day\" | \"week\" = \"day\";\nlet last: Stats | null = null;\nlet metrics: Metrics | null = null;\nlet refocus = false;\n\n/** The stored sessions' tokens; `superusers`: only superusers' (QA BUG-275: a moderator was refused the metrics every 30 s). */\nfunction tokens(superusers = false): string[] {\n const out: string[] = [];\n for (const key of SESSIONS) {\n try {\n const session = JSON.parse(localStorage.getItem(key) || \"{}\");\n const token = session?.token;\n if (superusers && session?.record?.collectionName !== \"_superusers\") continue;\n if (typeof token === \"string\" && token) out.push(token);\n } catch {}\n }\n return out;\n}\n\n/** The statistics, with the first session that may see them; \"denied\" when none may; null when it failed. */\nasync function load(): Promise<Stats | \"denied\" | null> {\n const tz = -new Date().getTimezoneOffset();\n for (const token of tokens()) {\n try {\n const res = await fetch(`/api/chat/stats?tz=${tz}`, { headers: { Authorization: token } });\n if (res.ok) return (await res.json()) as Stats;\n if (res.status !== 401 && res.status !== 403) return null;\n } catch {\n return null;\n }\n }\n return \"denied\";\n}\n\n/** The server's metrics, for a superuser's session; null for anyone else, or when they couldn't be had. */\nasync function loadMetrics(): Promise<Metrics | null> {\n for (const token of tokens(true)) {\n try {\n const res = await fetch(\"/api/chat/metrics\", { headers: { Authorization: token, Accept: \"application/json\" } });\n if (res.ok) return (await res.json()) as Metrics;\n } catch {\n return null;\n }\n }\n return null;\n}\n\n// ---- pieces ----\n\nfunction tile(label: string, value: string, note?: string, big = false): HTMLElement {\n return h(\"div\", { class: big ? \"tile big\" : \"tile\" }, [\n h(\"div\", { class: \"tile-label\" }, label),\n h(\"div\", { class: \"tile-value\" }, value),\n note ? h(\"div\", { class: \"tile-note\" }, note) : null,\n ]);\n}\n\nfunction section(title: string, children: Child[], hint?: string): HTMLElement {\n return h(\"section\", { class: \"card\" }, [h(\"h2\", {}, title), hint ? h(\"p\", { class: \"hint\" }, hint) : null, ...children]);\n}\n\nfunction svg<K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string | number> = {}): SVGElementTagNameMap[K] {\n const el = document.createElementNS(SVG, tag);\n for (const [k, v] of Object.entries(attrs)) el.setAttribute(k, String(v));\n return el;\n}\n\n/** A table of the chart's numbers, folded away: the values without hovering. */\nfunction table(caption: string, head: string[], rows: (string | number)[][]): HTMLElement {\n return h(\"details\", { class: \"chart-table\" }, [h(\"summary\", {}, \"Show as a table\"), grid(caption, head, rows)]);\n}\n\nfunction grid(caption: string, head: string[], rows: (string | number)[][]): HTMLElement {\n return h(\"table\", {}, [\n h(\"caption\", {}, caption),\n h(\n \"thead\",\n {},\n h(\n \"tr\",\n {},\n head.map((c) => h(\"th\", { scope: \"col\" }, c)),\n ),\n ),\n h(\n \"tbody\",\n {},\n rows.map((r) =>\n h(\n \"tr\",\n {},\n r.map((c, i) => (i ? h(\"td\", {}, typeof c === \"number\" ? num.format(c) : c) : h(\"th\", { scope: \"row\" }, String(c)))),\n ),\n ),\n ),\n ]);\n}\n\n/** The queues' and workers' names as people read them. */\nconst LABELS: Record<string, string> = {\n telegram: \"Telegram\",\n federation: \"Linked instances\",\n link_previews: \"Link previews\",\n media_thumbs: \"Thumbnails to make\",\n media_sizes: \"Video shapes to read\",\n media_moves: \"Files to move\",\n storage_cleanup: \"Storage to clean up\",\n account_jobs: \"Exports and deleted accounts\",\n account: \"Exports and deleted accounts\",\n previews: \"Link previews\",\n media: \"Media\",\n retention: \"Daily prune\",\n};\nconst named = (k: string) => LABELS[k] ?? k;\n\n/** The server's state, for a superuser (GET /api/chat/metrics). */\nfunction serverSection(m: Metrics): HTMLElement {\n const now = Date.parse(m.at) || Date.now();\n const db = (m.db[\"data.db\"] ?? 0) + (m.db[\"data.db-wal\"] ?? 0);\n const logs = (m.db[\"auxiliary.db\"] ?? 0) + (m.db[\"auxiliary.db-wal\"] ?? 0);\n const queues = Object.entries(m.queues).sort(([a], [b]) => named(a).localeCompare(named(b)));\n const workers = Object.entries(m.workers).sort(([a], [b]) => named(a).localeCompare(named(b)));\n return section(\n \"Server\",\n [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"Up for\", formatSpan(m.uptime_seconds), `Chirkle ${m.version}, PocketBase ${m.pocketbase}`),\n tile(\"Connections\", num.format(m.realtime.clients), \"realtime, incl. guests\"),\n tile(\n \"Live events waiting\",\n num.format(m.realtime.queued),\n S.slowClientsDroppedSinceTheStart(m.realtime.dropped, num.format(m.realtime.dropped)),\n ),\n tile(\"Database\", formatBytes(db), `logs ${formatBytes(logs)}`),\n tile(\"Memory\", formatBytes(m.process.heap_bytes), `${formatBytes(m.process.sys_bytes)} from the system`),\n ]),\n h(\"h3\", {}, \"Queues\"),\n h(\n \"div\",\n { class: \"chart-table\" },\n grid(\n \"Rows waiting for a worker\",\n [\"Queue\", \"Rows\", \"Failed once or more\", \"Oldest\"],\n queues.map(([k, q]) => [named(k), q.rows, q.failing, q.rows ? formatSpan(q.oldest_seconds) : \"\u2013\"]),\n ),\n ),\n h(\"h3\", {}, \"Workers\"),\n h(\n \"div\",\n { class: \"chart-table\" },\n grid(\n \"When each worker last did its work\",\n [\"Worker\", \"Last pass\", \"Last error\"],\n workers.map(([k, w]) => [\n named(k),\n `${ago(w.last_pass, now)}${S.running(w.running)}`,\n w.last_error ? `${w.last_error} (${ago(w.last_error_at, now)})` : \"\u2013\",\n ]),\n ),\n ),\n ],\n \"Only superusers see this. Also at /api/chat/metrics, in Prometheus's format with ?format=prometheus.\",\n );\n}\n\n// The charts are drawn at their box's own width (set by render), so their text stays its size on a phone.\nlet W = 720;\nlet H = 220;\n/** Narrow: fewer labels along the bottom. */\nconst narrow = () => W < 520;\nconst PAD = { top: 12, right: 12, bottom: 26, left: 36 };\n\n/** Gridlines and y labels at 0, half (when a whole number) and the top. */\nfunction yAxis(g: SVGGElement, top: number) {\n for (const v of [0, top / 2, top].filter(Number.isInteger)) {\n const y = PAD.top + (H - PAD.top - PAD.bottom) * (1 - v / top);\n g.append(svg(\"line\", { x1: PAD.left, x2: W - PAD.right, y1: y, y2: y, class: \"grid\" }));\n const t = svg(\"text\", { x: PAD.left - 6, y: y + 4, \"text-anchor\": \"end\", class: \"axis\" });\n t.textContent = num.format(v);\n g.append(t);\n }\n}\n\n/** A label along the bottom at `x`; near an edge it is anchored inward, so it isn't cut off. */\nfunction xLabel(g: SVGGElement, x: number, text: string) {\n const anchor = x > W - PAD.right - 32 ? \"end\" : x < PAD.left + 32 ? \"start\" : \"middle\";\n const t = svg(\"text\", { x: anchor === \"end\" ? Math.min(x + 6, W - 2) : x, y: H - 8, \"text-anchor\": anchor, class: \"axis\" });\n t.textContent = text;\n g.append(t);\n}\n\n/** The tooltip of a chart, placed over its box at `x` (0..1 of the width). */\nfunction tooltip(box: HTMLElement) {\n const tip = h(\"div\", { class: \"tip\", role: \"status\", hidden: true });\n box.append(tip);\n return {\n show(x: number, lines: [string, string][], title: string) {\n clear(tip);\n tip.append(h(\"div\", { class: \"tip-title\" }, title));\n for (const [value, label] of lines) tip.append(h(\"div\", {}, [h(\"strong\", {}, value), ` ${label}`]));\n tip.hidden = false;\n const left = Math.min(Math.max(x * box.clientWidth, tip.offsetWidth / 2 + 4), box.clientWidth - tip.offsetWidth / 2 - 4);\n tip.style.left = `${left}px`;\n },\n hide() {\n tip.hidden = true;\n },\n };\n}\n\n/** People online over the last 24 hours or 7 days: a line with a light area under it, and a crosshair. */\nfunction onlineChart(s: Stats): HTMLElement {\n const now = s.at;\n const from = now - (range === \"day\" ? DAY_MS : 7 * DAY_MS);\n const parts = runs(s.samples, from, s.sample_minutes);\n const shown = parts.flat();\n const top = niceMax(Math.max(0, ...shown.map((x) => x[1])));\n const plotW = W - PAD.left - PAD.right;\n const plotH = H - PAD.top - PAD.bottom;\n const xOf = (t: number) => PAD.left + ((t - from) / (now - from)) * plotW;\n const yOf = (v: number) => PAD.top + plotH * (1 - v / top);\n\n const chart = svg(\"svg\", { viewBox: `0 0 ${W} ${H}`, class: \"chart\", role: \"img\" });\n chart.setAttribute(\"aria-label\", S.peopleOnlineOverTheLast(range === \"day\"));\n const g = svg(\"g\");\n chart.append(g);\n yAxis(g, top);\n // x labels: every 6 hours, or each day at midnight.\n const ticks: number[] = [];\n if (range === \"day\") {\n const first = Math.ceil(from / (6 * 3_600_000)) * 6 * 3_600_000;\n for (let t = first; t <= now; t += 6 * 3_600_000) ticks.push(t);\n } else {\n for (let i = 6; i >= 0; i--) if (!narrow() || i % 2 === 0) ticks.push(midnight(now, i));\n }\n for (const t of ticks) {\n // A tick at either edge goes unlabeled: its label would run off or into the next.\n if (t < from || xOf(t) > W - PAD.right - 28) continue;\n xLabel(g, xOf(t), range === \"day\" ? time.format(t) : shortDay.format(t));\n }\n const base = yOf(0);\n for (const run of parts) {\n const pts = run.map((x) => `${xOf(x[0]).toFixed(1)},${yOf(x[1]).toFixed(1)}`);\n if (run.length === 1) {\n g.append(svg(\"circle\", { cx: xOf(run[0]![0]), cy: yOf(run[0]![1]), r: 3, class: \"dot\" }));\n continue;\n }\n g.append(svg(\"polygon\", { points: `${xOf(run[0]![0])},${base} ${pts.join(\" \")} ${xOf(run.at(-1)![0])},${base}`, class: \"area\" }));\n g.append(svg(\"polyline\", { points: pts.join(\" \"), class: \"line\" }));\n }\n const cross = svg(\"line\", { y1: PAD.top, y2: base, class: \"cross\", visibility: \"hidden\" });\n const mark = svg(\"circle\", { r: 4.5, class: \"mark\", visibility: \"hidden\" });\n g.append(cross, mark);\n\n const box = h(\"div\", { class: \"chart-box\" }, [chart]);\n if (!shown.length) box.append(h(\"p\", { class: \"empty\" }, s.history ? \"No samples yet: one is taken every 5 minutes.\" : \"Not recorded.\"));\n const tip = tooltip(box);\n const nearest = (clientX: number): Sample | null => {\n const r = chart.getBoundingClientRect();\n const t = from + ((((clientX - r.left) / r.width) * W - PAD.left) / plotW) * (now - from);\n let best: Sample | null = null;\n for (const x of shown) if (!best || Math.abs(x[0] - t) < Math.abs(best[0] - t)) best = x;\n return best;\n };\n const show = (x: Sample | null) => {\n if (!x) return;\n const cx = xOf(x[0]);\n for (const el of [cross, mark]) el.setAttribute(\"visibility\", \"visible\");\n cross.setAttribute(\"x1\", String(cx));\n cross.setAttribute(\"x2\", String(cx));\n mark.setAttribute(\"cx\", String(cx));\n mark.setAttribute(\"cy\", String(yOf(x[1])));\n tip.show(\n cx / W,\n [\n [num.format(x[1]), \"people online\"],\n [num.format(x[3]), \"on the web\"],\n [num.format(x[4]), \"on Android\"],\n [num.format(x[2]), \"guests\"],\n ],\n (range === \"day\" ? time : dayTime).format(x[0]),\n );\n };\n const hide = () => {\n for (const el of [cross, mark]) el.setAttribute(\"visibility\", \"hidden\");\n tip.hide();\n };\n chart.addEventListener(\"pointermove\", (e) => show(nearest(e.clientX)));\n chart.addEventListener(\"pointerleave\", hide);\n // Keys: the chart takes focus, and \u2190 \u2192 step through the samples.\n let at = shown.length - 1;\n chart.setAttribute(\"tabindex\", \"0\");\n chart.addEventListener(\"focus\", () => show(shown[at] ?? null));\n chart.addEventListener(\"blur\", hide);\n chart.addEventListener(\"keydown\", (e) => {\n if (e.key !== \"ArrowLeft\" && e.key !== \"ArrowRight\") return;\n e.preventDefault();\n at = Math.max(0, Math.min(shown.length - 1, at + (e.key === \"ArrowLeft\" ? -1 : 1)));\n show(shown[at] ?? null);\n });\n\n // The table: hourly in the last 24 hours, else daily peaks.\n const rows: (string | number)[][] = [];\n if (range === \"day\") {\n for (let t = Math.floor(from / 3_600_000) * 3_600_000; t <= now; t += 3_600_000) {\n const p = peak(\n shown.filter((x) => x[0] < t + 3_600_000),\n t,\n );\n if (p) rows.push([time.format(t), p.online]);\n }\n } else {\n for (let i = 6; i >= 0; i--) {\n const start = midnight(now, i);\n const p = peak(\n shown.filter((x) => x[0] < start + DAY_MS),\n start,\n );\n if (p) rows.push([dayName.format(start), p.online]);\n }\n }\n\n const picker = h(\"div\", { class: \"seg\", role: \"group\", \"aria-label\": \"Range\" }, [\n rangeButton(\"day\", \"24 hours\"),\n rangeButton(\"week\", \"7 days\"),\n ]);\n return h(\"div\", {}, [\n picker,\n box,\n table(range === \"day\" ? \"Most people online, by hour\" : \"Most people online, by day\", [range === \"day\" ? \"Hour\" : \"Day\", \"People\"], rows),\n ]);\n}\n\nfunction rangeButton(value: typeof range, label: string): HTMLElement {\n return h(\n \"button\",\n {\n type: \"button\",\n \"aria-pressed\": String(range === value),\n on: {\n click: () => {\n range = value;\n refocus = true;\n if (last) render(last);\n },\n },\n },\n label,\n );\n}\n\n/** Messages per day, the last 30 days: columns, each with its tooltip. */\nfunction messagesChart(s: Stats): HTMLElement {\n const days = lastDays(s.messages.days, s.at);\n const top = niceMax(Math.max(0, ...days.map((d) => d.messages)));\n const plotW = W - PAD.left - PAD.right;\n const plotH = H - PAD.top - PAD.bottom;\n const slot = plotW / days.length;\n const bw = Math.min(16, slot - 2);\n const chart = svg(\"svg\", { viewBox: `0 0 ${W} ${H}`, class: \"chart\", role: \"img\" });\n chart.setAttribute(\"aria-label\", \"Messages per day, the last 30 days\");\n const g = svg(\"g\");\n chart.append(g);\n yAxis(g, top);\n const box = h(\"div\", { class: \"chart-box\" }, [chart]);\n const tip = tooltip(box);\n days.forEach((d, i) => {\n const x = PAD.left + i * slot + (slot - bw) / 2;\n const bh = (d.messages / top) * plotH;\n const y = PAD.top + plotH - bh;\n const r = Math.min(4, bw / 2, bh);\n // A column, rounded at the top, square at the baseline.\n if (bh > 0) {\n g.append(\n svg(\"path\", {\n d: `M${x},${y + bh}V${y + r}Q${x},${y} ${x + r},${y}H${x + bw - r}Q${x + bw},${y} ${x + bw},${y + r}V${y + bh}Z`,\n class: \"bar\",\n }),\n );\n }\n const date = new Date(`${d.day}T12:00:00`);\n const every = narrow() ? 10 : 5;\n if (i % every === every - 1 || i === days.length - 1) {\n xLabel(g, x + bw / 2, i === days.length - 1 ? \"Today\" : shortDay.format(date));\n }\n // The hit target: the whole slot, top to bottom.\n const hit = svg(\"rect\", { x: PAD.left + i * slot, y: PAD.top, width: slot, height: plotH, class: \"hit\" });\n const show = () =>\n tip.show(\n (x + bw / 2) / W,\n [\n [num.format(d.messages), S.tipMessages(d.messages)],\n [num.format(d.people), S.tipPosted(d.people)],\n ],\n dayName.format(date),\n );\n hit.addEventListener(\"pointerenter\", show);\n hit.addEventListener(\"pointerleave\", () => tip.hide());\n g.append(hit);\n });\n return h(\"div\", {}, [\n box,\n table(\n \"Messages per day\",\n [\"Day\", \"Messages\", \"People who posted\"],\n days.map((d) => [dayName.format(new Date(`${d.day}T12:00:00`)), d.messages, d.people]),\n ),\n ]);\n}\n\n// ---- the page ----\n\nfunction render(s: Stats) {\n last = s;\n // The card's inner width: the page's, less its padding and the card's.\n W = Math.round(Math.min(928, Math.max(280, root.clientWidth - 66)));\n H = narrow() ? 180 : 220;\n const now = s.at;\n const today = midnight(now);\n const days = lastDays(s.messages.days, now);\n const sum = (n: number) => days.slice(-n).reduce((a, d) => a + d.messages, 0);\n const month = sum(30);\n const peakToday = peak(s.samples, today);\n const peakWeek = peak(s.samples, now - 7 * DAY_MS);\n const hoursToday = personHours(s.samples, today, s.sample_minutes);\n const hoursWeek = personHours(s.samples, now - 7 * DAY_MS, s.sample_minutes);\n const recorded = (v: string) => (s.history || s.samples.length ? v : \"\u2013\");\n\n const sections = [\n !s.history ? h(\"p\", { class: \"notice\", role: \"note\" }, \"Recording is off (site settings: no_stats). Live numbers and messages are still shown; what was recorded before is dropped as it ages.\") : null,\n section(\"Now\", [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"People online\", num.format(s.now.online), undefined, true),\n tile(\"On the web\", num.format(s.now.web)),\n tile(\"On Android\", num.format(s.now.android)),\n tile(\"Guests\", num.format(s.now.guests), \"open tabs, not signed in\"),\n tile(\n \"Peak today\",\n recorded(peakToday ? num.format(peakToday.online) : \"\u2013\"),\n peakToday?.at ? `at ${time.format(peakToday.at)}` : undefined,\n ),\n tile(\"Peak, 7 days\", recorded(peakWeek ? num.format(peakWeek.online) : \"\u2013\"), peakWeek?.at ? dayTime.format(peakWeek.at) : undefined),\n ]),\n ]),\n section(\n \"Usage\",\n [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"Active, 24 hours\", num.format(s.active.day), `${percent(s.active.day, s.accounts.total)} of accounts`),\n tile(\"Active, 7 days\", num.format(s.active.week), `${percent(s.active.week, s.accounts.total)} of accounts`),\n tile(\"Active, 30 days\", num.format(s.active.month), `${percent(s.active.month, s.accounts.total)} of accounts`),\n tile(\"Time online today\", recorded(formatHours(hoursToday)), \"all people together\"),\n tile(\"Time online, 7 days\", recorded(formatHours(hoursWeek)), \"all people together\"),\n tile(\"Per active person\", recorded(s.active.week ? formatHours(hoursWeek / s.active.week) : \"\u2013\"), \"a week, on average\"),\n ]),\n h(\"h3\", {}, \"People online\"),\n onlineChart(s),\n ],\n \"Active: online at least once. Time online is counted every 5 minutes.\",\n ),\n section(\"Messages\", [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"Today\", num.format(days.at(-1)?.messages ?? 0)),\n tile(\"7 days\", num.format(sum(7)), S.peoplePosted(s.messages.people_week, num.format(s.messages.people_week))),\n tile(\"30 days\", num.format(month), S.peoplePosted(s.messages.people_month, num.format(s.messages.people_month))),\n tile(\"In DMs\", percent(s.messages.dms_month, month), \"of the 30 days'\"),\n tile(\"Files sent\", num.format(s.messages.files_month), \"30 days\"),\n tile(\"Reactions\", num.format(s.messages.reactions_month), \"on the 30 days' messages\"),\n ]),\n h(\"h3\", {}, \"Messages per day\"),\n messagesChart(s),\n ]),\n section(\"Accounts\", [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"Accounts\", num.format(s.accounts.total)),\n tile(\"New, 7 days\", num.format(s.accounts.new_week)),\n tile(\"Moderators\", num.format(s.accounts.moderators)),\n tile(\"Banned\", num.format(s.accounts.banned)),\n ]),\n ]),\n metrics ? serverSection(metrics) : null,\n ];\n // Keep the open tables open across a refresh.\n const open = [...root.querySelectorAll(\"details\")].map((d) => d.open);\n clear(root);\n for (const el of sections) if (el) root.append(el);\n root.querySelectorAll(\"details\").forEach((d, i) => {\n d.open = !!open[i];\n });\n // A range button was pressed: it is a new one now, focused as the old one was.\n if (refocus) root.querySelector<HTMLElement>(\".seg [aria-pressed='true']\")?.focus();\n refocus = false;\n updated.textContent = `Updated ${new Date(now).toLocaleTimeString()}`;\n}\n\nfunction denied() {\n document.title = \"Page not found\";\n clear(root);\n root.append(\n h(\"section\", { class: \"card missing\" }, [\n h(\"h2\", {}, \"Page not found\"),\n h(\"p\", {}, \"There is no such page, or you can't see it.\"),\n h(\"a\", { href: \"/\" }, \"Back to the app\"),\n ]),\n );\n updated.textContent = \"\";\n}\n\nlet timer = 0;\nasync function refresh() {\n clearTimeout(timer);\n const [got, m] = await Promise.all([load(), loadMetrics()]);\n if (got === \"denied\") return denied();\n metrics = m;\n if (got) render(got);\n else updated.textContent = last ? `Couldn't refresh: showing ${new Date(last.at).toLocaleTimeString()}` : \"Couldn't load. Retrying\u2026\";\n if (!document.hidden) timer = window.setTimeout(refresh, REFRESH_MS);\n}\n\napplyTheme(savedTheme());\nlet drawnFor = root.clientWidth;\nlet resizing = 0;\naddEventListener(\"resize\", () => {\n clearTimeout(resizing);\n resizing = window.setTimeout(() => {\n if (!last || Math.abs(root.clientWidth - drawnFor) < 8) return;\n drawnFor = root.clientWidth;\n render(last);\n }, 150);\n});\ndocument.addEventListener(\"visibilitychange\", () => {\n if (!document.hidden) void refresh();\n else clearTimeout(timer);\n});\nvoid refresh();\n"],
|
|
5
|
-
"mappings": "AAiBA,IAAMA,GAAQ,IAAI,IAAI,CAAC,QAAS,SAAS,CAAC,EAEnC,SAASC,EAAyCC,EAAQC,EAAe,CAAC,EAAGC,EAAsD,CACxI,IAAMC,EAAK,SAAS,cAAcH,CAAG,EAC/B,CAAE,MAAOI,EAAK,QAAAC,EAAS,GAAIC,EAAW,OAAAC,EAAQ,GAAGC,CAAK,EAAIP,EAC5DG,IAAKD,EAAG,UAAYC,GACpBC,GAAS,OAAO,OAAOF,EAAG,QAASE,CAAO,EAC9C,OAAW,CAACI,EAAMC,CAAC,IAAK,OAAO,QAAQF,CAAI,EAClBE,GAAM,MAAQA,IAAM,KACvCZ,GAAM,IAAIW,CAAI,EAAIN,EAA0CM,CAAI,EAAIC,EACnEP,EAAG,aAAaM,EAAMC,IAAM,GAAO,GAAK,OAAOA,CAAC,CAAC,GAExD,GAAIJ,EACF,OAAW,CAACK,EAAMC,CAAE,IAAK,OAAO,QAAQN,CAAS,EAC/CH,EAAG,iBAAiBQ,EAAMC,EAAqBL,EAAS,CAAE,OAAAA,CAAO,EAAI,MAAS,EAGlF,OAAAM,GAAOV,EAAID,CAAQ,EACZC,CACT,CAEO,SAASU,GAAOV,EAAUD,EAAiC,CAChE,QAAWY,KAAK,MAAM,QAAQZ,CAAQ,EAAIA,EAAW,CAACA,CAAQ,EACxDY,GAAM,MAA2BA,IAAM,IAC3CX,EAAG,YAAY,OAAOW,GAAM,SAAWA,EAAI,SAAS,eAAe,OAAOA,CAAC,CAAC,CAAC,CAEjF,CASO,SAASC,EAAMC,EAAmB,CACvCA,EAAG,gBAAgB,CACrB,CCpBO,I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IC,GAAQ,CAErC,CAAC,EACIA,GAAQ",
|
|
6
|
-
"names": ["PROPS", "h", "tag", "attrs", "children", "el", "cls", "dataset", "listeners", "signal", "rest", "name", "v", "type", "fn", "append", "c", "clear", "el", "peopleOnlineOverTheLast", "day", "tipMessages", "n", "tipPosted", "running", "busy", "slowClientsDroppedSinceTheStart", "n", "shown", "peoplePosted", "n", "shown", "THEME_KEY", "BAR", "safeLocalStorage", "savedTheme", "storage", "v", "applyTheme", "theme", "doc", "html", "meta", "forTheme", "min", "n", "hours", "days", "n", "ago", "span", "DAY_MS", "dayKey", "t", "d", "midnight", "now", "back", "lastDays", "days", "by", "out", "i", "day", "personHours", "samples", "from", "minutes", "sum", "peak", "best", "s", "runs", "run", "last", "niceMax", "max", "min", "v", "p", "m", "formatHours", "h", "hours", "percent", "part", "whole", "formatBytes", "n", "units", "formatSpan", "ago", "at", "never", "REFRESH_MS", "SESSIONS", "SVG", "root", "updated", "num", "time", "dayTime", "dayName", "shortDay", "range", "last", "metrics", "refocus", "tokens", "superusers", "out", "key", "session", "token", "load", "tz", "res", "loadMetrics", "tile", "label", "value", "note", "big", "h", "section", "title", "children", "hint", "svg", "tag", "attrs", "el", "k", "v", "table", "caption", "head", "rows", "grid", "c", "r", "i", "LABELS", "named", "serverSection", "m", "now", "db", "logs", "queues", "a", "b", "workers", "formatSpan", "slowClientsDroppedSinceTheStart", "formatBytes", "q", "w", "ago", "running", "W", "H", "narrow", "PAD", "yAxis", "g", "top", "y", "t", "xLabel", "x", "text", "anchor", "tooltip", "box", "tip", "lines", "clear", "left", "onlineChart", "s", "from", "DAY_MS", "parts", "runs", "shown", "niceMax", "plotW", "plotH", "xOf", "yOf", "chart", "peopleOnlineOverTheLast", "ticks", "first", "midnight", "base", "run", "pts", "cross", "mark", "nearest", "clientX", "best", "show", "cx", "hide", "e", "at", "p", "peak", "start", "picker", "rangeButton", "render", "messagesChart", "days", "lastDays", "d", "slot", "bw", "bh", "date", "every", "hit", "tipMessages", "tipPosted", "today", "sum", "n", "month", "peakToday", "peakWeek", "hoursToday", "personHours", "hoursWeek", "recorded", "sections", "percent", "formatHours", "peoplePosted", "open", "denied", "timer", "refresh", "got", "applyTheme", "savedTheme", "drawnFor", "resizing"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
dialog.viewer{color-scheme:dark;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#0b0a10;color:#eceaf4;overscroll-behavior:contain}dialog.viewer[open]{display:grid;grid-template:auto minmax(0,1fr) / minmax(0,1fr);animation:viewer-in .15s ease-out}dialog.viewer::backdrop{background:transparent}.viewer-bar{display:flex;align-items:center;gap:.5rem;padding:max(.5rem,env(safe-area-inset-top)) max(.75rem,env(safe-area-inset-right)) .5rem max(.75rem,env(safe-area-inset-left))}.viewer-caption{flex:1;min-width:0}.viewer-caption>*{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.viewer-caption h2{font-size:1rem}.viewer-meta,.viewer-count{color:#bdb7d3;font-size:.875rem}.viewer-count{font-variant-numeric:tabular-nums}.viewer-button{display:inline-grid;place-items:center;flex:none;width:2.5rem;height:2.5rem;padding:0;border:0;border-radius:10px;background:#ffffff12;color:inherit;font-size:1.5rem;line-height:1;text-decoration:none}.viewer-jump:before{content:"";width:1.375rem;height:1.375rem;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat}.viewer-button:hover{background:#ffffff38}.viewer :focus-visible{outline-color:#fff}.viewer-stage{position:relative;display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);place-items:center;min-height:0;padding:0 0 env(safe-area-inset-bottom);overflow:hidden;touch-action:pan-y pinch-zoom}.viewer-stage img,.viewer-stage video{max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;transition:opacity .15s}.viewer-stage.loading img,.viewer-stage.loading video{opacity:0}.viewer-stage.loading:after{content:"";position:absolute;width:2.5rem;height:2.5rem;border:3px solid rgb(255 255 255 / 25%);border-top-color:#fff;border-radius:50%;opacity:0;animation:viewer-show 0s .2s forwards,viewer-spin .8s linear infinite}.viewer-error .link{color:inherit;text-decoration:underline}.viewer-prev,.viewer-next{position:absolute;top:50%;translate:0 -50%;font-size:2rem;background:#0d0b1499}.viewer-prev:hover,.viewer-next:hover{background:#0d0b14cc}.viewer-prev{left:max(.75rem,env(safe-area-inset-left))}.viewer-next{right:max(.75rem,env(safe-area-inset-right))}@keyframes viewer-in{0%{opacity:0}}@keyframes viewer-show{to{opacity:1}}@keyframes viewer-spin{to{rotate:1turn}}
|
|
2
|
-
/*# sourceMappingURL=viewer-P7GYCBYM.css.map */
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/pb_public/assets/{mention-suggest-ODJD2IC5.js.map → mention-suggest-K3UUHR4D.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|