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.
Files changed (253) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +23 -7
  3. package/dist/chunk-account-678dgbww.js +1 -0
  4. package/dist/chunk-action-menu-qpp9bdxh.js +1 -0
  5. package/dist/chunk-agent-x0yvvdq2.js +1 -0
  6. package/dist/chunk-arranged-rooms-6rdkk8t1.js +1 -0
  7. package/dist/chunk-bulk-actions-zbwdaxtc.js +1 -0
  8. package/dist/chunk-character-creator-215psy17.js +1 -0
  9. package/dist/chunk-codeeditor-jgj32247.js +2 -0
  10. package/dist/chunk-confirm-2pzrt272.js +1 -0
  11. package/dist/chunk-connectors-zha2d834.js +37 -0
  12. package/dist/chunk-conversations-fb071rez.js +1 -0
  13. package/dist/chunk-council-sheet-k5fycefd.js +2 -0
  14. package/dist/chunk-drag-04qfef58.js +1 -0
  15. package/dist/chunk-entry-mws704mc.js +1 -0
  16. package/dist/chunk-folder-list-qxhmczwv.js +1 -0
  17. package/dist/chunk-folds-b7asegfs.js +1 -0
  18. package/dist/chunk-gate-vxetvn8t.js +1 -0
  19. package/dist/chunk-group-scene-63yhh1mh.js +1 -0
  20. package/dist/chunk-group-table-zy4hmgk3.js +1 -0
  21. package/dist/chunk-host-icons-tyktazzz.js +1 -0
  22. package/dist/chunk-host-picture-ebhejn2k.js +1 -0
  23. package/dist/chunk-host-state-wajep0yr.js +1 -0
  24. package/dist/chunk-host-ui-pc9r24e3.js +1 -0
  25. package/dist/chunk-index-1af8vsyb.js +2 -0
  26. package/dist/{chunk-index-g1awv7rk.js → chunk-index-20xgx0k2.js} +2 -2
  27. package/dist/chunk-index-254701sm.js +3 -0
  28. package/dist/{chunk-index-ffbrm6tr.js → chunk-index-2822z600.js} +3 -3
  29. package/dist/{chunk-index-2fdns8tn.js → chunk-index-2hvn2kte.js} +2 -2
  30. package/dist/chunk-index-2syyyjnq.js +2 -0
  31. package/dist/chunk-index-2tr41qht.js +2 -0
  32. package/dist/chunk-index-2y8r4s4f.js +2 -0
  33. package/dist/chunk-index-31m1b2f5.js +2 -0
  34. package/dist/{chunk-index-ak6ecqy3.js → chunk-index-3gfbhmpb.js} +2 -2
  35. package/dist/chunk-index-3yy10a5h.js +2 -0
  36. package/dist/{chunk-index-sm7m4fej.js → chunk-index-4t6vnwap.js} +2 -2
  37. package/dist/{chunk-index-j4x9dq30.css → chunk-index-5hbq6g2e.css} +1 -1
  38. package/dist/chunk-index-5t2jkecy.js +2 -0
  39. package/dist/chunk-index-5vatmakn.js +2 -0
  40. package/dist/{chunk-index-zyvwhxga.js → chunk-index-6cg8xp1c.js} +1 -1
  41. package/dist/chunk-index-6yra9kdq.js +2 -0
  42. package/dist/{chunk-index-ac1ktr56.js → chunk-index-7qd604rq.js} +2 -2
  43. package/dist/chunk-index-9bdstf8t.js +2 -0
  44. package/dist/chunk-index-acj4xxgq.js +100 -0
  45. package/dist/chunk-index-aexy023z.js +2 -0
  46. package/dist/chunk-index-amxa2bn3.js +2 -0
  47. package/dist/chunk-index-bef0fc2m.js +2 -0
  48. package/dist/chunk-index-c6tphrjr.js +1 -0
  49. package/dist/chunk-index-c7dbvkrq.js +2 -0
  50. package/dist/chunk-index-cn49mawx.js +50 -0
  51. package/dist/{chunk-index-3d8s3565.js → chunk-index-e2gy763y.js} +2 -2
  52. package/dist/{chunk-index-31x6krbs.js → chunk-index-e35v554x.js} +3 -3
  53. package/dist/chunk-index-fepsbhr6.js +47 -0
  54. package/dist/chunk-index-gcmmwh8t.js +2 -0
  55. package/dist/{chunk-index-kbrg32sx.js → chunk-index-gwkhs8s3.js} +2 -2
  56. package/dist/chunk-index-h2vhv4kh.js +2 -0
  57. package/dist/chunk-index-h9ccz1r3.js +2 -0
  58. package/dist/{chunk-index-0w4bfjb5.js → chunk-index-jc3r4qam.js} +2 -2
  59. package/dist/{chunk-index-8d81qy69.js → chunk-index-m81362sc.js} +2 -2
  60. package/dist/{chunk-index-xq84gg8w.js → chunk-index-n0cmnwd2.js} +2 -2
  61. package/dist/chunk-index-n0ejy0wd.js +2 -0
  62. package/dist/chunk-index-nkdg1dfz.js +7 -0
  63. package/dist/chunk-index-p7jkr7gv.js +14 -0
  64. package/dist/{chunk-index-e2dqjde8.js → chunk-index-q5fyrtx4.js} +1 -1
  65. package/dist/{chunk-index-jgzygbt8.js → chunk-index-qxynr1hf.js} +2 -2
  66. package/dist/chunk-index-r7fdgzy1.js +2 -0
  67. package/dist/chunk-index-rgf4rvns.js +4 -0
  68. package/dist/chunk-index-rsd8rftk.js +2 -0
  69. package/dist/{chunk-index-rh0x9rzf.js → chunk-index-s53bxwkk.js} +2 -2
  70. package/dist/{chunk-index-xxeb2xp0.js → chunk-index-s9p27f9b.js} +3 -3
  71. package/dist/chunk-index-sdcpf5dp.js +2 -0
  72. package/dist/chunk-index-sm7kfb07.js +2 -0
  73. package/dist/chunk-index-sw9r4aa4.js +2 -0
  74. package/dist/chunk-index-t5bmsqqd.js +1 -0
  75. package/dist/chunk-index-v8mma5np.js +2 -0
  76. package/dist/{chunk-index-q7g62sgm.js → chunk-index-v9gbt5tz.js} +3 -3
  77. package/dist/chunk-index-vsfsv8hd.js +2 -0
  78. package/dist/chunk-index-wxft0aqb.js +2 -0
  79. package/dist/chunk-index-x60n1me6.js +2 -0
  80. package/dist/chunk-index-zcfr8jdv.js +13 -0
  81. package/dist/{chunk-index-w42rcbx1.js → chunk-index-zj0gjcvr.js} +2 -2
  82. package/dist/{chunk-index-2t30xwed.js → chunk-index-zt19fdmc.js} +2 -2
  83. package/dist/chunk-index-zvvwxkev.js +2 -0
  84. package/dist/chunk-lang-css-7q1dtpgm.js +1 -0
  85. package/dist/{chunk-lang-dockerfile-cnwqn660.js → chunk-lang-dockerfile-n4bt8jbt.js} +1 -1
  86. package/dist/{chunk-lang-go-yy6kgsxv.js → chunk-lang-go-9k4y107e.js} +3 -3
  87. package/dist/chunk-lang-html-xgvba8rn.js +1 -0
  88. package/dist/chunk-lang-javascript-vgxmgd0a.js +1 -0
  89. package/dist/chunk-lang-json-hr12bzs1.js +1 -0
  90. package/dist/chunk-lang-markdown-ttzcpgkg.js +6 -0
  91. package/dist/chunk-lang-python-ntj8maem.js +3 -0
  92. package/dist/chunk-lang-rust-gv8y859d.js +1 -0
  93. package/dist/{chunk-lang-shell-1rpgtepw.js → chunk-lang-shell-5zzs09b7.js} +1 -1
  94. package/dist/chunk-lang-sql-6vmze4pg.js +2 -0
  95. package/dist/{chunk-lang-toml-tbj7467c.js → chunk-lang-toml-tt0d4rw9.js} +1 -1
  96. package/dist/chunk-lang-typescript-2v652sh5.js +1 -0
  97. package/dist/chunk-lang-xml-r2sbqnjv.js +1 -0
  98. package/dist/chunk-lang-yaml-ex31qbph.js +1 -0
  99. package/dist/chunk-layout-actions-bfqtg71d.js +1 -0
  100. package/dist/chunk-menu-items-rztgekfj.js +1 -0
  101. package/dist/chunk-mode-toggle-m5kgb7c7.js +1 -0
  102. package/dist/chunk-note-row-40ypghn9.js +204 -0
  103. package/dist/chunk-notes-a8nqffbf.js +1 -0
  104. package/dist/chunk-notice-bell-rdnfmtf2.js +1 -0
  105. package/dist/{chunk-notices-fte9f196.js → chunk-notices-tefx93s6.js} +1 -1
  106. package/dist/chunk-onboarding-wvh0s3vg.js +1 -0
  107. package/dist/chunk-overview-zrx3bpwf.js +1 -0
  108. package/dist/chunk-palette-5xtdvy9a.js +1 -0
  109. package/dist/chunk-placement-items-rgyrktvy.js +1 -0
  110. package/dist/chunk-profile-tyb48b79.js +1 -0
  111. package/dist/chunk-prompt-history-wv0vdsjv.js +1 -0
  112. package/dist/chunk-prompts-75hgb0t0.js +1 -0
  113. package/dist/chunk-room-confirms-bcvhpcry.js +1 -0
  114. package/dist/chunk-room-menu-ha1evv71.js +1 -0
  115. package/dist/chunk-rooms-menu-button-ej3a2hyc.js +1 -0
  116. package/dist/chunk-schedules-a5pewkhd.js +1 -0
  117. package/dist/{chunk-seat-menu-r0k0eawr.js → chunk-seat-menu-eh3ymmks.js} +1 -1
  118. package/dist/chunk-sheet-hosts-d5zbwbbr.js +29 -0
  119. package/dist/{chunk-shortcut-help-a6pkjcq7.js → chunk-shortcut-help-bh9ntk9s.js} +2 -2
  120. package/dist/{chunk-shortcuts-cgt87jkz.js → chunk-shortcuts-6em0atk9.js} +1 -1
  121. package/dist/chunk-skill-editor-e43mwz01.js +8 -0
  122. package/dist/chunk-skills-vp107wrp.js +1 -0
  123. package/dist/chunk-start-over-line-xd1v2p0g.js +16 -0
  124. package/dist/chunk-switcher-list-dtfh87zy.js +1 -0
  125. package/dist/{chunk-tab-dot-vr11dfrw.js → chunk-tab-dot-qd640mjr.js} +1 -1
  126. package/dist/chunk-table-svb2xhfd.js +1 -0
  127. package/dist/chunk-table2d-5nrhfwft.js +1 -0
  128. package/dist/chunk-table3d-5cb66d99.js +4220 -0
  129. package/dist/chunk-thread-actions-926eab0w.js +1 -0
  130. package/dist/{chunk-thread-cards-c2mrp2gj.js → chunk-thread-cards-kgt22sbp.js} +1 -1
  131. package/dist/chunk-thread-list-j2v1pqkz.js +217 -0
  132. package/dist/chunk-transcript-a0p3vwh6.js +1 -0
  133. package/dist/chunk-waiting-cdyz7r1g.js +1 -0
  134. package/dist/chunk-waiting-chip-58ttx9av.js +28 -0
  135. package/dist/chunk-where-9jp6g029.js +1 -0
  136. package/dist/chunk-workspace-d34njy4p.js +578 -0
  137. package/dist/chunk-zh-tw-y3jb20wc.js +1 -0
  138. package/dist/index.html +1 -1
  139. package/dist/sw.js +1 -1
  140. package/package.json +3 -3
  141. package/src/api-types.ts +98 -1
  142. package/src/app/app.ts +4 -7
  143. package/src/app/desk.ts +19 -4
  144. package/src/app/room-log.ts +66 -18
  145. package/src/app/rooms.ts +15 -5
  146. package/src/app/routes.ts +60 -9
  147. package/src/app/skill-doc-routes.ts +12 -2
  148. package/src/app/surface.ts +26 -2
  149. package/src/app/team-routes.ts +3 -7
  150. package/src/authz.ts +1 -0
  151. package/src/cleanup-api.ts +9 -2
  152. package/src/connector-manage-api.ts +257 -0
  153. package/src/console-api.ts +60 -2
  154. package/src/features.ts +91 -0
  155. package/src/host/reads.ts +10 -1
  156. package/src/i18n/zh-tw.ts +107 -4
  157. package/src/web-plugin.ts +7 -1
  158. package/dist/chunk-account-1ecx5kt7.js +0 -1
  159. package/dist/chunk-action-menu-zh2n0ahf.js +0 -1
  160. package/dist/chunk-agent-ynm2tcbx.js +0 -1
  161. package/dist/chunk-arranged-rooms-qnz8vese.js +0 -1
  162. package/dist/chunk-bulk-actions-pr0mw0kc.js +0 -1
  163. package/dist/chunk-character-creator-caj4pmg4.js +0 -1
  164. package/dist/chunk-codeeditor-dga6s78p.js +0 -2
  165. package/dist/chunk-confirm-g76v5d9r.js +0 -1
  166. package/dist/chunk-connectors-j79ze3j1.js +0 -1
  167. package/dist/chunk-conversations-2farn72g.js +0 -1
  168. package/dist/chunk-council-sheet-s9sz1bzf.js +0 -2
  169. package/dist/chunk-drag-45e8222r.js +0 -1
  170. package/dist/chunk-entry-q11n47h9.js +0 -1
  171. package/dist/chunk-folder-list-4gcj7g7h.js +0 -1
  172. package/dist/chunk-folds-ten4ykfw.js +0 -1
  173. package/dist/chunk-gate-kcv1a4t0.js +0 -1
  174. package/dist/chunk-group-scene-12ghcvzd.js +0 -1
  175. package/dist/chunk-group-table-t458kdgn.js +0 -1
  176. package/dist/chunk-host-icons-h1k9k96a.js +0 -1
  177. package/dist/chunk-host-picture-3p0wzn3v.js +0 -1
  178. package/dist/chunk-host-state-7mdve7cb.js +0 -1
  179. package/dist/chunk-host-ui-bdgwa6sf.js +0 -1
  180. package/dist/chunk-index-02vfshtt.js +0 -2
  181. package/dist/chunk-index-0a81da8z.js +0 -2
  182. package/dist/chunk-index-12zyshae.js +0 -2
  183. package/dist/chunk-index-18pgxxw3.js +0 -2
  184. package/dist/chunk-index-2e4am3hw.js +0 -50
  185. package/dist/chunk-index-5bfqek1d.js +0 -2
  186. package/dist/chunk-index-64rsz6pf.js +0 -2
  187. package/dist/chunk-index-6bkcq9ka.js +0 -2
  188. package/dist/chunk-index-92zgb7my.js +0 -2
  189. package/dist/chunk-index-aamhjg5n.js +0 -2
  190. package/dist/chunk-index-b73y2gc0.js +0 -47
  191. package/dist/chunk-index-b8cpvr7y.js +0 -2
  192. package/dist/chunk-index-bhqczxr3.js +0 -2
  193. package/dist/chunk-index-cbqhzf40.js +0 -13
  194. package/dist/chunk-index-cdctnw71.js +0 -2
  195. package/dist/chunk-index-dj0tbfyb.js +0 -2
  196. package/dist/chunk-index-dnjftvtq.js +0 -2
  197. package/dist/chunk-index-ebg48jgy.js +0 -2
  198. package/dist/chunk-index-ek5mek4j.js +0 -14
  199. package/dist/chunk-index-f6q0stqx.js +0 -2
  200. package/dist/chunk-index-g3wrs02w.js +0 -1
  201. package/dist/chunk-index-j0m16cj1.js +0 -2
  202. package/dist/chunk-index-j4kk1m59.js +0 -2
  203. package/dist/chunk-index-kb3w11mn.js +0 -7
  204. package/dist/chunk-index-msqhgvfx.js +0 -2
  205. package/dist/chunk-index-pefwfm26.js +0 -2
  206. package/dist/chunk-index-pyfx77cj.js +0 -2
  207. package/dist/chunk-index-qfgkfq86.js +0 -2
  208. package/dist/chunk-index-sv9qpmhv.js +0 -1
  209. package/dist/chunk-index-t998yg8y.js +0 -2
  210. package/dist/chunk-index-tk4se135.js +0 -4
  211. package/dist/chunk-index-v6smgw77.js +0 -2
  212. package/dist/chunk-index-x4enmj72.js +0 -2
  213. package/dist/chunk-lang-css-y9133ktr.js +0 -1
  214. package/dist/chunk-lang-html-r2xmryek.js +0 -1
  215. package/dist/chunk-lang-javascript-1r6wd177.js +0 -1
  216. package/dist/chunk-lang-json-dx56g11y.js +0 -1
  217. package/dist/chunk-lang-markdown-fpcf2dfq.js +0 -6
  218. package/dist/chunk-lang-python-zzp95955.js +0 -3
  219. package/dist/chunk-lang-rust-214fh7sp.js +0 -1
  220. package/dist/chunk-lang-sql-vvp46hpj.js +0 -2
  221. package/dist/chunk-lang-typescript-y5w4tt4g.js +0 -1
  222. package/dist/chunk-lang-xml-tbcqmedk.js +0 -1
  223. package/dist/chunk-lang-yaml-jh56t3sv.js +0 -1
  224. package/dist/chunk-layout-actions-y73mpsh1.js +0 -1
  225. package/dist/chunk-menu-items-bza16bw6.js +0 -2
  226. package/dist/chunk-mode-toggle-nj9gnt3b.js +0 -1
  227. package/dist/chunk-note-row-6fmhrdng.js +0 -75
  228. package/dist/chunk-notes-wv0e6ssf.js +0 -1
  229. package/dist/chunk-notice-bell-9z27epd2.js +0 -1
  230. package/dist/chunk-onboarding-c5twahc3.js +0 -1
  231. package/dist/chunk-overview-k4ccprax.js +0 -1
  232. package/dist/chunk-palette-9rbp2fab.js +0 -1
  233. package/dist/chunk-placement-items-me598wsb.js +0 -1
  234. package/dist/chunk-profile-s7r7fcvz.js +0 -1
  235. package/dist/chunk-prompt-history-hf296e7v.js +0 -1
  236. package/dist/chunk-prompts-c8s0nhkm.js +0 -1
  237. package/dist/chunk-room-confirms-ga2sbvhc.js +0 -1
  238. package/dist/chunk-room-menu-7h4jym2b.js +0 -1
  239. package/dist/chunk-rooms-menu-button-pgtaanb6.js +0 -1
  240. package/dist/chunk-schedules-mbnwcxpc.js +0 -1
  241. package/dist/chunk-sheet-hosts-a5dfevy9.js +0 -1
  242. package/dist/chunk-skill-editor-67yk4x7t.js +0 -8
  243. package/dist/chunk-skills-rewemey4.js +0 -1
  244. package/dist/chunk-switcher-list-t8rbay2y.js +0 -1
  245. package/dist/chunk-table-52nh0azk.js +0 -1
  246. package/dist/chunk-table2d-g57vr6h0.js +0 -1
  247. package/dist/chunk-table3d-rp0w6kt4.js +0 -4220
  248. package/dist/chunk-thread-actions-qcxt1y1g.js +0 -1
  249. package/dist/chunk-thread-list-0071q455.js +0 -217
  250. package/dist/chunk-transcript-789yqysq.js +0 -1
  251. package/dist/chunk-where-hmwmme9e.js +0 -1
  252. package/dist/chunk-workspace-wr1qrtsh.js +0 -578
  253. package/dist/chunk-zh-tw-z5p5mpph.js +0 -1
@@ -1 +0,0 @@
1
- import{l,b,B,i,H,A,W,Y,j,Qn}from"./chunk-index-cbqhzf40.js";import{E,xe,Z}from"./chunk-index-3d8s3565.js";var h=1,K=2,L=3,J=4,ee=5,te=36,Oe=37,oe=38,re=11,ne=13;function ae(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function le(e){return e==9||e==10||e==13||e==32}var R=null,z=null,k=0;function w(e,t){let o=e.pos+t;if(z==e&&k==o)return R;while(le(e.peek(t)))t++;let O="";for(;;){let r=e.peek(t);if(!ae(r))break;O+=String.fromCharCode(r),t++}return z=e,k=o,R=O||null}function G(e,t){this.name=e,this.parent=t}var se=new xe({start:null,shift(e,t,o,O){return t==h?new G(w(O,1)||"",e):e},reduce(e,t){return t==re&&e?e.parent:e},reuse(e,t,o,O){let r=t.type.id;return r==h||r==ne?new G(w(O,1)||"",e):e},strict:!1}),ie=new E((e,t)=>{if(e.next!=60)return;if(e.advance(),e.next==47){e.advance();let o=w(e,0);if(!o)return e.acceptToken(ee);if(t.context&&o==t.context.name)return e.acceptToken(K);for(let O=t.context;O;O=O.parent)if(O.name==o)return e.acceptToken(L,-2);e.acceptToken(J)}else if(e.next!=33&&e.next!=63)return e.acceptToken(h)},{contextual:!0});function y(e,t){return new E((o)=>{let O=0,r=t.charCodeAt(0);e:for(;;o.advance(),O++){if(o.next<0)break;if(o.next==r){for(let a=1;a<t.length;a++)if(o.peek(a)!=t.charCodeAt(a))continue e;break}}if(O)o.acceptToken(e)})}var ce=y(te,"-->"),me=y(Oe,"?>"),$e=y(oe,"]]>"),Se=B({Text:i.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":i.angleBracket,TagName:i.tagName,"MismatchedCloseTag/TagName":[i.tagName,i.invalid],AttributeName:i.attributeName,AttributeValue:i.attributeValue,Is:i.definitionOperator,"EntityReference CharacterReference":i.character,Comment:i.blockComment,ProcessingInst:i.processingInstruction,D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E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:se,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]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|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[ie,ce,me,$e,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function P(e,t){let o=t&&t.getChild("TagName");return o?e.sliceString(o.from,o.to):""}function Q(e,t){let o=t&&t.firstChild;return!o||o.name!="OpenTag"?"":P(e,o)}function ge(e,t,o){let O=t&&t.getChildren("Attribute").find((a)=>a.from<=o&&a.to>=o),r=O&&O.getChild("AttributeName");return r?e.sliceString(r.from,r.to):""}function V(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function pe(e,t){var o;let O=A(e).resolveInner(t,-1),r=null;for(let a=O;!r&&a.parent;a=a.parent)if(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")r=a;if(r&&(r.to>t||r.lastChild.type.isError)){let a=r.parent;if(O.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:O.from,context:a}:{type:"openTag",from:O.from,context:V(a)};if(O.name=="AttributeName")return{type:"attrName",from:O.from,context:r};if(O.name=="AttributeValue")return{type:"attrValue",from:O.from,context:r};let c=O==r||O.name=="Attribute"?O.childBefore(t):O;if((c===null||c===void 0?void 0:c.name)=="StartTag")return{type:"openTag",from:t,context:V(a)};if((c===null||c===void 0?void 0:c.name)=="StartCloseTag"&&c.to<=t)return{type:"closeTag",from:t,context:a};if((c===null||c===void 0?void 0:c.name)=="Is")return{type:"attrValue",from:t,context:r};if(c)return{type:"attrName",from:t,context:r};return null}else if(O.name=="StartCloseTag")return{type:"closeTag",from:t,context:O.parent};while(O.parent&&O.to==t&&!((o=O.lastChild)===null||o===void 0?void 0:o.type.isError))O=O.parent;if(O.name=="Element"||O.name=="Text"||O.name=="Document")return{type:"tag",from:t,context:O.name=="Element"?O:V(O)};return null}class M{constructor(e,t,o){this.attrs=t,this.attrValues=o,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map((O)=>({label:O,type:"text"})):[]}}var X=/^[:\-\.\w\u00b7-\uffff]*$/;function I(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function U(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function ue(e,t){let o=[],O=[],r=Object.create(null);for(let n of t){let p=I(n);if(o.push(p),n.global)O.push(p);if(n.values)r[n.name]=n.values.map(U)}let a=[],c=[],q=Object.create(null);for(let n of e){let p=O,S=r;if(n.attributes)p=p.concat(n.attributes.map((s)=>{if(typeof s=="string")return o.find((x)=>x.label==s)||{label:s,type:"property"};if(s.values){if(S==r)S=Object.create(S);S[s.name]=s.values.map(U)}return I(s)}));let d=new M(n,p,S);if(q[d.name]=d,a.push(d),n.top)c.push(d)}if(!c.length)c=a;for(let n=0;n<a.length;n++){let p=e[n],S=a[n];if(p.children){for(let d of p.children)if(q[d])S.children.push(q[d])}else S.children=a}return(n)=>{var p;let{doc:S}=n.state,d=pe(n.state,n.pos);if(!d||d.type=="tag"&&!n.explicit)return null;let{type:s,from:x,context:u}=d;if(s=="openTag"){let m=c,g=Q(S,u);if(g){let f=q[g];m=(f===null||f===void 0?void 0:f.children)||a}return{from:x,options:m.map((f)=>f.completion),validFor:X}}else if(s=="closeTag"){let m=Q(S,u);return m?{from:x,to:n.pos+(S.sliceString(n.pos,n.pos+1)==">"?1:0),options:[((p=q[m])===null||p===void 0?void 0:p.closeNameCompletion)||{label:m+">",type:"type"}],validFor:X}:null}else if(s=="attrName"){let m=q[P(S,u)];return{from:x,options:(m===null||m===void 0?void 0:m.attrs)||O,validFor:X}}else if(s=="attrValue"){let m=ge(S,u,x);if(!m)return null;let g=q[P(S,u)],f=((g===null||g===void 0?void 0:g.attrValues)||r)[m];if(!f||!f.length)return null;return{from:x,to:n.pos+(S.sliceString(n.pos,n.pos+1)=='"'?1:0),options:f,validFor:/^"[^"]*"?$/}}else if(s=="tag"){let m=Q(S,u),g=q[m],f=[],T=u&&u.lastChild;if(m&&(!T||T.name!="CloseTag"||P(S,T)!=m))f.push(g?g.closeCompletion:{label:"</"+m+">",type:"type",boost:2});let C=f.concat(((g===null||g===void 0?void 0:g.children)||(u?a:c)).map((v)=>v.openCompletion));if(u&&(g===null||g===void 0?void 0:g.text.length)){let v=u.firstChild;if(v.to>n.pos-20&&!/\S/.test(n.state.sliceDoc(v.to,n.pos)))C=C.concat(g.text)}return{from:x,options:C,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}var _=H.define({name:"xml",parser:N.configure({props:[Y.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),j.add({Element(e){let{firstChild:t,lastChild:o}=e;if(!t||t.name!="OpenTag")return null;return{from:t.to,to:o.name=="CloseTag"?o.from:e.to}}}),Qn.add({"OpenTag CloseTag":(e)=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function F(e={}){let t=[_.data.of({autocomplete:ue(e.elements||[],e.attributes||[])})];if(e.autoCloseTags!==!1)t.push(fe);return new W(_,t)}function D(e,t,o=e.length){if(!t)return"";let O=t.firstChild,r=O&&O.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,o)):""}var fe=b.inputHandler.of((e,t,o,O,r)=>{if(e.composing||e.state.readOnly||t!=o||O!=">"&&O!="/"||!_.isActiveAt(e.state,t,-1))return!1;let a=r(),{state:c}=a,q=c.changeByRange((n)=>{var p,S,d;let{head:s}=n,x=c.doc.sliceString(s-1,s)==O,u=A(c).resolveInner(s,-1),m;if(x&&O==">"&&u.name=="EndTag"){let g=u.parent;if(((S=(p=g.parent)===null||p===void 0?void 0:p.lastChild)===null||S===void 0?void 0:S.name)!="CloseTag"&&(m=D(c.doc,g.parent,s))){let f=s+(c.doc.sliceString(s,s+1)===">"?1:0),T=`</${m}>`;return{range:n,changes:{from:s,to:f,insert:T}}}}else if(x&&O=="/"&&u.name=="StartCloseTag"){let g=u.parent;if(u.from==s-2&&((d=g.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(m=D(c.doc,g,s))){let f=s+(c.doc.sliceString(s,s+1)===">"?1:0),T=`${m}>`;return{range:l.cursor(s+T.length,-1),changes:{from:s,to:f,insert:T}}}}return{range:n}});if(q.changes.empty)return!1;return e.dispatch([a,c.update(q,{userEvent:"input.complete",scrollIntoView:!0})]),!0});var we=()=>F();export{we as language};
@@ -1 +0,0 @@
1
- import{B,i,H,W,Y,Ve,j,ye}from"./chunk-index-cbqhzf40.js";import{E,xe,Z}from"./chunk-index-3d8s3565.js";var l=63,h=64,L=1,u=2,q=3,M=4,U=5,N=6,A=7,y=65,F=66,I=8,K=9,J=10,OO=11,eO=12,C=13,aO=19,rO=20,tO=29,nO=33,oO=34,PO=47,QO=0,x=1,k=2,X=3,m=4;class Q{constructor(O,e,a){this.parent=O,this.depth=e,this.type=a,this.hash=(O?O.hash+O.hash<<8:0)+e+(e<<4)+a}}Q.top=new Q(null,-1,QO);function f(O,e){for(let a=0,r=e-O.pos-1;;r--,a++){let n=O.peek(r);if(o(n)||n==-1)return a}}function b(O){return O==32||O==9}function o(O){return O==10||O==13}function z(O){return b(O)||o(O)}function s(O){return O<0||z(O)}var sO=new xe({start:Q.top,reduce(O,e){return O.type==X&&(e==rO||e==oO)?O.parent:O},shift(O,e,a,r){if(e==q)return new Q(O,f(r,r.pos),x);if(e==y||e==U)return new Q(O,f(r,r.pos),k);if(e==l)return O.parent;if(e==aO||e==nO)return new Q(O,0,X);if(e==C&&O.type==m)return O.parent;if(e==PO){let n=/[1-9]/.exec(r.read(r.pos,a.pos));if(n)return new Q(O,O.depth+ +n[0],m)}return O},hash(O){return O.hash}});function c(O,e,a=0){return O.peek(a)==e&&O.peek(a+1)==e&&O.peek(a+2)==e&&s(O.peek(a+3))}var lO=new E((O,e)=>{if(O.next==-1&&e.canShift(h))return O.acceptToken(h);let a=O.peek(-1);if((o(a)||a<0)&&e.context.type!=X){if(c(O,45))if(e.canShift(l))O.acceptToken(l);else return O.acceptToken(L,3);if(c(O,46))if(e.canShift(l))O.acceptToken(l);else return O.acceptToken(u,3);let r=0;while(O.next==32)r++,O.advance();if((r<e.context.depth||r==e.context.depth&&e.context.type==x&&(O.next!=45||!s(O.peek(1))))&&O.next!=-1&&!o(O.next)&&O.next!=35)O.acceptToken(l,-r)}},{contextual:!0}),cO=new E((O,e)=>{if(e.context.type==X){if(O.next==63){if(O.advance(),s(O.next))O.acceptToken(A)}return}if(O.next==45){if(O.advance(),s(O.next))O.acceptToken(e.context.type==x&&e.context.depth==f(O,O.pos-1)?M:q)}else if(O.next==63){if(O.advance(),s(O.next))O.acceptToken(e.context.type==k&&e.context.depth==f(O,O.pos-1)?N:U)}else{let a=O.pos;for(;;)if(b(O.next)){if(O.pos==a)return;O.advance()}else if(O.next==33)V(O);else if(O.next==38)g(O);else if(O.next==42){g(O);break}else if(O.next==39||O.next==34){if(p(O,!0))break;return}else if(O.next==91||O.next==123){if(!XO(O))return;break}else{_(O,!0,!1,0);break}while(b(O.next))O.advance();if(O.next==58){if(O.pos==a&&e.canShift(tO))return;let r=O.peek(1);if(s(r))O.acceptTokenTo(e.context.type==k&&e.context.depth==f(O,a)?F:y,a)}}},{contextual:!0});function fO(O){return O>32&&O<127&&O!=34&&O!=37&&O!=44&&O!=60&&O!=62&&O!=92&&O!=94&&O!=96&&O!=123&&O!=124&&O!=125}function v(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function D(O,e){if(O.next==37){if(O.advance(),v(O.next))O.advance();if(v(O.next))O.advance();return!0}else if(fO(O.next)||e&&O.next==44)return O.advance(),!0;return!1}function V(O){if(O.advance(),O.next==60){O.advance();for(;;)if(!D(O,!0)){if(O.next==62)O.advance();break}}else while(D(O,!1));}function g(O){O.advance();while(!s(O.next)&&R(O.next)!="f")O.advance()}function p(O,e){let a=O.next,r=!1,n=O.pos;O.advance();for(;;){let t=O.next;if(t<0)break;if(O.advance(),t==a)if(t==39)if(O.next==39)O.advance();else break;else break;else if(t==92&&a==34){if(O.next>=0)O.advance()}else if(o(t)){if(e)return!1;r=!0}else if(e&&O.pos>=n+1024)return!1}return!r}function XO(O){for(let e=[],a=O.pos+1024;;)if(O.next==91||O.next==123)e.push(O.next),O.advance();else if(O.next==39||O.next==34){if(!p(O,!0))return!1}else if(O.next==93||O.next==125){if(e[e.length-1]!=O.next-2)return!1;if(e.pop(),O.advance(),!e.length)return!0}else if(O.next<0||O.pos>a||o(O.next))return!1;else O.advance()}var dO="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function R(O){if(O<33)return"u";if(O>125)return"s";return dO[O-33]}function S(O,e){let a=R(O);return a!="u"&&!(e&&a=="f")}function _(O,e,a,r){if(R(O.next)=="s"||(O.next==63||O.next==58||O.next==45)&&S(O.peek(1),a))O.advance();else return!1;let n=O.pos;for(;;){let t=O.next,P=0,d=r+1;while(z(t)){if(o(t)){if(e)return!1;d=0}else d++;t=O.peek(++P)}if(!(t>=0&&(t==58?S(O.peek(P+1),a):t==35?O.peek(P-1)!=32:S(t,a)))||!a&&d<=r||d==0&&!a&&(c(O,45,P)||c(O,46,P)))break;if(e&&R(t)=="f")return!1;for(let T=P;T>=0;T--)O.advance();if(e&&O.pos>n+1024)return!1}return!0}var RO=new E((O,e)=>{if(O.next==33)V(O),O.acceptToken(eO);else if(O.next==38||O.next==42){let a=O.next==38?J:OO;g(O),O.acceptToken(a)}else if(O.next==39||O.next==34)p(O,!1),O.acceptToken(K);else if(_(O,!1,e.context.type==X,e.context.depth))O.acceptToken(I)}),SO=new E((O,e)=>{let a=e.context.type==m?e.context.depth:-1,r=O.pos;O:for(;;){let n=0,t=O.next;while(t==32)t=O.peek(++n);if(!n&&(c(O,45,n)||c(O,46,n)))break;if(!o(t)){if(a<0)a=Math.max(e.context.depth+1,n);if(n<a)break}for(;;){if(O.next<0)break O;let P=o(O.next);if(O.advance(),P)continue O;r=O.pos}}O.acceptTokenTo(C,r)}),iO=B({DirectiveName:i.keyword,DirectiveContent:i.attributeValue,"DirectiveEnd DocEnd":i.meta,QuotedLiteral:i.string,BlockLiteralHeader:i.special(i.string),BlockLiteralContent:i.content,Literal:i.content,"Key/Literal Key/QuotedLiteral":i.definition(i.propertyName),"Anchor Alias":i.labelName,Tag:i.typeName,Comment:i.lineComment,": , -":i.separator,"?":i.punctuation,"[ ]":i.squareBracket,"{ }":i.brace}),G=Z.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q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u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:sO,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[iO],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#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OPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"⚠ Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),mO=H.define({name:"yaml",parser:G.configure({props:[Y.add({Stream:(O)=>{for(let e=O.node.resolve(O.pos,-1);e&&e.to>=O.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return O.baseIndentFor(e);if(e.name=="BlockLiteral")return O.baseIndentFor(e)+O.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return O.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let a=O.column(e.from,1);if(a==O.lineIndent(e.from,1))return a;if(e.to>O.pos)return null}}return null},FlowMapping:Ve({closing:"}"}),FlowSequence:Ve({closing:"]"})}),j.add({"FlowMapping FlowSequence":ye,"Item Pair BlockLiteral":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function w(){return new W(mO)}var YO=H.define({name:"yaml-frontmatter",parser:kO.configure({props:[B({DashLine:i.meta})]})});var yO=()=>w();export{yO as language};
@@ -1 +0,0 @@
1
- import{Wo,jt,er,zr,Ir,Cs,$s,Dr,Ns,Ls}from"./chunk-index-pyfx77cj.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";export{zr as createFolder,Dr as deleteFolder,Ls as dropRoom,jt as moveRoom,Ns as muteFolder,$s as nudgeFolder,er as nudgeRoom,Wo as pinRoom,Cs as placeFolderBefore,Ir as renameFolderTo};
@@ -1,2 +0,0 @@
1
- import{h,t,D,un,y,d,f,No,pe,rt,Et,Re,wt}from"./chunk-index-2e4am3hw.js";import"./chunk-index-kbrg32sx.js";import"./chunk-index-e2dqjde8.js";import"./chunk-index-64rsz6pf.js";import"./chunk-index-j4kk1m59.js";import{Br}from"./chunk-index-f6q0stqx.js";import{Dn}from"./chunk-index-dnjftvtq.js";import{Jt}from"./chunk-index-92zgb7my.js";import{ee,Te}from"./chunk-index-cdctnw71.js";import{Yr}from"./chunk-index-b8cpvr7y.js";import"./chunk-index-rh0x9rzf.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";var p=(e)=>e();async function s(e){try{await navigator.clipboard.writeText(e),f(t("Copied"))}catch{f(t("Could not copy."),"danger")}}async function c(e){try{await navigator.share(e)}catch(o){if(o instanceof DOMException&&o.name==="AbortError")return;f(t("Could not share."),"danger")}}var w=()=>(h("pr0mw0kc"),import("./chunk-bulk-actions-pr0mw0kc.js")),g=()=>typeof navigator.share==="function";function K(e,o=p){let i=y.getState().rooms[e],n=i?.view;if(!n||n.kind==="thread")return;let l=i.mode,a=n.home||n.helper?[]:Br(e,o);if(n.kind==="agent"){let r=n.name;a.push({id:"edit",label:t("Edit knight"),icon:"profile",run:()=>o(()=>rt(r))},{id:"look",label:t("Change look"),icon:"sparkle",run:()=>o(()=>rt(r,{look:!0}))})}if(n.kind==="group"){let r=n.name;a.push({id:"edit-group",label:t("Edit group"),icon:"profile",run:()=>o(()=>wt({kind:"group",name:r}))})}if(n.kind==="agent")a.push(...Yr([e]));if(!n.helper)a.push({id:"notifications",label:t("Notifications"),icon:n.muted?"bell-off":"bell",checked:!n.muted,run:async()=>{let r=n.muted!==!0;if(!await Jt(e,r))return;f(r?t("Notifications are off for {name}",{name:n.displayName}):t("Notifications are on for {name}",{name:n.displayName}))}});if(!n.readOnly)a.push({id:"yolo",label:t("Yolo mode"),icon:"bolt",tone:"yolo",checked:l.yolo,run:()=>{if(l.yolo)return Et(e,{yolo:!1});Re({kind:"yolo",room:e,name:n.displayName})}},{id:"long",label:t("Long-running mode"),icon:"timer",tone:"long",checked:l.longRunning,run:()=>Et(e,{longRunning:!l.longRunning})},{id:"start-over",label:t("Start over"),icon:"reset",tone:"danger",run:()=>Re({kind:"start-over",room:e,name:n.displayName})});if(n.helper){let{name:r,displayName:v}=n;a.push({id:"archive-helper",label:t("Archive this temp knight"),icon:"archive",tone:"danger",run:()=>w().then((b)=>b.archiveHelper(r,v))})}else if(!n.readOnly&&!n.coordinator)a.push({id:"archive",label:n.kind==="group"?t("Archive group"):t("Archive knight"),icon:"archive",tone:"danger",run:()=>Re({kind:"archive",room:e,name:n.displayName})});return{title:n.displayName,items:a}}function M(e=p){return{title:t("Add"),items:[{id:"new-agent",label:t("New knight"),icon:"profile",run:()=>e(()=>wt({kind:"new-agent"}))},{id:"new-group",label:t("New group"),icon:"rooms",run:()=>e(()=>wt({kind:"group"}))},{id:"archive-list",label:t("Archived"),icon:"archive",run:()=>e(()=>wt({kind:"archive"}))}]}}function Y(e,o){let i=e.getBoundingClientRect();pe({...M(o),at:{x:i.left,y:i.bottom},via:"key",source:e})}function _(e,o){let{rooms:i}=y.getState(),n=i[e]?.view,l=i[o]?.view;if(n?.kind!=="agent"||l?.kind!=="group")return;return{title:n.displayName,items:[{id:"chat",label:t("Private chat"),icon:"conversations",run:()=>D("room",e)},{id:"leave",label:t("Remove from the council"),icon:"close",run:()=>k(l,n)}]}}async function k(e,o){let i=(e.members??[]).filter((n)=>n!==o.name);if(i.length<Dn){Re({kind:"archive",room:e.key,name:e.displayName});return}try{let n=await ee.group(e.name);await ee.updateGroup(e.name,{members:i,...n.host===o.name?{host:i[0]??""}:{}}),await Te(),f(t("{name} left the council",{name:o.displayName}))}catch(n){f(d(n),"danger")}}function u(e,o){let i=e.querySelector(".bubble > .prose");if(!i)return o;return(i.innerText||i.textContent||o).trim()}function x(e){if(!e)return;let o=window.getSelection();if(!o)return;let i=document.createRange();i.selectNodeContents(e),o.removeAllRanges(),o.addRange(i)}function S(e){let o=window.getSelection();if(!o||o.isCollapsed)return"";return(o.anchorNode&&e.contains(o.anchorNode)?o.toString():"").trim()}function z(e,o,i){let n=[{id:"copy",label:t("Copy"),icon:"copy",run:()=>s(S(o)||u(o,e.text))},{id:"copy-markdown",label:t("Copy as Markdown"),icon:"notes",run:()=>s(e.text)}];if(i)n.push({id:"quote",label:t("Quote reply"),icon:"conversations",run:()=>No(e.room,e.text)});if(n.push({id:"select",label:t("Select text"),icon:"list",run:()=>x(o.querySelector(".bubble"))}),g())n.push({id:"share",label:t("Share"),icon:"send",run:()=>c({text:u(o,e.text)})});return{title:e.author,items:n}}function W(e,o){return{title:o,items:[{id:"profile",label:t("Knight profile"),icon:"profile",run:()=>rt(e)}]}}var m=(e)=>[e.header?`${e.header}: ${e.question}`:e.question,...e.options.map((o)=>o.description?`- ${o.label}: ${o.description}`:`- ${o.label}`)];function N(e){let o=[e.title];switch(e.kind){case"approval":{o.push("",e.message);let{approval:i}=e;if(i){if(o.push("",`${t("Tool")}: ${i.tool}`,`${t("Action")}: ${i.action}`),Object.keys(i.input).length)o.push(JSON.stringify(i.input,null,2));for(let n of i.files??[])o.push(n.path)}break}case"ask":o.push("",...m({question:e.question,options:e.options,multi:e.multi,allowOther:e.allowOther}));break;case"questionnaire":for(let i of e.questions)o.push("",...m(i));break}return o.join(`
2
- `)}function X(e){return{title:e.title,items:[{id:"copy-details",label:t("Copy details"),icon:"copy",run:()=>s(N(e))}]}}function R(e){let o=document.createElement("a");o.href=un(e),o.download=e.name,o.hidden=!0,document.body.append(o),o.click(),o.remove()}async function C(e){let o=new URL(un(e),window.location.href).href;if(typeof navigator.canShare==="function")try{let i=await fetch(o);if(i.ok){let n=new File([await i.blob()],e.name,{type:e.type});if(navigator.canShare({files:[n]})){await c({files:[n],title:e.name});return}}}catch{}await c({title:e.name,url:o})}function Z(e){let o=[{id:"download",label:t("Download"),icon:"download",run:()=>R(e)}];if(g())o.push({id:"share",label:t("Share"),icon:"send",run:()=>C(e)});return{title:e.name,items:o}}export{M as addMenu,W as avatarMenu,N as cardDetails,X as cardMenu,s as copyText,Z as fileMenu,z as messageMenu,Y as openAddMenu,K as roomMenu,_ as seatMenu};
@@ -1 +0,0 @@
1
- import{ur}from"./chunk-index-ffbrm6tr.js";export{ur as ModeToggle};
@@ -1,75 +0,0 @@
1
- import{h,J,r,t,e,n,o,fi,u,tt,Zt,Ct}from"./chunk-index-2e4am3hw.js";import{at}from"./chunk-index-q7g62sgm.js";var p=!1;function g(){if(p||typeof document>"u")return;if(p=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let i=new CSSStyleSheet;i.replaceSync(`
2
- /* A note is the room's people talking among themselves: a plain, dashed card, never the accent bubble of a message to the agent. */
3
- .message[data-note] .bubble,
4
- .message[data-note][data-mine] .bubble {
5
- border: 1px dashed var(--control-border);
6
- background: var(--surface-3);
7
- color: var(--text);
8
- box-shadow: none;
9
- }
10
-
11
- .message[data-note][data-mine] .bubble a,
12
- .message[data-note][data-mine] .bubble code {
13
- color: var(--accent);
14
- }
15
-
16
- .message[data-note][data-mine] .prose code,
17
- .message[data-note][data-mine] .prose blockquote {
18
- background: var(--surface);
19
- }
20
-
21
- .message[data-note][data-mine] .code-block pre {
22
- background: var(--surface);
23
- border-color: var(--border);
24
- }
25
-
26
- .message[data-note][data-mine] .file-chip {
27
- color: var(--text);
28
- }
29
-
30
- .note-chip {
31
- padding: 0 var(--space-2);
32
- border-radius: var(--radius-full);
33
- background: var(--surface-3);
34
- color: var(--muted);
35
- font-size: var(--text-xs);
36
- font-weight: var(--weight-medium);
37
- }
38
- `),document.adoptedStyleSheets=[...document.adoptedStyleSheets,i];return}catch{}let s=document.createElement("style");s.textContent=`
39
- /* A note is the room's people talking among themselves: a plain, dashed card, never the accent bubble of a message to the agent. */
40
- .message[data-note] .bubble,
41
- .message[data-note][data-mine] .bubble {
42
- border: 1px dashed var(--control-border);
43
- background: var(--surface-3);
44
- color: var(--text);
45
- box-shadow: none;
46
- }
47
-
48
- .message[data-note][data-mine] .bubble a,
49
- .message[data-note][data-mine] .bubble code {
50
- color: var(--accent);
51
- }
52
-
53
- .message[data-note][data-mine] .prose code,
54
- .message[data-note][data-mine] .prose blockquote {
55
- background: var(--surface);
56
- }
57
-
58
- .message[data-note][data-mine] .code-block pre {
59
- background: var(--surface);
60
- border-color: var(--border);
61
- }
62
-
63
- .message[data-note][data-mine] .file-chip {
64
- color: var(--text);
65
- }
66
-
67
- .note-chip {
68
- padding: 0 var(--space-2);
69
- border-radius: var(--radius-full);
70
- background: var(--surface-3);
71
- color: var(--muted);
72
- font-size: var(--text-xs);
73
- font-weight: var(--weight-medium);
74
- }
75
- `,document.head.append(s)}function v(s){if(!s.startsWith(fi))return[];try{let i=JSON.parse(s.slice(fi.length));return Array.isArray(i)?i.flatMap((a)=>typeof a?.name==="string"&&typeof a?.displayName==="string"?[{name:a.name,displayName:a.displayName}]:[]):[]}catch{return[]}}function f(s){let i=v(s.message.text),a=u((m)=>m.rooms[s.message.room]?.view?.displayName??""),[c,d]=r(!1),l={name:a,count:i.length,names:i.map((m)=>m.displayName).join(", ")};return n("li",{className:"line","data-enter":s.enter||void 0,children:[e(o,{name:"archive",size:14}),e("span",{children:i.length===1?t("{name} archived {count} temp knight: {names}",l):t("{name} archived {count} temp knights: {names}",l)}),e("button",{type:"button",className:"secondary compact",disabled:c,onClick:()=>{d(!0),(h("pr0mw0kc"),import("./chunk-bulk-actions-pr0mw0kc.js")).then((m)=>m.putBackHelpers(i.map((b)=>b.name)))},children:t("Undo")})]})}g();var y=J(function(i){let{message:a}=i,c=u((l)=>l.principal?.id),d=a.principalId!==void 0&&a.principalId===c;return n("li",{className:"message","data-mid":a.id,"data-note":!0,"data-mine":d||void 0,"data-header":!0,"data-enter":i.enter||void 0,children:[d?null:e("span",{className:"message-avatar",children:e(at,{picture:a.principalId===void 0?void 0:{principal:a.principalId},name:a.author})}),n("div",{className:"message-main",children:[n("div",{className:"message-meta",children:[e("strong",{children:a.author}),e("span",{className:"note-chip",children:t("Internal note")}),e("time",{dateTime:a.at,children:Zt(a.at,i.timeZone)})]}),n("div",{className:"bubble",children:[a.text?e(tt,{source:a.text}):null,e(Ct,{files:a.files})]})]})]})});function S(s){return s.message.kind==="system"?e(f,{message:s.message,enter:s.enter}):e(y,{...s})}export{S as default};
@@ -1 +0,0 @@
1
- import{X,s,N,a,r,t,c,e,n,O,d,w,g,_,P,k,Lo,ne}from"./chunk-index-2e4am3hw.js";import{be}from"./chunk-index-5bfqek1d.js";import{qe}from"./chunk-index-31x6krbs.js";import{he}from"./chunk-index-v6smgw77.js";import"./chunk-index-8d81qy69.js";var F=[{kind:"core",label:c("Core"),hint:c("Carried into every turn.")},{kind:"note",label:c("Note"),hint:c("Searched when a knight needs them.")},{kind:"event",label:c("Events"),hint:c("Carried into every turn until their date.")}],q=300;function ae(){let{timeZone:f}=k(),{version:o}=ne(),[u,l]=r("core"),[v,y]=r(""),[b,S]=r(),[m,L]=r(),[h,C]=r(),[E,x]=r(),[D,T]=r(),V=be(()=>O.principals(),"principals").data,A=a(0),K=X(async(i)=>{let p=++A.current;try{let I=await O.notes(i.trim(),D);if(p!==A.current)return;S(I),L(void 0)}catch(I){if(p===A.current)L(d(I))}},[D]);s(()=>{let i=setTimeout(()=>void K(v),q);return()=>clearTimeout(i)},[v,K,o]);let R=(b??[]).filter((i)=>i.kind===u).sort((i,p)=>u==="event"?(i.eventDate??"").localeCompare(p.eventDate??""):i.id-p.id),W=Lo(f);return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Notes")}),e("p",{className:"hint",children:t("What a knight remembers. A change applies from the next turn.")})]}),e("button",{type:"button",onClick:()=>C({draft:{kind:u,fact:"",eventDate:""}}),children:t("Add")})]}),V&&V.principals.length>1?e(B,{people:V,shown:D,choose:(i)=>{S(void 0),T(i)}}):null,n("div",{className:"toolbar",children:[e("div",{className:"tabs",role:"tablist",children:F.map((i)=>n("button",{type:"button",role:"tab","aria-selected":u===i.kind,onClick:()=>l(i.kind),children:[t(i.label),b?` ${b.filter((p)=>p.kind===i.kind).length}`:""]},i.kind))}),e("input",{type:"search",placeholder:t("Search (words separated by spaces)"),"aria-label":t("Search notes"),value:v,onChange:(i)=>y(i.target.value)})]}),e("p",{className:"hint",children:t(F.find((i)=>i.kind===u)?.hint??"")}),m?e(g,{message:m}):null,!b?e(w,{}):R.length===0?e(_,{children:v?t("No matching notes."):t("Nothing of this kind yet.")}):R.map((i)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[n("div",{children:[i.eventDate?n("p",{className:"meta",children:[i.eventDate," ",i.eventDate<W?e(P,{children:t("past")}):null]}):null,e("p",{className:"text",children:i.fact})]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>C({note:i,draft:{kind:i.kind,fact:i.fact,eventDate:i.eventDate??""}}),children:t("Edit")}),e("button",{type:"button",className:"danger",onClick:()=>x(i),children:t("Delete")})]})]})},i.id)),e(he,{open:h!==void 0,title:h?.note?t("Edit note"):t("Add note"),onClose:()=>C(void 0),children:h?e(H,{initial:h.draft,save:async(i)=>{if(h.note)await O.updateNote(h.note.id,i,D);else await O.addNote(i,D);C((p)=>p===h?void 0:p),await K(v)},cancel:()=>C(void 0)}):null}),e(he,{open:E!==void 0,title:t("Delete this note?"),onClose:()=>x(void 0),children:E?e(M,{text:E.fact,run:async()=>{await O.deleteNote(E.id,D),x((i)=>i===E?void 0:i),await K(v)},cancel:()=>x(void 0)}):null})]})}function B(f){let{people:o}=f,u=N();return n("label",{className:"inline",htmlFor:u,children:[t("Whose notes")," ",e(qe,{id:u,value:f.shown??o.self,onChange:(l)=>f.choose(l.target.value===o.self?void 0:l.target.value),children:o.principals.map((l)=>e("option",{value:l.id,children:l.id===o.self?t("{name} (you)",{name:l.name}):l.disabled?t("{name} (disabled)",{name:l.name}):l.name},l.id))})]})}function H(f){let[o,u]=r(f.initial),[l,v]=r(!1),[y,b]=r(),S=async()=>{v(!0),b(void 0);try{await f.save({kind:o.kind,fact:o.fact,...o.kind==="event"&&o.eventDate?{eventDate:o.eventDate}:{}})}catch(m){b(d(m)),v(!1)}};return n("form",{className:"stack",onSubmit:(m)=>{m.preventDefault(),S()},children:[n("fieldset",{children:[e("legend",{children:t("Kind")}),e("div",{className:"tabs",children:F.map((m)=>e("button",{type:"button","aria-pressed":o.kind===m.kind,onClick:()=>u({...o,kind:m.kind}),children:t(m.label)},m.kind))})]}),o.kind==="event"?n("label",{children:[t("Date"),e("input",{type:"date",value:o.eventDate,onChange:(m)=>u({...o,eventDate:m.target.value})})]}):null,n("label",{children:[t("Text"),e("textarea",{rows:4,value:o.fact,onChange:(m)=>u({...o,fact:m.target.value})})]}),y?e(g,{message:y}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:f.cancel,children:t("Cancel")}),e("button",{type:"submit",disabled:l,children:l?t("Saving…"):t("Save")})]})]})}function M(f){let[o,u]=r(!1),[l,v]=r();return n("div",{className:"stack",children:[e("p",{className:"text",children:f.text}),l?e(g,{message:l}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:f.cancel,children:t("Cancel")}),e("button",{type:"button",className:"danger",disabled:o,onClick:()=>{u(!0),f.run().catch((y)=>{v(d(y)),u(!1)})},children:o?t("Deleting…"):t("Delete")})]})]})}export{ae as NotesPage};
@@ -1 +0,0 @@
1
- import"./chunk-index-0q15ysrb.js";import{t,e,n,o,v}from"./chunk-index-2e4am3hw.js";import{ni}from"./chunk-index-ac1ktr56.js";import"./chunk-index-msqhgvfx.js";function i({current:r}){let{badge:a}=ni();return n("a",{className:"icon-button bell",href:v("notices"),"aria-current":r?"page":void 0,"aria-label":a>0?t("Notices, {count} waiting",{count:a}):t("Notices"),children:[e(o,{name:"bell"}),a>0?e("span",{className:"bell-count","aria-hidden":"true",children:a>99?"99+":a}):null]})}export{i as default};
@@ -1 +0,0 @@
1
- import{X,s,a,r,t,m,e,n,o,v,d,w,g,zn,Hi}from"./chunk-index-2e4am3hw.js";import{K}from"./chunk-index-jgzygbt8.js";import"./chunk-index-0q15ysrb.js";import{En,sn}from"./chunk-index-0w4bfjb5.js";import"./chunk-index-8d81qy69.js";import{de}from"./chunk-index-msqhgvfx.js";var _=90000,C=2000,V=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),F=()=>/iPhone|iPad/.test(navigator.userAgent);function z({step:i,view:b,refresh:p}){let[c,u]=r(),[l,h]=r(i.done?"arrived":"idle"),[S,y]=r(),[T,N]=r(!1),[I,O]=r(!1),k=a(void 0);s(()=>(zn().then(u,()=>u("unsupported")),()=>clearTimeout(k.current)),[]),s(()=>{if(i.done)h("arrived")},[i.done]);let L=X((f)=>{let A=async()=>{if((await p())?.steps.find((M)=>M.id===i.id)?.done){h("arrived");return}if(Date.now()-f>_){h("late");return}k.current=setTimeout(A,C)};k.current=setTimeout(A,C)},[p,i.id]),D=async()=>{N(!0),y(void 0),h("sending");try{await de.pushTest(),h("waiting"),L(Date.now())}catch(f){h("idle"),y(d(f))}finally{N(!1)}},E=async()=>{N(!0),y(void 0);try{await Hi(),u(await zn()),await p()}catch(f){y(f instanceof Error&&f.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):d(f)),u(await zn().catch(()=>"unsupported"))}finally{N(!1)}},P=c==="unsupported"&&F()&&!V();return n("section",{className:"card stack","aria-labelledby":`step-${i.id}`,children:[n("div",{className:"card-head",children:[e("h2",{id:`step-${i.id}`,children:En(i)}),i.done?n("span",{className:"meta",children:[e(o,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:sn(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":c==="on"||P===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:P?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):V()?t("This page is installed on this device."):t("On a phone, add it to the home screen from the browser's menu so notifications reach you when it is closed.")})]}),n("li",{"data-done":c==="on"||void 0,children:[e("strong",{children:t("Allow notifications")}),c==="blocked"?e("span",{className:"meta",children:t("Notifications are blocked for this site. Allow them in the browser's site settings.")}):c==="unsupported"?e("span",{className:"meta",children:t("This browser cannot get push notifications.")}):c==="on"?e("span",{className:"meta",children:t("Allowed on this device.")}):e("button",{type:"button",disabled:T||c===void 0,onClick:E,children:t("Allow notifications")})]}),n("li",{"data-done":i.done||void 0,children:[e("strong",{children:t("Send a test")}),l==="arrived"?e("span",{className:"meta",children:t("It arrived. Notifications work on this device.")}):n(m,{children:[e("button",{type:"button",className:"secondary",disabled:T||c!=="on"||l==="waiting",onClick:D,children:l==="waiting"?t("Waiting for it…"):t("Send a test notification")}),l==="late"?e("span",{className:"meta",children:t("It has not arrived. Check that notifications are allowed for this app, then send another.")}):null]})]})]}),S?e(g,{message:S}):null,i.waiver&&!i.done&&!i.waived?n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>O(!0),children:t(i.waiver.label)}),e(K,{open:I,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>O(!1),onConfirm:async()=>{await de.waive(i.id),await p()},children:e("p",{children:t(i.waiver.confirm)})})]}):null,b.push.devices>0&&!i.done?e("p",{className:"meta",children:t("{count} device(s) will get notifications.",{count:b.push.devices})}):null]})}function j(){let[i,b]=r(),[p,c]=r(),u=X(async()=>{try{let l=await de.onboarding();return b(l),l}catch(l){c(d(l));return}},[]);if(s(()=>{u()},[u]),p&&!i)return e(g,{message:p});if(!i)return e(w,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),i.steps.map((l)=>l.builtin==="push"?e(z,{step:l,view:i,refresh:u},l.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:En(l)}),l.done||l.waived?n("span",{className:"meta",children:[e(o,{name:"check",size:14})," ",l.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:v(l.open.page),children:t("Open")})]}),e("p",{className:"meta",children:sn(l)})]},l.id)),i.steps.length===0?e("p",{className:"empty",children:t("There is nothing left to set up.")}):null]})}export{j as OnboardingPage};
@@ -1 +0,0 @@
1
- import{r,t,c,m,e,n,v,O,d,w,g,_,P,k,_e,re,Me,Ui,fn,pi,ne}from"./chunk-index-2e4am3hw.js";import{be}from"./chunk-index-5bfqek1d.js";import{he}from"./chunk-index-v6smgw77.js";import"./chunk-index-8d81qy69.js";function f(a){let{cleanup:i}=k(),[u,p]=r(),[l,o]=r(!1),[h,s]=r();if(!i)return null;let b=()=>{if(!l)p(void 0),s(void 0)};return n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>p("start-over"),children:t("Start over")}),a.deletable?e("button",{type:"button",className:"danger",onClick:()=>p("delete"),children:t("Delete")}):null,n(he,{open:u!==void 0,title:u==="delete"?t("Permanently delete {name}?",{name:a.title}):t("Start over {name}?",{name:a.title}),onClose:b,children:[e("p",{children:u==="delete"?t("The live conversation and all archives will be permanently deleted. Memory and schedules are preserved."):t("The current conversation will be archived; the next message starts a new one. Long-term memory is preserved. Active turns finish first.")}),h?e(g,{message:h}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:l,onClick:b,children:t("Cancel")}),e("button",{type:"button",className:u==="delete"?"danger":"",disabled:l,onClick:async()=>{if(!u)return;o(!0),s(void 0);try{if(u==="delete")await O.deleteConversation(a.channel);else await O.startOver(a.channel);p(void 0),a.refresh()}catch(I){s(d(I))}finally{o(!1)}},children:l?u==="delete"?t("Deleting…"):a.busy?t("Waiting for this turn…"):t("Starting over…"):u==="delete"?t("Delete permanently"):t("Start over")})]})]})]})}function q(){let a=k(),{now:i}=ne(),[u,p]=r(0),l=()=>p((s)=>s+1),{data:o,error:h}=be(()=>O.overview(),`overview:${u}`);if(!o)return h?e(g,{message:h}):e(w,{});return n(m,{children:[h?e(g,{message:h}):null,n("section",{className:"stack",children:[e("h2",{children:t("Bot server")}),e("p",{className:"hint",children:t("Knight and group status; starting over archives the conversation and preserves memory.")}),o.agents.length+o.groups.length===0?e(_,{children:t("No knights.")}):null,o.agents.map((s)=>e(A,{agent:s,groups:o.groups,agents:o.agents,guildId:o.guildId,now:i,refresh:l},s.name)),o.groups.map((s)=>e(C,{group:s,guildId:o.guildId,now:i,timeZone:a.timeZone,refresh:l},s.name))]}),n("section",{className:"stack",children:[e("h2",{children:t("My workspaces")}),e("p",{className:"hint",children:t("Direct messages and channels where you mention a knight. Start over archives; delete removes every archive permanently.")}),o.workspaces?.length?o.workspaces.map((s)=>e(N,{conversation:s,schedules:s.schedules,now:i,refresh:l},s.key)):e(_,{children:t("No workspaces.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Outside AI client conversations")}),e("p",{className:"hint",children:t("Conversations opened through remote MCP; after deletion the session ID cannot be resumed.")}),o.outside?.length?o.outside.map((s)=>e(N,{conversation:s,now:i,refresh:l},s.key)):e(_,{children:t("No outside AI client conversations.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Party channels")}),e("p",{className:"hint",children:t("Starting over stops the container and archives role conversations; each speaker's memory is preserved.")}),o.party?.length?o.party.map((s)=>e(x,{party:s,now:i,refresh:l},s.key)):e(_,{children:t("No party channels.")})]})]})}function y({busy:a}){return e(P,{tone:a?"busy":"plain",children:a===0?t("idle"):a===1?t("Working"):t("Working, {count} waiting",{count:a-1})})}function C(a){let{group:i,now:u,timeZone:p}=a;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[i.channelId?e("a",{href:pi(i.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:i.displayName}):e("strong",{children:i.displayName}),e(P,{children:t("Group")}),e(y,{busy:i.busy})]}),e("p",{children:t("Members: {members} | Host: {host}",{members:i.members.join(", "),host:i.host})}),n("p",{className:"hint",children:[t("Last active")," ",_e(i.lastActive,u,p)]}),i.channelId?e(f,{channel:`discord:${i.channelId}`,title:i.displayName,busy:i.busy>0,refresh:a.refresh}):null]})}function A(a){let{agent:i}=a,{timeZone:u,panes:p}=k(),l=a.groups.find((s)=>s.channelId===i.workingIn),o=a.agents.find((s)=>s.channelId===i.workingIn),h=!i.workingIn?void 0:i.workingIn===i.channelId?t("Working in own channel"):l?t("Working in group {name}",{name:l.displayName}):o?t("Replying in {name}'s channel",{name:o.displayName}):t("Replying in another channel");return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.channelId?e("a",{href:pi(i.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:i.displayName}):i.displayName}),e(P,{children:"agent"}),i.workingIn?e(y,{busy:1+i.waiting}):i.waiting>0?e(P,{tone:"busy",children:t("{count} waiting",{count:i.waiting})}):e(P,{children:t("idle")})]}),h?e("p",{children:h}):null,n("dl",{className:"facts",children:[n("div",{children:[e("dt",{children:t("Model")}),n("dd",{children:[i.model," · thinking ",i.thinking]})]}),n("div",{children:[e("dt",{children:t("Context")}),e("dd",{children:i.context?i.context.tokens===null?t("Just compacted (limit {limit})",{limit:Ui(i.context.contextWindow)}):`${Ui(i.context.tokens)} / ${Ui(i.context.contextWindow)} (${Math.round(i.context.tokens/i.context.contextWindow*100)}%)`:"—"})]}),n("div",{children:[e("dt",{children:t("Schedules")}),e("dd",{children:i.schedules})]}),n("div",{children:[e("dt",{children:t("Last active")}),e("dd",{children:_e(i.lastActive,a.now,u)})]})]}),i.channelId?n(m,{children:[e(f,{channel:`discord:${i.channelId}`,title:i.displayName,busy:!!i.workingIn||i.waiting>0,refresh:a.refresh}),p.includes("conversations")?e("a",{href:v("conversations",`discord:${i.channelId}`),children:t("transcript")}):null]}):null]})}function N({conversation:a,schedules:i,now:u,refresh:p}){let{timeZone:l,panes:o}=k(),{title:h,detail:s}=a.kind==="outside"?{title:a.firstMessage||t("(No messages)"),detail:a.id}:fn(a.channel,a.id);return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel&&a.channel.kind!=="gone"?e("a",{href:pi(a.id,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:h}):h}),e(y,{busy:a.busy})]}),s?e("p",{className:"hint",children:s}):null,e("p",{children:a.liveBytes>0?t("Conversation {size} · Archives {count}",{size:Me(a.liveBytes),count:a.archives}):t("No live conversation · Archives {count}",{count:a.archives})}),a.startedAt?n("p",{children:[t("Started")," ",re(a.startedAt,l)]}):null,n("p",{className:"hint",children:[i!==void 0?`${t("Schedules")} ${i} · `:"",t("Last active")," ",_e(a.lastActive,u,l)]}),e(f,{channel:a.key,title:h,busy:a.busy>0,deletable:!0,refresh:p}),o.includes("conversations")?e("a",{href:v("conversations",a.key),children:t("transcript")}):null]})}function x({party:a,now:i,refresh:u}){let{timeZone:p}=k(),{title:l,detail:o}=fn(a.channel,a.channelId),h={running:c("Container running"),stopped:c("Container stopped"),missing:c("No container yet"),unknown:c("Container status unknown")};return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel.kind!=="gone"?e("a",{href:pi(a.channelId,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:l}):l}),e(P,{children:a.profile}),e(P,{children:t(h[a.container])}),e(y,{busy:a.busy})]}),o?e("p",{className:"hint",children:o}):null,e("p",{children:t("Enabled by {name} at {time}",{name:a.enabledBy,time:re(a.enabledAt,p)})}),n("p",{className:"hint",children:[t("Last active")," ",_e(a.lastActive,i,p)]}),e(f,{channel:a.key,title:l,busy:a.busy>0,refresh:u})]})}export{q as OverviewPage};
@@ -1 +0,0 @@
1
- import{s,M,a,r,t,e,n,o,v,D,u,nt,ue}from"./chunk-index-2e4am3hw.js";import{L}from"./chunk-index-8d81qy69.js";import{ii}from"./chunk-index-ak6ecqy3.js";function A(m){let[f,g]=r(""),[p,h]=r(0),b=a(null),y=u((l)=>l.order.flatMap((i)=>{let c=l.rooms[i]?.view;return c?[{key:i,name:c.displayName,agent:c.name,character:c.character,kind:c.kind}]:[]})),d=M(()=>[...y.map((i)=>({id:i.key,label:i.name,hint:i.kind==="agent"?t("Knight"):i.kind==="group"?t("Group"):t("Thread"),room:!0,...i.kind==="agent"?{avatar:{name:i.agent,character:i.character}}:{icon:"conversations"},go:()=>D("room",i.key)})),...m.pages.map((i)=>({id:i.pane,label:i.label,hint:t("Page"),icon:i.icon,go:()=>D(i.pane)}))].flatMap((i)=>{let c=ii(f,i.label);return c===void 0?[]:[{target:i,score:c}]}).sort((i,c)=>c.score-i.score).map((i)=>i.target).slice(0,12),[y,m.pages,f]);s(()=>h(0),[f]),s(()=>{if(m.open)g(""),requestAnimationFrame(()=>b.current?.focus())},[m.open]);let k=(l)=>{if(!l)return;m.onClose(),l.go()};return e(L,{open:m.open,title:t("Find a room"),onClose:m.onClose,variant:"palette",children:n("div",{className:"palette-box",children:[n("div",{className:"palette-input",children:[e(o,{name:"search",size:18}),e("input",{ref:b,value:f,placeholder:t("Find a room or page"),"aria-label":t("Find a room or page"),role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":d[p]?`palette-${p}`:void 0,onChange:(l)=>g(l.target.value),onKeyDown:(l)=>{if(nt(l.nativeEvent))return;if(l.key==="ArrowDown")l.preventDefault(),h((i)=>Math.min(d.length-1,i+1));else if(l.key==="ArrowUp")l.preventDefault(),h((i)=>Math.max(0,i-1));else if(l.key==="Enter")l.preventDefault(),k(d[p])}}),e("kbd",{children:"Esc"})]}),n("ul",{className:"palette-list",children:[d.length===0?e("li",{className:"palette-empty",children:t("Nothing matches.")}):null,d.map((l,i)=>e("li",{"data-active":i===p||void 0,children:n("a",{href:l.room?v("room",l.id):v(l.id),onClick:(c)=>{c.preventDefault(),k(l)},onMouseMove:()=>h(i),"aria-current":i===p?"true":void 0,children:[l.avatar?e(ue,{spec:l.avatar.character,name:l.avatar.name,size:28,live:!1}):e("span",{className:"palette-icon",children:e(o,{name:l.icon??"list",size:16})}),e("span",{className:"palette-label",children:l.label}),e("span",{className:"meta",children:l.hint})]})},l.id))]})]})})}export{A as Palette};
@@ -1 +0,0 @@
1
- import{Br,Xs}from"./chunk-index-f6q0stqx.js";import"./chunk-index-j4kk1m59.js";import"./chunk-index-b8cpvr7y.js";import"./chunk-index-rh0x9rzf.js";import"./chunk-index-e2dqjde8.js";import"./chunk-index-kbrg32sx.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";export{Xs as folderMenu,Br as placementItems};
@@ -1 +0,0 @@
1
- import{X,s,a,r,t,c,m,e,n,o,O,d,w,g,P,ji}from"./chunk-index-2e4am3hw.js";import{K}from"./chunk-index-jgzygbt8.js";import"./chunk-index-0q15ysrb.js";import"./chunk-index-8d81qy69.js";import{de}from"./chunk-index-msqhgvfx.js";var T=3000;function B({profile:i}){return n("div",{className:"who",children:[i.picture?e("img",{className:"who-picture",src:`api/people/${encodeURIComponent(i.principal)}/picture`,alt:""}):e("span",{className:"who-initial","aria-hidden":"true",children:Array.from(i.name)[0]??"?"}),n("div",{className:"stack",children:[e("strong",{children:i.name}),i.tier?n("span",{className:"meta",children:[e(o,{name:"shield",size:14})," ",t(F[i.tier])]}):null]})]})}function R({link:i,labels:C,changed:u}){let[l,p]=r(),[f,k]=r(!1),[L,V]=r(),[y,b]=r(!1),N=i.pending!==void 0||l!==void 0,q=a(void 0);s(()=>{if(!N||i.linked)return;return q.current=setInterval(()=>{de.links().then((v)=>{let I=v.links.find((A)=>A.provider===i.provider);if(I)u(I)},()=>{return})},T),()=>clearInterval(q.current)},[N,i.linked,i.provider,u]);let S=async(v)=>{k(!0),V(void 0);try{await v()}catch(I){V(d(I))}finally{k(!1)}},h=i.blockedBy.length>0;return n("li",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:i.label}),i.linked?n("span",{className:"meta",children:[e(o,{name:"check",size:14})," ",t("Linked"),i.linked.displayName?` · ${i.linked.displayName}`:""]}):i.step==="required"?e(P,{tone:"warn",children:t("Required")}):i.step==="nudge"?e(P,{children:t("Recommended")}):null]}),L?e(g,{message:L}):null,i.linked?i.linked.locked?e("p",{className:"meta",children:t("The server's configuration links this account.")}):n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>b(!0),children:t("Unlink")}),e(K,{open:y,title:t("Unlink {name}?",{name:i.label}),confirmLabel:t("Unlink"),tone:"danger",onClose:()=>b(!1),onConfirm:async()=>{u(await de.unlink(i.provider)),p(void 0)},children:e("p",{children:t("The app will no longer know this account is yours. You can link it again later.")})})]}):N?n("div",{className:"stack",children:[l?n(m,{children:[e("p",{children:l.instructions}),e("p",{className:"meta",children:t("Your code")}),e("code",{className:"link-code",children:l.code}),e("p",{className:"meta",children:t("The code works until {time}.",{time:new Date(l.expiresAt).toLocaleTimeString()})})]}):e("p",{className:"meta",children:t("A code is waiting to be used.")}),i.pending?.redeemedBy?n("p",{children:[e(o,{name:"check",size:14})," ",t("{name} used the code. Confirm that this is you.",{name:i.pending.redeemedBy.displayName})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>S(async()=>{u(await de.cancelLink(i.provider)),p(void 0)}),children:t("Cancel")}),e("button",{type:"button",disabled:f,onClick:()=>S(async()=>{let v=l?.request??i.pending?.request;if(!v)return;u(await de.confirmLink(i.provider,v)),p(void 0)}),children:t("I did it")})]})]}):n("div",{className:"stack",children:[h?e("p",{className:"meta",children:t("Link {name} first.",{name:i.blockedBy.map((v)=>C[v]??v).join(", ")})}):null,e("div",{className:"actions",children:e("button",{type:"button",disabled:f||h,onClick:()=>S(async()=>{p(await de.issueLink(i.provider)),u((await de.links()).links.find((v)=>v.provider===i.provider)??i)}),children:t("Link")})})]})]})}function E(){let i=Intl.DateTimeFormat().resolvedOptions().timeZone,[C,u]=r(),[l,p]=r({start:"22:00",end:"07:00"}),[f,k]=r(!1),[L,V]=r(!1),[y,b]=r(),[N,q]=r();s(()=>{de.pushPrefs().then((h)=>{if(u(h.quiet),h.quiet)p(h.quiet);k(!0)},()=>k(!0))},[]);let S=async(h)=>{V(!0),q(void 0),b(void 0);try{await h()}catch(v){q(d(v))}finally{V(!1)}};if(!f)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("Notifications")}),e("p",{className:"meta",children:t("In your quiet hours a normal notice waits in the bell instead of ringing your phone. An urgent one still rings.")}),n("div",{className:"quiet-row",children:[n("label",{children:[t("From")," ",e("input",{type:"time",value:l.start,onChange:(h)=>p({...l,start:h.target.value})})]}),n("label",{children:[t("To")," ",e("input",{type:"time",value:l.end,onChange:(h)=>p({...l,end:h.target.value})})]}),e("span",{className:"meta",children:i})]}),N?e(g,{message:N}):null,y?e("p",{className:"meta",children:y}):null,n("div",{className:"actions",children:[C?e("button",{type:"button",className:"secondary",disabled:L,onClick:()=>S(async()=>{await de.setPushPrefs(null),u(void 0)}),children:t("Turn off quiet hours")}):null,e("button",{type:"button",className:"secondary",disabled:L,onClick:()=>S(async()=>{await de.pushTest(),b(t("A test notification is on its way."))}),children:t("Send a test notification")}),e("button",{type:"button",disabled:L||l.start===l.end,onClick:()=>S(async()=>{let h=await de.setPushPrefs({...l,timeZone:i});u(h.quiet)}),children:t("Save")})]})]})}function z({profile:i,changed:C}){let[u,l]=r();if(i.sources.length===0)return null;let p=async(f)=>{l(void 0);try{C(await de.chooseSource(f))}catch(k){l(d(k))}};return n("section",{className:"card stack",children:[e("h2",{children:t("Shown as")}),e("p",{className:"meta",children:t("The name and picture of this account are what others see in the app.")}),n("fieldset",{className:"choice",children:[e("legend",{className:"visually-hidden",children:t("Shown as")}),n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===void 0,onChange:()=>p(null)}),t("Automatic")]}),i.sources.map((f)=>n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===f.provider,onChange:()=>p(f.provider)}),t(f.label)]},f.provider))]}),u?e(g,{message:u}):null]})}function W(){let[i,C]=r(),[u,l]=r(),[p,f]=r(),[k,L]=r();s(()=>{O.session().then(C,(y)=>L(d(y))),de.profile().then(l,()=>{return}),de.links().then(f,()=>{return})},[]);let V=X((y)=>{f((b)=>b?{links:b.links.map((N)=>N.provider===y.provider?y:N)}:b),de.profile().then(l,()=>{return})},[]);if(k)return e(g,{message:k});if(!i)return e(w,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Profile")})}),n("section",{className:"card stack",children:[e("h2",{children:t("Account")}),u?e(B,{profile:u}):e("p",{className:"meta",children:t("Signed in as {name}.",{name:i.principal.name})}),e(ji,{auth:i.auth})]}),p&&p.links.length>0?n("section",{className:"stack",children:[e("h2",{children:t("Your accounts")}),e("ul",{className:"stack notices",children:p.links.map((y)=>e(R,{link:y,labels:Object.fromEntries(p.links.map((b)=>[b.provider,b.label])),changed:V},y.provider))})]}):null,u?e(z,{profile:u,changed:l}):null,i.push?e(E,{}):null]})}var F={owner:c("Owner"),admin:c("Admin"),member:c("Member")};export{W as ProfilePage};
@@ -1 +0,0 @@
1
- import{s,r,t,e,n,d,w,g,_,P,k,re}from"./chunk-index-2e4am3hw.js";import{mt}from"./chunk-index-tk4se135.js";import{L}from"./chunk-index-8d81qy69.js";function T(a){let{open:m,load:v}=a,{timeZone:y}=k(),[i,f]=r(),[u,p]=r(),[h,b]=r();s(()=>{if(!m)return;let o=!0;return f(void 0),p(void 0),b(void 0),v().then((c)=>o&&f(c),(c)=>o&&p(d(c))),()=>{o=!1}},[m]);let l=i?.find((o)=>o.id===h);return e(L,{open:m,title:a.title,size:"wide",onClose:a.onClose,children:n("div",{className:"stack history",children:[u?e(g,{message:u}):null,!i&&!u?e(w,{}):null,i?.length===0?e(_,{children:t("No changes have been kept yet.")}):null,i&&i.length>0?e("ul",{className:"menu",children:i.map((o)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":o.id===h,onClick:()=>b(o.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:o.by}),e("span",{className:"meta",children:re(o.at,y)})]}),o.revert?e(P,{children:t("Back to the file version")}):null]})},o.id))}):null,l?n("section",{className:"stack","aria-label":t("This change"),children:[e(mt,{label:t("This change"),before:l.previous,after:l.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>a.onUse(l.text),children:t("Use this text")})})]}):null]})})}export{T as HistorySheet};
@@ -1 +0,0 @@
1
- import{h,Q,S,X,s,N,r,t,c,m,e,n,o,ce,d,f,w,g,_,P,k,re}from"./chunk-index-2e4am3hw.js";import{Ne,mt}from"./chunk-index-tk4se135.js";import{L}from"./chunk-index-8d81qy69.js";var G={"Shared prompt":c("Shared prompt"),"Guest prompt":c("Guest prompt"),"The base every knight's prompt starts with, the main knight's included.":c("The base every knight's prompt starts with, the main knight's included."),"Used instead of the shared prompt when the person speaking is not the owner.":c("Used instead of the shared prompt when the person speaking is not the owner.")},C=(l)=>t(G[l]??l);var M=S(()=>(h("hf296e7v"),import("./chunk-prompt-history-hf296e7v.js")).then((l)=>({default:l.HistorySheet}))),O=S(()=>(h("g76v5d9r"),import("./chunk-confirm-g76v5d9r.js")).then((l)=>({default:l.Confirm})));function pe(){let{timeZone:l}=k(),[R,i]=r(),[u,y]=r(),[v,x]=r(),E=X(()=>{Ne.prompts().then((p)=>i(p.documents),(p)=>y(d(p)))},[]);return s(E,[E]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Main prompts")})}),e("p",{className:"hint",children:t("The texts the main knight and the other knights start from. A text you save here replaces the one from the file from the next turn on, until you go back to the file's.")}),u?e(g,{message:u}):null,!R&&!u?e(w,{}):null,R?.length===0?e(_,{children:t("No prompts to edit.")}):null,R?.map((p)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:C(p.label)}),p.differs?e(P,{tone:"warn",children:t("Differs from the file version")}):null,p.broken?e(P,{tone:"warn",children:t("File version cannot be read")}):null]}),p.description?e("p",{children:C(p.description)}):null,p.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:p.override.by,time:re(p.override.at,l)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>x(p.id),children:t("Edit")})})]},p.id)),v?e(Z,{id:v,onClose:()=>{x(void 0),E()}}):null]})}function Z({id:l,onClose:R}){let[i,u]=r(),[y,v]=r(""),[x,E]=r(),[p,T]=r(!1),[B,D]=r(!1),[V,H]=r(!1),[F,z]=r(!1),A=N();s(()=>{let a=!0;return Ne.prompt(l).then((b)=>{if(!a)return;u(b),v(b.text)},(b)=>a&&E(d(b))),()=>{a=!1}},[l]);let I=async()=>{if(!i)return;D(!0);try{let a=await Ne.savePrompt(l,{text:y,base:i.text});u(a),v(a.text),T(!1),f(t("Saved."))}catch(a){if(a instanceof ce&&a.status===409){let{current:b}=a.body;u(b),f(a.message,"danger")}else f(d(a),"danger")}finally{D(!1)}},U=i!==void 0&&y!==i.text;return n(L,{open:!0,title:i?C(i.label):t("Main prompts"),size:"full",onClose:R,children:[x?e(g,{message:x}):null,!i&&!x?e(w,{}):null,i?.broken?e(g,{message:t("The file version of this prompt cannot be read, so it cannot be changed here until it can: {reason}",{reason:i.broken})}):null,i&&!i.broken?n("div",{className:"stack",children:[i.differs?e("p",{className:"hint",children:e(P,{tone:"warn",children:t("Differs from the file version")})}):null,p?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(mt,{label:t("Prompt"),before:i.text,after:y}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:B,onClick:()=>T(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:B,onClick:I,children:B?t("Saving…"):t("Save")})]})]}):n(m,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:A,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>H(!0),children:[e(o,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:A,className:"prompt-full",value:y,maxLength:i.maxChars,onChange:(a)=>v(a.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>z(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!U||!y.trim(),onClick:()=>T(!0),children:t("Review changes")})]})]}),V?e(Q,{fallback:null,children:e(M,{open:V,title:t("History of {name}",{name:C(i.label)}),load:async()=>(await Ne.promptHistory(l)).versions.map((a)=>({id:a.id,text:a.text,previous:a.previous,by:a.by,at:a.at,revert:a.action==="revert"})),onUse:(a)=>{v(a),T(!1),H(!1)},onClose:()=>H(!1)})}):null,F?e(Q,{fallback:null,children:e(O,{open:F,title:t("Revert {name} to the file version?",{name:C(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let a=await Ne.revertPrompt(l,{base:i.text});u(a),v(a.text),T(!1),f(t("Back to the file version."))}catch(a){if(!(a instanceof ce&&a.status===409))throw a;let{current:b}=a.body;u(b),f(a.message,"danger")}},onClose:()=>z(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{pe as PromptsPage};
@@ -1 +0,0 @@
1
- import{lr}from"./chunk-index-aamhjg5n.js";import"./chunk-index-v6smgw77.js";import"./chunk-index-jgzygbt8.js";import"./chunk-index-8d81qy69.js";import"./chunk-index-pyfx77cj.js";import"./chunk-index-j4kk1m59.js";import"./chunk-index-cdctnw71.js";import"./chunk-index-e2dqjde8.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";export{lr as RoomConfirmHost};
@@ -1 +0,0 @@
1
- import{h,r,t,m,e,n,o,v,u,k,rt,Et,Re,wt}from"./chunk-index-2e4am3hw.js";import{Ce}from"./chunk-index-j4kk1m59.js";import"./chunk-index-e2dqjde8.js";import{qt}from"./chunk-index-2fdns8tn.js";import{L}from"./chunk-index-8d81qy69.js";import{Jt}from"./chunk-index-92zgb7my.js";var p="room-menu-yolo",N="room-menu-long",f="room-menu-mute";function T(a){let[i,l]=r(!1),c=k().app?.modes!==!1,b=u((s)=>s.rooms[a.room]?.view?.home===!1,a.room),d=u((s)=>s.pins.includes(a.room),a.room),g=a.mode??{yolo:!1,longRunning:!1},y=async(s)=>{l(!0),await Et(a.room,{longRunning:s}),l(!1)};return e(L,{open:a.open,title:t("Room menu"),onClose:a.onClose,children:n("ul",{className:"menu",children:[a.readOnly?e("li",{children:a.parent?n("a",{className:"menu-item menu-link",href:v("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(o,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(o,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:f,children:[e("span",{className:"menu-icon",children:e(o,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(qt,{id:f,checked:!a.muted,label:t("Notifications"),onChange:async(s)=>{l(!0),await Jt(a.room,!s),l(!1)},busy:i})]})}),a.readOnly||!c?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:p,children:[e("span",{className:"menu-icon","data-tone":"yolo",children:e(o,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(qt,{id:p,checked:g.yolo,label:t("Yolo mode"),onChange:(s)=>{if(s)a.onAskYolo();else l(!0),Et(a.room,{yolo:!1}).then(()=>l(!1))},busy:i})]})}),a.readOnly||!c?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(o,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(qt,{id:N,checked:g.longRunning,label:t("Long-running mode"),onChange:y,busy:i})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),rt(a.agent)},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit knight")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(o,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),wt({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(o,{name:"chevron",size:16})]})}):null,a.readOnly||!b?null:n(m,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(h("y73mpsh1"),import("./chunk-layout-actions-y73mpsh1.js")).then((s)=>s.pinRoom(a.room,!d))},children:[e("span",{className:"menu-icon",children:e(o,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:d?t("Unpin"):t("Pin")}),e("span",{className:"meta",children:t("Keep this room at the top of the list.")})]})]})}),e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ce({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(o,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(o,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),Re({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{T as RoomMenu};
@@ -1 +0,0 @@
1
- import{t,e,o,u}from"./chunk-index-2e4am3hw.js";import"./chunk-index-e2dqjde8.js";import"./chunk-index-kbrg32sx.js";import"./chunk-index-j4kk1m59.js";import{Jn}from"./chunk-index-pefwfm26.js";import"./chunk-index-b8cpvr7y.js";import"./chunk-index-rh0x9rzf.js";function n(){if(!u((r)=>r.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(r)=>Jn(r.currentTarget),children:e(o,{name:"more",size:18})})}export{n as default};
@@ -1 +0,0 @@
1
- import{r,t,c,e,n,o,v,O,f,w,g,_,P,k,re}from"./chunk-index-2e4am3hw.js";import{K}from"./chunk-index-jgzygbt8.js";import{be}from"./chunk-index-5bfqek1d.js";import"./chunk-index-8d81qy69.js";var y={mon:c("Mon"),tue:c("Tue"),wed:c("Wed"),thu:c("Thu"),fri:c("Fri"),sat:c("Sat"),sun:c("Sun")};function h(m){if(typeof m!=="object"||m===null)return"";let i=m,s=typeof i.time==="string"?i.time:"";switch(i.kind){case"once":return t("Once on {date} at {time}",{date:String(i.date??""),time:s});case"every":return Number(i.everyDays)===1?t("Every day at {time}",{time:s}):t("Every {count} days at {time}",{count:Number(i.everyDays),time:s});case"weekly":{let l=Array.isArray(i.weekdays)?i.weekdays.map((d)=>t(y[String(d)]??String(d))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:s})}default:return""}}function L(){let{timeZone:m}=k(),[i,s]=r(0),[l,d]=r(),{data:u,error:p}=be(()=>O.schedules(),`schedules:${i}`);return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Schedules")})}),p?e(g,{message:p}):null,!u&&!p?e(w,{}):null,u&&u.schedules.length===0?e(_,{children:t("Nothing is scheduled. Ask a knight to remind you or to run something later.")}):null,e("ul",{className:"schedule-list",children:u?.schedules.map((a)=>n("li",{className:"card schedule",children:[n("div",{className:"schedule-main",children:[n("div",{className:"card-head",children:[e("strong",{children:a.title}),a.lastStatus?e(P,{children:a.lastStatus}):null]}),n("p",{className:"meta",children:[h(a.recurrence)," ·"," ",t("next {when}",{when:re(a.nextRun,m)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:v("room",a.room),children:a.label}):a.label," ","· ",t("set by {name}",{name:a.createdBy})]})]}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Cancel {title}",{title:a.title}),onClick:()=>d(a),children:e(o,{name:"trash"})})]},a.id))}),e(K,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>d(void 0),onConfirm:async()=>{if(!l)return;await O.cancelSchedule(l.id),s((a)=>a+1),f(t("Schedule cancelled."))},children:e("p",{children:t("“{title}” will not run again. Runs that already happened stay in the conversation.",{title:l?.title??""})})})]})}export{L as SchedulesPage};
@@ -1 +0,0 @@
1
- import{h,Q,S,X,s,N,M,a,r,t,c,m,e,n,o,D,u,ce,O,d,f,w,g,_,gn,zo,Io,Re,Oi,Vo,ue,Ln}from"./chunk-index-2e4am3hw.js";import{vo}from"./chunk-index-dj0tbfyb.js";import{K}from"./chunk-index-jgzygbt8.js";import"./chunk-index-j4kk1m59.js";import"./chunk-index-pyfx77cj.js";import"./chunk-index-e2dqjde8.js";import{lr}from"./chunk-index-aamhjg5n.js";import{xn}from"./chunk-index-b73y2gc0.js";import{Ut}from"./chunk-index-xq84gg8w.js";import{Ne,mt}from"./chunk-index-tk4se135.js";import{qt}from"./chunk-index-2fdns8tn.js";import{qe}from"./chunk-index-31x6krbs.js";import"./chunk-index-v6smgw77.js";import{L}from"./chunk-index-8d81qy69.js";import{Jt}from"./chunk-index-92zgb7my.js";import{ee,Te}from"./chunk-index-cdctnw71.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";var xe=S(()=>(h("hf296e7v"),import("./chunk-prompt-history-hf296e7v.js")).then((l)=>({default:l.HistorySheet}))),Fe=S(()=>(h("caj4pmg4"),import("./chunk-character-creator-caj4pmg4.js")).then((l)=>({default:l.CharacterCreator}))),Oe=["default","off","minimal","low","medium","high","xhigh"],ve={default:c("Default"),off:c("Off"),minimal:c("Minimal"),low:c("Low"),medium:c("Medium"),high:c("High"),xhigh:c("Very high")},G="default",be=(l)=>l.model===void 0?t("Default model ({current})",{current:l.effective.model}):t("Default model (server setting)"),$e=c("Automatic"),le=(l)=>l==="auto"?t($e):t(ve[l]??l),he=(l)=>({displayName:l.displayName,prompt:l.prompt,model:l.model??G,thinking:l.thinking??G});function ge(l,p){return{...p.displayName!==l.displayName?{displayName:p.displayName}:{},...p.prompt!==l.prompt?{prompt:p.prompt}:{},...p.model!==(l.model??G)?{model:p.model}:{},...p.thinking!==(l.thinking??G)?{thinking:p.thinking}:{}}}function ye(){let l=Io(),p=a(l);if(l)p.current=l;let i=p.current,k=l!==void 0;if(s(()=>{if(!k)return;let C=window.location.href,I=()=>{if(window.location.href!==C)gn()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[k]),!i)return null;return e(L,{open:l!==void 0,title:t("Edit knight"),size:"wide",onClose:gn,children:e(Ve,{name:i.name,opened:i.id},i.name)})}function Ve({name:l,opened:p}){let[i,k]=r(),[C,I]=r([]),[A,V]=r(),[E,x]=r(),[v,R]=r(!1),[H,z]=r(!1),[te,J]=r(!1),[B,j]=r(!1),ae=Ln(i?.room??""),q=a(null),W=i!==void 0,U=u((y)=>i?y.rooms[i.room]?.view?.muted===!0:!1,i?.room??""),[ne,F]=r(!1),oe=u((y)=>i?y.rooms[i.room]?.view?.coordinator===!0:!1,i?.room??""),Y=N(),Z=N(),P=N();s(()=>{if(!W||!zo()?.look)return;q.current?.scrollIntoView({block:"start"}),q.current?.focus({preventScroll:!0})},[W,p]);let b=a({});b.current={profile:i,draft:E},s(()=>{let y=!0;return Promise.all([O.agent(l),O.models()]).then(([re,Pe])=>{if(!y)return;let{profile:fe,draft:ie}=b.current,He=fe&&ie&&Object.keys(ge(fe,ie)).length>0;k(re),I(Pe.models),x(He?ie:he(re))},(re)=>y&&V(d(re))),()=>{y=!1}},[l,p]);let T=M(()=>i&&E?ge(i,E):{},[i,E]);if(A)return e(g,{message:A});if(!i||!E)return e(w,{});let de=Object.keys(T).length>0,De=Array.from(new Set([G,...C,E.model])),Ie=be(i),pe=async()=>{R(!0);try{let y=await O.updateAgent(l,T);k(y),x(he(y)),z(!1),f(t("Saved."))}catch(y){f(d(y),"danger")}finally{R(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(ue,{spec:i.character,name:i.name,size:72,state:ae,label:i.displayName}),n("div",{children:[e("h3",{children:i.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:i.effective.model,thinking:le(i.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:P,children:[e("span",{className:"menu-icon",children:e(o,{name:U?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(qt,{id:P,checked:!U,label:t("Notifications"),busy:ne,onChange:async(y)=>{F(!0),await Jt(i.room,!y),F(!1)}})]})})}),H?e(Be,{profile:i,draft:E,saving:v,onBack:()=>z(!1),onSave:pe}):n("form",{className:"stack form",onSubmit:(y)=>{if(y.preventDefault(),!de)return;if(T.prompt!==void 0)z(!0);else pe()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:E.displayName,onChange:(y)=>x({...E,displayName:y.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:Y,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>j(!0),children:[e(o,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>J(!0),children:[e(Ge,{}),t("Full screen")]})]})]}),e("textarea",{id:Y,rows:8,value:E.prompt,onChange:(y)=>x({...E,prompt:y.target.value})})]}),e(Ut,{label:t("Model"),value:E.model,onChange:(y)=>x({...E,model:y}),options:De.map((y)=>({value:y,label:y===G?Ie:y}))}),e(Ut,{label:t("Thinking level"),value:E.thinking,onChange:(y)=>x({...E,thinking:y}),options:Oe.map((y)=>({value:y,label:t(ve[y])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!de||v,children:v?t("Saving…"):T.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(ze,{name:l,opened:p}),n("section",{className:"card stack",ref:q,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(Q,{fallback:e(w,{}),children:e(Fe,{name:i.name,displayName:i.displayName,prompt:i.prompt,character:i.character,onSaved:(y)=>k(y)})})]}),oe?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived knight stops answering and its schedules are cancelled. Its history is kept, and you can restore it from Archived.")}),e("div",{className:"actions",children:e("button",{type:"button",className:"danger",onClick:()=>{gn(),Re({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive {name}",{name:i.displayName})})})]}),B?e(Q,{fallback:null,children:e(xe,{open:B,title:t("History of the prompt"),load:async()=>(await Ne.agentPromptHistory(l)).versions.map((y)=>({id:y.id,text:y.text,previous:y.previous,by:y.by,at:y.at})),onUse:(y)=>{x({...E,prompt:y}),j(!1)},onClose:()=>j(!1)})}):null,e(L,{open:te,title:t("Prompt"),size:"full",onClose:()=>J(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:E.prompt,onChange:(y)=>x({...E,prompt:y.target.value})})})]})}function ze({name:l,opened:p}){let[i,k]=r(),[C,I]=r(),[A,V]=r(),E=N();if(s(()=>{let v=!0;return ee.skills(l).then((R)=>v&&k(R),(R)=>{if(v&&!(R instanceof ce&&R.status===404))V(d(R))}),()=>{v=!1}},[l,p]),A)return e(g,{message:A});if(!i)return null;let x=async(v,R)=>{I(v);try{k(await ee.setSkills(l,R?{add:[v]}:{remove:[v]}))}catch(H){f(d(H),"danger")}finally{I(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),children:[e("h3",{children:t("Skills")}),e("p",{className:"meta",children:t("What the knight can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:i.skills.map((v,R)=>{let H=`${E}-${R}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:H,children:[n("span",{className:"menu-text",children:[e("strong",{children:v.name}),e("span",{className:"meta",children:v.missing?t("Its file cannot be read."):v.builtin?t("Built in: every knight carries it."):v.description??""})]}),e(qt,{id:H,checked:v.carried,label:v.name,busy:C===v.name,disabled:v.builtin,onChange:(z)=>x(v.name,z)})]})},v.name)})})]})}var Ge=()=>e("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e("path",{d:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"})});function Be(l){let{profile:p,draft:i}=l,k=a(null);s(()=>k.current?.focus(),[]);let C=[];if(i.displayName!==p.displayName)C.push({label:t("Name"),before:p.displayName,after:i.displayName});let I=(A)=>A===G?be(p):A;if(i.model!==(p.model??G))C.push({label:t("Model"),before:I(p.model??G),after:I(i.model)});if(i.thinking!==(p.thinking??G))C.push({label:t("Thinking level"),before:le(p.thinking??G),after:le(i.thinking)});return n("section",{ref:k,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),C.length?e("ul",{className:"review-fields",children:C.map((A)=>n("li",{children:[e("strong",{children:A.label}),e("span",{className:"review-before",children:A.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:A.after})]},A.label))}):null,e(mt,{label:t("Prompt"),before:p.prompt,after:i.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:l.saving,onClick:l.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:l.saving,onClick:l.onSave,children:l.saving?t("Saving…"):t("Save")})]})]})}function Ke(l){let p=l.filter((C)=>C.parent!==void 0),i=l.filter((C)=>C.parent===void 0),k=new Set(i.map((C)=>C.name));return[...i.flatMap((C)=>[C,...p.filter((I)=>I.parent===C.name)]),...p.filter((C)=>!k.has(C.parent??""))]}function ke(){let[l,p]=r(),[i,k]=r(),[C,I]=r(),[A,V]=r(),E=X(async()=>{try{p((await ee.archive()).entries),k(void 0)}catch(v){k(d(v))}},[]);s(()=>{E()},[E]);let x=async(v)=>{I(v.name);try{if(v.kind==="agent")await ee.restoreAgent(v.name);else await ee.restoreGroup(v.name);await Te(),f(t("Restored {name}.",{name:v.displayName})),await E()}catch(R){f(d(R),"danger")}finally{I(void 0)}};if(i&&!l)return e(g,{message:i});if(!l)return e(w,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived knights and groups no longer answer. Their history is kept until you delete them.")}),l.length===0?e(_,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:Ke(l).map((v)=>n("li",{className:"menu-item","data-helper":v.parent??void 0,style:v.parent?{paddingLeft:"var(--space-6)"}:void 0,children:[e("span",{className:"menu-icon",children:e(o,{name:v.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:v.displayName}),n("span",{className:"meta",children:[v.parent?t("Temp knight of {name}",{name:v.parent}):v.kind==="agent"?t("Knight"):t("Group")," ","· ",v.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:C===v.name,onClick:()=>x(v),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:C===v.name,onClick:()=>V(v),children:t("Delete")})]},`${v.kind}:${v.name}`))}),e(K,{open:A!==void 0,title:t("Delete {name}?",{name:A?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>V(void 0),onConfirm:async()=>{if(!A)return;if(A.kind==="agent")await ee.deleteAgent(A.name);else await ee.deleteGroup(A.name);await Te(),f(t("Deleted {name}.",{name:A.displayName})),await E()},children:e("p",{children:t("{name} and its messages in this app are deleted for good, and the name can be used again. This cannot be undone.",{name:A?.displayName??""})})})]})}var we=/^[a-z0-9-]{1,32}$/,Se=2,Ce=8,se="\x00";function Ue(){let l=u((p)=>p.order.flatMap((i)=>{let k=p.rooms[i]?.view;return k?.kind==="agent"&&!k.helper?[`${k.name}${se}${k.displayName}`]:[]}).join(`${se}${se}`));return M(()=>l===""?[]:l.split(`${se}${se}`).map((p)=>{let[i="",k=""]=p.split(se);return{name:i,displayName:k}}),[l])}function Ae(l){let p=Ue(),[i,k]=r(),[C,I]=r(),[A,V]=r(""),[E,x]=r(""),[v,R]=r(!1),[H,z]=r([]),[te,J]=r(""),[B,j]=r(!1),[ae,q]=r(l.name===void 0),W=N(),U=N();s(()=>{let P=l.name;if(P===void 0)return;let b=!0;return ee.group(P).then((T)=>{if(!b)return;k(T),V(T.displayName),z(T.members),J(T.host),q(!0)},(T)=>b&&I(d(T))),()=>{b=!1}},[l.name]);let ne=(P)=>p.find((b)=>b.name===P)?.displayName??P,F=H.includes(te)?te:H[0]??"",oe=i===void 0?!0:A.trim()!==i.displayName||H.join(",")!==i.members.join(",")||F!==i.host,Y=A.trim()!==""&&H.length>=Se&&H.length<=Ce&&(i!==void 0||we.test(E));if(C&&!ae)return e(g,{message:C});if(!ae)return e(w,{});let Z=async()=>{j(!0),I(void 0);try{if(i){await ee.updateGroup(i.name,{...A.trim()!==i.displayName?{displayName:A.trim()}:{},...H.join(",")!==i.members.join(",")?{members:H}:{},...F!==i.host?{host:F}:{}}),await Te(),f(t("Saved.")),l.onDone();return}let P=await ee.createGroup({name:E,displayName:A.trim(),members:H,host:F});await Te(),f(t("Made {name}.",{name:P.displayName})),l.onDone(),D("room",P.room)}catch(P){I(d(P))}finally{j(!1)}};return n("form",{className:"stack form",onSubmit:(P)=>{if(P.preventDefault(),Y&&oe&&!B)Z()},children:[n("label",{htmlFor:W,children:[t("Name"),e("input",{id:W,value:A,autoComplete:"off",onChange:(P)=>{if(V(P.target.value),!i&&!v)x(P.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),i?null:n("label",{htmlFor:U,children:[t("Permanent name"),e("input",{id:U,value:E,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":E!==""&&!we.test(E),onChange:(P)=>{R(!0),x(P.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Members")}),e("span",{className:"meta",children:t("Pick 2 to 8 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:p.map((P)=>{let b=H.includes(P.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:b,disabled:!b&&H.length>=Ce,onChange:()=>z(b?H.filter((T)=>T!==P.name):[...H,P.name])}),e("span",{className:"menu-text",children:e("strong",{children:P.displayName})})]})},P.name)})})]}),H.length>=Se?e(Ut,{label:t("Host"),value:F,onChange:J,options:H.map((P)=>({value:P,label:ne(P)}))}):null,C?e(g,{message:C}):null,n("div",{className:"actions",children:[i?e("button",{type:"button",className:"danger",onClick:()=>{l.onDone(),Re({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!Y||!oe||B,children:B?t("Saving…"):i?t("Save"):t("Make group")})]})]})}var je=S(()=>(h("caj4pmg4"),import("./chunk-character-creator-caj4pmg4.js")).then((l)=>({default:l.CharacterCreator}))),Ee=/^[a-z0-9-]{1,32}$/,me="default";function _e(l){let p=[];for(let i of l){let k=i.indexOf("/"),C=k>0?i.slice(0,k):"",I=p.find((A)=>A.provider===C&&C!=="");if(I)I.models.push(i);else p.push({provider:C,models:[i]})}return p}var We=(l)=>l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Me({onDone:l}){let[p,i]=r(""),[k,C]=r(""),[I,A]=r(!1),[V,E]=r(""),[x,v]=r(me),[R,H]=r(""),[z,te]=r(),[J,B]=r(!1),[j,ae]=r([]),[q,W]=r(),[U,ne]=r(!1),F=[N(),N(),N(),N(),N()];s(()=>{let b=!0;return O.models().then((T)=>b&&ae(T.models),()=>{return}),()=>{b=!1}},[]);let oe=M(()=>xn({name:k,displayName:p,prompt:V}),[k,p,V]),Y=z?.spec??oe,Z=Ee.test(k)&&p.trim()!==""&&V.trim()!=="";if(J)return e(Q,{fallback:e(w,{}),children:e(je,{name:k||"new",displayName:p,prompt:V,character:Y,onPick:(b,T)=>{te({input:b,spec:T}),B(!1)},onCancel:()=>B(!1)})});let P=async()=>{ne(!0),W(void 0);try{let b={name:k,displayName:p.trim(),prompt:V,...x!==me?{model:x}:{},...R.trim()?{task:R.trim()}:{},...z?{character:z.input}:{}},T=await ee.createAgent(b);await Te(),f(t("Made {name}.",{name:T.displayName})),l(),D("room",T.room)}catch(b){W(b instanceof ce&&b.field?`${b.field}: ${d(b)}`:d(b))}finally{ne(!1)}};return n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),Z&&!U)P()},children:[n("label",{htmlFor:F[0],children:[t("Name"),e("input",{id:F[0],value:p,autoComplete:"off",onChange:(b)=>{if(i(b.target.value),!I)C(We(b.target.value))}})]}),n("label",{htmlFor:F[1],children:[t("Permanent name"),e("input",{id:F[1],value:k,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":k!==""&&!Ee.test(k),onChange:(b)=>{A(!0),C(b.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("label",{htmlFor:F[2],children:[t("Prompt"),e("textarea",{id:F[2],rows:6,value:V,onChange:(b)=>E(b.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:F[4],children:[t("Model"),n(qe,{id:F[4],value:x,onChange:(b)=>v(b.target.value),children:[e("option",{value:me,children:t("Default model")}),_e(j).map((b)=>b.provider===""?b.models.map((T)=>e("option",{value:T,children:T},T)):e("optgroup",{label:b.provider,children:b.models.map((T)=>e("option",{value:T,children:T},T))},b.provider))]})]}),n("label",{htmlFor:F[3],children:[t("Opening task"),e("textarea",{id:F[3],rows:3,value:R,onChange:(b)=>H(b.target.value)}),e("span",{className:"meta",children:t("Optional. The knight starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(ue,{spec:Y,name:k||"new",size:72,label:p}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:z?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>B(!0),children:t("Choose a look")})]})]}),q?e(g,{message:q}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!Z||U,children:U?t("Making…"):t("Make knight")})})]})}var Xe=(l)=>l.kind==="new-agent"?t("New knight"):l.kind==="archive"?t("Archived"):l.name===void 0?t("New group"):t("Edit group");function Le(){let l=Vo(),p=a(l);if(l)p.current=l;let i=p.current,k=l!==void 0;if(s(()=>{if(!k)return;let C=window.location.href,I=()=>{if(window.location.href!==C)Oi()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[k]),!i)return null;return e(L,{open:l!==void 0,title:Xe(i),size:"wide",onClose:Oi,children:e("div",{className:"stack agent-sheet",children:i.kind==="new-agent"?e(Me,{onDone:Oi}):i.kind==="archive"?e(ke,{}):e(Ae,{...i.name===void 0?{}:{name:i.name},onDone:Oi})},i.id)})}var Ye=S(()=>(h("a6pkjcq7"),import("./chunk-shortcut-help-a6pkjcq7.js")));function Je(){let l=vo(),p=a(!1);if(l)p.current=!0;if(!p.current)return null;return e(Q,{fallback:null,children:e(Ye,{open:l})})}function ga(){return n(m,{children:[e(lr,{}),e(ye,{}),e(Le,{}),e(Je,{})]})}export{ga as SheetHosts};
@@ -1,8 +0,0 @@
1
- import{h,Q,S,s,N,r,t,m,e,n,o,ce,d,f,w,g}from"./chunk-index-2e4am3hw.js";import{Ne,mt}from"./chunk-index-tk4se135.js";import{L}from"./chunk-index-8d81qy69.js";var M=S(()=>(h("hf296e7v"),import("./chunk-prompt-history-hf296e7v.js")).then((c)=>({default:c.HistorySheet}))),B=`---
2
- name: my-skill
3
- description: "Use when "
4
- ---
5
-
6
- # My skill
7
-
8
- `;function _(c){let{name:u}=c,[i,k]=r(),[p,v]=r(u?"":B),[b,R]=r(),[z,y]=r(!1),[C,D]=r(!1),[A,H]=r(!1),[T,x]=r(!1),E=N();s(()=>{if(!u)return;let a=!0;return Ne.skillDocument(u).then((l)=>{if(!a)return;k(l),v(l.text)},(l)=>a&&R(d(l))),()=>{a=!1}},[u]);let F=i?.text??"",U=p!==F,I=u!==void 0&&!i&&!b,V=async()=>{D(!0);try{if(i){let a=await Ne.saveSkillDocument(i.name,{text:p,baseHash:i.hash});k(a),v(a.text),y(!1),H(!1),f(t("Saved.")),c.onSaved()}else await Ne.createSkillDocument({text:p}),f(t("Skill created.")),c.onSaved(),c.onClose()}catch(a){if(a instanceof ce&&a.status===409){let{current:l}=a.body;k(l),H(!0)}else f(d(a),"danger")}finally{D(!1)}};return n(L,{open:!0,title:u??t("New skill"),size:"full",onClose:c.onClose,children:[b?e(g,{message:b}):null,I?e(w,{}):null,i&&!i.writable?e(g,{message:t("This skill cannot be edited here.")}):null,!I&&!b&&(!i||i.writable)?n("div",{className:"stack",children:[z?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),A?e(g,{message:t("This skill changed while you were editing it. The changes below are against the version there now; save again to replace it, or go back to edit.")}):null,e(mt,{label:"SKILL.md",before:F,after:p}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>y(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:C,onClick:V,children:C?t("Saving…"):i?t("Save"):t("Create skill")})]})]}):n(m,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:E,children:"SKILL.md"}),i?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>x(!0),children:[e(o,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:E,className:"prompt-full",spellCheck:!1,value:p,onChange:(a)=>v(a.target.value)}),e("p",{className:"meta",children:t("Frontmatter holds the name, which cannot change, and a description that starts with “Use when”. The rest is the skill.")})]}),e("div",{className:"actions",children:e("button",{type:"button",disabled:!U||!p.trim(),onClick:()=>y(!0),children:t("Review changes")})})]}),T&&i?e(Q,{fallback:null,children:e(M,{open:T,title:t("History of {name}",{name:i.name}),load:async()=>{let{versions:a}=await Ne.skillHistory(i.name);return a.map((l,K)=>({id:l.id,text:l.text,previous:a[K+1]?.text??"",by:l.by,at:l.at}))},onUse:(a)=>{v(a),y(!1),x(!1)},onClose:()=>x(!1)})}):null]}):null]})}export{_ as SkillEditor};
@@ -1 +0,0 @@
1
- import{h,vr,Q,S,s,r,t,m,e,n,o,O,d,w,g,_,P,Gt,Rt}from"./chunk-index-2e4am3hw.js";import{be}from"./chunk-index-5bfqek1d.js";import{he}from"./chunk-index-v6smgw77.js";import"./chunk-index-8d81qy69.js";function N({source:i}){return e("div",{className:"prose document",children:e(Gt,{remarkPlugins:[Rt],components:{a:({href:a,children:c})=>a&&/^https?:\/\//.test(a)?e("a",{href:a,target:"_blank",rel:"noreferrer",children:c}):e("span",{children:c}),img:({alt:a})=>e("span",{children:a}),pre:({children:a})=>e("div",{className:"code-block",children:e("pre",{children:a})}),table:({children:a})=>e("div",{className:"table-wrap",children:e("table",{children:a})})},children:i})})}var v=S(()=>(h("67yk4x7t"),import("./chunk-skill-editor-67yk4x7t.js")).then((i)=>({default:i.SkillEditor})));function j(){let[i,a]=r(0),{data:c,error:l}=be(()=>O.skills(),`skills:${i}`),[f,y]=r(),[p,k]=r();s(()=>{O.session().then(y,()=>{return})},[]);let b=f?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),b?n("button",{type:"button",className:"secondary",onClick:()=>k({name:void 0}),children:[e(o,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:b?t("Registered skills and their carriers. A skill a knight wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask a knight on Discord to edit their contents.")}),l?e(g,{message:l}):null,!c&&!l?e(w,{}):null,c?.length===0?e(_,{children:t("No skills.")}):null,c?.map((u)=>e(D,{skill:u,onEdit:b&&u.source.kind==="written"?()=>k({name:u.name}):void 0},`${u.name}:${i}`)),p?e(Q,{fallback:null,children:e(v,{name:p.name,onSaved:()=>a((u)=>u+1),onClose:()=>k(void 0)},p.name??"")}):null]})}function E(i){switch(i.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:i.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${i.repo}:${i.path}`});default:return}}function D({skill:i,onEdit:a}){let[c,l]=r(!1),[f,y]=r(),[p,k]=r(),b=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Knight-written"):i.source.kind==="package"?i.source.package:`${i.source.repo}:${i.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(P,{children:b}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(m,{children:[a?e("button",{type:"button",className:"secondary",onClick:a,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!f)k(void 0),O.skill(i.name).then(y).catch((u)=>k(d(u)))},children:"SKILL.md"})]})]}),e("p",{children:i.missing??i.description}),i.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(o,{name:"lock",size:14}),e("span",{children:E(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All knights"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(he,{open:c,title:i.name,size:"wide",onClose:()=>l(!1),children:p?e(g,{message:p}):!f?e(w,{}):e(V,{title:i.name,detail:f})})]})}function V({title:i,detail:a}){let c=a.metadata.filter((l)=>!(l.key==="name"&&l.value===i));return n("div",{className:"skill-document",children:[c.length?e("dl",{className:"skill-meta",children:c.map((l)=>n(vr,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(N,{source:a.body})]})}export{j as SkillsPage};
@@ -1 +0,0 @@
1
- import{M,a,r,t,te,m,e,n,o,v,D,gt,ke,u,nt,Wt,On,We,Xe,Yt}from"./chunk-index-2e4am3hw.js";import{si}from"./chunk-index-02vfshtt.js";import{ii}from"./chunk-index-ak6ecqy3.js";import{ri,oi}from"./chunk-index-xxeb2xp0.js";import{Bt}from"./chunk-index-12zyshae.js";import{Ts}from"./chunk-index-g1awv7rk.js";ri();function b(){let l=u((c)=>JSON.stringify(Ts(c,(s)=>ke(c,s),(s)=>gt(c,s)>0,!0).map((s)=>({id:s.id,...s.title===void 0?{}:{title:s.title},entries:s.keys.map((h)=>({key:h,name:c.rooms[h]?.view?.displayName??h,waiting:gt(c,h)>0}))})))),d=si(),y=a(l);if(!d)y.current=l;let f=y.current;return M(()=>JSON.parse(f),[f])}function k(l){let{key:d,name:y}=l.entry,f=u((i)=>i.rooms[d]),c=u((i)=>gt(i,d)),s=f?.view,h=We(s?.character),g=Bt(()=>Wt(d,l.onLeave),l.liftable&&!s?.home?oi(d):void 0);if(!s)return null;return e("li",{...l.liftable&&!s.home?{"data-drop-item":"","data-key":d}:{},children:n("a",{className:"switcher-row",...g,href:v("room",d),"aria-current":d===l.current?"page":void 0,style:h,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(d)},children:[n("span",{className:"switcher-picture",children:[e(Xe,{view:s,size:40}),c?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:y}),f?.typing?n("span",{className:"switcher-working",children:[n("span",{className:"typing","aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t("Working")]}):null]}),e(Yt,{room:d}),c?e("span",{className:"badge badge-warn",children:te(c,"{count} card waiting","{count} cards waiting")}):null,s.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(o,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,f?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(o,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,f?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(o,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[d,y]=r(""),f=b(),c=f.map((i)=>({...i,entries:i.entries.filter((p)=>ii(d,p.name)!==void 0)})).filter((i)=>i.entries.length>0||d===""),s=(i)=>l.close(i===l.current?void 0:()=>D("room",i)),h=f.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),g=c.filter((i)=>i.entries.length>0).length>1;return n(m,{children:[n("div",{className:"switcher-search",children:[e(o,{name:"search",size:16}),e("input",{type:"search",value:d,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>y(i.target.value),onKeyDown:(i)=>{let p=c.flatMap((w)=>w.entries)[0];if(i.key==="Enter"&&p&&!nt(i.nativeEvent))s(p.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>On(i.currentTarget,l.close),children:e(o,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:c.map((i)=>{let p=i.id==="waiting",w=i.id==="pinned"?"pinned":i.id==="rest"?"rest":p||i.id==="home"?void 0:"folder";return n("section",{"aria-label":p?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?h:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...w?{"data-drop-zone":w,"data-zone-id":i.id,...w==="folder"?{"data-folder":i.id}:{}}:{},children:[p?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):g||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?h:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((N)=>e(k,{entry:N,current:l.current,onPick:s,onLeave:l.close,liftable:!p&&i.id!=="home"},N.key))})]},i.id)})})]})}export{Y as SwitcherList};
@@ -1 +0,0 @@
1
- import{h,Q,S,ve,s,r,t,e,n,D,u,et,pe,qo}from"./chunk-index-2e4am3hw.js";import"./chunk-index-2t30xwed.js";import"./chunk-index-18pgxxw3.js";import"./chunk-index-kbrg32sx.js";import{Mn,ei,wo,$i,ti,Vt}from"./chunk-index-kb3w11mn.js";import"./chunk-index-64rsz6pf.js";import{Ei,Ci}from"./chunk-index-t998yg8y.js";import"./chunk-index-8d81qy69.js";import{es,xi,ts}from"./chunk-index-dnjftvtq.js";var x=S(()=>(h("s9sz1bzf"),import("./chunk-council-sheet-s9sz1bzf.js")).then((o)=>({default:o.CouncilSheet})));function A(o,i,b,c,d){qo(o,i).then((m)=>{if(m)pe({...m,at:b,via:c,source:d})},()=>{return})}function P(){return wo((ve(et)?.kinds??[]).map((o)=>o.kind)),null}function V({focus:o}){let[i,b]=r(),c=$i(void 0),d=Mn(),m=d.loaded&&c.length===0;return s(()=>{if(o&&d.loaded)D("table",void 0,{replace:!0})},[o,d.loaded]),n("div",{className:"table-page",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[i?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>i.focus(null),children:t("Reset view")}):null,e("button",{type:"button",className:"secondary",onClick:()=>D("rooms"),children:t("All rooms")})]})]}),n("div",{className:"table-frame",children:[m?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("There are no rooms to seat yet.")})]}):e(Vt,{onHandle:b,onSeat:(a)=>{let l=c.find((f)=>f.name===a);if(l)D("room",l.key)},onFocus:(a)=>{let l=c.find((f)=>f.name===a);if(l)D("room",l.key)}}),e(P,{})]})]})}function F({named:o}){let[i,b]=r(),c=xi(),d=es(),m=u((p)=>p.listed),a=ts(c,d,o),l=a?.members??[],f=$i(l),g=ti(),{focus:R,look:y}=Ei(a?.key??"",l),[w,k]=r(!1),[H,M]=r(!1),v=()=>{M(!0),k(!0)},C=o===void 0||c.some(G(o));s(()=>{if(o!==void 0&&m&&!C)D("table",void 0,{replace:!0})},[o,m,C]);let N=f.length>0;return n("div",{className:"table-page","data-focused":N||void 0,children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[i?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>y(null),children:t("Reset view")}):null,g.length>0?e("button",{type:"button",className:"secondary council-chip","aria-haspopup":"dialog",onClick:v,children:a?t("Council: {name} ▾",{name:a.displayName}):t("Pick who sits")}):null]})]}),a&&N?e(Ci,{roomKey:a.key,members:l,focus:R,onLook:y,streams:!0,onHandle:b,onSeatMenu:(p)=>{let T=f.find((E)=>E.name===p.id);if(T)A(T.key,a.key,p.at,p.via,p.source)}}):e("div",{className:"table-frame",children:n("div",{className:"table-empty-state",children:[e("strong",{children:a?t("The council is empty"):t("No council yet")}),e("p",{className:"meta",children:a?t("Every member of this council is gone. Edit who sits."):t("A council is a group of up to {max} knights who answer in turn. Pick who sits.",{max:8})}),g.length>0?e("button",{type:"button",onClick:v,children:a?t("Edit this council"):t("Pick who sits")}):null]})}),H?e(Q,{fallback:null,children:e(x,{open:w,onClose:()=>k(!1),council:a})}):null]})}var G=(o)=>(i)=>i.key===o||i.name===o;function Y({focus:o}){return ei()?e(V,{focus:o}):e(F,{named:o})}export{Y as TablePage};
@@ -1 +0,0 @@
1
- import{Cn,yr,br,Pt,an,ln,ai}from"./chunk-index-w42rcbx1.js";import"./chunk-index-64rsz6pf.js";import{Mt,Ft}from"./chunk-index-0a81da8z.js";var de="http://www.w3.org/2000/svg",t=(d,s={},p)=>{let x=document.createElementNS(de,d);for(let[E,R]of Object.entries(s))x.setAttribute(E,String(R));return p?.appendChild(x),x},fe=(d)=>{let s=/<svg[^>]*\swidth=/.test(d)?d:d.replace("<svg",'<svg width="256" height="256"');return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(s)}`},me=0;function he(d,s){let p=s||d<=6?1:2;return{rows:p,perRow:Math.max(1,Math.ceil(d/p))}}function we(d,s){let p=`t2d${++me}`,x=window.matchMedia("(prefers-reduced-motion: reduce)"),E=s.reducedMotion==="auto"||s.reducedMotion===void 0?x.matches:s.reducedMotion,R=s.labels??Ft,{theme:I,scheme:_}=s,M=[],z=new Map,A=new Map,G=new Map,T=s.focus??null,S=document.createElement("div");S.className="t2d";let m=t("svg",{role:"group","aria-label":R.table});if(S.appendChild(m),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(S);function te(e,i,c){let o=Math.max(1.6,c*0.022),g=o+Math.max(1.2,c*0.014),a=t("filter",{id:`${p}-rim`,x:"-15%",y:"-15%",width:"130%",height:"130%"},e);t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:g,result:"far"},a),t("feFlood",{"flood-color":i.ink,result:"ink"},a),t("feComposite",{in:"ink",in2:"far",operator:"in",result:"line"},a),t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:o,result:"near"},a),t("feFlood",{"flood-color":i.paper,result:"paper"},a),t("feComposite",{in:"paper",in2:"near",operator:"in",result:"rim"},a);let l=t("feMerge",{},a);for(let w of["line","rim","SourceGraphic"])t("feMergeNode",{in:w},l)}function y(){let e=Cn(I,_);S.classList.toggle("reduced",E),S.classList.toggle("focus",T!==null),S.classList.toggle("dim",M.some((r)=>A.get(r.id)==="speaking"));let i=s.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,i?60:200);m.setAttribute("viewBox",`0 0 ${c} ${o}`),m.replaceChildren();let g=Math.max(M.length,1),{rows:a,perRow:l}=he(g,i);t("rect",{width:c,height:o,fill:e.css.bg},m);let w=t("defs",{},m),C=c/2,F=i?o*0.82:o*0.62;if(t("ellipse",{cx:C,cy:F,rx:c*0.47,ry:i?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},m),!i)t("ellipse",{cx:C,cy:F,rx:c*0.3,ry:o*0.2,fill:"none",stroke:e.css.ring,"stroke-width":3,opacity:e.night?0.9:0.7},m);let H=c/l,B=i?o*0.95:o/(a+0.6),h=Math.max(46,Math.min(H*0.94,132,B*1.05)),u=h*0.72,n=h*1.05;te(w,e,n),M.forEach((r,b)=>{let k=t("radialGradient",{id:`${p}-h${b}`},w);t("stop",{offset:0,"stop-color":r.color,"stop-opacity":0.95},k),t("stop",{offset:1,"stop-color":r.color,"stop-opacity":0},k)});let ne=(r)=>{if(i)return o*0.92;return a===1?o*0.62:o*(0.46+r*0.3)};if(M.forEach((r,b)=>{let k=Math.floor(b/l),re=Math.min(l,g-k*l),ie=b-k*l,se=c/re*(ie+0.5),ae=ne(k),O=A.get(r.id)??"idle",f=t("g",{class:"seat","data-seat":r.id,"data-state":O,...T===r.id?{"data-focus":""}:{},transform:`translate(${se.toFixed(1)} ${ae.toFixed(1)})`,tabindex:s.listBelow?-1:0,role:"button","aria-label":R.seat(r.name,O),color:e.css.text,...s.listBelow?{"aria-hidden":"true"}:{}},m);t("ellipse",{cx:0,cy:3,rx:h*0.55,ry:h*0.1,fill:"#000",opacity:0.35},f),t("ellipse",{class:"halo",cx:0,cy:-u-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${p}-h${b})`},f),t("polygon",{class:"beam",points:`${-n*0.12},${-n*2.1} ${n*0.12},${-n*2.1} ${n*0.5},0 ${-n*0.5},0`,fill:r.color,opacity:0.2},f);let K=t("g",{class:"lift"},f),X=z.get(r.id);if(X)t("image",{href:fe(X),x:-n/2,y:-u-n*0.78,width:n,height:n*0.88,filter:`url(#${p}-rim)`,...r.dim?{opacity:0.55}:{}},K);else{t("circle",{cx:0,cy:-u-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},K);let v=t("text",{x:0,y:-u-n*0.3+n*0.1,"text-anchor":"middle","font-size":n*0.3,"font-weight":700,fill:"#fff","font-family":Pt},K);v.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let Z=u*0.22;t("path",{d:`M ${-h*0.5} ${-u} L ${h*0.5} ${-u} L ${h*0.42} 0 L ${-h*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},f),t("rect",{x:-h*0.54,y:-u-Z*0.2,width:h*1.08,height:Z,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},f);let L=Math.max(11,Math.min(15,h*0.14)),V=Math.min(Math.max(h*0.9,L*5.5+14),Math.max(h*0.9,r.name.length*L*0.62+18),H*0.98),le=L+8;t("rect",{class:"plate",x:-V/2,y:-u*0.78,width:V,height:le,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},f);let ce=t("text",{x:0,y:-u*0.78+L+1.5,"text-anchor":"middle","font-size":L,"font-weight":700,"font-family":Pt,fill:e.plateInk},f),J=G.get(r.id);ce.textContent=br(J?`${J} ${r.name}`:r.name,(V-8)/L);let Q=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-u-n*0.78})`},f)),D=O==="done",P=O==="error",U=e.gold;if(D)U=yr.done;else if(P)U=yr.error;t("circle",{r:n*0.15,fill:U,stroke:e.ink,"stroke-width":2},Q);let W=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":Pt,fill:D||P?"#fff":e.ink},Q);if(W.textContent="!",D)W.textContent="✓";else if(P)W.textContent="✕";let ee=t("g",{class:"orbit"},f);t("circle",{cx:n*0.4,cy:-u-n*0.5,r:n*0.05,fill:r.color},ee),t("circle",{cx:-n*0.4,cy:-u-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},ee),f.addEventListener("click",(v)=>s.onSeatClick({id:r.id,name:r.name,at:Mt(v,f)})),f.addEventListener("keydown",(v)=>{if(v.key==="Enter"||v.key===" ")v.preventDefault(),s.onSeatClick({id:r.id,name:r.name,at:Mt({clientX:0,clientY:0,detail:0},f)})})}),!i){let r=Math.min(c*0.34,190),b=o-6;t("rect",{x:C-r/2,y:b-22,width:r,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},m);let k=t("text",{x:C,y:b-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":Pt,fill:e.gold},m);k.textContent=br(s.ownerName??"You",12)}}let N=new Set,oe=(e,i)=>{if(e.mode==="cut")return;let c=Cn(I,_),o=(g,a)=>{let l=setTimeout(()=>{N.delete(l),g()},a);N.add(l)};for(let g of e.joining){let a=[...m.querySelectorAll("g.seat[data-seat]")].find((l)=>l.getAttribute("data-seat")===g);if(!a)continue;a.classList.add("seat-in"),a.prepend(t("ellipse",{class:"seat-ring",rx:44,ry:12,cy:4,stroke:c.css.ring})),o(()=>{a.classList.remove("seat-in"),a.querySelector(".seat-ring")?.remove()},ln)}for(let g of e.leaving){let a=i.get(g);if(!a)continue;let l=a.cloneNode(!0);l.classList.add("seat-out");for(let w of["data-seat","tabindex","role","aria-label"])l.removeAttribute(w);l.setAttribute("aria-hidden","true");for(let[w,[C,F,H]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let B=t("circle",{class:"puff",cx:C,cy:F,r:H,fill:c.paper,stroke:c.ink,"stroke-width":3},l);B.style.animationDelay=`${w*40}ms`}m.appendChild(l),o(()=>l.remove(),an)}},Y=new ResizeObserver(y);Y.observe(d);let j=()=>{if(s.reducedMotion==="auto"||s.reducedMotion===void 0)q.setReducedMotion(x.matches)};x.addEventListener("change",j);let q={kind:"svg",setTheme(e,i){I=e,_=i,y()},setSeats(e){let i=M.map((o)=>o.id),c=new Map([...m.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));M=e;for(let o of e)if(A.set(o.id,o.state??"idle"),o.avatarSvg)z.set(o.id,o.avatarSvg);if(y(),i.length>0||c.size>0)oe(ai(i,e.map((o)=>o.id),E),c)},setState(e,i){if(A.get(e)===i)return;A.set(e,i),y()},setMark(e,i){if((G.get(e)??null)===i)return;if(i===null)G.delete(e);else G.set(e,i);y()},setAvatar(e,i){return z.set(e,i),y(),Promise.resolve()},setReducedMotion(e){E=e,y()},resetCamera(){T=null,y(),s.onFocus?.(null)},focus(e){if(e===T)return;T=e,y()},focused:()=>T,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:E,loop:"idle",seats:M.length,renders:0}},dispose(){for(let e of N)clearTimeout(e);N.clear(),Y.disconnect(),x.removeEventListener("change",j),S.remove()}};return q.setSeats(s.seats),q}export{we as createTable2D};