pi-roundtable-web 0.27.0 → 0.28.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/CHANGELOG.md +37 -0
- package/README.md +23 -7
- package/dist/chunk-account-678dgbww.js +1 -0
- package/dist/chunk-action-menu-qpp9bdxh.js +1 -0
- package/dist/chunk-agent-x0yvvdq2.js +1 -0
- package/dist/chunk-arranged-rooms-6rdkk8t1.js +1 -0
- package/dist/chunk-bulk-actions-zbwdaxtc.js +1 -0
- package/dist/chunk-character-creator-215psy17.js +1 -0
- package/dist/chunk-codeeditor-jgj32247.js +2 -0
- package/dist/chunk-confirm-2pzrt272.js +1 -0
- package/dist/chunk-connectors-zha2d834.js +37 -0
- package/dist/chunk-conversations-fb071rez.js +1 -0
- package/dist/chunk-council-sheet-k5fycefd.js +2 -0
- package/dist/chunk-drag-04qfef58.js +1 -0
- package/dist/chunk-entry-mws704mc.js +1 -0
- package/dist/chunk-folder-list-qxhmczwv.js +1 -0
- package/dist/chunk-folds-b7asegfs.js +1 -0
- package/dist/chunk-gate-vxetvn8t.js +1 -0
- package/dist/chunk-group-scene-63yhh1mh.js +1 -0
- package/dist/chunk-group-table-zy4hmgk3.js +1 -0
- package/dist/chunk-host-icons-tyktazzz.js +1 -0
- package/dist/chunk-host-picture-ebhejn2k.js +1 -0
- package/dist/chunk-host-state-wajep0yr.js +1 -0
- package/dist/chunk-host-ui-pc9r24e3.js +1 -0
- package/dist/chunk-index-1af8vsyb.js +2 -0
- package/dist/{chunk-index-g1awv7rk.js → chunk-index-20xgx0k2.js} +2 -2
- package/dist/chunk-index-254701sm.js +3 -0
- package/dist/{chunk-index-ffbrm6tr.js → chunk-index-2822z600.js} +3 -3
- package/dist/{chunk-index-2fdns8tn.js → chunk-index-2hvn2kte.js} +2 -2
- package/dist/chunk-index-2syyyjnq.js +2 -0
- package/dist/chunk-index-2tr41qht.js +2 -0
- package/dist/chunk-index-2y8r4s4f.js +2 -0
- package/dist/chunk-index-31m1b2f5.js +2 -0
- package/dist/{chunk-index-ak6ecqy3.js → chunk-index-3gfbhmpb.js} +2 -2
- package/dist/chunk-index-3yy10a5h.js +2 -0
- package/dist/{chunk-index-sm7m4fej.js → chunk-index-4t6vnwap.js} +2 -2
- package/dist/{chunk-index-j4x9dq30.css → chunk-index-5hbq6g2e.css} +1 -1
- package/dist/chunk-index-5t2jkecy.js +2 -0
- package/dist/chunk-index-5vatmakn.js +2 -0
- package/dist/{chunk-index-zyvwhxga.js → chunk-index-6cg8xp1c.js} +1 -1
- package/dist/chunk-index-6yra9kdq.js +2 -0
- package/dist/{chunk-index-ac1ktr56.js → chunk-index-7qd604rq.js} +2 -2
- package/dist/chunk-index-9bdstf8t.js +2 -0
- package/dist/chunk-index-acj4xxgq.js +100 -0
- package/dist/chunk-index-aexy023z.js +2 -0
- package/dist/chunk-index-amxa2bn3.js +2 -0
- package/dist/chunk-index-bef0fc2m.js +2 -0
- package/dist/chunk-index-c6tphrjr.js +1 -0
- package/dist/chunk-index-c7dbvkrq.js +2 -0
- package/dist/chunk-index-cn49mawx.js +50 -0
- package/dist/{chunk-index-3d8s3565.js → chunk-index-e2gy763y.js} +2 -2
- package/dist/{chunk-index-31x6krbs.js → chunk-index-e35v554x.js} +3 -3
- package/dist/chunk-index-fepsbhr6.js +47 -0
- package/dist/chunk-index-gcmmwh8t.js +2 -0
- package/dist/{chunk-index-kbrg32sx.js → chunk-index-gwkhs8s3.js} +2 -2
- package/dist/chunk-index-h2vhv4kh.js +2 -0
- package/dist/chunk-index-h9ccz1r3.js +2 -0
- package/dist/{chunk-index-0w4bfjb5.js → chunk-index-jc3r4qam.js} +2 -2
- package/dist/{chunk-index-8d81qy69.js → chunk-index-m81362sc.js} +2 -2
- package/dist/{chunk-index-xq84gg8w.js → chunk-index-n0cmnwd2.js} +2 -2
- package/dist/chunk-index-n0ejy0wd.js +2 -0
- package/dist/chunk-index-nkdg1dfz.js +7 -0
- package/dist/chunk-index-p7jkr7gv.js +14 -0
- package/dist/{chunk-index-e2dqjde8.js → chunk-index-q5fyrtx4.js} +1 -1
- package/dist/{chunk-index-jgzygbt8.js → chunk-index-qxynr1hf.js} +2 -2
- package/dist/chunk-index-r7fdgzy1.js +2 -0
- package/dist/chunk-index-rgf4rvns.js +4 -0
- package/dist/chunk-index-rsd8rftk.js +2 -0
- package/dist/{chunk-index-rh0x9rzf.js → chunk-index-s53bxwkk.js} +2 -2
- package/dist/{chunk-index-xxeb2xp0.js → chunk-index-s9p27f9b.js} +3 -3
- package/dist/chunk-index-sdcpf5dp.js +2 -0
- package/dist/chunk-index-sm7kfb07.js +2 -0
- package/dist/chunk-index-sw9r4aa4.js +2 -0
- package/dist/chunk-index-t5bmsqqd.js +1 -0
- package/dist/chunk-index-v8mma5np.js +2 -0
- package/dist/{chunk-index-q7g62sgm.js → chunk-index-v9gbt5tz.js} +3 -3
- package/dist/chunk-index-vsfsv8hd.js +2 -0
- package/dist/chunk-index-wxft0aqb.js +2 -0
- package/dist/chunk-index-x60n1me6.js +2 -0
- package/dist/chunk-index-zcfr8jdv.js +13 -0
- package/dist/{chunk-index-w42rcbx1.js → chunk-index-zj0gjcvr.js} +2 -2
- package/dist/{chunk-index-2t30xwed.js → chunk-index-zt19fdmc.js} +2 -2
- package/dist/chunk-index-zvvwxkev.js +2 -0
- package/dist/chunk-lang-css-7q1dtpgm.js +1 -0
- package/dist/{chunk-lang-dockerfile-cnwqn660.js → chunk-lang-dockerfile-n4bt8jbt.js} +1 -1
- package/dist/{chunk-lang-go-yy6kgsxv.js → chunk-lang-go-9k4y107e.js} +3 -3
- package/dist/chunk-lang-html-xgvba8rn.js +1 -0
- package/dist/chunk-lang-javascript-vgxmgd0a.js +1 -0
- package/dist/chunk-lang-json-hr12bzs1.js +1 -0
- package/dist/chunk-lang-markdown-ttzcpgkg.js +6 -0
- package/dist/chunk-lang-python-ntj8maem.js +3 -0
- package/dist/chunk-lang-rust-gv8y859d.js +1 -0
- package/dist/{chunk-lang-shell-1rpgtepw.js → chunk-lang-shell-5zzs09b7.js} +1 -1
- package/dist/chunk-lang-sql-6vmze4pg.js +2 -0
- package/dist/{chunk-lang-toml-tbj7467c.js → chunk-lang-toml-tt0d4rw9.js} +1 -1
- package/dist/chunk-lang-typescript-2v652sh5.js +1 -0
- package/dist/chunk-lang-xml-r2sbqnjv.js +1 -0
- package/dist/chunk-lang-yaml-ex31qbph.js +1 -0
- package/dist/chunk-layout-actions-bfqtg71d.js +1 -0
- package/dist/chunk-menu-items-rztgekfj.js +1 -0
- package/dist/chunk-mode-toggle-m5kgb7c7.js +1 -0
- package/dist/chunk-note-row-40ypghn9.js +204 -0
- package/dist/chunk-notes-a8nqffbf.js +1 -0
- package/dist/chunk-notice-bell-rdnfmtf2.js +1 -0
- package/dist/{chunk-notices-fte9f196.js → chunk-notices-tefx93s6.js} +1 -1
- package/dist/chunk-onboarding-wvh0s3vg.js +1 -0
- package/dist/chunk-overview-zrx3bpwf.js +1 -0
- package/dist/chunk-palette-5xtdvy9a.js +1 -0
- package/dist/chunk-placement-items-rgyrktvy.js +1 -0
- package/dist/chunk-profile-tyb48b79.js +1 -0
- package/dist/chunk-prompt-history-wv0vdsjv.js +1 -0
- package/dist/chunk-prompts-75hgb0t0.js +1 -0
- package/dist/chunk-room-confirms-bcvhpcry.js +1 -0
- package/dist/chunk-room-menu-ha1evv71.js +1 -0
- package/dist/chunk-rooms-menu-button-ej3a2hyc.js +1 -0
- package/dist/chunk-schedules-a5pewkhd.js +1 -0
- package/dist/{chunk-seat-menu-r0k0eawr.js → chunk-seat-menu-eh3ymmks.js} +1 -1
- package/dist/chunk-sheet-hosts-d5zbwbbr.js +29 -0
- package/dist/{chunk-shortcut-help-a6pkjcq7.js → chunk-shortcut-help-bh9ntk9s.js} +2 -2
- package/dist/{chunk-shortcuts-cgt87jkz.js → chunk-shortcuts-6em0atk9.js} +1 -1
- package/dist/chunk-skill-editor-e43mwz01.js +8 -0
- package/dist/chunk-skills-vp107wrp.js +1 -0
- package/dist/chunk-start-over-line-xd1v2p0g.js +16 -0
- package/dist/chunk-switcher-list-dtfh87zy.js +1 -0
- package/dist/{chunk-tab-dot-vr11dfrw.js → chunk-tab-dot-qd640mjr.js} +1 -1
- package/dist/chunk-table-svb2xhfd.js +1 -0
- package/dist/chunk-table2d-5nrhfwft.js +1 -0
- package/dist/chunk-table3d-5cb66d99.js +4220 -0
- package/dist/chunk-thread-actions-926eab0w.js +1 -0
- package/dist/{chunk-thread-cards-c2mrp2gj.js → chunk-thread-cards-kgt22sbp.js} +1 -1
- package/dist/chunk-thread-list-j2v1pqkz.js +217 -0
- package/dist/chunk-transcript-a0p3vwh6.js +1 -0
- package/dist/chunk-waiting-cdyz7r1g.js +1 -0
- package/dist/chunk-waiting-chip-58ttx9av.js +28 -0
- package/dist/chunk-where-9jp6g029.js +1 -0
- package/dist/chunk-workspace-d34njy4p.js +578 -0
- package/dist/chunk-zh-tw-y3jb20wc.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/api-types.ts +98 -1
- package/src/app/app.ts +4 -7
- package/src/app/desk.ts +19 -4
- package/src/app/room-log.ts +66 -18
- package/src/app/rooms.ts +15 -5
- package/src/app/routes.ts +60 -9
- package/src/app/skill-doc-routes.ts +12 -2
- package/src/app/surface.ts +26 -2
- package/src/app/team-routes.ts +3 -7
- package/src/authz.ts +1 -0
- package/src/cleanup-api.ts +9 -2
- package/src/connector-manage-api.ts +257 -0
- package/src/console-api.ts +60 -2
- package/src/features.ts +91 -0
- package/src/host/reads.ts +10 -1
- package/src/i18n/zh-tw.ts +107 -4
- package/src/web-plugin.ts +7 -1
- package/dist/chunk-account-1ecx5kt7.js +0 -1
- package/dist/chunk-action-menu-zh2n0ahf.js +0 -1
- package/dist/chunk-agent-ynm2tcbx.js +0 -1
- package/dist/chunk-arranged-rooms-qnz8vese.js +0 -1
- package/dist/chunk-bulk-actions-pr0mw0kc.js +0 -1
- package/dist/chunk-character-creator-caj4pmg4.js +0 -1
- package/dist/chunk-codeeditor-dga6s78p.js +0 -2
- package/dist/chunk-confirm-g76v5d9r.js +0 -1
- package/dist/chunk-connectors-j79ze3j1.js +0 -1
- package/dist/chunk-conversations-2farn72g.js +0 -1
- package/dist/chunk-council-sheet-s9sz1bzf.js +0 -2
- package/dist/chunk-drag-45e8222r.js +0 -1
- package/dist/chunk-entry-q11n47h9.js +0 -1
- package/dist/chunk-folder-list-4gcj7g7h.js +0 -1
- package/dist/chunk-folds-ten4ykfw.js +0 -1
- package/dist/chunk-gate-kcv1a4t0.js +0 -1
- package/dist/chunk-group-scene-12ghcvzd.js +0 -1
- package/dist/chunk-group-table-t458kdgn.js +0 -1
- package/dist/chunk-host-icons-h1k9k96a.js +0 -1
- package/dist/chunk-host-picture-3p0wzn3v.js +0 -1
- package/dist/chunk-host-state-7mdve7cb.js +0 -1
- package/dist/chunk-host-ui-bdgwa6sf.js +0 -1
- package/dist/chunk-index-02vfshtt.js +0 -2
- package/dist/chunk-index-0a81da8z.js +0 -2
- package/dist/chunk-index-12zyshae.js +0 -2
- package/dist/chunk-index-18pgxxw3.js +0 -2
- package/dist/chunk-index-2e4am3hw.js +0 -50
- package/dist/chunk-index-5bfqek1d.js +0 -2
- package/dist/chunk-index-64rsz6pf.js +0 -2
- package/dist/chunk-index-6bkcq9ka.js +0 -2
- package/dist/chunk-index-92zgb7my.js +0 -2
- package/dist/chunk-index-aamhjg5n.js +0 -2
- package/dist/chunk-index-b73y2gc0.js +0 -47
- package/dist/chunk-index-b8cpvr7y.js +0 -2
- package/dist/chunk-index-bhqczxr3.js +0 -2
- package/dist/chunk-index-cbqhzf40.js +0 -13
- package/dist/chunk-index-cdctnw71.js +0 -2
- package/dist/chunk-index-dj0tbfyb.js +0 -2
- package/dist/chunk-index-dnjftvtq.js +0 -2
- package/dist/chunk-index-ebg48jgy.js +0 -2
- package/dist/chunk-index-ek5mek4j.js +0 -14
- package/dist/chunk-index-f6q0stqx.js +0 -2
- package/dist/chunk-index-g3wrs02w.js +0 -1
- package/dist/chunk-index-j0m16cj1.js +0 -2
- package/dist/chunk-index-j4kk1m59.js +0 -2
- package/dist/chunk-index-kb3w11mn.js +0 -7
- package/dist/chunk-index-msqhgvfx.js +0 -2
- package/dist/chunk-index-pefwfm26.js +0 -2
- package/dist/chunk-index-pyfx77cj.js +0 -2
- package/dist/chunk-index-qfgkfq86.js +0 -2
- package/dist/chunk-index-sv9qpmhv.js +0 -1
- package/dist/chunk-index-t998yg8y.js +0 -2
- package/dist/chunk-index-tk4se135.js +0 -4
- package/dist/chunk-index-v6smgw77.js +0 -2
- package/dist/chunk-index-x4enmj72.js +0 -2
- package/dist/chunk-lang-css-y9133ktr.js +0 -1
- package/dist/chunk-lang-html-r2xmryek.js +0 -1
- package/dist/chunk-lang-javascript-1r6wd177.js +0 -1
- package/dist/chunk-lang-json-dx56g11y.js +0 -1
- package/dist/chunk-lang-markdown-fpcf2dfq.js +0 -6
- package/dist/chunk-lang-python-zzp95955.js +0 -3
- package/dist/chunk-lang-rust-214fh7sp.js +0 -1
- package/dist/chunk-lang-sql-vvp46hpj.js +0 -2
- package/dist/chunk-lang-typescript-y5w4tt4g.js +0 -1
- package/dist/chunk-lang-xml-tbcqmedk.js +0 -1
- package/dist/chunk-lang-yaml-jh56t3sv.js +0 -1
- package/dist/chunk-layout-actions-y73mpsh1.js +0 -1
- package/dist/chunk-menu-items-bza16bw6.js +0 -2
- package/dist/chunk-mode-toggle-nj9gnt3b.js +0 -1
- package/dist/chunk-note-row-6fmhrdng.js +0 -75
- package/dist/chunk-notes-wv0e6ssf.js +0 -1
- package/dist/chunk-notice-bell-9z27epd2.js +0 -1
- package/dist/chunk-onboarding-c5twahc3.js +0 -1
- package/dist/chunk-overview-k4ccprax.js +0 -1
- package/dist/chunk-palette-9rbp2fab.js +0 -1
- package/dist/chunk-placement-items-me598wsb.js +0 -1
- package/dist/chunk-profile-s7r7fcvz.js +0 -1
- package/dist/chunk-prompt-history-hf296e7v.js +0 -1
- package/dist/chunk-prompts-c8s0nhkm.js +0 -1
- package/dist/chunk-room-confirms-ga2sbvhc.js +0 -1
- package/dist/chunk-room-menu-7h4jym2b.js +0 -1
- package/dist/chunk-rooms-menu-button-pgtaanb6.js +0 -1
- package/dist/chunk-schedules-mbnwcxpc.js +0 -1
- package/dist/chunk-sheet-hosts-a5dfevy9.js +0 -1
- package/dist/chunk-skill-editor-67yk4x7t.js +0 -8
- package/dist/chunk-skills-rewemey4.js +0 -1
- package/dist/chunk-switcher-list-t8rbay2y.js +0 -1
- package/dist/chunk-table-52nh0azk.js +0 -1
- package/dist/chunk-table2d-g57vr6h0.js +0 -1
- package/dist/chunk-table3d-rp0w6kt4.js +0 -4220
- package/dist/chunk-thread-actions-qcxt1y1g.js +0 -1
- package/dist/chunk-thread-list-0071q455.js +0 -217
- package/dist/chunk-transcript-789yqysq.js +0 -1
- package/dist/chunk-where-hmwmme9e.js +0 -1
- package/dist/chunk-workspace-wr1qrtsh.js +0 -578
- package/dist/chunk-zh-tw-z5p5mpph.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,43 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.28.0] - 2026-10-31
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Connector management on the Connectors page, behind the optional `connectors.manage` port: a list with each connector's name, purpose, tool count and only the scheme and host of its URL, so a credential in the path or query never shows; an add form whose token is write-only (never returned or shown again); a purpose editor; and removal behind a confirmation. pi-roundtable-mcp's `CONNECTORS` fits the port.
|
|
13
|
+
- An "MCP authorizations" section behind the optional `mcpGrants` port: each bundle with its channels, allowed operations and recent audit entries; authorize a channel (an existing or new bundle, a channel from the host's list, the operations), rename and re-purpose, revoke behind a confirmation, and replace a bundle's URL. A new URL is shown once with a copy button. The host supplies the channels and the acting owner's Discord ID; pi-roundtable-mcp's `REMOTE_MCP` provides the rest.
|
|
14
|
+
- The routes are under `api/connectors/` and answer owners only. A port's rejection carrying `refusal: true` answers 400 with its message; any other is logged and answered 502 with a fixed message. The config's `connectorParts` names the sections served, and a section whose port is absent is hidden. The `connectors` pane may be served with `mcpGrants` alone.
|
|
15
|
+
- The fixture hosts serve in-memory connector and authorization ports.
|
|
16
|
+
- Rooms store and draw messages between agents as collapsible intercom cards (`RoomMessage.intercom`, migration `web-room-messages-intercom`).
|
|
17
|
+
- The table page switches between the animated scene and a chat view of the council, kept per device, with the draft carried over; a message sent from the table closes a phone's keyboard.
|
|
18
|
+
- Waiting cards show as a count in the top bar, the rail and a room's header; a press jumps to the card (or a list of them) and highlights it, and a chip in the room brings back a card scrolled out of view.
|
|
19
|
+
- Starting over clears the room on every page; the old messages open read-only as the archived conversation from the start-over line (`?archive=`, migration `web-room-messages-start-over`).
|
|
20
|
+
- "Select text" opens the message alone in a sheet where the phone's own partial selection works, with Copy all; a room's interface text is no longer selectable.
|
|
21
|
+
- A temp knight's mode banner says whose modes it follows and hides its switches.
|
|
22
|
+
- The Skills page deletes an agent-written skill after a confirm naming the knights that carry it (`DELETE api/skill-docs/<name>`, owner-only; built-in, linked and package skills are refused).
|
|
23
|
+
- A knight's menus have a Skills entry that opens the Edit knight sheet at its Skills section, whose title shows how many skills it carries.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Rooms no longer post the interim tool-trail line; the progress pane keeps the tools.
|
|
28
|
+
- The round table's dialogue box folds to one bar with a labelled collapse / expand button and gives the height back to the scene.
|
|
29
|
+
- A round-table seat is lit only while its words show, thinking until then, and a speaking figure's mouth moves in 3D and 2D (still under reduced motion).
|
|
30
|
+
- The council hint drops "Pick who sits."
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- A link click reaches every `useRoute`, not only the first that listened. The Files page, kept mounted across folders since 0.26.2, no longer ignores taps on its folders when reached from another page (the phone's tab bar).
|
|
35
|
+
- The overview's Start over resets an agent's or group's web room, not its Discord channel's sessions.
|
|
36
|
+
- A room dragged within Ungrouped no longer makes the other rows move aside as if it could be placed among them; Ungrouped keeps its newest-first order, and a room dragged in from a pinned list or a folder lights it without a placement line.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [0.27.1] - 2026-10-31
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- A lazy style (`installStyle`) is installed once per document instead of once per page load, so a new document gets it again. A test suite that rendered a drop-down in an earlier document no longer leaves a later one without the style.
|
|
44
|
+
|
|
8
45
|
## [0.27.0] - 2026-10-31
|
|
9
46
|
|
|
10
47
|
### Added
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Then only a person whose principal holds the owner role gets in.
|
|
|
30
30
|
|
|
31
31
|
## Requirements
|
|
32
32
|
|
|
33
|
-
- Bun 1.4.4 or later, and pi-roundtable `>=0.
|
|
33
|
+
- Bun 1.4.4 or later, and pi-roundtable `>=0.28.0 <0.29.0` as a peer dependency.
|
|
34
34
|
- The host must run on the machine that holds its data directory: the console reads `<dataDir>/sessions` from disk, and the app keeps its files and keys under `<dataDir>/web/`.
|
|
35
35
|
- An agent team: `agents` in the configuration, with or without `discord`. Without Discord the host also needs a surface that hosts rooms, and this plugin is one; the start fails otherwise, naming the fix.
|
|
36
36
|
- A way to authenticate the owners (see [Authentication](#authentication)): a password, Cloudflare Access or a verifier of your own in front of the listener, or `none` on a listener only the owner reaches.
|
|
@@ -145,7 +145,9 @@ The classes, the rule behind each and the guardrails are in the core guide: [hol
|
|
|
145
145
|
|
|
146
146
|
### Dispatch threads
|
|
147
147
|
|
|
148
|
-
The app hosts the core's dispatch threads (`ChatSurface.threads`). A background dispatch started from a room (a coding task, a delegated task
|
|
148
|
+
The app hosts the core's dispatch threads (`ChatSurface.threads`). A background dispatch started from a room (a coding task, a delegated task) puts one start line in that room and opens a thread, `<surface>:thread.<uuid>`, whose room holds the dispatch's progress and report. The start line links the thread, and the room list nests each thread under the room that started it, with the finished ones folded away. Only an agent's or group's room can host a thread, never a thread itself.
|
|
149
|
+
|
|
150
|
+
A `message_agent` exchange opens no thread: the sender's room shows it as small cards, the request under the sender's name and then the answer, or why none came, under the target's, each one line that opens to the whole text. The cards are stored with the room's messages (`RoomMessage.intercom`), so they come back with its history. While a turn runs its live text leaves out the tools it calls, which the progress pane shows.
|
|
149
151
|
|
|
150
152
|
A thread's room is read only: a `send` to it is refused with `read_only`, and it has no modes. Its cards are the dispatch's own, such as a coding job's approvals, and any owner answers them there as in any room. Agents post in it under their own names. A closed thread stays readable (the list keeps the 30 newest closed ones), and the host closes the threads a restart left open, with a restart notice. `GET api/rooms` lists a thread with `parent` and, once closed, `closed: true`; opening and closing one sends `changed`.
|
|
151
153
|
|
|
@@ -242,22 +244,22 @@ Every agent is drawn as its composed character (`pi-roundtable/characters`). The
|
|
|
242
244
|
|
|
243
245
|
### The round table
|
|
244
246
|
|
|
245
|
-
The `table` pane is a council hall: a ring of tall dark-wood podiums, one for each member of the council on the table, at most eight (the coordinator first), and one low lip at the near edge for you, under torches, banners and a stained-glass window, around a glowing rune circle. The hall is drawn in the characters' own flat, outlined style (a stepped tone gradient and a dark line round every shape, no photographic textures). Dark is the hall at night, light the same hall by day; the Modern and Camelot looks change the banners and the trim, not the hall. Each agent stands behind its podium as a waist-up standee: the character without its frame, cut out with a thin light rim, a dark line and a visible board thickness, turning to the camera within limits. A seat's state comes from the same rules as the room list (`sleepy` sits as `idle`): a thinking seat shows a "…" badge and bobs, a seat with a card waiting a gold "!", a speaking seat has a light on its podium
|
|
247
|
+
The `table` pane is a council hall: a ring of tall dark-wood podiums, one for each member of the council on the table, at most eight (the coordinator first), and one low lip at the near edge for you, under torches, banners and a stained-glass window, around a glowing rune circle. The hall is drawn in the characters' own flat, outlined style (a stepped tone gradient and a dark line round every shape, no photographic textures). Dark is the hall at night, light the same hall by day; the Modern and Camelot looks change the banners and the trim, not the hall. Each agent stands behind its podium as a waist-up standee: the character without its frame, cut out with a thin light rim, a dark line and a visible board thickness, turning to the camera within limits. A seat's state comes from the same rules as the room list (`sleepy` sits as `idle`): a thinking seat shows a "…" badge and bobs, a seat with a card waiting a gold "!", a speaking seat has a light on its podium, the concept art's three gold emphasis strokes beside its head and a mouth that opens and closes about seven times a second (in 3D and 2D alike; it rests closed under reduced motion); a change of face redraws that one picture once it has stood for 300 ms. The table never shows a "+N" podium: a council has eight members at most, and an agent that is not a member is not drawn.
|
|
246
248
|
|
|
247
249
|
The table is a **council**: one agent group (the same group as the group chat, with no second store) shown with its members. Host rooms (a support desk's ticket rooms, say) are not on the owners' table; they are in the room list and the notices. Only a member's or an admin's table, below, seats host rooms.
|
|
248
250
|
|
|
249
251
|
This section describes the owners' table. A member or an admin is served the table only when the host names it for their tier, and theirs seats host rooms instead of agents: see [What each tier is served](#what-each-tier-is-served).
|
|
250
252
|
|
|
251
253
|
- **Cameras.** The overview stands behind your podium, raised. A drag or swipe turns it round the ring and snaps to a podium; the wheel or a pinch moves in on the podium across the ring and back out. A close-up of a speaker stands low inside the ring, tilted a little, with thin speed lines flashing for 400 ms on a new speaker. A turn follows the ring the shorter way and takes 450 to 650 ms. A swipe never starts within 32 px of the screen's edge. Under `prefers-reduced-motion` the camera cuts, with no speed lines, bob or flicker.
|
|
252
|
-
- **Talking in the scene.** The dialogue box at the bottom is the council's group room: a nameplate tab in the speaker's color with their picture, the line being said (Markdown, typed out while it streams, a tap shows it whole), the cards waiting for an answer, and the room's message box, with its unsent text kept per room. A message sent there starts a round under the group's rules. A tap on a podium (or on its name, a button over the plate) turns the camera to that member until the next line comes; **Reset view** brings it back to the whole ring; holding a seat (a long press, a right click or the Menu key) opens its menu with **Private chat** (the knight's own room) and **Remove from the council**. **Log** opens the room's whole message list as a sheet over the scene. The address is `#/table/<group>` (the group's name or the key of its room): without one the table shows the council this device chose last (kept in the browser's storage), or the first group, and an address that names no group goes back to `#/table`.
|
|
254
|
+
- **Talking in the scene.** The dialogue box at the bottom is the council's group room: a nameplate tab in the speaker's color with their picture, the line being said (Markdown, typed out while it streams, a tap shows it whole), the cards waiting for an answer, and the room's message box, with its unsent text kept per room. A message sent there starts a round under the group's rules. A tap on a podium (or on its name, a button over the plate) turns the camera to that member until the next line comes; **Reset view** brings it back to the whole ring; holding a seat (a long press, a right click or the Menu key) opens its menu with **Private chat** (the knight's own room) and **Remove from the council**. **Log** opens the room's whole message list as a sheet over the scene. **Collapse dialogue** folds the box to one bar (the speaker's face and name, the start of the newest line, and *Waiting for your answer* while a card waits) and **Expand dialogue**, or a tap anywhere on the bar, opens it again; the choice is kept per device (`roundtable-console:dialogue-folded`). On a phone (a narrow or touch screen) a message sent from the table closes the keyboard, so the answer has the screen; elsewhere the box keeps the focus for the next one. The header's **Animation mode** / **Chat mode** switch shows the council as the scene with its dialogue box, or as its group room's message list with the cards and the same message box (the unsent text carries over); the choice is kept per device (`roundtable-console:table-mode`). The address is `#/table/<group>` (the group's name or the key of its room): without one the table shows the council this device chose last (kept in the browser's storage), or the first group, and an address that names no group goes back to `#/table`.
|
|
253
255
|
- **Names.** A seat's name is a button laid over its podium's nameplate, at least 12 px on the screen at any distance, in a font stack that carries Chinese (`system-ui`, PingFang TC, Noto Sans TC, Microsoft JhengHei); the podium's own plate is lettered the same way. The seat's full name and state are its accessible name. Where the names stand over each other (many seats on a phone) the agents are also listed as buttons under the scene.
|
|
254
|
-
- **Phones.** Held upright, the scene fills the top 55 % and the dialogue box the rest, and
|
|
256
|
+
- **Phones.** Held upright, the scene fills the top 55 % and the dialogue box the rest, and a folded box is only its bar, giving the scene the rest; on its side the scene is whole and the box lies over its bottom third.
|
|
255
257
|
- **Fallback.** Without WebGL (or after a lost context) the same ring is drawn as SVG in the same palette, with the same standees, plates and dialogue box, never a blank pane. `?nogl` in the page address (`/console/?nogl`, or `#/table?nogl`) draws it on a browser that has WebGL, to try that path; `nogl=0` and `nogl=false` leave the choice to the browser.
|
|
256
258
|
- **Performance.** The WebGL scene is a chunk of its own, fetched when the view first opens and cached by the service worker, never precached. It stops drawing while the page is hidden or the table is off screen, draws a few frames a second while nothing moves (so a torch flickers without keeping the GPU busy), and caps the pixel ratio at 2 (1.5 on phones).
|
|
257
259
|
- **The council.** The header's chip (**Council: <name> ▾**) opens a sheet, a bottom sheet on a phone and a dialog elsewhere. It lists the saved councils (the groups, with their members' faces; pressing one puts it on the table, with the same puff, glide and rise as a seat leaving or joining), and a tick list of every knight with a counter (**3 of 8 picked**): the ninth tick is refused and the sheet says *At most 8 knights*. Ticks keep the order they were made in, which is the group's tie order, and the host is chosen among the ticked. **Done** saves the ticks into the council on the table in place (`PATCH api/groups/<name>`); **Save as a new council** asks for a name and makes another group (`POST api/groups`), which opens its Discord channel as every group does. With no group yet the table says *No council yet* and the sheet starts from the knights that were not muted, the coordinator first, at most eight, to be named and saved. Who sits is no longer mute's say: mute only stops a room's push, stays in the knight's sheet and the room menu, and a muted knight sits when the council has it. Owners who used mute to take knights off the table see their first group (or the empty state) after this change.
|
|
258
260
|
- **Leaving and joining.** An agent who leaves goes in a manga-style puff: the standee squashes a little, flat outlined clouds pop up round it and hide it, then drift up and fade with a few sparkles (about 0.7 s). The other seats then glide to their new places with the camera. An agent who sits down is called up out of a small rune circle in the hall's teal that glows on the floor at its new place; the podium rises out of it with a slight bounce, under a column of light (about 0.85 s), once the others have opened the gap. The pictures are drawn on small canvases in the hall's style and given back when the show ends. Under `prefers-reduced-motion` the picture only dips and comes back (0.16 s each way), with no smoke or rise; the 2D fallback fades the seat in over a ring and out inside a puff with CSS.
|
|
259
261
|
- **Group rooms.** The same scene is a group room's: its header has a "Table" button that switches the room between its list and the scene; the choice is kept per room. In the scene the whole conversation runs in the dialogue box, the camera turns to whoever replies, and it rests on the whole ring while you speak; a member that starts thinking shows its badge wherever the camera is, and a speaker change never takes the focus from your message box. Under the Camelot look a compact strip of the members stands under the header in the list, with the speaker lit.
|
|
260
|
-
- **Turn-taking.** A group round is the members' answers to one message, one after another. The server tells the page where it stands in a `round` frame (`{ type: "round", room, round }`, and `RoomView.round` for a page that opens mid-round): `id` (the group message that opened it), `state`, `current`, `next` (the queue, a handoff appended), `spoken`, `replies` and `limit` (8), `ended` (`done`, `limit` or `stopped`) and `queued` (your messages waiting for the next round). An **order strip** on top of the dialogue box shows the faces in that order: those who spoke dimmed with a check, the one speaking larger, those who are next numbered, and a chip, *Reply 3 of 8*, that reads *Limit reached*, *Round stopped* or *n of 8 replies* once it ended; the strip of the last round stays until the next starts. While it runs the seats wear the same signs before their names (a check, or ① to ⑧; a round that ended leaves them bare), the seat
|
|
262
|
+
- **Turn-taking.** A group round is the members' answers to one message, one after another. The server tells the page where it stands in a `round` frame (`{ type: "round", room, round }`, and `RoomView.round` for a page that opens mid-round): `id` (the group message that opened it), `state`, `current`, `next` (the queue, a handoff appended), `spoken`, `replies` and `limit` (8), `ended` (`done`, `limit` or `stopped`) and `queued` (your messages waiting for the next round). An **order strip** on top of the dialogue box shows the faces in that order: those who spoke dimmed with a check, the one speaking larger, those who are next numbered, and a chip, *Reply 3 of 8*, that reads *Limit reached*, *Round stopped* or *n of 8 replies* once it ended; the strip of the last round stays until the next starts. While it runs the seats wear the same signs before their names (a check, or ① to ⑧; a round that ended leaves them bare), the member whose turn runs thinks (its seat bobs with the thinking badge, no light) until its words show, and its seat is lit only while its words are on screen: streaming in, or typed out in the dialogue box until the last of them shows (on a group room's page, while they stream); the camera turns to it as soon as its turn starts, not when its line arrives; a camera you turned by hand stays until the next line or the next speaker. While a message of yours waits, the strip says so. The box's stop button reads **Stop the round**: it stops the member speaking and the ones waiting do not speak, on the web and in Discord alike.
|
|
261
263
|
|
|
262
264
|
### The files pane
|
|
263
265
|
|
|
@@ -815,7 +817,21 @@ The host wrapper must declare any additional required service keys in its plugin
|
|
|
815
817
|
| `schedules` | `count(key)` returns the workspace schedule count. |
|
|
816
818
|
| `cleanup` | `startFresh(key)` archives/waits for active turns and returns its kind; `deleteConversation(key)` returns `deleted` or `busy`. The package validates key shape, ownership, existence and exclusions before calling either hook. |
|
|
817
819
|
| `skills` | `catalog()` supplies public `SkillView[]`; `read(name)` reads only that catalog entry and returns `{ frontmatter, body }`. The host bounds disk reads and the API shows what `read` returns, flattening metadata in source order. A skill that cannot be read answers with a fixed message; set `errorDetail: true` to append the catalog's `missing` text or the read error's message (cut at 300 characters) when the host's reasons are safe to show. |
|
|
818
|
-
| `connectors` | `gateways()`, `servers()`, `usedBy(server)` provide status/tools/usage. Optional `adminUrl` accepts HTTP(S) or an absolute local path, never script URLs. |
|
|
820
|
+
| `connectors` | `gateways()`, `servers()`, `usedBy(server)` provide status/tools/usage. Optional `adminUrl` accepts HTTP(S) or an absolute local path, never script URLs. Optional `manage` lets the owners list, add, re-describe and remove connectors from the page (below). |
|
|
821
|
+
| `mcpGrants` | Optional. Shows the MCP authorizations on the Connectors page and manages them as `/<root> mcp` does (below). With it alone, the `connectors` pane serves just that section. |
|
|
822
|
+
|
|
823
|
+
`connectors.manage` is `{ list(), add(input), describe(name, description), remove(name) }`; pi-roundtable-mcp's `CONNECTORS` service fits it as it is.
|
|
824
|
+
`add` receives `{ name, url, description, header?, token? }`; the token is write-only, sent to the port and never returned, logged or shown again.
|
|
825
|
+
The page shows each connector's name, purpose, tool count and only the scheme and host of its URL (with `/…` when the URL has a path, query, fragment or user part), so a credential in the URL never shows.
|
|
826
|
+
|
|
827
|
+
`mcpGrants` is `{ operations, bundles(), channels(actor), revoke(bundle, channelId), describe(bundle, channelId, { displayName?, description? }), rotate(bundle), authorize(input, actor) }`.
|
|
828
|
+
`operations` lists `{ id, label }`; `bundles()` returns each bundle with its channels (`channelId`, `guildName`, `channelName`, `visible`, `displayName`, `description`, `operations`, `authorizedAt`, `audit`).
|
|
829
|
+
`actor` is the acting owner, `{ principalId, speakerId }`: the host maps them to their Discord ID for `authorize`, which must keep the Discord flow's channel checks, and lists in `channels(actor)` the channels `{ id, name, guild }` they may pick.
|
|
830
|
+
`rotate` returns `{ url }`, and `authorize` returns `{ bundle, url? }` with the URL only when it created the bundle; the page shows such a URL once, with a copy button.
|
|
831
|
+
pi-roundtable-mcp's `REMOTE_MCP` provides each of these once the host passes its Discord client to `bundles` and `authorize`.
|
|
832
|
+
|
|
833
|
+
Both ports' routes are under `api/connectors/` and answer owners only (`403` to anyone else, before any port is called).
|
|
834
|
+
A rejection whose error carries `refusal: true` (as pi-roundtable-mcp's `ConnectorError` and `RemoteMcpError` do) answers `400` with its message, already in the host's wording; any other is logged and answered `502` with a fixed message, so nothing the error holds reaches the page.
|
|
819
835
|
|
|
820
836
|
`sessionSummary(directory)` is a public helper for a trusted host to summarize separately stored party session files.
|
|
821
837
|
It reports live bytes, archive count and last activity without revealing message contents.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,Q,S,e,v}from"./chunk-index-cn49mawx.js";var a={profile:S(()=>(p("tyb48b79"),import("./chunk-profile-tyb48b79.js")).then((o)=>({default:o.ProfilePage}))),notices:S(()=>(p("tefx93s6"),import("./chunk-notices-tefx93s6.js")).then((o)=>({default:o.NoticesPage}))),onboarding:S(()=>(p("wvh0s3vg"),import("./chunk-onboarding-wvh0s3vg.js")).then((o)=>({default:o.OnboardingPage})))};function n({pane:o}){let t=a[o];return t?e(Q,{fallback:e(v,{}),children:e(t,{})}):null}export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,$e,a,r,g,e,n,s,kt,ns}from"./chunk-index-cn49mawx.js";import{R}from"./chunk-index-m81362sc.js";var L=()=>typeof matchMedia==="function"&&matchMedia("(max-width: 719px)").matches,k={rtMenu:!0},x=()=>Boolean(window.history.state?.rtMenu),w=8,E=(t)=>t?.isConnected?t:null;function M(t){return t.items.map((i)=>n("button",{type:"button",role:i.checked===void 0?"menuitem":"menuitemcheckbox",...i.checked===void 0?{}:{"aria-checked":i.checked},className:"menu-item menu-link","data-tone":i.tone,onClick:()=>t.onChoose(i),children:[i.icon?e("span",{className:"menu-icon","data-tone":i.tone,children:e(s,{name:i.icon,size:18})}):null,e("span",{className:"menu-text",children:e("strong",{children:i.label})}),i.checked?e(s,{name:"check",size:18,className:"menu-check"}):null]},i.id))}function H({menu:t}){let i=a(void 0);if(t)i.current=t;let l=i.current,m=a(!1),h=a(void 0),p=t?.serial;return o(()=>{if(p===void 0)return;return window.history.pushState(k,"",window.location.href),m.current=!0,()=>{if(m.current)m.current=!1,window.history.back()}},[p]),o(()=>{let f=()=>{if(!m.current||x())return;m.current=!1,kt();let y=h.current;h.current=void 0,y?.()};return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[]),e(R,{open:t!==void 0,title:l?.title??"",onClose:kt,restoreFocus:()=>E(l?.source??null),children:l?e("div",{className:"menu action-items",role:"menu","aria-label":l.title,children:e(M,{items:l.items,onChoose:(f)=>{if(!m.current){kt(),f.run();return}h.current=f.run,window.history.back()}})}):null})}function T({menu:t}){let i=a(null),[l,m]=r(t.at),{source:h}=t,p=(u)=>{E(h)?.focus(),kt(),u?.()},f=a(p);f.current=p,$e(()=>{let u=i.current;if(!u)return;let d={left:u.style.left,top:u.style.top};u.style.left="0px",u.style.top="0px";let c={width:u.offsetWidth,height:u.offsetHeight};u.style.left=d.left,u.style.top=d.top,m({x:Math.max(w,Math.min(t.at.x,window.innerWidth-c.width-w)),y:Math.max(w,Math.min(t.at.y,window.innerHeight-c.height-w))}),u.querySelector('[role^="menuitem"]')?.focus()},[t.serial]),o(()=>{let u=(c)=>{if(c.target instanceof Node&&i.current?.contains(c.target))return;kt()},d=()=>kt();return document.addEventListener("pointerdown",u,!0),document.addEventListener("wheel",u,{capture:!0,passive:!0}),document.addEventListener("touchmove",u,{capture:!0,passive:!0}),window.addEventListener("resize",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("wheel",u,!0),document.removeEventListener("touchmove",u,!0),window.removeEventListener("resize",d)}},[]);let y=(u)=>{let d=[...i.current?.querySelectorAll('[role^="menuitem"]')??[]],c=d.indexOf(document.activeElement),v=(b)=>{u.preventDefault(),d[(b+d.length)%d.length]?.focus()};switch(u.key){case"Escape":u.preventDefault(),u.stopPropagation(),f.current();return;case"ArrowDown":return v(c+1);case"ArrowUp":return v(c<0?-1:c-1);case"Tab":return v(u.shiftKey?c<0?-1:c-1:c+1);case"Home":return v(0);case"End":return v(-1)}};return e("div",{ref:i,className:"action-popover",role:"menu","aria-label":t.title,tabIndex:-1,style:{left:`${l.x}px`,top:`${l.y}px`},onKeyDown:y,children:e(M,{items:t.items,onChoose:(u)=>p(u.run)})})}function I(){let t=ns(),i=a(void 0);if(t&&i.current?.serial!==t.serial)i.current={serial:t.serial,sheet:L()};let l=Boolean(t&&i.current?.sheet);return n(g,{children:[e(H,{menu:l?t:void 0}),t&&!l?e(T,{menu:t},t.serial):null]})}export{I as ActionMenuHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,e,I,l,v,He}from"./chunk-index-cn49mawx.js";function c({name:r}){let m=l((i)=>i.listed),t=l((i)=>Object.values(i.rooms).find((n)=>n.view?.kind==="agent"&&n.view.name===r)?.view?.key,r);return o(()=>{if(t)I("room",t,{replace:!0}),He(r);else if(m)I("rooms",void 0,{replace:!0})},[t,m,r]),e("div",{className:"page",children:e(v,{})})}export{c as AgentPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,Q,S,j,C,a,t,g,e,n,s,Re,l,k,_,me,Ht,bn,J,ar,wi,qr,Nt,ki,Br}from"./chunk-index-cn49mawx.js";import{ze}from"./chunk-index-6yra9kdq.js";import{ui}from"./chunk-index-sdcpf5dp.js";import"./chunk-index-q5fyrtx4.js";import"./chunk-index-gwkhs8s3.js";import{si}from"./chunk-index-31m1b2f5.js";import{ai,li}from"./chunk-index-s9p27f9b.js";import{Gt}from"./chunk-index-2tr41qht.js";import"./chunk-index-vsfsv8hd.js";import"./chunk-index-s53bxwkk.js";import{at}from"./chunk-index-20xgx0k2.js";ai();var M=S(()=>(p("qxhmczwv"),import("./chunk-folder-list-qxhmczwv.js")).then((o)=>({default:o.FolderList}))),O=j(function(d){let{view:r}=d,f=Gt(()=>Ht(r.key),r.home?void 0:li(r.key));return e(qr,{...d,press:f,item:{...r.home?{}:{"data-drop-item":"","data-key":r.key},...d.arranging?{"data-arranging":""}:{}},after:d.arranging?e("button",{type:"button",className:"icon-button row-more","aria-haspopup":"menu","aria-label":t("Room menu"),onClick:(c)=>{let u=c.currentTarget;Ht(r.key).then((i)=>{if(!i)return;let y=u.getBoundingClientRect();me({...i,at:{x:y.left,y:y.bottom},via:"key",source:u})},()=>{return})},children:e(s,{name:"more",size:18})}):null})});function P(o){let{now:d}=J(),{timeZone:r}=_(),f=Nt(o.rooms);return e("ul",{className:"room-list",children:f.map(({key:c,...u})=>{let i=o.threads[c];return e(O,{...u,active:c===o.active,now:d,timeZone:r,arranging:o.arranging,...i?{threads:e(ki,{open:i.open,closed:i.closed,active:o.active,parent:c})}:{}},c)})})}function v(o){let r=Nt(o.rooms).length===0;if(r&&o.zone?.kind!=="pinned")return null;return n("section",{className:"stack",...r?{"data-empty":""}:{},...o.zone?{"data-drop-zone":o.zone.kind,"data-zone-id":o.zone.id}:{},children:[e("h2",{className:"section-title",children:o.title}),r?null:e(P,{rooms:o.rooms,threads:o.threads,active:o.active,arranging:o.arranging})]})}function re(o){let d=Boolean(_().kinds?.length),r=l((m)=>JSON.stringify({listed:m.listed,...at(m,(F)=>Re(m,F))})),f=ui(),c=a(r);if(!f)c.current=r;let u=c.current,{listed:i,...y}=C(()=>JSON.parse(u),[u]),{home:w,pinned:z,folders:N,restAgents:T,restGroups:D,rest:A,threads:L,orphans:h}=y,R=ar(),K=w.length+z.length+A.length===0&&N.every((m)=>m.rooms.length===0)&&h.open.length+h.closed.length===0,b={threads:L,active:o.active,arranging:R};return n("div",{className:"page","data-column":o.active?"":void 0,"data-drop-root":"",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Rooms")}),n("div",{className:"actions",children:[n("button",{type:"button",className:"header-button search-button",onClick:o.onSearch,children:[e(s,{name:"search",size:16}),e("span",{children:t("Find a room")}),e("kbd",{children:"⌘K"})]}),i?e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(m)=>si(m.currentTarget),children:e(s,{name:"more",size:18})}):null,e("button",{type:"button",className:"header-button icon-button","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(m)=>bn(m.currentTarget),children:e(s,{name:"plus"})})]})]}),R?n("div",{className:"arrange-bar",children:[n("button",{type:"button",className:"secondary",onClick:()=>ze({kind:"new"}),children:[e(s,{name:"plus",size:16}),e("span",{children:t("Add a folder")})]}),e("button",{type:"button",onClick:()=>wi(!1),children:t("Done")})]}):null,i&&K&&!d?e(k,{children:t("No rooms yet. Rooms appear when the team has a knight.")}):null,!i?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,e(v,{title:t("Home"),rooms:w,...b}),e(v,{title:t("Pinned"),rooms:z,zone:{kind:"pinned",id:"pinned"},...b}),N.length>0?e("div",{className:"stack folder-list","data-folder-list":"",children:e(Q,{fallback:e("div",{className:"skeleton","aria-busy":"true"}),children:e(M,{folders:N,active:o.active,listed:i,rooms:(m)=>e(P,{rooms:m,threads:L,active:o.active,arranging:R})})})}):null,N.length>0?e(v,{title:t("Ungrouped"),rooms:A,zone:{kind:"rest",id:"rest"},...b}):n(g,{children:[e(v,{title:t("Knights"),rooms:T,zone:{kind:"rest",id:"rest-agents"},...b}),e(v,{title:t("Groups"),rooms:D,zone:{kind:"rest",id:"rest-groups"},...b})]}),h.open.length+h.closed.length>0?n("section",{className:"stack",children:[e("h2",{className:"section-title",children:t("Dispatch threads")}),e(ki,{open:h.open,closed:h.closed,active:o.active})]}):null,e(Br,{active:o.active})]})}export{re as ArrangedRoomsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,K,O,d,f}from"./chunk-index-cn49mawx.js";import{on}from"./chunk-index-gwkhs8s3.js";import"./chunk-index-q5fyrtx4.js";import{kn,Hr}from"./chunk-index-5t2jkecy.js";import{ne}from"./chunk-index-c7dbvkrq.js";import{uo}from"./chunk-index-vsfsv8hd.js";import"./chunk-index-s53bxwkk.js";var s=500,c=(n)=>{let r=[];for(let e=0;e<n.length;e+=s)r.push(n.slice(e,e+s));return r},i=()=>O.dispatch({type:"changed"});async function w(n){let r=uo(n),e=Object.keys(r);if(e.length===0)return;let a=[];try{for(let o of c(e))a.push(...(await kn.readAll(o)).moved)}catch(o){f(d(o),"danger"),i();return}on(Object.fromEntries(e.map((o)=>[o,0]))),f(K(e.length,"Marked {count} room as read","Marked {count} rooms as read"),"info",a.length?{label:t("Undo"),run:()=>void m(a,r)}:void 0)}async function m(n,r){try{for(let e of c(n)){let{restored:a}=await kn.unreadAll(e);on(Object.fromEntries(a.map((o)=>[o,r[o]??0])))}}catch(e){f(d(e),"danger")}i()}var P=(n)=>Hr(n);async function l(n){try{await kn.restoreHelpers(n)}catch(r){f(d(r),"danger")}i()}async function R(n){let r;try{r=(await kn.archiveFinishedHelpers(n)).archived.flatMap((a)=>a.names)}catch(e){f(d(e),"danger"),i();return}if(i(),r.length===0)return;f(K(r.length,"Archived {count} temp knight","Archived {count} temp knights"),"info",{label:t("Undo"),run:()=>void l(r)})}async function T(n,r){try{await ne.archiveAgent(n)}catch(e){f(d(e),"danger"),i();return}i(),f(t("Archived {name}",{name:r}),"info",{label:t("Undo"),run:()=>void l([n])})}export{T as archiveHelper,P as clearAllFinished,R as clearFinishedHelpers,w as markAllRead,l as putBackHelpers};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ke,Kt,Z,_i,wn}from"./chunk-index-fepsbhr6.js";import{j,$r,o,z,C,a,r,t,u,g,e,n,Oi,de,y,d,f,vn,fe,et,Ce}from"./chunk-index-cn49mawx.js";import{q}from"./chunk-index-qxynr1hf.js";import{R}from"./chunk-index-m81362sc.js";var ue={"hat.none":"No hat","hat.goggcap":"Leather cap","hat.tallcap":"Burgundian felt cap","hat.softcap":"Soft cap","hat.hardhat":"Iron skullcap","hat.fcap":"Hunter's cap","hat.winghelm":"Winged helm","hat.helm":"Helm","hat.mortar":"Biretta","hat.beret":"Chaperon","hat.goggles":"Pointed cap","hat.tricorn":"Pilgrim hat","hat.sailor":"Straw hat","hat.kettle":"Kettle hat","hat.cavalier":"Feathered hat","hat.toque":"Linen cook's cap","hair.none":"No hair","beard.none":"No beard","accessory.none":"No accessory","prop.beads":"Prayer beads","prop.marotte":"Marotte","prop.map":"Chart","prop.flask":"Alchemist's phial","prop.telescope":"Astrolabe","prop.wrench":"Dividers","outfit.surplice":"Surplice","outfit.overalls":"Work jerkin","outfit.armor":"Mail hauberk","outfit.apron":"Smith's apron","outfit.chef":"Cook's tunic","outfit.coat":"Doublet","outfit.vest":"Pourpoint","outfit.sailor":"Mariner's tunic","hair.bob":"Bob","hair.bun":"Bun","hair.ponytail":"Ponytail"},X=(i)=>i.charAt(0).toUpperCase()+i.slice(1);function P(i,l){let h=`character.${i}.${l}`,b=t(h);if(b!==h)return b;if(i==="class")return Z.classes[l]?.label??X(l);return ue[`${i}.${l}`]??X(l)}function Y(i){let l=`character.jobs.${i}`,h=t(l);return h!==l?h:Z.classes[i]?.jobs??""}var M=[{field:"hat",title:u("Hat"),ids:Z.hats},{field:"outfit",title:u("Outfit"),ids:Z.outfits},{field:"prop",title:u("Prop"),ids:Z.props},{field:"hair",title:u("Hair"),ids:Z.hair},{field:"beard",title:u("Beard"),ids:["none",...Z.beards]},{field:"accessory",title:u("Accessory"),ids:["none",...Z.accessories]}],me=new Set(["class","colors","palette","build","skin","hairColor",...M.map((i)=>i.field)]),re=Object.keys(Z.palettes),ee={idle:u("Idle"),thinking:u("Thinking"),working:u("Working"),waiting:u("Waiting for you"),done:u("Done"),error:u("Error"),sleepy:u("Sleepy")},he={slim:u("Slim"),regular:u("Regular"),stout:u("Stout")};function O(i){return{class:i.class,outfit:i.outfit,hat:i.hat,prop:i.prop,hair:i.hair,beard:i.beard,accessory:i.accessory,build:i.build,skin:i.skin,hairColor:i.hairColor,colors:{...i.colors}}}var te=(i)=>JSON.stringify(O(i)),v=(i)=>i[Math.floor(Math.random()*i.length)];function be(){return{class:v(Ke),outfit:v(Z.outfits),hat:v(Z.hats),prop:v(Z.props),hair:v(Z.hair),beard:v(["none",...Z.beards]),accessory:v(["none",...Z.accessories]),build:v(["slim","regular","stout"]),skin:v([0,1,2,3,4,5]),hairColor:v(Z.hairColors),palette:v(re)}}var ie=j(function(l){return n("button",{type:"button",className:"creator-tile","aria-pressed":l.pressed,title:l.hint?`${l.label} — ${l.hint}`:l.label,onClick:l.onPick,...l.data,children:[e(fe,{spec:l.spec,size:l.size,live:!1}),e("span",{children:l.label})]})});function ge(i,l,h){let b=JSON.stringify({...i,[l]:0});return C(()=>h.map((c)=>({...i,[l]:c})),[b,l,h])}function pe(){let i=a(null),[l,h]=r();return o(()=>{let b=i.current;if(!b)return;let c=()=>{let N=b.scrollLeft>1,w=b.scrollLeft+b.clientWidth<b.scrollWidth-1;h(N&&w?"both":w?"end":N?"start":void 0)};c(),b.addEventListener("scroll",c,{passive:!0});let p=typeof ResizeObserver>"u"?void 0:new ResizeObserver(c);return p?.observe(b),()=>{b.removeEventListener("scroll",c),p?.disconnect()}},[]),[i,l]}function ye(i){let{part:l}=i,h=ge(i.shown,l.field,l.ids),[b,c]=pe();return e("div",{className:"creator-strip",ref:b,"data-more":c,children:l.ids.map((p,N)=>e(ie,{data:{[`data-${l.field}`]:p},spec:h[N],size:44,label:P(l.field,p),pressed:i.draft[l.field]===p,onPick:()=>i.onPick(p)},p))})}function K(i){return e("button",{type:"button",className:"creator-swatch","aria-pressed":i.pressed,"aria-label":i.label,title:i.label,style:{background:i.background},onClick:i.onPick,...i.data})}function L(i){return n("div",{className:"creator-field","data-field":i.field,children:[i.title?e("h3",{children:i.title}):null,i.children,i.error?e("p",{className:"field-error",role:"alert",children:i.error}):null]})}function Oe(i){let[l,h]=r(i.character),b=$r(l),[c,p]=r({}),[N,w]=r(!1),[I,ne]=r("idle"),[W,T]=r(),[D,U]=r(),_=Ce("(max-width: 719px)"),G=a(null),F=z(),oe=et(l),se=vn(),A=te(l)!==te(i.character);o(()=>h(i.character),[i.character]),o(()=>{if(!A||i.onPick)return;let s=(k)=>k.preventDefault(),m=(k)=>{if(k.button!==0||k.metaKey||k.ctrlKey||k.shiftKey||k.altKey)return;let E=k.target instanceof Element?k.target.closest("a"):null;if(!E||E.target||E.hasAttribute("download"))return;if(G.current?.contains(E))return;k.preventDefault(),k.stopPropagation(),T({kind:"link",anchor:E})},H=Oi((k)=>T({kind:"navigate",proceed:k}));return window.addEventListener("beforeunload",s),document.addEventListener("click",m,!0),()=>{H(),window.removeEventListener("beforeunload",s),document.removeEventListener("click",m,!0)}},[A,i.onPick]);let S=(s)=>{p({}),h((m)=>_i(s,m))},le=async()=>{if(i.onPick){i.onPick(O(l),l);return}w(!0),p({});try{let s=await y.setCharacter(i.name,O(l));i.onSaved?.(s),f(t("Saved."))}catch(s){let m=s instanceof de&&s.field?s.field.split(".")[0]:void 0,H=m&&me.has(m)?m:"*";p({[H]:d(s)})}finally{w(!1)}},ce=async()=>{let s=W;if(h(i.character),p({}),s?.kind==="link")setTimeout(()=>s.anchor.click(),0);else if(s?.kind==="navigate")s.proceed()},J=e(L,{field:"class",title:t("Class"),error:c.class,children:e("div",{className:"creator-grid",children:Ke.map((s)=>e(ke,{id:s,base:b,pressed:l.class===s,onPick:()=>S({class:s,colors:l.colors})},s))})}),V=n(L,{field:"colors",title:t("Colors"),error:c.colors??c.palette,children:[n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Palette")}),re.map((s)=>{let m=Z.palettes[s];return e(K,{data:{"data-palette":s},label:P("palette",s),pressed:l.palette===s,background:`linear-gradient(135deg, ${m.primary} 52%, ${m.trim} 52%)`,onPick:()=>S({palette:s})},s)})]}),e("div",{className:"creator-custom",children:["primary","secondary","trim"].map((s)=>n("label",{children:[e("span",{children:s==="primary"?t("Primary (the accent)"):s==="secondary"?t("Secondary"):t("Trim")}),e("input",{type:"color",value:l.colors[s],onChange:(m)=>S({colors:{[s]:m.target.value}})})]},s))})]}),x=M.map((s)=>e(L,{field:s.field,title:t(s.title),error:c[s.field],children:e(ye,{part:s,draft:l,shown:b,onPick:(m)=>S({[s.field]:m})})},s.field)),Q=n(g,{children:[e(L,{field:"build",title:t("Build"),error:c.build,children:n("fieldset",{className:"segmented",children:[e("legend",{className:"visually-hidden",children:t("Build")}),["slim","regular","stout"].map((s)=>n("label",{"data-checked":l.build===s,children:[e("input",{type:"radio",name:`${F}-build`,checked:l.build===s,onChange:()=>S({build:s})}),ae(s)]},s))]})}),e(L,{field:"skin",title:t("Skin tone"),error:c.skin,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Skin tone")}),(se??Z.skins).map((s,m)=>e(K,{data:{"data-skin":String(m)},label:t("Skin tone {n}",{n:m+1}),pressed:l.skin===m,background:s,onPick:()=>S({skin:m})},m))]})}),e(L,{field:"hairColor",title:t("Hair color"),error:c.hairColor,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Hair color")}),Z.hairColors.map((s,m)=>e(K,{data:{"data-hair-color":s},label:t("Hair color {n}",{n:m+1}),pressed:l.hairColor===s,background:s,onPick:()=>S({hairColor:s})},s)),e("input",{type:"color","aria-label":t("Hair color"),value:l.hairColor,onChange:(s)=>S({hairColor:s.target.value})})]})})]}),B=[{id:"class",title:t("Class"),summary:P("class",l.class),error:c.class,node:J},{id:"colors",title:t("Colors"),summary:l.palette?P("palette",l.palette):l.colors.primary,error:c.colors??c.palette,node:V},...M.map((s,m)=>({id:s.field,title:t(s.title),summary:P(s.field,l[s.field]),error:c[s.field],node:x[m]})),{id:"body",title:t("Body"),summary:ae(l.build),error:c.build??c.skin??c.hairColor,node:Q}];return n("form",{ref:G,className:"creator",style:oe,"aria-labelledby":F,onSubmit:(s)=>{if(s.preventDefault(),(A||i.onPick)&&!N)le()},children:[e("h2",{id:F,className:"visually-hidden",children:t("Character of {name}",{name:i.displayName})}),n("div",{className:"creator-preview",children:[e(fe,{spec:l,name:i.name,state:I,size:176,label:t("{name}, {state}",{name:i.displayName,state:t(ee[I])})}),e("button",{type:"button",className:"secondary","data-action":"cycle",onClick:()=>ne((s)=>Kt[(Kt.indexOf(s)+1)%Kt.length]??"idle"),children:t("Preview states")}),e("span",{className:"meta","aria-live":"polite",children:t(ee[I])})]}),n("div",{className:"creator-body",children:[c["*"]?e("p",{className:"field-error",role:"alert","data-field":"*",children:c["*"]}):null,_?e("ul",{className:"creator-sections",children:B.map((s)=>e("li",{children:n("button",{type:"button",className:"creator-section secondary",onClick:()=>U(s.id),children:[e("strong",{children:s.title}),e("span",{className:"meta",children:s.summary}),s.error?e("span",{className:"field-error",role:"alert",children:s.error}):null]})},s.id))}):n(g,{children:[J,V,x,Q]}),n("div",{className:"actions creator-actions",children:[e("button",{type:"button",className:"secondary","data-action":"suggest",onClick:()=>{p({}),h(wn({name:i.name,displayName:i.displayName,prompt:i.prompt}))},children:t("Suggest from role")}),e("button",{type:"button",className:"secondary","data-action":"randomize",onClick:()=>S(be()),children:t("Randomize")}),e("button",{type:"button",className:"secondary","data-action":"cancel",onClick:()=>{if(i.onCancel)i.onCancel();else if(A)T({kind:"cancel"})},children:t("Cancel")}),e("button",{type:"submit","data-action":"save",disabled:!A&&!i.onPick||N,children:N?t("Saving…"):i.onPick?t("Use this look"):t("Save")})]})]}),e(R,{open:_&&D!==void 0,title:B.find((s)=>s.id===D)?.title??"",onClose:()=>U(void 0),children:e("div",{className:"stack",children:B.find((s)=>s.id===D)?.node})}),e(q,{open:W!==void 0,title:t("Discard your changes?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>T(void 0),onConfirm:ce,children:e("p",{children:t("The new look for {name} has not been saved.",{name:i.displayName})})})]})}var ae=(i)=>t(he[i]);function ke(i){let l=i.base.colors,h=C(()=>_i({class:i.id,colors:l}),[i.id,l]);return e(ie,{data:{"data-class":i.id},spec:h,size:56,label:P("class",i.id),hint:Y(i.id),pressed:i.pressed,onPick:i.onPick})}export{Oe as CharacterCreator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{B,ge,Ei,wo,Ai,pt,Oe,c,w,Me,Ve,It,qe,G,le,ce,V,bt,vt,Be,ye,L,oe,Ae,b,Tt,ko,_o,To,$i,Kn,Po,Qo,Mo,Ro,P,i,X,it,Vt,ti,mr,Qn,Mn,Ao,$o,gt}from"./chunk-index-zcfr8jdv.js";import{p}from"./chunk-index-cn49mawx.js";var nn=(e)=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=be(e.state,n.from);return r.line?rn(e):r.block?ln(e):!1};function ve(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);if(!o)return!1;return r(n.update(o)),!0}}var rn=ve(an,0);var on=ve(Xe,0);var ln=ve((e,t)=>Xe(e,t,cn(t)),0);function be(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}var q=50;function sn(e,{open:t,close:n},r,o){let l=e.sliceDoc(r-q,r),s=e.sliceDoc(o,o+q),a=/\s*$/.exec(l)[0].length,u=/^\s*/.exec(s)[0].length,f=l.length-a;if(l.slice(f-t.length,f)==t&&s.slice(u,u+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:o+u,margin:u&&1}};let h,d;if(o-r<=2*q)h=d=e.sliceDoc(r,o);else h=e.sliceDoc(r,r+q),d=e.sliceDoc(o-q,o);let m=/^\s*/.exec(h)[0].length,D=/\s*$/.exec(d)[0].length,v=d.length-D-n.length;if(h.slice(m,m+t.length)==t&&d.slice(v,v+n.length)==n)return{open:{pos:r+m+t.length,margin:/\s/.test(h.charAt(m+t.length))?1:0},close:{pos:o-D-n.length,margin:/\s/.test(d.charAt(v-1))?1:0}};return null}function cn(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to);if(o.from>r.from&&o.from==n.to)o=n.to==r.to+1?r:e.doc.lineAt(n.to-1);let l=t.length-1;if(l>=0&&t[l].to>r.from)t[l].to=o.to;else t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}function Xe(e,t,n=t.selection.ranges){let r=n.map((l)=>be(t,l.from).block);if(!r.every((l)=>l))return null;let o=n.map((l,s)=>sn(t,r[s],l.from,l.to));if(e!=2&&!o.every((l)=>l))return{changes:t.changes(n.map((l,s)=>{if(o[s])return[];return[{from:l.from,insert:r[s].open+" "},{from:l.to,insert:" "+r[s].close}]}))};else if(e!=1&&o.some((l)=>l)){let l=[];for(let s=0,a;s<o.length;s++)if(a=o[s]){let u=r[s],{open:f,close:h}=a;l.push({from:f.pos-u.open.length,to:f.pos+f.margin},{from:h.pos-h.margin,to:h.pos+u.close.length})}return{changes:l}}return null}function an(e,t,n=t.selection.ranges){let r=[],o=-1;e:for(let{from:l,to:s}of n){let a=r.length,u=1e9,f;for(let h=l;h<=s;){let d=t.doc.lineAt(h);if(f==null){if(f=be(t,d.from).line,!f)continue e}if(d.from>o&&(l==s||s>d.from)){o=d.from;let m=/^\s*/.exec(d.text)[0].length,D=m==d.length,v=d.text.slice(m,m+f.length)==f?m:-1;if(m<d.text.length&&m<u)u=m;r.push({line:d,comment:v,token:f,indent:m,empty:D,single:!1})}h=d.to+1}if(u<1e9){for(let h=a;h<r.length;h++)if(r[h].indent<r[h].line.text.length)r[h].indent=u}if(r.length==a+1)r[a].single=!0}if(e!=2&&r.some((l)=>l.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:a,token:u,indent:f,empty:h,single:d}of r)if(d||!h)l.push({from:a.from+f,insert:u+" "});let s=t.changes(l);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some((l)=>l.comment>=0)){let l=[];for(let{line:s,comment:a,token:u}of r)if(a>=0){let f=s.from+a,h=f+u.length;if(s.text[h-s.from]==" ")h++;l.push({from:f,to:h})}return{changes:l}}return null}var xe=qe.define(),un=qe.define(),hn=w.define(),Ye=w.define({combine(e){return bt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,o)=>t(r,o)||n(r,o)})}}),Ze=Me.define({create(){return A.empty},update(e,t){let n=t.state.facet(Ye),r=t.annotation(xe);if(r){let u=y.fromTransaction(t,r.selection),f=r.side,h=f==0?e.undone:e.done;if(u)h=H(h,h.length,n.minDepth,u);else h=nt(h,t.startState.selection);return new A(f==0?r.rest:h,f==0?h:r.rest)}let o=t.annotation(un);if(o=="full"||o=="before")e=e.isolate();if(t.annotation(le.addToHistory)===!1)return!t.changes.empty?e.addMapping(t.changes.desc):e;let l=y.fromTransaction(t),s=t.annotation(le.time),a=t.annotation(le.userEvent);if(l)e=e.addChanges(l,s,a,n,t);else if(t.selection)e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay);if(o=="full"||o=="after")e=e.isolate();return e},toJSON(e){return{done:e.done.map((t)=>t.toJSON()),undone:e.undone.map((t)=>t.toJSON())}},fromJSON(e){return new A(e.done.map(y.fromJSON),e.undone.map(y.fromJSON))}});function et(e={}){return[Ze,Ye.of(e),b.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?j:t.inputType=="historyRedo"?U:null;if(!r)return!1;return t.preventDefault(),r(n)}})]}function Q(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(Ze,!1);if(!o)return!1;let l=o.pop(e,n,t);if(!l)return!1;return r(l),!0}}var j=Q(0,!1),U=Q(1,!1),fn=Q(0,!0),dn=Q(1,!0);class y{constructor(e,t,n,r,o){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new y(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((r)=>r.toJSON())}}static fromJSON(e){return new y(e.changes&&Oe.fromJSON(e.changes),[],e.mapped&&pt.fromJSON(e.mapped),e.startSelection&&c.fromJSON(e.startSelection),e.selectionsAfter.map(c.fromJSON))}static fromTransaction(e,t){let n=S;for(let r of e.startState.facet(hn)){let o=r(e);if(o.length)n=n.concat(o)}if(!n.length&&e.changes.empty)return null;return new y(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,S)}static selection(e){return new y(void 0,S,void 0,void 0,e)}}function H(e,t,n,r){let o=t+1>n+20?t-n-1:0,l=e.slice(o,t);return l.push(r),l}function mn(e,t){let n=[],r=!1;return e.iterChangedRanges((o,l)=>n.push(o,l)),t.iterChangedRanges((o,l,s,a)=>{for(let u=0;u<n.length;){let f=n[u++],h=n[u++];if(a>=f&&s<=h)r=!0}}),r}function pn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function tt(e,t){return!e.length?t:!t.length?e:e.concat(t)}var S=[],gn=200;function nt(e,t){if(!e.length)return[y.selection([t])];else{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-gn));if(r.length&&r[r.length-1].eq(t))return e;return r.push(t),H(e,e.length-1,1e9,n.setSelAfter(r))}}function yn(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function pe(e,t){if(!e.length)return e;let n=e.length,r=S;while(n){let o=xn(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let l=e.slice(0,n);return l[n-1]=o,l}else t=o.mapped,n--,r=o.selectionsAfter}return r.length?[y.selection(r)]:S}function xn(e,t,n){let r=tt(e.selectionsAfter.length?e.selectionsAfter.map((a)=>a.map(t)):S,n);if(!e.changes)return y.selection(r);let o=e.changes.map(t),l=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(l):l;return new y(o,G.mapEffects(e.effects,t),s,e.startSelection.map(l),r)}var Sn=/^(input\.type|delete)($|\.)/;class A{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new A(this.done,this.undone):this}addChanges(e,t,n,r,o){let l=this.done,s=l[l.length-1];if(s&&s.changes&&!s.changes.empty&&e.changes&&(!n||Sn.test(n))&&(!s.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,mn(s.changes,e.changes))||n=="input.type.compose"))l=H(l,l.length-1,r.minDepth,new y(e.changes.compose(s.changes),tt(G.mapEffects(e.effects,s.changes),s.effects),s.mapped,s.startSelection,S));else l=H(l,l.length,r.minDepth,e);return new A(l,S,t,n)}addSelection(e,t,n,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:S;if(o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&pn(o[o.length-1],e))return this;return new A(nt(this.done,e),this.undone,t,n)}addMapping(e){return new A(pe(this.done,e),pe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let o=r[r.length-1],l=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):t.selection);if(n&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:xe.of({side:e,rest:yn(r),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});else if(!o.changes)return null;else{let s=r.length==1?S:r.slice(0,r.length-1);if(o.mapped)s=pe(s,o.mapped);return t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:xe.of({side:e,rest:s,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}}}A.empty=new A(S,S);var rt=[{key:"Mod-z",run:j,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:U,preventDefault:!0},{linux:"Ctrl-Shift-z",run:U,preventDefault:!0},{key:"Mod-u",run:fn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:dn,preventDefault:!0}];function O(e,t){return c.create(e.ranges.map(t),e.mainIndex)}function C(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function M({state:e,dispatch:t},n){let r=O(e.selection,n);if(r.eq(e.selection,!0))return!1;return t(C(e,r)),!0}function Y(e,t){return c.cursor(t?e.to:e.from)}function ot(e,t){return M(e,(n)=>n.empty?e.moveByChar(n,t):Y(n,t))}function g(e){return e.textDirectionAt(e.state.selection.main.head)==oe.LTR}var lt=(e)=>ot(e,!g(e)),st=(e)=>ot(e,g(e));function ct(e,t){return M(e,(n)=>n.empty?e.moveByGroup(n,t):Y(n,t))}var kn=(e)=>ct(e,!g(e)),vn=(e)=>ct(e,g(e));var $r=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function bn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Z(e,t,n){let r=X(e).resolveInner(t.head),o=n?P.closedBy:P.openedBy;for(let u=t.head;;){let f=n?r.childAfter(u):r.childBefore(u);if(!f)break;if(bn(e,f,o))r=f;else u=n?f.to:f.from}let l=r.type.prop(o),s,a;if(l&&(s=n?gt(e,r.from,1):gt(e,r.to,-1))&&s.matched)a=n?s.end.to:s.end.from;else a=n?r.to:r.from;return c.cursor(a,n?-1:1)}var Cn=(e)=>M(e,(t)=>Z(e.state,t,!g(e))),An=(e)=>M(e,(t)=>Z(e.state,t,g(e)));function at(e,t){return M(e,(n)=>{if(!n.empty)return Y(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}var ut=(e)=>at(e,!1),ht=(e)=>at(e,!0);function ft(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,o;if(t){for(let l of e.state.facet(b.scrollMargins)){let s=l(e);if(s===null||s===void 0?void 0:s.top)n=Math.max(s===null||s===void 0?void 0:s.top,n);if(s===null||s===void 0?void 0:s.bottom)r=Math.max(s===null||s===void 0?void 0:s.bottom,r)}o=e.scrollDOM.clientHeight-n-r}else o=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,o-5)}}function dt(e,t){let n=ft(e),{state:r}=e,o=O(r.selection,(s)=>s.empty?e.moveVertically(s,t,n.height):Y(s,t));if(o.eq(r.selection))return!1;let l;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),u=a.top+n.marginTop,f=a.bottom-n.marginBottom;if(s&&s.top>u&&s.bottom<f)l=b.scrollIntoView(o.main.head,{y:"start",yMargin:s.top-u})}return e.dispatch(C(r,o),{effects:l}),!0}var ze=(e)=>dt(e,!1),Se=(e)=>dt(e,!0);function E(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from))o=e.moveToLineBoundary(t,n,!1);if(!n&&o.head==r.from&&r.length){let l=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;if(l&&t.head!=r.from+l)o=c.cursor(r.from+l)}return o}var Ln=(e)=>M(e,(t)=>E(e,t,!0)),Bn=(e)=>M(e,(t)=>E(e,t,!1)),Dn=(e)=>M(e,(t)=>E(e,t,!g(e))),En=(e)=>M(e,(t)=>E(e,t,g(e))),Tn=(e)=>M(e,(t)=>e.moveToLineBoundary(t,!1,!1)),wn=(e)=>M(e,(t)=>e.moveToLineBoundary(t,!0,!1));function Wn(e,t,n){let r=!1,o=O(e.selection,(l)=>{let s=gt(e,l.head,-1)||gt(e,l.head,1)||l.head>0&>(e,l.head-1,1)||l.head<e.doc.length&>(e,l.head+1,-1);if(!s||!s.end)return l;r=!0;let a=s.start.from==l.head?s.end.to:s.end.from;return n?c.range(l.anchor,a):c.cursor(a)});if(!r)return!1;return t(C(e,o)),!0}var Rn=({state:e,dispatch:t})=>Wn(e,t,!1);function k(e,t,n){let r=O(e.state.selection,(o)=>{if(o.undirectional&&o.head>=o.anchor!=t)o=c.range(o.head,o.anchor);let l=n(o);return c.range(o.anchor,l.head,l.goalColumn,l.bidiLevel||void 0,l.assoc)});if(r.eq(e.state.selection))return!1;return e.dispatch(C(e.state,r)),!0}function mt(e,t){return k(e,t,(n)=>e.moveByChar(n,t))}var yt=(e)=>mt(e,!g(e)),xt=(e)=>mt(e,g(e));function St(e,t){return k(e,t,(n)=>e.moveByGroup(n,t))}var On=(e)=>St(e,!g(e)),Fn=(e)=>St(e,g(e));var In=(e)=>{let t=!g(e);return k(e,t,(n)=>Z(e.state,n,t))},Pn=(e)=>{let t=g(e);return k(e,t,(n)=>Z(e.state,n,t))};function kt(e,t){return k(e,t,(n)=>e.moveVertically(n,t))}var Ct=(e)=>kt(e,!1),Mt=(e)=>kt(e,!0);function At(e,t){return k(e,t,(n)=>e.moveVertically(n,t,ft(e).height))}var _e=(e)=>At(e,!1),Je=(e)=>At(e,!0),Nn=(e)=>k(e,!0,(t)=>E(e,t,!0)),qn=(e)=>k(e,!1,(t)=>E(e,t,!1)),Vn=(e)=>{let t=!g(e);return k(e,t,(n)=>E(e,n,t))},Gn=(e)=>{let t=g(e);return k(e,t,(n)=>E(e,n,t))},Un=(e)=>k(e,!1,(t)=>c.cursor(e.lineBlockAt(t.head).from)),zn=(e)=>k(e,!0,(t)=>c.cursor(e.lineBlockAt(t.head).to)),$e=({state:e,dispatch:t})=>(t(C(e,{anchor:0})),!0),Ke=({state:e,dispatch:t})=>(t(C(e,{anchor:e.doc.length})),!0),He=({state:e,dispatch:t})=>(t(C(e,{anchor:e.selection.main.anchor,head:0})),!0),Qe=({state:e,dispatch:t})=>(t(C(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),_n=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Jn=({state:e,dispatch:t})=>{let n=ee(e).map(({from:r,to:o})=>c.undirectionalRange(r,Math.min(o+1,e.doc.length)));return t(e.update({selection:c.create(n),userEvent:"select"})),!0},$n=({state:e,dispatch:t})=>{let n=O(e.selection,(r)=>{let o=X(e),l=o.resolveStack(r.from,1);if(r.empty){let s=o.resolveStack(r.from,-1);if(s.node.from>=l.node.from&&s.node.to<=l.node.to)l=s}for(let s=l;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return c.undirectionalRange(a.from,a.to)}return r});if(n.eq(e.selection))return!1;return t(C(e,n)),!0};function Lt(e,t){let{state:n}=e,r=n.selection,o=n.selection.ranges.slice();for(let l of n.selection.ranges){let s=n.doc.lineAt(l.head);if(t?s.to<e.state.doc.length:s.from>0)for(let a=l;;){let u=e.moveVertically(a,t);if(u.head<s.from||u.head>s.to){if(!o.some((f)=>f.head==u.head))o.push(u);break}else if(u.head==a.head)break;else a=u}}if(o.length==r.ranges.length)return!1;return e.dispatch(C(n,c.create(o,o.length-1))),!0}var Hn=(e)=>Lt(e,!1),jn=(e)=>Lt(e,!0),Xn=({state:e,dispatch:t})=>{let n=e.selection,r=null;if(n.ranges.length>1)r=c.create([n.main]);else if(!n.main.empty)r=c.create([c.cursor(n.main.head)]);if(!r)return!1;return t(C(e,r)),!0};function z(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange((l)=>{let{from:s,to:a}=l;if(s==a){let u=t(l);if(u<s)n="delete.backward",u=K(e,u,!1);else if(u>s)n="delete.forward",u=K(e,u,!0);s=Math.min(s,u),a=Math.max(a,u)}else s=K(e,s,!1),a=K(e,a,!0);return s==a?{range:l}:{changes:{from:s,to:a},range:c.cursor(s,s<l.head?-1:1)}});if(o.changes.empty)return!1;return e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?b.announce.of(r.phrase("Selection deleted")):void 0})),!0}function K(e,t,n){if(e instanceof b)for(let r of e.state.facet(b.atomicRanges).map((o)=>o(e)))r.between(t,t,(o,l)=>{if(o<t&&l>t)t=n?l:o});return t}var Bt=(e,t,n)=>z(e,(r)=>{let o=r.from,{state:l}=e,s=l.doc.lineAt(o),a,u;if(n&&!t&&o>s.from&&o<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,o-s.from))){if(a[a.length-1]=="\t")return o-1;let f=Be(a,l.tabSize),h=f%Vt(l)||Vt(l);for(let d=0;d<h&&a[a.length-1-d]==" ";d++)o--;u=o}else if(u=ge(s.text,o-s.from,t,t)+s.from,u==o&&s.number!=(t?l.doc.lines:1))u+=t?1:-1;else if(!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(u-s.from,o-s.from)))u=ge(s.text,u-s.from,!1,!1)+s.from;return u}),ke=(e)=>Bt(e,!1,!0);var Dt=(e)=>Bt(e,!0,!1),Et=(e,t)=>z(e,(n)=>{let r=n.head,{state:o}=e,l=o.doc.lineAt(r),s=o.charCategorizer(r);for(let a=null;;){if(r==(t?l.to:l.from)){if(r==n.head&&l.number!=(t?o.doc.lines:1))r+=t?1:-1;break}let u=ge(l.text,r-l.from,t)+l.from,f=l.text.slice(Math.min(r,u)-l.from,Math.max(r,u)-l.from),h=s(f);if(a!=null&&h!=a)break;if(f!=" "||r!=n.head)a=h;r=u}return r}),wt=(e)=>Et(e,!1),Yn=(e)=>Et(e,!0);var Zn=(e)=>z(e,(t)=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)});var er=(e)=>z(e,(t)=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),tr=(e)=>z(e,(t)=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)});var nr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((r)=>({changes:{from:r.from,to:r.to,insert:B.of(["",""])},range:c.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},rr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((r)=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let o=r.from,l=e.doc.lineAt(o),s=o==l.from?o-1:ge(l.text,o-l.from,!1)+l.from,a=o==l.to?o+1:ge(l.text,o-l.from,!0)+l.from;return{changes:{from:s,to:a,insert:e.doc.slice(o,a).append(e.doc.slice(s,o))},range:c.cursor(a)}});if(n.changes.empty)return!1;return t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0};function ee(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),l=e.doc.lineAt(r.to);if(!r.empty&&r.to==l.from)l=e.doc.lineAt(r.to-1);if(n>=o.number){let s=t[t.length-1];s.to=l.to,s.ranges.push(r)}else t.push({from:o.from,to:l.to,ranges:[r]});n=l.number+1}return t}function Wt(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let l of ee(e)){if(n?l.to==e.doc.length:l.from==0)continue;let s=e.doc.lineAt(n?l.to+1:l.from-1),a=s.length+1;if(n){r.push({from:l.to,to:s.to},{from:l.from,insert:s.text+e.lineBreak});for(let u of l.ranges)o.push(c.range(Math.min(e.doc.length,u.anchor+a),Math.min(e.doc.length,u.head+a)))}else{r.push({from:s.from,to:l.from},{from:l.to,insert:e.lineBreak+s.text});for(let u of l.ranges)o.push(c.range(u.anchor-a,u.head-a))}}if(!r.length)return!1;return t(e.update({changes:r,scrollIntoView:!0,selection:c.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0}var or=({state:e,dispatch:t})=>Wt(e,t,!1),lr=({state:e,dispatch:t})=>Wt(e,t,!0);function Rt(e,t,n){if(e.readOnly)return!1;let r=[];for(let l of ee(e))if(n)r.push({from:l.from,insert:e.doc.slice(l.from,l.to)+e.lineBreak});else r.push({from:l.to,insert:e.lineBreak+e.doc.slice(l.from,l.to)});let o=e.changes(r);return t(e.update({changes:o,selection:e.selection.map(o,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var ir=({state:e,dispatch:t})=>Rt(e,t,!1),sr=({state:e,dispatch:t})=>Rt(e,t,!0),cr=(e)=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ee(t).map(({from:o,to:l})=>{if(o>0)o--;else if(l<t.doc.length)l++;return{from:o,to:l}})),r=O(t.selection,(o)=>{let l=void 0;if(e.lineWrapping){let s=e.lineBlockAt(o.head),a=e.coordsAtPos(o.head,o.assoc||1);if(a)l=s.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2}return e.moveVertically(o,!0,l)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ar(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=X(e).resolveInner(t),r=n.childBefore(t),o=n.childAfter(t),l;if(r&&o&&r.to<=t&&o.from>=t&&(l=r.type.prop(P.closedBy))&&l.indexOf(o.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(o.from).from&&!/\S/.test(e.sliceDoc(r.to,o.from)))return{from:r.to,to:o.from};return null}var je=Ot(!1),ur=Ot(!0);function Ot(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange((o)=>{let{from:l,to:s}=o,a=t.doc.lineAt(l),u=!e&&l==s&&ar(t,l);if(e)l=s=(s<=a.to?a:t.doc.lineAt(s)).to;let f=new Qn(t,{simulateBreak:l,simulateDoubleBreak:!!u}),h=mr(f,l);if(h==null)h=Be(/^\s*/.exec(t.doc.lineAt(l).text)[0],t.tabSize);while(s<a.to&&/\s/.test(a.text[s-a.from]))s++;if(u)({from:l,to:s}=u);else if(l>a.from&&l<a.from+100&&!/\S/.test(a.text.slice(0,l)))l=a.from;let d=["",ti(t,h)];if(u)d.push(ti(t,f.lineIndent(a.from,-1)));return{changes:{from:l,to:s,insert:B.of(d)},range:c.cursor(l+1+d[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ce(e,t){let n=-1;return e.changeByRange((r)=>{let o=[];for(let s=r.from;s<=r.to;){let a=e.doc.lineAt(s);if(a.number>n&&(r.empty||r.to>a.from))t(a,o,r),n=a.number;s=a.to+1}let l=e.changes(o);return{changes:o,range:c.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}var hr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Qn(e,{overrideIndentation:(l)=>{let s=n[l];return s==null?-1:s}}),o=Ce(e,(l,s,a)=>{let u=mr(r,l.from);if(u==null)return;if(!/\S/.test(l.text))u=0;let f=/^\s*/.exec(l.text)[0],h=ti(e,u);if(f!=h||a.from<l.from+f.length)n[l.from]=u,s.push({from:l.from,to:l.from+f.length,insert:h})});if(!o.changes.empty)t(e.update(o,{userEvent:"indent"}));return!0},te=({state:e,dispatch:t})=>{if(e.readOnly)return!1;return t(e.update(Ce(e,(n,r)=>{r.push({from:n.from,insert:e.facet(it)})}),{userEvent:"input.indent"})),!0},Ft=({state:e,dispatch:t})=>{if(e.readOnly)return!1;return t(e.update(Ce(e,(n,r)=>{let o=/^\s*/.exec(n.text)[0];if(!o)return;let l=Be(o,e.tabSize),s=0,a=ti(e,Math.max(0,l-Vt(e)));while(s<o.length&&s<a.length&&o.charCodeAt(s)==a.charCodeAt(s))s++;r.push({from:n.from+s,to:n.from+o.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0},fr=(e)=>(e.setTabFocusMode(),!0);var dr=[{key:"Ctrl-b",run:lt,shift:yt,preventDefault:!0},{key:"Ctrl-f",run:st,shift:xt},{key:"Ctrl-p",run:ut,shift:Ct},{key:"Ctrl-n",run:ht,shift:Mt},{key:"Ctrl-a",run:Tn,shift:Un},{key:"Ctrl-e",run:wn,shift:zn},{key:"Ctrl-d",run:Dt},{key:"Ctrl-h",run:ke},{key:"Ctrl-k",run:Zn},{key:"Ctrl-Alt-h",run:wt},{key:"Ctrl-o",run:nr},{key:"Ctrl-t",run:rr},{key:"Ctrl-v",run:Se}],pr=[{key:"ArrowLeft",run:lt,shift:yt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:kn,shift:On,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Dn,shift:Vn,preventDefault:!0},{key:"ArrowRight",run:st,shift:xt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:vn,shift:Fn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:En,shift:Gn,preventDefault:!0},{key:"ArrowUp",run:ut,shift:Ct,preventDefault:!0},{mac:"Cmd-ArrowUp",run:$e,shift:He},{mac:"Ctrl-ArrowUp",run:ze,shift:_e},{key:"ArrowDown",run:ht,shift:Mt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ke,shift:Qe},{mac:"Ctrl-ArrowDown",run:Se,shift:Je},{key:"PageUp",run:ze,shift:_e},{key:"PageDown",run:Se,shift:Je},{key:"Home",run:Bn,shift:qn,preventDefault:!0},{key:"Mod-Home",run:$e,shift:He},{key:"End",run:Ln,shift:Nn,preventDefault:!0},{key:"Mod-End",run:Ke,shift:Qe},{key:"Enter",run:je,shift:je},{key:"Mod-a",run:_n},{key:"Backspace",run:ke,shift:ke,preventDefault:!0},{key:"Delete",run:Dt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:wt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Yn,preventDefault:!0},{mac:"Mod-Backspace",run:er,preventDefault:!0},{mac:"Mod-Delete",run:tr,preventDefault:!0}].concat(dr.map((e)=>({mac:e.key,run:e.run,shift:e.shift}))),Pt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Cn,shift:In},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:An,shift:Pn},{key:"Alt-ArrowUp",run:or},{key:"Shift-Alt-ArrowUp",run:ir},{key:"Alt-ArrowDown",run:lr},{key:"Shift-Alt-ArrowDown",run:sr},{key:"Mod-Alt-ArrowUp",run:Hn},{key:"Mod-Alt-ArrowDown",run:jn},{key:"Escape",run:Xn},{key:"Mod-Enter",run:ur},{key:"Alt-l",mac:"Ctrl-l",run:Jn},{key:"Mod-i",run:$n,preventDefault:!0},{key:"Mod-[",run:Ft},{key:"Mod-]",run:te},{key:"Mod-Alt-\\",run:hr},{key:"Shift-Mod-k",run:cr},{key:"Shift-Mod-\\",run:Rn},{key:"Mod-/",run:nn},{key:"Alt-A",mac:"Ctrl-A",run:on},{key:"Ctrl-m",mac:"Shift-Alt-m",run:fr}].concat(pr),Nt={key:"Tab",run:te,shift:Ft};var qt=typeof String.prototype.normalize=="function"?(e)=>e.normalize("NFKD"):(e)=>e;class W{constructor(e,t,n=0,r=e.length,o,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?(s)=>o(qt(s)):qt,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ei(this.buffer,this.bufferPos)}next(){while(this.matches.length)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=wo(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ai(e);let r=this.normalize(t);if(r.length)for(let o=0,l=n,s=!0;;o++){let a=r.charCodeAt(o),u=this.match(a,l,s,this.bufferPos+this.bufferStart,o==r.length-1);if(u)return this.value=u,this;if(o==r.length-1)break;if(s&&o<t.length&&t.charCodeAt(o)==a)l++;else s=!1}}}match(e,t,n,r,o){let l=null;for(let s=0;s<this.matches.length;){let a=this.matches[s],u=!1;if(this.query.charCodeAt(a.index)==e)if(a.index==this.query.length-1)l={from:a.from,to:r,precise:o&&a.precise};else a.index++,u=!0;if(u)s++;else this.matches.splice(s,1)}if(this.query.charCodeAt(0)==e)if(this.query.length==1)l={from:t,to:r,precise:n&&o};else this.matches.push({from:t,index:1,precise:n});if(l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart))l=null;return l}}if(typeof Symbol<"u")W.prototype[Symbol.iterator]=function(){return this};var zt={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Te="gm"+(/x/.unicode==null?"":"u");class we{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=zt,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new We(e,t,n,r,o);this.re=new RegExp(t,Te+((n===null||n===void 0?void 0:n.ignoreCase)?"i":"")),this.test=n===null||n===void 0?void 0:n.test,this.iter=e.iter();let l=e.lineAt(r);this.curLineStart=l.from,this.matchPos=se(e,r),this.getLine(this.curLineStart)}getLine(e){if(this.iter.next(e),this.iter.lineBreak)this.curLine="";else{if(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to)this.curLine=this.curLine.slice(0,this.to-this.curLineStart);this.iter.next()}}nextLine(){if(this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to)this.curLine="";else this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=se(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length)this.nextLine();if((n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}var Le=new WeakMap;class N{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=Le.get(e);if(!r||r.from>=n||r.to<=t){let s=new N(t,e.sliceString(t,n));return Le.set(e,s),s}if(r.from==t&&r.to==n)return r;let{text:o,from:l}=r;if(l>t)o=e.sliceString(t,l)+o,l=t;if(r.to<n)o+=e.sliceString(r.to,n);return Le.set(e,new N(l,o)),new N(t,o.slice(t-l,n-l))}}class We{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=zt,this.matchPos=se(e,r),this.re=new RegExp(t,Te+((n===null||n===void 0?void 0:n.ignoreCase)?"i":"")),this.test=n===null||n===void 0?void 0:n.test,this.flat=N.get(e,r,this.chunkEnd(r+5000))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e)this.re.lastIndex=e+1,t=this.re.exec(this.flat.text);if(t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this.matchPos=se(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=N.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}if(typeof Symbol<"u")we.prototype[Symbol.iterator]=We.prototype[Symbol.iterator]=function(){return this};function gr(e){try{return new RegExp(e,Te),!0}catch(t){return!1}}function se(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;while(t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344)t++;return t}var yr=(e)=>{let t=Qo(e,"cm-goto-line");if(t){let s=t.dom.querySelector("input[type=text]");if(s)s.select();return!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:o,result:l}=Po(e,{class:"cm-goto-line",label:n.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:n.phrase("go")});return l.then((s)=>{let a=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!a){e.dispatch({effects:o});return}let u=n.doc.lineAt(n.selection.main.head),[,f,h,d,m]=a,D=d?+d.slice(1):0,v=h?+h:u.number;if(h&&m){let me=v/100;if(f)me=me*(f=="-"?-1:1)+u.number/n.doc.lines;v=Math.round(n.doc.lines*me)}else if(h&&f)v=v*(f=="-"?-1:1)+u.number;let Ge=n.doc.line(Math.max(1,Math.min(n.doc.lines,v))),Ue=c.cursor(Ge.from+Math.max(0,Math.min(D,Ge.length)));e.dispatch({effects:[o,b.scrollIntoView(Ue.from,{y:"center"})],selection:Ue})}),!0},xr={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},_t=w.define({combine(e){return bt(e,xr,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Jt(e){let t=[Cr,br];if(e)t.push(_t.of(e));return t}var Sr=L.mark({class:"cm-selectionMatch"}),kr=L.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Gt(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=ce.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=ce.Word)}function vr(e,t,n,r){return e(t.sliceDoc(n,n+1))==ce.Word&&e(t.sliceDoc(r-1,r))==ce.Word}var br=Ae.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){if(e.selectionSet||e.docChanged||e.viewportChanged)this.decorations=this.getDeco(e.view)}getDeco(e){let t=e.state.facet(_t),{state:n}=e,r=n.selection;if(r.ranges.length>1)return L.none;let o=r.main,l,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return L.none;let u=n.wordAt(o.head);if(!u)return L.none;s=n.charCategorizer(o.head),l=n.sliceDoc(u.from,u.to)}else{let u=o.to-o.from;if(u<t.minSelectionLength||u>200)return L.none;if(t.wholeWords){if(l=n.sliceDoc(o.from,o.to),s=n.charCategorizer(o.head),!(Gt(s,n,o.from,o.to)&&vr(s,n,o.from,o.to)))return L.none}else if(l=n.sliceDoc(o.from,o.to),!l)return L.none}let a=[];for(let u of e.visibleRanges){let f=new W(n.doc,l,u.from,u.to);while(!f.next().done){let{from:h,to:d}=f.value;if(!s||Gt(s,n,h,d)){if(o.empty&&h<=o.from&&d>=o.to)a.push(kr.range(h,d));else if(h>=o.to||d<=o.from)a.push(Sr.range(h,d));if(a.length>t.maxMatches)return L.none}}}return L.set(a)}},{decorations:(e)=>e.decorations}),Cr=b.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Mr=({state:e,dispatch:t})=>{let{selection:n}=e,r=c.create(n.ranges.map((o)=>e.wordAt(o.head)||c.cursor(o.head)),n.mainIndex);if(r.eq(n))return!1;return t(e.update({selection:r})),!0};function Ar(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),l=o&&o.from==n.from&&o.to==n.to;for(let s=!1,a=new W(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new W(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some((u)=>u.from==a.value.from))continue;if(l){let u=e.wordAt(a.value.from);if(!u||u.from!=a.value.from||u.to!=a.value.to)continue}return a.value}}var Lr=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((l)=>l.from===l.to))return Mr({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((l)=>e.sliceDoc(l.from,l.to)!=r))return!1;let o=Ar(e,r);if(!o)return!1;return t(e.update({selection:e.selection.addRange(c.range(o.from,o.to),!1),effects:b.scrollIntoView(o.to)})),!0},R=w.define({combine(e){return bt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:(t)=>new Zt(t),scrollToMatch:(t)=>b.scrollIntoView(t)})}});function $t(e){return e?[R.of(e),Ee]:Ee}class Re{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||gr(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
|
|
2
|
+
`:n=="r"?"\r":n=="t"?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ht(this):new Kt(this)}getCursor(e,t=0,n){let r=e.doc?e:V.create({doc:e});if(n==null)n=r.doc.length;return this.regexp?I(this,r,t,n):F(this,r,t,n)}}class Fe{constructor(e){this.spec=e}}function Br(e,t,n){return(r,o,l,s)=>{if(n&&!n(r,o,l,s))return!1;let a=r>=s&&o<=s+l.length?l.slice(r-s,o-s):t.doc.sliceString(r,o);return e(a,t,r,o)}}function F(e,t,n,r){let o;if(e.wholeWord)o=Dr(t.doc,t.charCategorizer(t.selection.main.head));if(e.test)o=Br(e.test,t,o);return new W(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:(l)=>l.toLowerCase(),o)}function Dr(e,t){return(n,r,o,l)=>{if(l>n||l+o.length<r)l=Math.max(0,n-2),o=e.sliceString(l,Math.min(e.length,r+2));return(t(ae(o,n-l))!=ce.Word||t(ue(o,n-l))!=ce.Word)&&(t(ue(o,r-l))!=ce.Word||t(ae(o,r-l))!=ce.Word)}}class Kt extends Fe{constructor(e){super(e)}nextMatch(e,t,n){let r=F(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let o=Math.min(e.doc.length,t+this.spec.unquoted.length);r=F(this.spec,e,0,o).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let o=Math.max(t,r-1e4-this.spec.unquoted.length),l=F(this.spec,e,o,r),s=null;while(!l.nextOverlapping().done)s=l.value;if(s)return s;if(o==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);if(!r)r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length);return r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=F(this.spec,e,0,e.doc.length),r=[];while(!n.next().done){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=F(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));while(!o.next().done)r(o.value.from,o.value.to)}}function Er(e,t,n){return(r,o,l)=>(!n||n(r,o,l))&&e(l[0],t,r,o)}function I(e,t,n,r){let o;if(e.wholeWord)o=Tr(t.charCategorizer(t.selection.main.head));if(e.test)o=Er(e.test,t,o);return new we(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function ae(e,t){return e.slice(ge(e,t,!1),t)}function ue(e,t){return e.slice(t,ge(e,t))}function Tr(e){return(t,n,r)=>!r[0].length||(e(ae(r.input,r.index))!=ce.Word||e(ue(r.input,r.index))!=ce.Word)&&(e(ue(r.input,r.index+r[0].length))!=ce.Word||e(ae(r.input,r.index+r[0].length))!=ce.Word)}class Ht extends Fe{nextMatch(e,t,n){let r=I(this.spec,e,n,e.doc.length).next();if(r.done)r=I(this.spec,e,0,t).next();return r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-r*1e4),l=I(this.spec,e,o,n),s=null;while(!l.next().done)s=l.value;if(s&&(o==t||s.from>o+10))return s;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let o=+n.slice(0,r);if(o>0&&o<e.match.length)return e.match[o]+n.slice(r)}return t})}matchAll(e,t){let n=I(this.spec,e,0,e.doc.length),r=[];while(!n.next().done){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=I(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));while(!o.next().done)r(o.value.from,o.value.to)}}var _=G.define(),Ie=G.define(),T=Me.define({create(e){return new ie(De(e).create(),null)},update(e,t){for(let n of t.effects)if(n.is(_))e=new ie(n.value.create(),e.panel);else if(n.is(Ie))e=new ie(e.query,n.value?Pe:null);return e},provide:(e)=>Kn.from(e,(t)=>t.panel)});class ie{constructor(e,t){this.query=e,this.panel=t}}var wr=L.mark({class:"cm-searchMatch"}),Wr=L.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Rr=Ae.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(T))}update(e){let t=e.state.field(T);if(t!=e.startState.field(T)||e.docChanged||e.selectionSet||e.viewportChanged)this.decorations=this.highlight(t)}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return L.none;let{view:n}=this,r=new vt;for(let o=0,l=n.visibleRanges,s=l.length;o<s;o++){let{from:a,to:u}=l[o];while(o<s-1&&u>l[o+1].from-500)u=l[++o].to;e.highlight(n.state,a,u,(f,h)=>{let d=n.state.selection.ranges.some((m)=>m.from==f&&m.to==h);r.add(f,h,d?Wr:wr)})}return r.finish()}},{decorations:(e)=>e.decorations});function J(e){return(t)=>{let n=t.state.field(T,!1);return n&&n.query.spec.valid?e(t,n):de(t)}}var he=J((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=c.single(r.from,r.to),l=e.state.facet(R);return e.dispatch({selection:o,effects:[Ne(e,r),l.scrollToMatch(o.main,e)],userEvent:"select.search"}),jt(e),!0}),fe=J((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let l=c.single(o.from,o.to),s=e.state.facet(R);return e.dispatch({selection:l,effects:[Ne(e,o),s.scrollToMatch(l.main,e)],userEvent:"select.search"}),jt(e),!0}),Or=J((e,{query:t})=>{let n=t.matchAll(e.state,1000);if(!n||!n.length)return!1;return e.dispatch({selection:c.create(n.map((r)=>c.range(r.from,r.to))),userEvent:"select.search.matches"}),!0}),Fr=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,l=[],s=0;for(let a=new W(e.doc,e.sliceDoc(r,o));!a.next().done;){if(l.length>1000)return!1;if(a.value.from==r)s=l.length;l.push(c.range(a.value.from,a.value.to))}return t(e.update({selection:c.create(l,s),userEvent:"select.search.matches"})),!0},Ut=J((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let l=t.nextMatch(n,r,r);if(!l)return!1;let s=l,a=[],u,f,h=[];if(!s.precise)s=t.nextMatch(n,s.from,s.to);else if(s.from==r&&s.to==o)f=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:f}),s=t.nextMatch(n,s.from,s.to),h.push(b.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."));let d=e.state.changes(a);if(s)u=c.single(s.from,s.to).map(d),h.push(Ne(e,s)),h.push(n.facet(R).scrollToMatch(u.main,e));return e.dispatch({changes:d,selection:u,effects:h,userEvent:"input.replace"}),!0}),Ir=J((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let o of t.matchAll(e.state,1e9)){let{from:l,to:s,precise:a}=o;if(a)n.push({from:l,to:s,insert:t.getReplacement(o)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:b.announce.of(r),userEvent:"input.replace.all"}),!0});function Pe(e){return e.state.facet(R).createPanel(e)}function De(e,t){var n,r,o,l,s;let a=e.selection.main,u=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!u)return t;let f=e.facet(R);return new Re({search:((n=t===null||t===void 0?void 0:t.literal)!==null&&n!==void 0?n:f.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=t===null||t===void 0?void 0:t.caseSensitive)!==null&&r!==void 0?r:f.caseSensitive,literal:(o=t===null||t===void 0?void 0:t.literal)!==null&&o!==void 0?o:f.literal,regexp:(l=t===null||t===void 0?void 0:t.regexp)!==null&&l!==void 0?l:f.regexp,wholeWord:(s=t===null||t===void 0?void 0:t.wholeWord)!==null&&s!==void 0?s:f.wholeWord})}function Qt(e){let t=$i(e,Pe);return t&&t.dom.querySelector("[main-field]")}function jt(e){let t=Qt(e);if(t&&t==e.root.activeElement)t.select()}var de=(e)=>{let t=e.state.field(T,!1);if(t&&t.panel){let n=Qt(e);if(n&&n!=e.root.activeElement){let r=De(e.state,t.query.spec);if(r.valid)e.dispatch({effects:_.of(r)});n.focus(),n.select()}}else e.dispatch({effects:[Ie.of(!0),t?_.of(De(e.state,t.query.spec)):G.appendConfig.of(Ee)]});return!0},Xt=(e)=>{let t=e.state.field(T,!1);if(!t||!t.panel)return!1;let n=$i(e,Pe);if(n&&n.dom.contains(e.root.activeElement))e.focus();return e.dispatch({effects:Ie.of(!1)}),!0},Yt=[{key:"Mod-f",run:de,scope:"editor search-panel"},{key:"F3",run:he,shift:fe,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:he,shift:fe,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Xt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Fr},{key:"Mod-Alt-g",run:yr},{key:"Mod-d",run:Lr,preventDefault:!0}];class Zt{constructor(e){this.view=e;let t=this.query=e.state.field(T).query.spec;this.commit=this.commit.bind(this),this.searchField=ye("input",{value:t.search,placeholder:x(e,"Find"),"aria-label":x(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ye("input",{value:t.replace,placeholder:x(e,"Replace"),"aria-label":x(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ye("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=ye("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=ye("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,o,l){return ye("button",{class:"cm-button",name:r,onclick:o,type:"button"},l)}this.dom=ye("div",{onkeydown:(r)=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>he(e),[x(e,"next")]),n("prev",()=>fe(e),[x(e,"previous")]),n("select",()=>Or(e),[x(e,"all")]),ye("label",null,[this.caseField,x(e,"match case")]),ye("label",null,[this.reField,x(e,"regexp")]),ye("label",null,[this.wordField,x(e,"by word")]),...e.state.readOnly?[]:[ye("br"),this.replaceField,n("replace",()=>Ut(e),[x(e,"replace")]),n("replaceAll",()=>Ir(e),[x(e,"replace all")])],ye("button",{name:"close",onclick:()=>Xt(e),"aria-label":x(e,"close"),type:"button"},["×"])])}commit(){let e=new Re({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});if(!e.eq(this.query))this.query=e,this.view.dispatch({effects:_.of(e)})}keydown(e){if(ko(this.view,e,"search-panel"))e.preventDefault();else if(e.keyCode==13&&e.target==this.searchField)e.preventDefault(),(e.shiftKey?fe:he)(this.view);else if(e.keyCode==13&&e.target==this.replaceField)e.preventDefault(),Ut(this.view)}update(e){for(let t of e.transactions)for(let n of t.effects)if(n.is(_)&&!n.value.eq(this.query))this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(R).top}}function x(e,t){return e.state.phrase(t)}var ne=30,re=/[\s\.,:;?!]/;function Ne(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,l=Math.max(r.from,t-ne),s=Math.min(o,n+ne),a=e.state.sliceDoc(l,s);if(l!=r.from){for(let u=0;u<ne;u++)if(!re.test(a[u+1])&&re.test(a[u])){a=a.slice(u);break}}if(s!=o){for(let u=a.length-1;u>a.length-ne;u--)if(!re.test(a[u-1])&&re.test(a[u])){a=a.slice(0,u);break}}return b.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}var Pr=b.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Ee=[T,Ve.low(Rr),Pr];var Nr=b.theme({"&":{color:"var(--code-fg)",backgroundColor:"var(--code-bg)",height:"100%",fontSize:"var(--code-size, 13px)"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:"var(--font-mono)",lineHeight:"1.55",overflow:"auto"},".cm-content":{caretColor:"var(--code-fg)",padding:"0.5rem 0"},".cm-line":{padding:"0 0.75rem"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--code-fg)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--code-selection)"},".cm-activeLine":{backgroundColor:"var(--code-active-line)"},".cm-gutters":{backgroundColor:"var(--code-gutter-bg)",color:"var(--code-gutter)",border:"none",borderRight:"1px solid var(--border)"},".cm-activeLineGutter":{backgroundColor:"var(--code-active-line)",color:"var(--code-fg)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5rem 0 0.5rem",minWidth:"2.25rem"},".cm-matchingBracket, .cm-nonmatchingBracket":{backgroundColor:"var(--code-selection)",outline:"1px solid var(--border-strong)"},".cm-searchMatch":{backgroundColor:"var(--warn-soft)",outline:"1px solid var(--warn)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--accent-soft)",outline:"1px solid var(--accent)"},".cm-panels":{backgroundColor:"var(--surface-2)",color:"var(--text)",borderColor:"var(--border)",fontFamily:"var(--font)"},".cm-panels-top":{borderBottom:"1px solid var(--border)"},".cm-panel.cm-search":{padding:"0.5rem 2rem 0.5rem 0.5rem"},".cm-panel.cm-search input, .cm-panel.cm-search button, .cm-panel.cm-search label":{fontSize:"0.875rem"},".cm-panel.cm-search input[type=text]":{backgroundColor:"var(--surface)",color:"var(--text)",border:"1px solid var(--control-border)",borderRadius:"var(--radius-sm)",padding:"0.25rem 0.5rem"},".cm-panel.cm-search button":{backgroundColor:"var(--surface-3)",color:"var(--text)",border:"1px solid var(--border-strong)",borderRadius:"var(--radius-sm)",backgroundImage:"none",padding:"0.25rem 0.625rem"},".cm-panel.cm-search [name=close]":{color:"var(--muted)"}}),qr=Mn.define([{tag:[i.keyword,i.modifier,i.operatorKeyword,i.controlKeyword],color:"var(--code-keyword)"},{tag:[i.string,i.regexp,i.special(i.string),i.inserted],color:"var(--code-string)"},{tag:[i.number,i.bool,i.null,i.atom,i.literal],color:"var(--code-number)"},{tag:[i.comment,i.lineComment,i.blockComment,i.docComment],color:"var(--code-comment)",fontStyle:"italic"},{tag:[i.typeName,i.className,i.namespace,i.tagName,i.standard(i.tagName)],color:"var(--code-type)"},{tag:[i.function(i.variableName),i.function(i.propertyName),i.definition(i.variableName),i.labelName],color:"var(--code-function)"},{tag:[i.meta,i.processingInstruction,i.annotation,i.attributeName,i.propertyName,i.heading],color:"var(--code-meta)"},{tag:i.heading,fontWeight:"bold"},{tag:i.strong,fontWeight:"bold"},{tag:i.emphasis,fontStyle:"italic"},{tag:i.strikethrough,textDecoration:"line-through"},{tag:i.link,color:"var(--code-function)",textDecoration:"underline"},{tag:i.url,color:"var(--code-function)"},{tag:i.invalid,color:"var(--danger)"},{tag:i.deleted,color:"var(--danger)"}]),en=[Nr,Ao(qr)];var Vr={typescript:()=>(p("2v652sh5"),import("./chunk-lang-typescript-2v652sh5.js")),javascript:()=>(p("vgxmgd0a"),import("./chunk-lang-javascript-vgxmgd0a.js")),json:()=>(p("hr12bzs1"),import("./chunk-lang-json-hr12bzs1.js")),markdown:()=>(p("ttzcpgkg"),import("./chunk-lang-markdown-ttzcpgkg.js")),css:()=>(p("7q1dtpgm"),import("./chunk-lang-css-7q1dtpgm.js")),html:()=>(p("xgvba8rn"),import("./chunk-lang-html-xgvba8rn.js")),python:()=>(p("ntj8maem"),import("./chunk-lang-python-ntj8maem.js")),yaml:()=>(p("ex31qbph"),import("./chunk-lang-yaml-ex31qbph.js")),go:()=>(p("9k4y107e"),import("./chunk-lang-go-9k4y107e.js")),rust:()=>(p("gv8y859d"),import("./chunk-lang-rust-gv8y859d.js")),sql:()=>(p("6vmze4pg"),import("./chunk-lang-sql-6vmze4pg.js")),xml:()=>(p("r2sbqnjv"),import("./chunk-lang-xml-r2sbqnjv.js")),shell:()=>(p("5zzs09b7"),import("./chunk-lang-shell-5zzs09b7.js")),toml:()=>(p("tt0d4rw9"),import("./chunk-lang-toml-tt0d4rw9.js")),dockerfile:()=>(p("n4bt8jbt"),import("./chunk-lang-dockerfile-n4bt8jbt.js"))};async function tn(e){if(e==="plain")return;try{return(await Vr[e]()).language()}catch(t){console.warn("a language for the editor failed to load",t);return}}function Gr(e){if(typeof e.attachShadow!=="function"||typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in Document.prototype))return{parent:e,root:void 0};let t=e.shadowRoot??e.attachShadow({mode:"open"}),n=new CSSStyleSheet;return n.replaceSync(":host{display:flex;flex-direction:column;min-height:0}.cm-editor{flex:1;min-height:0}"),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],{parent:t,root:t}}async function uo(e){let t=new It,n=new It,r=new It,o=await tn(e.language),l=(d)=>[V.readOnly.of(!d),b.editable.of(d)],s={editable:e.editable,wrap:e.wrap,language:o??[]},a,u=(d)=>[Mo(),To(),Ro(),et(),_o(),$o(),Jt(),$t({top:!0}),it.of(" "),V.phrases.of(e.phrases),en,Tt.of([{key:"Mod-s",preventDefault:!0,run:()=>(e.onSave(),!0)},{key:"Escape",run:()=>(e.onEscape(),!0)},Nt,...Yt,...rt,...Pt]),V.lineSeparator.of(d),t.of(l(s.editable)),n.of(s.wrap?b.lineWrapping:[]),r.of(s.language),b.updateListener.of((m)=>{if(m.docChanged)e.onChange()})],f=Gr(e.parent),h=new b({parent:f.parent,root:f.root,state:V.create({doc:e.text,extensions:u(e.eol)})});return a=h.state.doc,{text:()=>h.state.doc.sliceString(0,void 0,h.state.lineBreak),dirty:()=>a===void 0||!h.state.doc.eq(a),snapshot:()=>h.state.doc,markSaved:(d)=>{a=d??h.state.doc},replace:(d,m)=>{let D=h.scrollDOM.scrollTop;h.setState(V.create({doc:d,extensions:u(m)})),a=h.state.doc,h.scrollDOM.scrollTop=D},setEditable:(d)=>{s.editable=d,h.dispatch({effects:t.reconfigure(l(d))})},setWrap:(d)=>{s.wrap=d,h.dispatch({effects:n.reconfigure(d?b.lineWrapping:[])})},setLanguage:async(d)=>{s.language=await tn(d)??[],h.dispatch({effects:r.reconfigure(s.language)})},undo:()=>{j(h)},redo:()=>{U(h)},find:()=>{de(h)},tab:()=>{te(h)},focus:()=>h.focus(),scrollTop:()=>h.scrollDOM.scrollTop,scrollTo:(d)=>{h.scrollDOM.scrollTop=d},destroy:()=>h.destroy()}}export{uo as createEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q}from"./chunk-index-qxynr1hf.js";import"./chunk-index-m81362sc.js";export{q as Confirm};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{A,o,r,t,g,e,n,h,y,d,f,v,m,k,T,_,re,J}from"./chunk-index-cn49mawx.js";import{q}from"./chunk-index-qxynr1hf.js";import{ve}from"./chunk-index-gcmmwh8t.js";import{Te}from"./chunk-index-e35v554x.js";import{ie}from"./chunk-index-sw9r4aa4.js";import{se}from"./chunk-index-amxa2bn3.js";import"./chunk-index-m81362sc.js";var P=(a,s)=>({method:a,body:JSON.stringify(s)}),U=encodeURIComponent,L={list:()=>h("connectors/managed"),add:(a)=>h("connectors/managed",P("POST",a)),describe:(a,s)=>h(`connectors/managed/${U(a)}`,P("PATCH",{description:s})),remove:(a)=>h(`connectors/managed/${U(a)}`,{method:"DELETE"}),grants:()=>h("connectors/grants"),channels:()=>h("connectors/grants/channels"),authorize:(a)=>h("connectors/grants",P("POST",a)),describeGrant:(a,s,l)=>h(`connectors/grants/${U(a)}/${U(s)}`,P("PATCH",l)),revoke:(a,s)=>h(`connectors/grants/${U(a)}/${U(s)}`,{method:"DELETE"}),rotate:(a)=>h(`connectors/grants/${U(a)}/rotate`,{method:"POST"})};function V(a){let{version:s}=J(),[l,c]=r(0),[b,C]=r(),[w,u]=r();o(()=>{let i=!0;return a().then((N)=>{if(!i)return;C(N),u(void 0)},(N)=>{if(i)u(d(N))}),()=>{i=!1}},[l,s]);let R=A(()=>c((i)=>i+1),[]);return{data:b,error:w,reload:R}}var G={name:"",url:"",description:"",header:"",token:""};function K(a){let[s,l]=r(G),[c,b]=r(),[C,w]=r(!1),u=(i)=>(N)=>l((x)=>({...x,[i]:N}));return n("form",{className:"stack",onSubmit:async(i)=>{i.preventDefault(),w(!0),b(void 0);try{let{connector:N,skipped:x}=await L.add({name:s.name,url:s.url,description:s.description,...s.header.trim()?{header:s.header}:{},...s.token?{token:s.token}:{}});l(G),f(x.length?t("Added {name}. Left out tools whose names are too long: {tools}",{name:N.name,tools:x.join(", ")}):t("Added {name}.",{name:N.name})),a.onDone()}catch(N){b(d(N))}finally{w(!1)}},autoComplete:"off",children:[n("label",{children:[t("Name"),e("input",{value:s.name,maxLength:12,placeholder:"notion",required:!0,onChange:(i)=>u("name")(i.target.value)}),e("span",{className:"meta",children:t("Lowercase letters, digits and -, up to 12; it becomes the prefix of its tool names.")})]}),n("label",{children:[t("MCP URL"),e("input",{type:"url",value:s.url,maxLength:500,placeholder:"https://mcp.example.com/mcp",required:!0,onChange:(i)=>u("url")(i.target.value)}),e("span",{className:"meta",children:t("A Streamable HTTP endpoint; one ending in /sse uses SSE. A credential may be part of the URL.")})]}),n("label",{children:[t("Purpose"),e("textarea",{value:s.description,maxLength:1000,rows:3,required:!0,onChange:(i)=>u("description")(i.target.value)}),e("span",{className:"meta",children:t("The knights decide from this text when to use the connector.")})]}),n("div",{className:"form-row",children:[n("label",{children:[t("Header name (optional)"),e("input",{value:s.header,maxLength:100,placeholder:"X-API-Key",onChange:(i)=>u("header")(i.target.value)}),e("span",{className:"meta",children:t("Leave empty to send Authorization: Bearer <token>.")})]}),n("label",{children:[t("Token (optional)"),e("input",{type:"password",value:s.token,maxLength:4000,autoComplete:"new-password",onChange:(i)=>u("token")(i.target.value)}),e("span",{className:"meta",children:t("Stored encrypted by the gateway and never shown again; leave empty if the credential is in the URL.")})]})]}),c?e(m,{message:c}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:C,children:t("Add connector")})]})]})}function X(a){let[s,l]=r(a.connector.description),[c,b]=r(),[C,w]=r(!1);return n("form",{className:"stack",onSubmit:async(R)=>{R.preventDefault(),w(!0),b(void 0);try{await L.describe(a.connector.name,s),f(t("Purpose updated.")),a.onDone()}catch(i){b(d(i))}finally{w(!1)}},children:[n("label",{children:[t("Purpose"),e("textarea",{value:s,maxLength:1000,rows:4,required:!0,onChange:(R)=>l(R.target.value)}),e("span",{className:"meta",children:t("From the next message on, the knights follow the new purpose.")})]}),c?e(m,{message:c}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:C,children:t("Save")})]})]})}function H(){let{data:a,error:s,reload:l}=V(()=>L.list()),[c,b]=r(!1),[C,w]=r(),[u,R]=r();return n("section",{className:"stack","aria-labelledby":"connectors-mine",children:[n("div",{className:"card-head",children:[e("h3",{id:"connectors-mine",children:t("MCP connectors")}),e("button",{type:"button",onClick:()=>b(!0),children:t("Add connector")})]}),s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?.length===0?e(k,{children:t("No connectors yet.")}):null,a?.map((i)=>n("article",{className:"card connector-card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),i.tools===void 0?e(T,{tone:"warn",children:t("Tools unreadable")}):e(T,{children:t("{count} tools",{count:i.tools})})]}),e("p",{className:"meta connector-url",children:i.displayUrl??t("(the URL cannot be parsed)")}),e("p",{children:i.description}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>w(i),children:t("Edit purpose")}),e("button",{type:"button",className:"danger",onClick:()=>R(i),children:t("Remove")})]})]},i.name)),e(ie,{open:c,title:t("Add an MCP connector"),onClose:()=>b(!1),children:c?e(K,{onCancel:()=>b(!1),onDone:()=>{b(!1),l()}}):null}),e(ie,{open:C!==void 0,title:t("Edit purpose of {name}",{name:C?.name??""}),onClose:()=>w(void 0),children:C?e(X,{connector:C,onCancel:()=>w(void 0),onDone:()=>{w(void 0),l()}},C.name):null}),e(q,{open:u!==void 0,title:t("Remove connector"),confirmLabel:t("Remove"),tone:"danger",onClose:()=>R(void 0),onConfirm:async()=>{if(!u)return;await L.remove(u.name),f(t("Removed {name}.",{name:u.name})),l()},children:e("p",{children:t("Remove {name} and its token? From the next message on, the knights no longer use it.",{name:u?.name??""})})})]})}var I=" new",Z=(a,s)=>a.map((l)=>s.find((c)=>c.id===l)?.label??l).join(", ");function Q(a){return e(ie,{open:a.shown!==void 0,title:t("MCP URL of {bundle}",{bundle:a.shown?.bundle??""}),onClose:a.onClose,children:n("div",{className:"stack",children:[e("p",{children:t("This URL is the access credential and is shown only this once. Add a remote MCP server in the AI client and paste it; no separate token is needed.")}),e("input",{readOnly:!0,"aria-label":t("MCP URL"),className:"mcp-url",value:a.shown?.url??"",onFocus:(s)=>s.target.select()}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>{navigator.clipboard?.writeText(a.shown?.url??"").then(()=>f(t("Copied")))},children:t("Copy")}),e("button",{type:"button",onClick:a.onClose,children:t("Done")})]})]})})}function ee(a){return n("fieldset",{className:"field",children:[e("legend",{children:t("Allowed operations")}),e("ul",{className:"menu",children:a.operations.map((s)=>{let l=a.chosen.includes(s.id);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:l,onChange:()=>a.onChange(l?a.chosen.filter((c)=>c!==s.id):[...a.chosen,s.id])}),e("span",{className:"menu-text",children:e("strong",{children:s.label})})]})},s.id)})})]})}function ne(a){let{view:s}=a,[l,c]=r(),[b,C]=r(s.bundles[0]?.name??I),[w,u]=r(""),[R,i]=r(""),[N,x]=r([]),[M,D]=r(""),[E,j]=r(""),[B,O]=r(),[z,F]=r(!1);return o(()=>{L.channels().then((p)=>{c(p),i((S)=>S||p[0]?.id||"")},(p)=>O(d(p)))},[]),n("form",{className:"stack",onSubmit:async(p)=>{p.preventDefault(),F(!0),O(void 0);try{let S=await L.authorize({bundle:b===I?w:b,channelId:R,operations:N,...M.trim()?{displayName:M}:{},...E.trim()?{description:E}:{}});f(t("Authorized the channel in {bundle}.",{bundle:S.bundle})),a.onDone(S.url?{bundle:S.bundle,url:S.url}:void 0)}catch(S){O(d(S))}finally{F(!1)}},children:[n("label",{htmlFor:"mcp-bundle",children:[t("Bundle"),n(Te,{id:"mcp-bundle",value:b,onChange:(p)=>C(p.target.value),children:[s.bundles.map((p)=>e("option",{value:p.name,children:p.name},p.name)),e("option",{value:I,children:t("New bundle…")})]})]}),b===I?n("label",{children:[t("New bundle name"),e("input",{value:w,maxLength:80,required:!0,onChange:(p)=>u(p.target.value)}),e("span",{className:"meta",children:t("Channels in one bundle share one MCP URL.")})]}):null,n("label",{htmlFor:"mcp-channel",children:[t("Channel"),l===void 0&&!B?e(v,{}):e(Te,{id:"mcp-channel",value:R,required:!0,onChange:(p)=>i(p.target.value),children:(l??[]).map((p)=>e("option",{value:p.id,children:`${p.guild} › #${p.name}`},p.id))})]}),e(ee,{operations:s.operations,chosen:N,onChange:x}),n("label",{children:[t("Name outside AI clients see (optional)"),e("input",{value:M,maxLength:100,onChange:(p)=>D(p.target.value)})]}),n("label",{children:[t("Purpose (optional)"),e("textarea",{value:E,maxLength:1000,rows:2,onChange:(p)=>j(p.target.value)})]}),B?e(m,{message:B}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:z,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:z||!R||N.length===0,children:t("Authorize")})]})]})}function te(a){let{bundle:s,grant:l}=a.target,[c,b]=r(l.displayName),[C,w]=r(l.description),[u,R]=r(),[i,N]=r(!1);return n("form",{className:"stack",onSubmit:async(M)=>{M.preventDefault(),N(!0),R(void 0);try{await L.describeGrant(s,l.channelId,{displayName:c,description:C}),f(t("Updated what outside AI clients see.")),a.onDone()}catch(D){R(d(D))}finally{N(!1)}},children:[n("label",{children:[t("Name outside AI clients see"),e("input",{value:c,maxLength:100,required:!0,onChange:(M)=>b(M.target.value)})]}),n("label",{children:[t("Purpose"),e("textarea",{value:C,maxLength:1000,rows:3,onChange:(M)=>w(M.target.value)}),e("span",{className:"meta",children:t("The channel's name and topic on Discord stay as they are.")})]}),u?e(m,{message:u}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:i,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:i,children:t("Save")})]})]})}function ae(a){let{grant:s}=a,{timeZone:l}=_();return n("li",{className:"grant",children:[n("div",{className:"card-head",children:[e("strong",{children:s.displayName}),s.visible?null:e(T,{tone:"warn",children:t("Not visible now")})]}),e("p",{className:"meta",children:`${s.guildName} › #${s.channelName}`}),e("p",{children:s.description||t("No purpose set.")}),e("p",{className:"meta",children:t("Allowed: {operations}",{operations:Z(s.operations,a.operations)})}),s.audit.length?n("details",{children:[e("summary",{children:t("Recent activity")}),e("ul",{className:"audit",children:s.audit.map((c)=>n("li",{children:[e("time",{dateTime:c.at,children:re(c.at,l)})," ",e("code",{children:c.tool})," ",c.status]},`${c.at}-${c.tool}`))})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:a.onDescribe,children:t("Rename / purpose")}),e("button",{type:"button",className:"danger",onClick:a.onRevoke,children:t("Revoke")})]})]})}function W(){let{data:a,error:s,reload:l}=V(()=>L.grants()),[c,b]=r(!1),[C,w]=r(),[u,R]=r(),[i,N]=r(),[x,M]=r();return n("section",{className:"stack","aria-labelledby":"mcp-grants",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h3",{id:"mcp-grants",children:t("MCP authorizations")}),e("p",{className:"hint",children:t("Which channels outside AI clients may use through each bundle's MCP URL, and with which operations.")})]}),e("button",{type:"button",disabled:!a,onClick:()=>b(!0),children:t("Authorize a channel")})]}),s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?.bundles.length===0?e(k,{children:t("There are no authorizations yet.")}):null,a?.bundles.map((D)=>n("article",{className:"card bundle-card",children:[n("div",{className:"card-head",children:[e("strong",{children:D.name}),e("button",{type:"button",className:"secondary",onClick:()=>N(D.name),children:t("New URL")})]}),D.grants.length===0?e(k,{children:t("No channels")}):null,e("ul",{className:"grants",children:D.grants.map((E)=>e(ae,{bundle:D.name,grant:E,operations:a.operations,onDescribe:()=>w({bundle:D.name,grant:E}),onRevoke:()=>R({bundle:D.name,grant:E})},E.channelId))})]},D.name)),e(ie,{open:c,title:t("Authorize a channel"),onClose:()=>b(!1),children:c&&a?e(ne,{view:a,onCancel:()=>b(!1),onDone:(D)=>{if(b(!1),D)M(D);l()}}):null}),e(ie,{open:C!==void 0,title:t("What outside AI clients see"),onClose:()=>w(void 0),children:C?e(te,{target:C,onCancel:()=>w(void 0),onDone:()=>{w(void 0),l()}},`${C.bundle}/${C.grant.channelId}`):null}),e(q,{open:u!==void 0,title:t("Revoke the channel"),confirmLabel:t("Revoke"),tone:"danger",onClose:()=>R(void 0),onConfirm:async()=>{if(!u)return;await L.revoke(u.bundle,u.grant.channelId),f(t("Revoked.")),l()},children:e("p",{children:t("Remove {channel} from bundle {bundle}? Its other channels and its URL keep working; operations already sent are not undone.",{channel:u?.grant.displayName??"",bundle:u?.bundle??""})})}),e(q,{open:i!==void 0,title:t("Replace the MCP URL"),confirmLabel:t("Replace URL"),tone:"danger",onClose:()=>N(void 0),onConfirm:async()=>{if(!i)return;let{bundle:D,url:E}=await L.rotate(i);if(E)M({bundle:D,url:E});l()},children:e("p",{children:t("Replace the URL of bundle {bundle}? The old URL stops working at once; every channel setting stays.",{bundle:i??""})})}),e(Q,{...x?{shown:x}:{},onClose:()=>M(void 0)})]})}var oe=`
|
|
2
|
+
/* The Connectors page's management: an address never breaks the layout, a bundle's channels sit as rows. */
|
|
3
|
+
.connector-url,
|
|
4
|
+
.connectors-page .grant .meta {
|
|
5
|
+
overflow-wrap: anywhere;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.connectors-page .grants,
|
|
9
|
+
.connectors-page .audit {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
list-style: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.connectors-page .grant {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--space-1);
|
|
21
|
+
padding: var(--space-3) 0;
|
|
22
|
+
border-top: 1px solid var(--border);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.connectors-page .grant p {
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.connectors-page .audit {
|
|
30
|
+
gap: var(--space-1);
|
|
31
|
+
font-size: var(--text-sm);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.mcp-url {
|
|
35
|
+
font-family: var(--font-mono);
|
|
36
|
+
}
|
|
37
|
+
`,Y=()=>se("connectors",oe);function Qe(){Y();let{connectorAdminUrl:a,connectorParts:s}=_(),l=s??{gateways:!0};return n("section",{className:"stack connectors-page",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Connectors")}),a?e("a",{href:a,target:"_blank",rel:"noreferrer",children:t("Open connector admin")}):null]}),e("p",{className:"hint",children:t("Upstream MCP gateways and virtual servers used by the knights.")}),l.manage?e(H,{}):null,l.grants?e(W,{}):null,l.gateways?e(le,{}):null]})}function le(){let{data:a,error:s}=ve(()=>y.connectors(),"connectors");return n("section",{className:"stack",children:[s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?n(g,{children:[e("h3",{children:t("Upstream gateways")}),a.gateways.length===0?e(k,{children:t("No gateways.")}):null,a.gateways.map((l)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[e("strong",{children:l.name}),e(T,{children:l.enabled?t("Enabled"):t("Disabled")}),e(T,{tone:l.reachable?"plain":"warn",children:l.reachable?t("Reachable"):t("Unreachable")}),e(T,{children:t("{count} tools",{count:l.tools})})]})},l.name)),e("h3",{children:t("Virtual servers")}),a.servers.length===0?e(k,{children:t("No virtual servers.")}):null,a.servers.map((l)=>n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:l.name}),e(T,{children:t("{count} tools",{count:l.tools.length})})]}),n("p",{children:[t("Used by"),": ",l.usedBy.join(", ")||t("None")]}),n("details",{children:[e("summary",{children:t("Tool list")}),e("ul",{children:l.tools.map((c)=>e("li",{children:c},c))})]})]},l.name))]}):null]})}export{Qe as ConnectorsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,u,g,e,n,x,y,v,m,k,T,_,xe,re,Ne,mn,vi,J}from"./chunk-index-cn49mawx.js";import{ve}from"./chunk-index-gcmmwh8t.js";var h=[{kind:"owner",title:u("Owner channels"),note:u("Direct messages and channels where the owner talks to a knight.")},{kind:"agent",title:u("Bot server channels"),note:u("The bot server's one-to-one channels.")},{kind:"group",title:u("Group channels"),note:u("The bot server's group channels.")},{kind:"outside",title:u("Outside AI clients"),note:u("Conversations an outside AI client holds over MCP.")},{kind:"plugin",title:u("Plugin conversations"),note:u("Conversations a plugin runs, such as a web chat, as the host recorded them.")}];function P(){let{timeZone:o}=_(),{now:i}=J(),{data:a,error:s}=ve(()=>y.conversations(),"conversations"),c=a?.conversations;if(!c)return s?e(m,{message:s}):e(v,{});return n(g,{children:[s?e(m,{message:s}):null,h.map((r)=>{let d=c.filter((l)=>l.kind===r.kind);return n("section",{className:"stack",children:[e("h2",{children:t(r.title)}),e("p",{className:"hint",children:t(r.note)}),d.length===0?e(k,{children:t("None stored.")}):null,d.map((l)=>e(p,{item:l,now:i,timeZone:o},l.key))]},r.kind)})]})}function p(o){let{item:i}=o,a=mn(i.channel,i.id),s=vi(i);return n("a",{className:"card card-link",href:x("conversations",i.key),children:[n("div",{className:"card-head",children:[e("strong",{children:s}),i.busy>0?e(T,{tone:"busy",children:t("running")}):null,i.liveBytes===0?e(T,{children:t("archived only")}):null]}),n("p",{className:"meta",children:[(i.kind==="outside"||i.kind==="plugin")&&i.startedAt?`${t("Started")} ${re(i.startedAt,o.timeZone)} · `:a.detail?`${a.detail} · `:"",i.principal?`${i.visibility==="private"?t("Private to {name}",{name:i.principal.name}):t("Shared · {name}",{name:i.principal.name})} · `:"",t("Last active")," ",xe(i.lastActive,o.now,o.timeZone)," ·"," ",Ne(i.liveBytes)," ·"," ",t("{count} archived",{count:i.archives})]})]})}export{P as ConversationsPage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o,z,C,r,t,g,e,n,I,d,f,m,Ue}from"./chunk-index-cn49mawx.js";import"./chunk-index-r7fdgzy1.js";import"./chunk-index-zt19fdmc.js";import"./chunk-index-2y8r4s4f.js";import"./chunk-index-gwkhs8s3.js";import{oi}from"./chunk-index-nkdg1dfz.js";import{qt}from"./chunk-index-n0cmnwd2.js";import{R}from"./chunk-index-m81362sc.js";import{en,Fn,io,Ti,vs,xs,Ss,ws,ks}from"./chunk-index-9bdstf8t.js";import{ne,Ee}from"./chunk-index-c7dbvkrq.js";function Q(i){let{view:a}=i;return e("li",{children:n("button",{type:"button",className:"menu-item council-row","aria-current":i.current||void 0,onClick:i.onPick,children:[e(Ue,{view:a,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:a.displayName}),e("span",{className:"meta",children:t("{count} knights",{count:a.members?.length??0})})]})]})})}function W(i){let{council:a}=i,w=Ti(),u=oi(),[v,M]=r([]),[y,O]=r(),[L,S]=r(""),[G,j]=r(!1),[P,E]=r(""),[p,k]=r(!1),[F,x]=r(),B=z(),V=a?.name,T=a?.members?.join(`
|
|
2
|
+
`);o(()=>{if(!i.open)return;if(x(void 0),j(a===void 0),E(""),k(!1),O(void 0),S(""),M(a?[...a.members??[]]:vs(u)),!V)return;let s=!0;return ne.group(V).then((l)=>{if(!s)return;O(l),S(l.host)},()=>{return}),()=>{s=!1}},[i.open,V,T]);let U=C(()=>new Set(u.map((s)=>s.name)),[u]),_=u.find((s)=>s.home)?.name,c=Ss(v,(s)=>U.has(s)),b=ws(c,L||void 0,_),X=(s)=>u.find((l)=>l.name===s)?.displayName??s,D=c.length>=en,N=c.length>=Fn,q=a===void 0||c.join(",")!==(a.members??[]).join(",")||y!==void 0&&b!==y.host,H=async(s)=>{k(!0),x(void 0);try{await s(),await Ee()}catch(l){return x(d(l)),k(!1),!1}return k(!1),!0},J=async()=>{if(!a)return;if(!await H(async()=>{await ne.updateGroup(a.name,{...c.join(",")!==(a.members??[]).join(",")?{members:c}:{},...y&&b!==y.host?{host:b}:{}})}))return;f(t("Saved.")),i.onClose()},K=async()=>{let s=P.trim();if(s==="")return;let l=new Set([...u.map((A)=>A.name),...w.map((A)=>A.name)]),h;if(!await H(async()=>{h=await ne.createGroup({name:ks(s,l),displayName:s,members:c,host:b})})||!h)return;io(h.room),I("table",h.name,{replace:!0}),f(t("Made {name}.",{name:h.displayName})),i.onClose()};return n("div",{className:"stack council-sheet",children:[w.length>0?n("section",{className:"stack","aria-label":t("Councils"),children:[e("h3",{children:t("Councils")}),e("ul",{className:"menu",children:w.map((s)=>e(Q,{view:s,current:s.key===a?.key,onPick:()=>{io(s.key),I("table",s.name,{replace:!0}),i.onClose()}},s.key))})]}):null,n("fieldset",{className:"field council-pick",children:[e("legend",{children:a?t("Edit this council"):t("Pick who sits")}),n("span",{className:"meta council-count","aria-live":"polite",children:[t("{count} of {max} picked",{count:c.length,max:en}),D?` · ${t("At most {max} knights",{max:en})}`:""]}),e("ul",{className:"menu",children:u.map((s)=>{let l=v.includes(s.name);return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",children:[e("input",{type:"checkbox",checked:l,disabled:!l&&D,onChange:()=>M(xs(v,s.name,en))}),e(Ue,{view:s,size:32}),e("span",{className:"menu-text",children:e("strong",{children:s.displayName})})]})},s.key)})})]}),N?e(qt,{label:t("Host"),value:b,onChange:S,options:c.map((s)=>({value:s,label:X(s)}))}):e("span",{className:"meta",children:t("A council needs at least {min} knights.",{min:Fn})}),G?n("label",{htmlFor:B,children:[t("Council name"),e("input",{id:B,value:P,autoComplete:"off",onChange:(s)=>E(s.target.value)})]}):null,F?e(m,{message:F}):null,e("div",{className:"actions",children:a&&!G?n(g,{children:[e("button",{type:"button",className:"secondary",disabled:!N||p,onClick:()=>j(!0),children:t("Save as a new council")}),e("button",{type:"button",disabled:!N||!q||p,onClick:J,children:p?t("Saving…"):t("Done")})]}):e("button",{type:"button",disabled:!N||P.trim()===""||p,onClick:K,children:p?t("Saving…"):a?t("Save as a new council"):t("Make council")})})]})}function de(i){return e(R,{open:i.open,title:t("Council"),onClose:i.onClose,size:"default",children:e(W,{open:i.open,council:i.council,onClose:i.onClose})})}export{de as CouncilSheet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ir}from"./chunk-index-cn49mawx.js";import{kr}from"./chunk-index-sdcpf5dp.js";import{hs,ms,to,no,gs,Os}from"./chunk-index-h9ccz1r3.js";var re=Ir,ie=(s)=>{for(let n=s;n;n=n.parentElement){let{overflowY:a}=getComputedStyle(n);if((a==="auto"||a==="scroll")&&n.scrollHeight>n.clientHeight)return n}return document.scrollingElement??document.documentElement};function de(s){let{item:n,root:a,key:f,mode:C}=s,m=ie(a),O=m===document.scrollingElement||m===document.documentElement,A=()=>O?0:m.getBoundingClientRect().top,j=()=>O?window.innerHeight:m.clientHeight,x=(e)=>e-A()+m.scrollTop,c=(e)=>{let t=e.getBoundingClientRect();return{top:x(t.top),height:t.height}},u=document.createElement("div");u.className="drop-line",u.setAttribute("aria-hidden","true");let z=[],P=[],v=[],g=[],R=[],B={top:0,bottom:0},D=()=>{let e=[...a.querySelectorAll("[data-drop-item], [data-folder-block]")].map((t)=>[t,t.style.transform]);for(let[t]of e)t.style.removeProperty("transform");try{G()}finally{for(let[t,r]of e)if(r)t.style.transform=r}},G=()=>{if(C==="room"){P=[...a.querySelectorAll("[data-drop-zone]")],z=P.map((t)=>{let{top:r,height:T}=c(t);return{id:t.dataset.zoneId??"",kind:t.dataset.dropZone,...t.dataset.folder?{folder:t.dataset.folder}:{},top:r,bottom:r+T,items:t.dataset.collapsed===void 0?[...t.querySelectorAll("[data-drop-item]")].map((o)=>({key:o.dataset.key??"",...c(o)})):[]}});return}v=[...a.querySelectorAll(":scope > [data-folder-block]")],g=v.map((t)=>({key:t.dataset.key??"",...c(t)})),R=v.map((t)=>({key:t.dataset.key??"",...c(t.querySelector("[data-folder-head]")??t)}));let e=c(a);B={top:e.top,bottom:e.top+e.height}};kr(!0);let J=n.getBoundingClientRect().top;n.setAttribute("data-lifted",""),a.setAttribute("data-reordering","");let F=n.getBoundingClientRect().top-J;if(F)m.scrollTop+=F;D();let Q=x(s.y),I={x:0,y:s.y},Z=!1,p=0,h,d,q={type:"cancel"};try{n.setPointerCapture(s.pointerId)}catch{}let _=()=>{p=0;let e=x(I.y),t=e-Q;if(Math.abs(t)>re)Z=!0;n.style.transform=`translate3d(0, ${t}px, 0)`;let r;if(C==="room"){let o=hs(z,f,e);q=o?{type:"room",drop:o}:{type:"cancel"};let H=o?z.indexOf(o.zone):-1;r=P[H];let y=r?.contains(n)??!1,E=o?.zone.kind!=="rest";if(!E&&y)r=void 0;let i=o&&E?o.zone.items:[],M=y?[...r.querySelectorAll("[data-drop-item]")]:[],U=i.findIndex((l)=>l.key===f),ee=o?no(i.map((l)=>l.key),f,o.before):0,te=i.length>1?Math.max(0,(i[1]?.top??0)-(i[0]?.top??0)-(i[0]?.height??0)):0,X=y&&U>=0?to(i,U,ee,te):[];for(let l of document.querySelectorAll("[data-drop-item]:not([data-lifted])"))l.style.removeProperty("transform");if(M.forEach((l,k)=>{if(X[k])l.style.transform=`translate3d(0, ${X[k]}px, 0)`}),r&&o&&!y&&E){let l=o.before===null?void 0:o.zone.items.find((ne)=>ne.key===o.before),k=c(r).top,oe=l?l.top-k:o.zone.items.length?c(r).height:0;u.style.top=`${oe}px`,r.append(u)}else u.remove();if(o?.zone.kind==="folder"&&o.zone.items.length===0&&r?.dataset.collapsed!==void 0){if(d?.zone!==o.zone.id){if(d)clearTimeout(d.timer);let l=o.zone.folder??"";d={zone:o.zone.id,timer:setTimeout(()=>{s.open(l),requestAnimationFrame(()=>requestAnimationFrame(()=>{D(),w()}))},Os)}}}else if(d)clearTimeout(d.timer),d=void 0}else{let o=ms(R,B,f,e);q=o?{type:"folder",before:o.before}:{type:"cancel"};let H=g.findIndex((i)=>i.key===f),y=o?no(g.map((i)=>i.key),f,o.before):H,E=to(g,H,y,12);v.forEach((i,M)=>{if(i!==n)i.style.transform=E[M]?`translate3d(0, ${E[M]}px, 0)`:""})}if(r!==h)h?.removeAttribute("data-drop-target"),r?.setAttribute("data-drop-target",""),h=r;let T=gs(I.y,A(),A()+j());if(T)m.scrollTop+=T,w()},w=()=>{if(!p)p=requestAnimationFrame(_)},L=(e)=>{W(),s.done(e)},S=(e)=>e.pointerId===s.pointerId,K=(e)=>{if(!S(e))return;e.stopPropagation(),e.preventDefault(),I={x:e.clientX,y:e.clientY},w()},N=(e)=>{if(!S(e))return;if(e.stopPropagation(),p)cancelAnimationFrame(p),_();L(Z?q:{type:"tap"})},V=(e)=>{if(S(e))L({type:"cancel"})},Y=(e)=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation(),L({type:"cancel"})},b=(e)=>e.preventDefault();function W(){if(kr(!1),window.removeEventListener("pointermove",K,!0),window.removeEventListener("pointerup",N,!0),window.removeEventListener("pointercancel",V,!0),window.removeEventListener("keydown",Y,!0),window.removeEventListener("touchmove",b,!0),window.removeEventListener("contextmenu",b,!0),p)cancelAnimationFrame(p);if(d)clearTimeout(d.timer);h?.removeAttribute("data-drop-target"),u.remove(),n.removeAttribute("data-lifted"),n.style.removeProperty("transform"),a.removeAttribute("data-reordering");for(let e of a.querySelectorAll("[data-drop-item], [data-folder-block]"))e.style.removeProperty("transform");try{n.releasePointerCapture(s.pointerId)}catch{}}return window.addEventListener("pointermove",K,!0),window.addEventListener("pointerup",N,!0),window.addEventListener("pointercancel",V,!0),window.addEventListener("keydown",Y,!0),window.addEventListener("touchmove",b,{capture:!0,passive:!1}),window.addEventListener("contextmenu",b,!0),w(),()=>L({type:"cancel"})}export{de as lift};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ct,Zt}from"./chunk-index-x60n1me6.js";import{p}from"./chunk-index-cn49mawx.js";function H(){try{let c=document.createElement("canvas");return!!(c.getContext("webgl2")||c.getContext("webgl"))}catch{return!1}}function x(c,n){return[c,n.includes("?")?n.slice(n.indexOf("?")):""].some((d)=>{let u=new URLSearchParams(d).get("nogl");return u!==null&&u!=="0"&&u!=="false"})}async function I(c,n,T){let d=n.variant==="compact",u=n.labels??Zt,l=new Map,E=(e)=>{l.clear();for(let t of e)l.set(t.id,{...t})};E(n.seats);let f={t:n.theme,s:n.scheme},a=null,o=document.createElement("div");o.className="rt-table",o.dataset.variant=d?"compact":"full";let g=document.createElement("div");g.className="rt-table-stage",o.appendChild(g);let r=null,y=!1,A=()=>!d&&(Boolean(n.listBelow)||y);c.appendChild(o);let m=new Map,S=()=>{if(!A()){r?.remove(),r=null,m.clear(),delete o.dataset.list;return}if(!r)r=document.createElement("ul"),r.className="rt-table-list",r.setAttribute("aria-label",u.table),o.appendChild(r),o.dataset.list="";for(let e of[...m.keys()])if(!l.has(e))m.delete(e);for(let e of l.values()){let t=m.get(e.id);if(!t){t=document.createElement("button"),t.type="button",t.dataset.seat=e.id;let s=e.id;t.addEventListener("click",(i)=>{let b=l.get(s);if(b)n.onSeatClick({id:b.id,name:b.name,at:Ct(i,i.currentTarget)})}),m.set(e.id,t)}t.textContent=u.seat(e.name,e.state??"idle"),t.style.setProperty("--seat",e.color)}r.replaceChildren(...[...l.values()].map((e)=>{let t=document.createElement("li"),s=m.get(e.id);if(s)t.appendChild(s);return t}))};S();let w=(e)=>{y=!e,S(),n.onNames?.(e)},v=async()=>{let{createTable2D:e}=await (p("5nrhfwft"),import("./chunk-table2d-5nrhfwft.js"));a=e(g,{...n,theme:f.t,scheme:f.s,seats:[...l.values()]}),w(!0)},C=async()=>{let{createTable3D:e}=await (p("5cb66d99"),import("./chunk-table3d-5cb66d99.js"));a=e(g,{...n,theme:f.t,scheme:f.s,seats:[...l.values()],onNames:w},()=>{a?.dispose(),v()})};if(d||T==="svg"||T!=="webgl"&&(x(location.search,location.hash)||!H()))await v();else try{await C()}catch{await v()}let M,L=n.onSeatMenu;if(L&&!d){let{attachSeatMenu:e}=await (p("eh3ymmks"),import("./chunk-seat-menu-eh3ymmks.js"));M=e(o,(t,s,i)=>{let b=t instanceof Element?t.closest("[data-seat]")?.dataset.seat:void 0,h=l.get(b??a?.seatAt?.(s,i)??"");return h?{id:h.id,name:h.name}:void 0},L)}return{get kind(){return a.kind},setTheme(e,t){f={t:e,s:t},a.setTheme(e,t)},setSeats(e){E(e),S(),a.setSeats(e)},setState(e,t){let s=l.get(e);if(s)s.state=t;S(),a.setState(e,t)},setMark:(e,t)=>a.setMark(e,t),setAvatar(e,t,s){let i=l.get(e);if(i)if(i.avatarSvg=t,s===void 0)delete i.talkSvg;else i.talkSvg=s;return a.setAvatar(e,t,s)},setReducedMotion:(e)=>a.setReducedMotion(e),resetCamera:()=>a.resetCamera(),focus:(e,t)=>a.focus(e,t),focused:()=>a.focused(),seatAt:(e,t)=>a.seatAt?.(e,t)??null,getStats:()=>a.getStats(),dispose(){M?.(),a?.dispose(),o.remove()}}}export{I as mountRoundTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,o,z,t,K,g,e,n,s,Je,l,me,Ue,qn,Sn}from"./chunk-index-cn49mawx.js";import{yr,vr,xr,Sr}from"./chunk-index-t5bmsqqd.js";import"./chunk-index-q5fyrtx4.js";import{Gt}from"./chunk-index-2tr41qht.js";import{Ci}from"./chunk-index-20xgx0k2.js";var v=()=>(p("bfqtg71d"),import("./chunk-layout-actions-bfqtg71d.js")),k=(a)=>(p("rgyrktvy"),import("./chunk-placement-items-rgyrktvy.js")).then((r)=>r.folderMenu(a)),F=(a)=>({mode:"folder",key:a,item:(r)=>r.closest("[data-folder-block]"),root:(r)=>r.closest("[data-folder-block]")?.parentElement??null,onDrop:(r)=>{if(r.type==="folder")v().then((i)=>i.placeFolderBefore(a,r.before))},open:xr});function b(a){let{id:r,name:i}=a,m=yr().has(r),d=a.holdsActive||!m,c=z(),h=Gt(()=>k(r),F(r)),N=(u)=>{k(r).then((f)=>{if(!f)return;let y=u.getBoundingClientRect();me({...f,at:{x:y.left,y:y.bottom},via:"key",source:u})},()=>{return})};return n("section",{className:"folder","aria-label":i,"data-folder-block":"","data-key":r,"data-drop-zone":"folder","data-zone-id":r,"data-folder":r,"data-collapsed":d?void 0:"",children:[n("header",{className:"folder-head","data-folder-head":"",...h,children:[n("button",{type:"button",className:"folder-toggle","aria-expanded":d,"aria-controls":c,"aria-label":d?t("Collapse {name}",{name:i}):t("Expand {name}",{name:i}),onClick:()=>vr(r),children:[e(s,{name:"chevron",size:16,className:"folder-chevron","data-open":d||void 0}),e("strong",{children:i}),e("span",{className:"meta",children:K(a.count,"{count} room","{count} rooms")}),d?null:a.stack]}),a.muted==="none"?null:e(s,{name:"bell-off",size:14,className:"muted-mark","data-partial":a.muted==="some"||void 0,role:"img","aria-hidden":!1,"aria-label":a.muted==="all"?t("Notifications are off"):t("Some notifications are off")}),d?null:a.summary,e("button",{type:"button",className:"icon-button folder-more","aria-haspopup":"menu","aria-label":t("Folder menu"),onClick:(u)=>N(u.currentTarget),children:e(s,{name:"more",size:18})})]}),e("div",{id:c,className:"folder-body",hidden:!d,children:d?a.count===0?e("p",{className:"meta folder-empty",children:t("No rooms in this folder yet.")}):a.children:null})]})}var R=4;function S(a){let r=a.rooms.slice(0,R),i=l((d)=>r.map((c)=>d.rooms[c]?.view),r.join(",")),m=a.rooms.length-r.length;return n("span",{className:"folder-stack","aria-hidden":"true",children:[i.map((d)=>d?e("span",{className:"folder-stack-item",children:e(Ue,{view:d,size:28})},d.key):null),m>0?n("span",{className:"folder-stack-more",children:["+",m]}):null]})}function M(a){let r=l((i)=>({waiting:a.rooms.reduce((m,d)=>m+Je(i,d),0),typing:a.rooms.some((m)=>i.rooms[m]?.typing)}),a.rooms.join(","));return n(g,{children:[r.typing?e(qn,{}):null,r.waiting?e(Sn,{count:r.waiting}):null]})}function w(a){return l((r)=>Ci(a,(i)=>r.rooms[i]?.view?.muted===!0),a.join(","))}function U(a){let r=a.folders.map((i)=>i.id).join(",");return o(()=>{if(a.listed)Sr(r?r.split(","):[])},[a.listed,r]),e(g,{children:a.folders.map((i)=>e(C,{folder:i,...a},i.id))})}function C(a){let{folder:r}=a,i=w(r.rooms);return e(b,{id:r.id,name:r.name,count:r.rooms.length,holdsActive:a.active!==void 0&&r.rooms.includes(a.active),muted:i,summary:e(M,{rooms:r.rooms}),stack:e(S,{rooms:r.rooms}),children:a.rooms(r.rooms)})}export{U as FolderList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yr,br,vr,xr,Sr}from"./chunk-index-t5bmsqqd.js";export{br as collapsedNow,xr as expandFolder,Sr as pruneCollapsed,vr as toggleCollapsed,yr as useCollapsed};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,e,n,s,x}from"./chunk-index-cn49mawx.js";import{Nn,un}from"./chunk-index-jc3r4qam.js";function l({steps:p}){return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),e("p",{className:"meta",children:t("These steps come first. The rest of the app opens when they are done.")}),e("ul",{className:"menu",children:p.map((a)=>e("li",{children:n("a",{className:"menu-item menu-link",href:x(a.open.page),children:[n("span",{className:"menu-text",children:[e("strong",{children:Nn(a)}),un(a)?e("span",{className:"meta",children:un(a)}):null]}),e(s,{name:"chevron",size:16})]})},a.id))})]})}export{l as GatePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Li,Xi,ra}from"./chunk-index-acj4xxgq.js";import"./chunk-index-nkdg1dfz.js";import"./chunk-index-2y8r4s4f.js";import"./chunk-index-zt19fdmc.js";import"./chunk-index-m81362sc.js";import"./chunk-index-r7fdgzy1.js";import"./chunk-index-gwkhs8s3.js";export{ra as GroupScene,Xi as GroupStage,Li as useGroupFocus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Nr,t,g,e,n,s,l,st}from"./chunk-index-cn49mawx.js";import"./chunk-index-zt19fdmc.js";import"./chunk-index-2y8r4s4f.js";import"./chunk-index-gwkhs8s3.js";import{Bt}from"./chunk-index-nkdg1dfz.js";import"./chunk-index-r7fdgzy1.js";var i=(o,a)=>a?Nr(o,a):o;function T(o){let a=l((c)=>c.rooms[o.roomKey]?.view),r=st();if(!a||a.kind!=="group")return null;let m=a.members??[];return n(g,{children:[n("button",{type:"button",className:"icon-button group-table-button","aria-label":t("Table"),"aria-pressed":o.scene,onClick:()=>o.onScene(!o.scene),children:[e(s,{name:"table"}),e("span",{className:"group-table-label",children:t("Table")})]}),r==="camelot"&&!o.scene?i(e("div",{className:"group-strip",children:e(Bt,{members:m,groupRoom:o.roomKey,variant:"compact"})}),o.slot):null]})}export{T as GroupTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-index-6cg8xp1c.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ct}from"./chunk-index-v9gbt5tz.js";export{ct as HostPicture};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ho,Ie,po,mo,go,Oo,yo,on,ur,bo,Oa}from"./chunk-index-gwkhs8s3.js";export{bo as keepCards,ur as keepReads,yo as noCards,Oo as noReads,Oa as onFrame,on as seedUnread,ho as subscribeHost,mo as totalUnread,go as unreadCounts,po as unreadOf,Ie as useHost};
|