pi-roundtable-web 0.26.2 → 0.27.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 (219) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +34 -12
  3. package/dist/chunk-account-1ecx5kt7.js +1 -0
  4. package/dist/chunk-action-menu-zh2n0ahf.js +1 -0
  5. package/dist/chunk-agent-ynm2tcbx.js +1 -0
  6. package/dist/chunk-arranged-rooms-qnz8vese.js +1 -0
  7. package/dist/chunk-bulk-actions-pr0mw0kc.js +1 -0
  8. package/dist/chunk-character-creator-caj4pmg4.js +1 -0
  9. package/dist/{chunk-codeeditor-jm2sm333.js → chunk-codeeditor-dga6s78p.js} +2 -2
  10. package/dist/chunk-confirm-g76v5d9r.js +1 -0
  11. package/dist/{chunk-connectors-mhnw6d79.js → chunk-connectors-j79ze3j1.js} +1 -1
  12. package/dist/{chunk-conversations-yjyq4g1y.js → chunk-conversations-2farn72g.js} +1 -1
  13. package/dist/chunk-council-sheet-s9sz1bzf.js +2 -0
  14. package/dist/{chunk-drag-nyq52ck7.js → chunk-drag-45e8222r.js} +1 -1
  15. package/dist/chunk-entry-q11n47h9.js +1 -0
  16. package/dist/chunk-folder-list-4gcj7g7h.js +1 -0
  17. package/dist/chunk-folds-ten4ykfw.js +1 -0
  18. package/dist/chunk-gate-kcv1a4t0.js +1 -0
  19. package/dist/chunk-group-scene-12ghcvzd.js +1 -0
  20. package/dist/chunk-group-table-t458kdgn.js +1 -0
  21. package/dist/chunk-host-icons-h1k9k96a.js +1 -0
  22. package/dist/chunk-host-picture-3p0wzn3v.js +1 -0
  23. package/dist/chunk-host-state-7mdve7cb.js +1 -0
  24. package/dist/chunk-host-ui-bdgwa6sf.js +1 -0
  25. package/dist/chunk-index-02vfshtt.js +2 -0
  26. package/dist/{chunk-index-31ays46f.js → chunk-index-0a81da8z.js} +2 -2
  27. package/dist/{chunk-index-y00wke93.js → chunk-index-0w4bfjb5.js} +2 -2
  28. package/dist/chunk-index-12zyshae.js +2 -0
  29. package/dist/chunk-index-18pgxxw3.js +2 -0
  30. package/dist/chunk-index-2e4am3hw.js +50 -0
  31. package/dist/{chunk-index-1f0j335v.js → chunk-index-2fdns8tn.js} +2 -2
  32. package/dist/{chunk-index-934zgd18.js → chunk-index-2t30xwed.js} +2 -2
  33. package/dist/{chunk-index-cmxs5y22.js → chunk-index-31x6krbs.js} +3 -3
  34. package/dist/{chunk-index-b7jjca66.js → chunk-index-3d8s3565.js} +2 -2
  35. package/dist/chunk-index-5bfqek1d.js +2 -0
  36. package/dist/chunk-index-64rsz6pf.js +2 -0
  37. package/dist/chunk-index-6bkcq9ka.js +2 -0
  38. package/dist/{chunk-index-9nents16.js → chunk-index-8d81qy69.js} +2 -2
  39. package/dist/chunk-index-92zgb7my.js +2 -0
  40. package/dist/chunk-index-aamhjg5n.js +2 -0
  41. package/dist/{chunk-index-ewj52be9.js → chunk-index-ac1ktr56.js} +2 -2
  42. package/dist/{chunk-index-6tpr6r6d.js → chunk-index-ak6ecqy3.js} +2 -2
  43. package/dist/{chunk-index-yrhbhmxz.js → chunk-index-b73y2gc0.js} +2 -2
  44. package/dist/chunk-index-b8cpvr7y.js +2 -0
  45. package/dist/{chunk-index-tmx30r1w.js → chunk-index-bhqczxr3.js} +2 -2
  46. package/dist/{chunk-index-0xj30mzw.js → chunk-index-cbqhzf40.js} +12 -12
  47. package/dist/chunk-index-cdctnw71.js +2 -0
  48. package/dist/chunk-index-dj0tbfyb.js +2 -0
  49. package/dist/chunk-index-dnjftvtq.js +2 -0
  50. package/dist/chunk-index-e2dqjde8.js +1 -0
  51. package/dist/{chunk-index-frwa2fmc.js → chunk-index-ebg48jgy.js} +2 -2
  52. package/dist/{chunk-index-smw1n2pt.js → chunk-index-ek5mek4j.js} +5 -5
  53. package/dist/chunk-index-f6q0stqx.js +2 -0
  54. package/dist/{chunk-index-kw85ajap.js → chunk-index-ffbrm6tr.js} +3 -3
  55. package/dist/chunk-index-g1awv7rk.js +2 -0
  56. package/dist/chunk-index-g3wrs02w.js +1 -0
  57. package/dist/chunk-index-j0m16cj1.js +2 -0
  58. package/dist/chunk-index-j4kk1m59.js +2 -0
  59. package/dist/chunk-index-j4x9dq30.css +1 -0
  60. package/dist/{chunk-index-7bbqtdce.js → chunk-index-jgzygbt8.js} +2 -2
  61. package/dist/chunk-index-kb3w11mn.js +7 -0
  62. package/dist/chunk-index-kbrg32sx.js +2 -0
  63. package/dist/chunk-index-msqhgvfx.js +2 -0
  64. package/dist/chunk-index-pefwfm26.js +2 -0
  65. package/dist/chunk-index-pyfx77cj.js +2 -0
  66. package/dist/{chunk-index-kfv996qe.js → chunk-index-q7g62sgm.js} +35 -3
  67. package/dist/chunk-index-qfgkfq86.js +2 -0
  68. package/dist/chunk-index-rh0x9rzf.js +2 -0
  69. package/dist/{chunk-index-029209sy.js → chunk-index-sm7m4fej.js} +2 -2
  70. package/dist/chunk-index-sv9qpmhv.js +1 -0
  71. package/dist/chunk-index-t998yg8y.js +2 -0
  72. package/dist/chunk-index-tk4se135.js +4 -0
  73. package/dist/chunk-index-v6smgw77.js +2 -0
  74. package/dist/chunk-index-w42rcbx1.js +2 -0
  75. package/dist/chunk-index-x4enmj72.js +2 -0
  76. package/dist/chunk-index-xq84gg8w.js +2 -0
  77. package/dist/{chunk-index-f3b5nch2.js → chunk-index-xxeb2xp0.js} +3 -3
  78. package/dist/{chunk-index-0n6ja7my.js → chunk-index-zyvwhxga.js} +1 -1
  79. package/dist/chunk-lang-css-y9133ktr.js +1 -0
  80. package/dist/{chunk-lang-dockerfile-46rk929v.js → chunk-lang-dockerfile-cnwqn660.js} +1 -1
  81. package/dist/{chunk-lang-go-qb0qdpg7.js → chunk-lang-go-yy6kgsxv.js} +3 -3
  82. package/dist/chunk-lang-html-r2xmryek.js +1 -0
  83. package/dist/chunk-lang-javascript-1r6wd177.js +1 -0
  84. package/dist/{chunk-lang-json-1q4fp694.js → chunk-lang-json-dx56g11y.js} +1 -1
  85. package/dist/{chunk-lang-markdown-5w7t28wa.js → chunk-lang-markdown-fpcf2dfq.js} +5 -5
  86. package/dist/{chunk-lang-python-3dq0p4rf.js → chunk-lang-python-zzp95955.js} +2 -2
  87. package/dist/{chunk-lang-rust-70pa0agr.js → chunk-lang-rust-214fh7sp.js} +1 -1
  88. package/dist/{chunk-lang-shell-4pxt7hf4.js → chunk-lang-shell-1rpgtepw.js} +1 -1
  89. package/dist/{chunk-lang-sql-kgcbh2a9.js → chunk-lang-sql-vvp46hpj.js} +2 -2
  90. package/dist/{chunk-lang-toml-99t95pab.js → chunk-lang-toml-tbj7467c.js} +1 -1
  91. package/dist/chunk-lang-typescript-y5w4tt4g.js +1 -0
  92. package/dist/{chunk-lang-xml-mnbv9yfa.js → chunk-lang-xml-tbcqmedk.js} +1 -1
  93. package/dist/{chunk-lang-yaml-2by9g1dy.js → chunk-lang-yaml-jh56t3sv.js} +1 -1
  94. package/dist/chunk-layout-actions-y73mpsh1.js +1 -0
  95. package/dist/chunk-menu-items-bza16bw6.js +2 -0
  96. package/dist/chunk-mode-toggle-nj9gnt3b.js +1 -0
  97. package/dist/chunk-note-row-6fmhrdng.js +75 -0
  98. package/dist/chunk-notes-wv0e6ssf.js +1 -0
  99. package/dist/chunk-notice-bell-9z27epd2.js +1 -0
  100. package/dist/{chunk-notices-evny44be.js → chunk-notices-fte9f196.js} +1 -1
  101. package/dist/chunk-onboarding-c5twahc3.js +1 -0
  102. package/dist/{chunk-overview-42h45ehd.js → chunk-overview-k4ccprax.js} +1 -1
  103. package/dist/chunk-palette-9rbp2fab.js +1 -0
  104. package/dist/chunk-placement-items-me598wsb.js +1 -0
  105. package/dist/{chunk-profile-bqcgkgk4.js → chunk-profile-s7r7fcvz.js} +1 -1
  106. package/dist/chunk-prompt-history-hf296e7v.js +1 -0
  107. package/dist/chunk-prompts-c8s0nhkm.js +1 -0
  108. package/dist/chunk-room-confirms-ga2sbvhc.js +1 -0
  109. package/dist/chunk-room-menu-7h4jym2b.js +1 -0
  110. package/dist/chunk-rooms-menu-button-pgtaanb6.js +1 -0
  111. package/dist/chunk-schedules-mbnwcxpc.js +1 -0
  112. package/dist/{chunk-seat-menu-ca5p4e9q.js → chunk-seat-menu-r0k0eawr.js} +1 -1
  113. package/dist/chunk-sheet-hosts-a5dfevy9.js +1 -0
  114. package/dist/chunk-shortcut-help-a6pkjcq7.js +26 -0
  115. package/dist/chunk-shortcuts-cgt87jkz.js +1 -0
  116. package/dist/chunk-skill-editor-67yk4x7t.js +8 -0
  117. package/dist/chunk-skills-rewemey4.js +1 -0
  118. package/dist/chunk-switcher-list-t8rbay2y.js +1 -0
  119. package/dist/{chunk-tab-dot-4tkpxqeh.js → chunk-tab-dot-vr11dfrw.js} +1 -1
  120. package/dist/chunk-table-52nh0azk.js +1 -0
  121. package/dist/chunk-table2d-g57vr6h0.js +1 -0
  122. package/dist/chunk-table3d-rp0w6kt4.js +4220 -0
  123. package/dist/chunk-thread-actions-qcxt1y1g.js +1 -0
  124. package/dist/chunk-thread-cards-c2mrp2gj.js +1 -0
  125. package/dist/chunk-thread-list-0071q455.js +217 -0
  126. package/dist/chunk-transcript-789yqysq.js +1 -0
  127. package/dist/chunk-where-hmwmme9e.js +1 -0
  128. package/dist/{chunk-workspace-h0p32ygy.js → chunk-workspace-wr1qrtsh.js} +2 -2
  129. package/dist/chunk-zh-tw-z5p5mpph.js +1 -0
  130. package/dist/index.html +1 -1
  131. package/dist/sw.js +1 -1
  132. package/package.json +3 -3
  133. package/src/api-types.ts +73 -0
  134. package/src/app/app.ts +38 -4
  135. package/src/app/helper-routes.ts +106 -0
  136. package/src/app/rooms.ts +18 -3
  137. package/src/app/routes.ts +125 -2
  138. package/src/app/surface.ts +18 -1
  139. package/src/app/team-routes.ts +21 -1
  140. package/src/app/threads.ts +11 -0
  141. package/src/host/host-app.ts +15 -1
  142. package/src/host/read-all.ts +80 -0
  143. package/src/host/reads.ts +67 -0
  144. package/src/i18n/zh-tw.ts +64 -13
  145. package/dist/chunk-account-nhpd9j90.js +0 -1
  146. package/dist/chunk-action-menu-ec9jqtxq.js +0 -1
  147. package/dist/chunk-agent-d1xfrawq.js +0 -1
  148. package/dist/chunk-arranged-rooms-bga8yk2v.js +0 -1
  149. package/dist/chunk-character-creator-k67f77w5.js +0 -1
  150. package/dist/chunk-confirm-wc5xraev.js +0 -1
  151. package/dist/chunk-entry-red1597w.js +0 -1
  152. package/dist/chunk-folder-list-x56y26yq.js +0 -1
  153. package/dist/chunk-folds-3p7s2nvx.js +0 -1
  154. package/dist/chunk-gate-h41bv4y9.js +0 -1
  155. package/dist/chunk-group-scene-7eb6jyev.js +0 -1
  156. package/dist/chunk-group-table-rca48kt0.js +0 -1
  157. package/dist/chunk-host-icons-x318gjqp.js +0 -1
  158. package/dist/chunk-host-picture-xswcakgy.js +0 -1
  159. package/dist/chunk-host-state-bpahvk54.js +0 -1
  160. package/dist/chunk-host-ui-tsbwwk38.js +0 -1
  161. package/dist/chunk-index-066vzexw.js +0 -2
  162. package/dist/chunk-index-0h4h76kw.js +0 -2
  163. package/dist/chunk-index-2f5nfekb.js +0 -8
  164. package/dist/chunk-index-43k1rjmx.js +0 -2
  165. package/dist/chunk-index-4gk88a0x.js +0 -4
  166. package/dist/chunk-index-4jf4jvfd.css +0 -1
  167. package/dist/chunk-index-4mf29sbx.js +0 -2
  168. package/dist/chunk-index-51n20yhb.js +0 -2
  169. package/dist/chunk-index-84v7j6vh.js +0 -50
  170. package/dist/chunk-index-8f9jer8r.js +0 -2
  171. package/dist/chunk-index-91z3g774.js +0 -1
  172. package/dist/chunk-index-9w0sar6s.js +0 -2
  173. package/dist/chunk-index-a768zmp6.js +0 -2
  174. package/dist/chunk-index-c5x70d9g.js +0 -2
  175. package/dist/chunk-index-cwc1vvpw.js +0 -2
  176. package/dist/chunk-index-d85x96q0.js +0 -2
  177. package/dist/chunk-index-datrrs6b.js +0 -2
  178. package/dist/chunk-index-dep2e3f3.js +0 -2
  179. package/dist/chunk-index-dtste2ed.js +0 -2
  180. package/dist/chunk-index-grkczq2c.js +0 -2
  181. package/dist/chunk-index-gzvkpe3e.js +0 -2
  182. package/dist/chunk-index-satam151.js +0 -2
  183. package/dist/chunk-index-th43f690.js +0 -2
  184. package/dist/chunk-index-ths2hxpe.js +0 -1
  185. package/dist/chunk-index-y4sqmenv.js +0 -2
  186. package/dist/chunk-index-zd76pr2k.js +0 -2
  187. package/dist/chunk-lang-css-fa7c0zfj.js +0 -1
  188. package/dist/chunk-lang-html-47mf2y0v.js +0 -1
  189. package/dist/chunk-lang-javascript-d32qrvxz.js +0 -1
  190. package/dist/chunk-lang-typescript-4k1d8z7s.js +0 -1
  191. package/dist/chunk-layout-actions-cgghzj1w.js +0 -1
  192. package/dist/chunk-menu-items-24cfwawa.js +0 -2
  193. package/dist/chunk-mode-toggle-v4baz3r1.js +0 -1
  194. package/dist/chunk-note-row-72n6cqyk.js +0 -75
  195. package/dist/chunk-notes-83s3tsey.js +0 -1
  196. package/dist/chunk-notice-bell-a4ty5h1p.js +0 -1
  197. package/dist/chunk-onboarding-q1avjbrx.js +0 -1
  198. package/dist/chunk-palette-e44qepmh.js +0 -1
  199. package/dist/chunk-placement-items-v466t0sv.js +0 -1
  200. package/dist/chunk-prompt-history-hgbtcn4b.js +0 -1
  201. package/dist/chunk-prompts-czs8y6r1.js +0 -1
  202. package/dist/chunk-room-confirms-h8cdj3ng.js +0 -1
  203. package/dist/chunk-room-menu-7s0feajw.js +0 -1
  204. package/dist/chunk-rooms-menu-button-gawqvpsr.js +0 -1
  205. package/dist/chunk-schedules-zba7krac.js +0 -1
  206. package/dist/chunk-sheet-hosts-ssbz6hf2.js +0 -1
  207. package/dist/chunk-skill-editor-n0y9pd90.js +0 -8
  208. package/dist/chunk-skills-ea4vb2s4.js +0 -1
  209. package/dist/chunk-switcher-list-pj5csqr9.js +0 -1
  210. package/dist/chunk-table-j8nmtdnn.js +0 -1
  211. package/dist/chunk-table-seats-qeytqe0m.js +0 -1
  212. package/dist/chunk-table2d-18y029k9.js +0 -1
  213. package/dist/chunk-table3d-q2s31ae0.js +0 -4220
  214. package/dist/chunk-thread-actions-w3eadnh7.js +0 -1
  215. package/dist/chunk-thread-cards-fbpky3c9.js +0 -1
  216. package/dist/chunk-thread-list-pghe84be.js +0 -1
  217. package/dist/chunk-transcript-eqzxgqys.js +0 -1
  218. package/dist/chunk-where-ygyr4jdj.js +0 -1
  219. package/dist/chunk-zh-tw-k6xx1hp2.js +0 -1
@@ -1,2 +0,0 @@
1
- import{t,c,x,h}from"./chunk-index-84v7j6vh.js";import{ur}from"./chunk-index-934zgd18.js";var n=encodeURIComponent,a=new Set([c("This action takes no form."),c("The form has no such field."),c("This field is required."),c("Choose from the list."),c("This field takes one value."),c("This field is too long."),c("Give a web address."),c("The action could not be done.")]),ki=(e)=>a.has(e)?t(e):e;function vs(e){let s=e.indexOf(":"),o=e.lastIndexOf(".");if(s<0||o<s+2||o===e.length-1)return;return{kind:e.slice(s+1,o),id:e.slice(o+1)}}var Ue={list:(e,s,o)=>{let i=new URLSearchParams;if(s)i.set("filter",s);if(o)i.set("cursor",o);let r=i.toString();return h(`host/${n(e)}${r?`?${r}`:""}`)},open:(e,s)=>h(`host/${n(e)}/${n(s)}`),older:(e,s,o,i)=>h(`host/${n(e)}/${n(s)}/messages?before=${o}&limit=${i}`),act:(e,s,o)=>h(`host/${n(e)}/${n(s)}/act`,{method:"POST",body:JSON.stringify(o)}),page:(e,s)=>{let o=new URLSearchParams(s).toString();return h(`pages/${n(e)}${o?`?${o}`:""}`)},pageAct:(e,s)=>h(`pages/${n(e)}/act`,{method:"POST",body:JSON.stringify(s)})};function g(e){if("room"in e){let o=e.message===void 0?"":`?message=${e.message}`;return`${x("room",e.room)}${o}`}let s=new URLSearchParams(e.query??{}).toString();return`${x("p",e.page)}${s?`?${s}`:""}`}function _i(e){ur(new URL(g(e),document.baseURI))}
2
- export{ki,vs,Ue,_i};
@@ -1 +0,0 @@
1
- import{Be,Pr,Yt,Qr,F,re,ci,Mr,Hs,js,Rr,Ks,Js,eo,On}from"./chunk-index-yrhbhmxz.js";export{Yt as AVATAR_STATES,F as CATALOG,Be as CLASS_IDS,re as CharacterError,js as EAST_ASIAN_SKINS,Pr as EXPRESSIONS,Qr as STATE_EXPRESSION,Js as accentOf,eo as characterCss,Rr as checkSkins,Ks as composeSvg,Mr as parseCharacter,Hs as readCharacter,ci as resolveCharacter,On as suggestCharacter};
@@ -1,2 +0,0 @@
1
- import{Ln}from"./chunk-index-zd76pr2k.js";var f=12;function m(r,e){let t=r.find((u)=>e>=u.top&&e<=u.bottom);if(t)return t;let n,o=f+1;for(let u of r){let i=e<u.top?u.top-e:e-u.bottom;if(i<o)n=u,o=i}return n}function d(r,e,t){for(let n of r)if(n.key!==e&&n.top+n.height/2>t)return n.key;return null}function Ls(r,e,t){let n=m(r,t);return n?{zone:n,before:d(n.items,e,t)}:void 0}function Xs(r,e,t){let{zone:n,before:o}=t;if(n.kind==="rest")return r.kind==="rest"?void 0:{kind:"unplace"};if(n.kind==="pinned"&&r.kind==="pinned"||n.kind==="folder"&&r.kind==="folder"&&r.folder===n.folder){let i=r.siblings;if(Ln(i,e,o).every((s,l)=>s===i[l]))return}return n.kind==="pinned"?{kind:"pin",before:o}:{kind:"folder",folder:n.folder,before:o}}function zs(r,e,t,n){if(n<e.top-f*3||n>e.bottom+f*3)return;return{before:d(r,t,n)}}function $r(r,e,t,n=0){let o=(r[e]?.height??0)+n;return r.map((u,i)=>{if(i===e)return 0;if(e<t&&i>e&&i<=t)return-o;if(e>t&&i>=t&&i<e)return o;return 0})}function Nr(r,e,t){return Ln(r,e,t).indexOf(e)}function Is(r,e,t,n=64,o=18){if(r<e+n)return-Math.min(1,(e+n-r)/n)*o;if(r>t-n)return Math.min(1,(r-(t-n))/n)*o;return 0}var Ds=600;
2
- export{Ls,Xs,zs,$r,Nr,Is,Ds};
@@ -1,2 +0,0 @@
1
- import{f,o,a,fe,Mi,Cn}from"./chunk-index-84v7j6vh.js";var D=6,g=()=>(f("nyq52ck7"),import("./chunk-drag-nyq52ck7.js"));var h=()=>{return},L=0;function ir(){if(L++===0)window.addEventListener("touchmove",h,{passive:!1});return()=>{if(--L===0)window.removeEventListener("touchmove",h)}}function Dt(T,m){let s=a(m);s.current=m;let E=m!==void 0;o(()=>E?ir():void 0,[E]);let t=a(void 0),p=a(void 0),d=a(!1),v=(e,n,i)=>T(e).then((u)=>{if(u)fe({...u,at:n,via:i,source:e})},()=>{return}),y=(e,n,i,u)=>{let c=s.current,M=c?.item(e),P=c?.root(e);if(!c||!M||!P)return!1;return p.current??=g(),p.current.then(({lift:x})=>{if(t.current?.id!==n)return u();x({mode:c.mode,key:c.key,item:M,root:P,pointerId:n,y:i(),open:c.open,done:(l)=>{if(l.type==="tap")u();else if(l.type!=="cancel")c.onDrop(l)}})},u),!0},r=Mi((e)=>{let n=()=>v(e.source,e.at,e.via),i=t.current;if(!(e.via==="hold"||e.via==="contextmenu"&&i?.touch)||!i)return void n();if(!y(e.source,i.id,()=>i.y,n))return void n();if(e.via==="contextmenu")d.current=!0});return{...r,onPointerDown(e){if(d.current=!1,t.current={id:e.pointerId,x:e.clientX,y:e.clientY,touch:e.pointerType!=="mouse"},e.pointerType!=="mouse"&&Cn(e.clientX,window.innerWidth))t.current=void 0;else if(s.current)p.current??=g();r.onPointerDown(e)},onPointerMove(e){let n=t.current;if(n?.id===e.pointerId){if(e.pointerType==="mouse"&&e.buttons===1&&!d.current&&s.current&&Math.hypot(e.clientX-n.x,e.clientY-n.y)>D)d.current=y(e.currentTarget,e.pointerId,()=>e.clientY,()=>{return});n.y=e.clientY}r.onPointerMove(e)},onPointerUp(e){if(t.current?.id===e.pointerId)t.current=void 0;r.onPointerUp(e)},onPointerCancel(e){if(t.current?.id===e.pointerId)t.current=void 0;r.onPointerCancel(e)},onContextMenu:r.onContextMenu,onKeyDown:r.onKeyDown,onClickCapture(e){if(d.current){d.current=!1,e.preventDefault(),e.stopPropagation();return}r.onClickCapture(e)},onDragStart(e){e.preventDefault()}}}
2
- export{ir,Dt};
@@ -1,2 +0,0 @@
1
- import{f,t,b}from"./chunk-index-84v7j6vh.js";import{Ce}from"./chunk-index-51n20yhb.js";import{yn}from"./chunk-index-0h4h76kw.js";import{Ye}from"./chunk-index-zd76pr2k.js";import{$t,di}from"./chunk-index-43k1rjmx.js";var s=(e)=>e(),d=()=>(f("cgghzj1w"),import("./chunk-layout-actions-cgghzj1w.js"));function Lr(e,u=s){let o=$t(yn(),e),l=o.kind==="pinned",i=[{id:"pin",label:l?t("Unpin"):t("Pin"),icon:"pin",run:()=>{d().then((r)=>r.pinRoom(e,!l))}},{id:"move",label:t("Move to folder…"),icon:"folder",run:()=>u(()=>Ce({kind:"move",room:e}))}];if(o.kind==="rest")return i;if(Ye(o.siblings,e,"up"))i.push({id:"up",label:t("Move up"),icon:"up",run:()=>{d().then((r)=>r.nudgeRoom(e,"up"))}});if(Ye(o.siblings,e,"down"))i.push({id:"down",label:t("Move down"),icon:"down",run:()=>{d().then((r)=>r.nudgeRoom(e,"down"))}});return i}function oo(e){let u=b.getState(),o=u.folders.find((n)=>n.id===e);if(!o)return;let l=yn().folders.find((n)=>n.id===e)?.rooms??[],i=di(l,(n)=>u.rooms[n]?.view?.muted===!0)==="all",r=u.folders.map((n)=>n.id),m=[{id:"rename",label:t("Rename"),icon:"edit",run:()=>Ce({kind:"rename",id:e,name:o.name})}];if(l.length>0)m.push({id:"mute",label:i?t("Unmute the whole folder"):t("Mute the whole folder"),icon:i?"bell":"bell-off",run:()=>{d().then((n)=>n.muteFolder(e,!i))}});if(Ye(r,e,"up"))m.push({id:"up",label:t("Move up"),icon:"up",run:()=>{d().then((n)=>n.nudgeFolder(e,"up"))}});if(Ye(r,e,"down"))m.push({id:"down",label:t("Move down"),icon:"down",run:()=>{d().then((n)=>n.nudgeFolder(e,"down"))}});return m.push({id:"delete",label:t("Delete folder"),icon:"trash",tone:"danger",run:()=>Ce({kind:"delete",id:e,name:o.name})}),{title:o.name,items:m}}
2
- export{Lr,oo};
@@ -1,2 +0,0 @@
1
- import{h}from"./chunk-index-84v7j6vh.js";var ce={pushTest:()=>h("push/test",{method:"POST"}),pushPrefs:()=>h("push/prefs"),setPushPrefs:(e)=>h("push/prefs",{method:"PUT",body:JSON.stringify({quiet:e})}),notices:()=>h("notices"),ackNotice:(e)=>h(`notices/${encodeURIComponent(e)}/ack`,{method:"POST"}),onboarding:()=>h("onboarding"),waive:(e)=>h(`onboarding/${encodeURIComponent(e)}/waive`,{method:"POST"}),profile:()=>h("profile"),chooseSource:(e)=>h("profile/source",{method:"PUT",body:JSON.stringify({provider:e})}),links:()=>h("links"),issueLink:(e)=>h(`links/${encodeURIComponent(e)}/issue`,{method:"POST"}),confirmLink:(e,i)=>h(`links/${encodeURIComponent(e)}/confirm`,{method:"POST",body:JSON.stringify({request:i})}),cancelLink:(e)=>h(`links/${encodeURIComponent(e)}/cancel`,{method:"POST"}),unlink:(e)=>h(`links/${encodeURIComponent(e)}`,{method:"DELETE"})};
2
- export{ce};
@@ -1,2 +0,0 @@
1
- import{f,o,a,r,t,ne,g,e,n,s,xs,K,Ve,b,u,h,O,p,fn,Ps,Qs}from"./chunk-index-84v7j6vh.js";import{j}from"./chunk-index-7bbqtdce.js";import{Ce,ui,Us}from"./chunk-index-51n20yhb.js";import{Ht,Vi,Er,Cr,Ar}from"./chunk-index-dep2e3f3.js";import{de}from"./chunk-index-grkczq2c.js";import{Vs,Ye,zr}from"./chunk-index-zd76pr2k.js";import{At,$t}from"./chunk-index-43k1rjmx.js";var C=(i,l,m)=>h(i,{method:l,...m===void 0?{}:{body:JSON.stringify(m)}}),v=(i)=>encodeURIComponent(i),xe={createAgent:(i)=>C("agents","POST",i),archiveAgent:(i)=>C(`agents/${v(i)}/archive`,"POST"),restoreAgent:(i)=>C(`agents/${v(i)}/restore`,"POST"),deleteAgent:(i)=>C(`agents/${v(i)}`,"DELETE"),skills:(i)=>h(`agents/${v(i)}/skills`),setSkills:(i,l)=>C(`agents/${v(i)}/skills`,"PUT",l),archive:()=>h("archive"),createGroup:(i)=>C("groups","POST",i),group:(i)=>h(`groups/${v(i)}`),updateGroup:(i,l)=>C(`groups/${v(i)}`,"PATCH",l),archiveGroup:(i)=>C(`groups/${v(i)}/archive`,"POST"),restoreGroup:(i)=>C(`groups/${v(i)}/restore`,"POST"),deleteGroup:(i)=>C(`groups/${v(i)}`,"DELETE")};async function xt(){let i=await O.rooms();b.dispatch({type:"rooms_loaded",rooms:i.rooms})}function E(i){let{room:l}=i,m=u((d)=>{let A=At(d,(N)=>Ve(d,N)),y=$t(A,l),F=y.kind==="rest"?[]:y.siblings;return{name:d.rooms[l]?.view?.displayName??l,folder:y.kind==="folder"?y.folder:"",pinned:y.kind==="pinned",canUp:Ye(F,l,"up")!==void 0,canDown:Ye(F,l,"down")!==void 0}},l),c=u((d)=>d.folders),k=(d)=>{i.onClose(),Ht(l,d)},w=m.folder===""&&!m.pinned;return n("div",{className:"stack",children:[e("p",{className:"meta",children:m.name}),n("fieldset",{children:[e("legend",{className:"visually-hidden",children:t("Move to folder…")}),n("ul",{className:"menu",children:[e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:w,onChange:()=>k(null)}),e("span",{className:"menu-icon",children:e(s,{name:"rooms",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Ungrouped")})})]})}),c.map((d)=>e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:m.folder===d.id,onChange:()=>k(d.id)}),e("span",{className:"menu-icon",children:e(s,{name:"folder",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:d.name})})]})},d.id)),e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>Ce({kind:"new",room:l}),children:[e("span",{className:"menu-icon",children:e(s,{name:"plus",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("New folder…")})})]})})]})]}),m.canUp||m.canDown?n("ul",{className:"menu",children:[m.canUp?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),Vi(l,"up")},children:[e("span",{className:"menu-icon",children:e(s,{name:"up",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move up")})})]})}):null,m.canDown?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),Vi(l,"down")},children:[e("span",{className:"menu-icon",children:e(s,{name:"down",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move down")})})]})}):null]}):null]})}function D(i){return e(de,{open:i.open,title:t("Move to folder…"),onClose:i.onClose,children:e(E,{room:i.room,onClose:i.onClose})})}function x(i){let{ask:l}=i,[m,c]=r(l.kind==="rename"?l.name:""),[k,w]=r(),[d,A]=r(!1),y=a(null);return o(()=>y.current?.focus(),[]),n("form",{className:"stack",onSubmit:async(N)=>{N.preventDefault();let P;try{P=zr(m)}catch{w(t("Give the folder a name of 1 to 40 characters."));return}A(!0),w(void 0);let S;if(l.kind==="rename")S=await Cr(l.id,P,w)!==void 0;else{let T=await Er(P,w);if(S=T!==void 0,T&&l.room)await Ht(l.room,T)}if(A(!1),S)i.onClose()},children:[n("div",{className:"field",children:[e("label",{className:"field-label",htmlFor:"folder-name",children:t("Folder name")}),e("input",{id:"folder-name",type:"text",ref:y,value:m,autoComplete:"off",enterKeyHint:"done",maxLength:Vs*2,"aria-invalid":k?!0:void 0,onChange:(N)=>c(N.target.value)}),k?e("p",{className:"field-error",role:"alert",children:k}):null]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:d,onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:d,children:l.kind==="rename"?t("Rename"):t("Create")})]})]})}function R(){let i=Us(),l=a(void 0);if(i)l.current=i;let m=l.current;if(!m)return null;let c=m.kind==="new"||m.kind==="rename";return n(g,{children:[c?e(de,{open:i?.kind==="new"||i?.kind==="rename",title:m.kind==="rename"?t("Rename folder"):t("Add a folder"),onClose:ui,children:e(x,{ask:m,onClose:ui})}):null,m.kind==="delete"?e(j,{open:i?.kind==="delete",title:t("Delete folder"),confirmLabel:t("Delete folder"),tone:"danger",onClose:ui,onConfirm:async()=>{let k="";if(!await Ar(m.id,(d)=>{k=d}))throw Error(k)},children:e("p",{children:t("Delete the folder {name}? Its rooms move to Ungrouped; no room is deleted.",{name:m.name})})}):null,m.kind==="move"?e(D,{open:i?.kind==="move",room:m.room,onClose:ui}):null]})}function G(i){return n(j,{open:i.open,title:t("Turn on yolo mode?"),confirmLabel:t("Turn on yolo mode"),tone:"yolo",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await O.setMode(i.room,{yolo:!0})},children:[e("p",{children:t("In this room, the knight's held actions are approved for you, without a card, as soon as they come up.")}),e("p",{children:t("Risky classes still ask: running as another user, deleting files, force pushes, disk, service and firewall changes, and anything that names its own approvers. The host can add more.")}),e("p",{children:t("Every approval it makes is written into the conversation, and a banner stays up while yolo mode is on.")})]})}function V(i){return e(j,{open:i.open,title:t("Start over {name}?",{name:i.name}),confirmLabel:t("Start over"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await O.startRoomOver(i.room)},children:e("p",{children:t("The current conversation is archived and the next message begins a new one. Long-term memory is kept. A turn that is running finishes first.")})})}function L(i){return e(j,{open:i.open,title:t("Archive {name}?",{name:i.name}),confirmLabel:t("Archive"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{let l=i.room.indexOf("."),m=i.room.slice(l+1);if(i.room.slice(0,l).endsWith(":group"))await xe.archiveGroup(m);else await xe.archiveAgent(m);if(fn(),await xt(),p(t("Archived {name}.",{name:i.name})),xs().key===i.room)K("rooms")},children:e("p",{children:t("{name} stops answering and its schedules are cancelled. A group loses it as a member. The history is kept, and Archived in the room list restores it.",{name:i.name})})})}function M(i){return e(j,{open:i.open,title:ne(i.threads.length,"Clear {count} finished thread?","Clear {count} finished threads?"),confirmLabel:t("Clear all finished"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{let{dismissThreads:l}=await (f("w3eadnh7"),import("./chunk-thread-actions-w3eadnh7.js"));await l(i.room||void 0,i.threads)},children:e("p",{children:t("They leave the list for every owner. Each one stays readable by its address, and Undo brings them back.")})})}function Wi(){return n(g,{children:[e(U,{}),e(R,{})]})}function U(){let i=Qs(),l=a(void 0);if(i)l.current=i;let m=l.current;if(!m)return null;let c={room:m.room,name:m.name,restoreFocus:m.restoreFocus,onClose:Ps};return n(g,{children:[e(G,{open:i?.kind==="yolo",...c}),e(V,{open:i?.kind==="start-over",...c}),e(L,{open:i?.kind==="archive",...c}),e(M,{open:i?.kind==="clear-threads",...c,threads:m.threads??[]})]})}
2
- export{xe,xt,Wi};
@@ -1,2 +0,0 @@
1
- var x={bg:"#0a1130",ink:"#0b0f1e",stone:"#3c4a6d",stoneShade:"#2a3555",stoneJoint:"#1d2745",floor:"#2b3756",floorJoint:"#1b2442",rune:"#3fe6cb",runeGlow:0.9,wood:"#5b3a22",woodDark:"#3a2314",woodLight:"#7d5231",gold:"#e3b24b",goldDark:"#9a6c1d",banner:"#1b5160",bannerEdge:"#e3b24b",glass:"#2e53a3",glassLight:"#5f86d6",glassDark:"#1b2f66",sky:"#f6f3da",beam:"#9fb9ff",beamAlpha:0.14,flame:"#ffb23a",flameCore:"#fff0a8",ambient:"#6f86c9",ambientI:1.55,key:"#aebfff",keyI:1.4,plateInk:"#3a2410",paper:"#f4efe3",spot:"#ffe29a",night:!0,additive:!0,css:{bg:"#0a1130",floor:"#2b3756",ring:"#3fe6cb",text:"#f4efe3",plate:"#e3b24b"}},h={bg:"#e8dcc0",ink:"#2a2036",stone:"#b9ae9a",stoneShade:"#938873",stoneJoint:"#756b5a",floor:"#cfc2a6",floorJoint:"#a79a80",rune:"#1c9d8f",runeGlow:0.75,wood:"#8c5a33",woodDark:"#5d3a20",woodLight:"#ab7443",gold:"#e0a92f",goldDark:"#936718",banner:"#2c7283",bannerEdge:"#e0a92f",glass:"#8dbbe6",glassLight:"#c4e0f6",glassDark:"#5d8dc2",sky:"#ffe9a6",beam:"#fff0b4",beamAlpha:0.2,flame:"#ff9a2c",flameCore:"#ffe7a0",ambient:"#fff1d4",ambientI:2.1,key:"#ffe3b0",keyI:1.6,plateInk:"#3a2410",paper:"#fffaf0",spot:"#fff0b0",night:!1,additive:!1,css:{bg:"#e8dcc0",floor:"#cfc2a6",ring:"#1c9d8f",text:"#2a2036",plate:"#e0a92f"}},H={modern:{dark:{banner:x.banner,bannerEdge:x.gold,gold:x.gold,goldDark:x.goldDark},light:{banner:h.banner,bannerEdge:h.gold,gold:h.gold,goldDark:h.goldDark}},camelot:{dark:{banner:"#6b1f3f",bannerEdge:"#f0c35a",gold:"#f0c35a",goldDark:"#a8791f"},light:{banner:"#9b2a45",bannerEdge:"#e6b436",gold:"#e6b436",goldDark:"#9a6b14"}}},wn=(n,e)=>({...e==="dark"?x:h,...H[n][e]}),sr={done:"#58c878",error:"#ee4b4b"};var z=(n)=>{let e=n.codePointAt(0)??0;return e>=11904&&e<=64255?1:e>=65280&&e<=65519?1:0.6};function M(n,e){if(e(n))return n;let t=Array.from(n);while(t.length>1){t.pop();let r=`${t.join("").trimEnd()}…`;if(e(r))return r}return"…"}function or(n,e){let t=(r)=>Array.from(r).reduce((a,o)=>a+z(o),0);return M(n,(r)=>t(r)<=e)}var Tt='system-ui, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif',P=(n)=>`700 ${n}px ${Tt}`;function L(n,e,t,r){let a=t*0.86,o=Math.round(r*0.56),s=Math.round(r*0.36),l=(i,c)=>(n.font=P(c),n.measureText(i).width);for(let i=o;i>=s;i-=2)if(l(e,i)<=a)return{text:e,px:i,font:P(i)};return{text:M(e,(i)=>l(i,s)<=a),px:s,font:P(s)}}function rs(n,e,t,r,a){let o=Math.max(3,r*0.07);n.fillStyle=a.ink,n.fillRect(0,0,t,r);let s=n.createLinearGradient?.(0,0,0,r);if(s)s.addColorStop(0,a.gold),s.addColorStop(0.55,a.gold),s.addColorStop(1,a.goldDark),n.fillStyle=s;else n.fillStyle=a.gold;n.fillRect(o,o,t-o*2,r-o*2),n.strokeStyle=a.goldDark,n.lineWidth=Math.max(1,r*0.03),n.beginPath(),n.moveTo(o*2,o*2),n.lineTo(t-o*2,o*2),n.lineTo(t-o*2,r-o*2),n.lineTo(o*2,r-o*2),n.closePath(),n.stroke(),n.fillStyle=a.goldDark;for(let u of[o*3.4,t-o*3.4])n.beginPath(),n.arc(u,r/2,Math.max(1.4,r*0.04),0,Math.PI*2),n.fill();let l=L(n,e,t-o*4,r);return n.font=l.font,n.fillStyle=a.plateInk,n.textAlign="center",n.textBaseline="middle",n.fillText(l.text,t/2,r/2+r*0.03),l}var Ut=Math.PI*2;function Jt(n){let e=((n+Math.PI)%Ut+Ut)%Ut-Math.PI;return e===-Math.PI?Math.PI:e}var g=(n,e)=>Jt(e-n);function yi(n){let e=Math.min(Math.max(n,0),12),t=Math.max(n-12,0);return{count:1+e+(t>0?1:0),seated:e,more:t}}var F=0.62,w=(n)=>Math.min(Ut/Math.max(n,1),F),Vt=(n,e)=>n===0?0:Jt(Math.PI+(n-e/2)*w(e)),Pt=(n)=>Math.max(4.2,2.6/(2*Math.sin(w(n)/2)));function O(n,e){let t=0,r=Number.POSITIVE_INFINITY;for(let a=0;a<e;a+=1){let o=Math.abs(g(n,Vt(a,e)));if(o<r-0.000000001)r=o,t=a}return t}var ar=(n,e)=>Vt(O(n,e),e);function ss(n,e){if(e.seated===0)return;let t=Jt(n+Math.PI),r,a=Number.POSITIVE_INFINITY;for(let o=1;o<=e.seated;o+=1){let s=Math.abs(g(t,Vt(o,e.count)));if(s<a-0.000000001)a=s,r=o}return r}var A=1.65,Y=1.06,G=44,X=390,W=4.8,k=0.07,y=3;function B(n,e,t){let{position:r,target:a}=lr(n),o=I([a[0]-r[0],a[1]-r[1],a[2]-r[2]]),s=I(E(o,[0,1,0])),l=E(s,o),u=[t[0]-r[0],t[1]-r[1],t[2]-r[2]],i=S(u,o),c=Math.tan(cr(n.fov,e)*Math.PI/360),f=i>0.000001?i:Number.NaN;return{x:S(u,s)/(f*c*e),y:S(u,l)/(f*c),depth:i}}var S=(n,e)=>n[0]*e[0]+n[1]*e[1]+n[2]*e[2],E=(n,e)=>[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]],I=(n)=>{let e=Math.hypot(n[0],n[1],n[2])||1;return[n[0]/e,n[1]/e,n[2]/e]};function J(n){let e=Pt(n),t=[];for(let r=1;r<n;r+=1){let a=Vt(r,n),o=Math.cos(a),s=-Math.sin(a);for(let l of[-1,1])for(let u of[0,W])t.push([Math.sin(a)*e+o*l*A,u,Math.cos(a)*e+s*l*A])}return t}function T(n,e,t,r=k,a=r){let o=1-a,s=1-r;return t.every((l)=>{let u=B(n,e,l);return Math.abs(u.x)<=o&&Math.abs(u.y)<=s})}var ht=2.9,U=0.7,V=0.2,j=0.8;function os(n,e,t){let r=t[0]-n[0],a=t[2]-n[2],o=Math.hypot(r,a)||1,s=a/o,l=-r/o,u=ht*U/2,i=ht*e,c=n[1]+i/2-i*V,f=n[1]+i/2-i*j,p=[];for(let b of[-1,1])for(let C of[c,f])p.push([n[0]+s*b*u,C,n[2]+l*b*u]);return p}function K(n){let e=Pt(n),t=[];for(let r=1;r<n;r+=1){let a=Vt(r,n);t.push([Math.sin(a)*e,Y,Math.cos(a)*e])}return t}function _(n,e){return{...n,r:n.lookR+(n.r-n.lookR)*e,y:n.lookY+(n.y-n.lookY)*e}}function kn(n,e,t=1.6,r=X){let a=Pt(e),o={az:n,r:a+4.4,y:4.4+a*0.1,aim:0,lookR:-1.6,lookY:2.5,roll:0,fov:46};if(!(t>0))return o;let s=J(e),l=K(e),u=k+G/(Math.max(r,1)/2);for(let i=1;i<=y;i+=0.02){let c=_(o,i);if(T(c,t,s)&&T(c,t,l,k,u))return c}return _(o,y)}function as(n,e){let t=Pt(e),r=0.18;return{az:Jt(n+0.18),r:Math.max(t-3.9,0.5),y:1.8,aim:-0.18,lookR:t+0.1,lookY:1.7,roll:-0.16,fov:58}}var d=(n,e,t)=>n+(e-n)*t;function ls(n,e,t){return{az:Jt(n.az+g(n.az,e.az)*t),r:d(n.r,e.r,t),y:d(n.y,e.y,t),aim:d(n.aim,e.aim,t),lookR:d(n.lookR,e.lookR,t),lookY:d(n.lookY,e.lookY,t),roll:d(n.roll,e.roll,t),fov:d(n.fov,e.fov,t)}}var bi=(n)=>{let e=Math.min(1,Math.max(0,n));return e<0.5?4*e*e*e:1-(-2*e+2)**3/2},cs=(n)=>{let e=Math.min(1,Math.max(0,n)),t=(o,s,l)=>3*(1-o)*(1-o)*o*s+3*(1-o)*o*o*l+o*o*o,r=0,a=1;for(let o=0;o<24;o++){let s=(r+a)/2;if(t(s,0.7,0.84)<e)r=s;else a=s}return t((r+a)/2,0,0)},Z=420,v=450,q=650;function us(n,e,t,r=!1){if(t)return{ms:0,cut:!0};if(r)return{ms:Z,cut:!1,dive:!0};let a=Math.abs(g(n.az,e.az))/Math.PI;return{ms:Math.round(v+(q-v)*a),cut:!1}}function lr(n){let e=n.az+n.aim;return{position:[Math.sin(n.az)*n.r,n.y,Math.cos(n.az)*n.r],target:[Math.sin(e)*n.lookR,n.lookY,Math.cos(e)*n.lookR]}}function ds(n,e){let t=Vt(n,e),r=Pt(e);return{x:Math.sin(t)*r,z:Math.cos(t)*r,yaw:t+Math.PI}}var fs=(n,e)=>-n/Math.max(e,1)*(Math.PI/2),D=32;function hs(n,e,t,r){let a=(o,s,l)=>o-s<D||l-o<D;return a(n,0,r.width)||a(e,0,r.height)||a(n,t.left,t.left+t.width)||a(e,t.top,t.top+t.height)}function ps(n,e){if(Math.abs(n)<0.000001)return"none";if(n<0)return e?"none":"in";return e?"out":"none"}function cr(n,e){if(!(e>0)||e>=1.2)return n;return Math.min(n*(1+(1.2-e)*0.55),95)}var en=720,R=260,Q=380,N=600,tn=850,Qt=160,ms=4.2,nn=0.35;function Kn(n,e,t){let r=new Set(n),a=new Set(e),o=n.filter((b)=>!a.has(b)),s=e.filter((b)=>!r.has(b)),l=e.filter((b)=>r.has(b)),u={leaving:o,joining:s,staying:l,swapAt:0,glideEnd:0,riseAt:0,riseEnd:0,total:0};if(o.length===0&&s.length===0)return{mode:"cut",...u};if(t)return{mode:"fade",...u,swapAt:Qt,glideEnd:Qt,riseAt:Qt,riseEnd:Qt,total:Qt*2};let i=o.length>0?Q:0,c=i+N,f=c,p=s.length>0?f+tn:c;return{mode:"play",...u,swapAt:i,glideEnd:c,riseAt:f,riseEnd:p,total:Math.max(o.length>0?en:0,c,s.length>0?p:0)}}var m=(n,e=0,t=1)=>Math.min(t,Math.max(e,n));function vi(n){let e=m(n),t=1.70158;return 1+2.70158*(e-1)**3+1.70158*(e-1)**2}function gs(n){let e=Math.sin(Math.PI*m(n/R));return{scaleX:1+0.08*e,scaleY:1-0.14*e,gone:n>=R,puff:m(n/en)}}function xi(n){if(n<0)return{shown:!1,depth:1,circle:0,light:0,spin:0,named:!1};let e=m(n/tn),t=m((e-0.25)/0.6),r=1-vi(t);return{shown:e>=0.25,depth:r,named:e>=0.25&&r<=nn,circle:m(e/0.25)*m((1-e)/0.2),light:Math.sin(Math.PI*m((e-0.2)/0.7)),spin:e*Math.PI*1.5}}var Os=(n)=>bi(m(n/N)),ys=(n,e,t)=>n+g(n,e)*t;
2
- export{wn,sr,or,Tt,rs,Ut,Jt,yi,Vt,Pt,ar,ss,ht,os,kn,as,ls,bi,cs,us,lr,ds,fs,hs,ps,cr,en,tn,Qt,ms,Kn,vi,gs,xi,Os,ys};
@@ -1,2 +0,0 @@
1
- import{b,h,d,p}from"./chunk-index-84v7j6vh.js";import{Xs}from"./chunk-index-9w0sar6s.js";import{Xr,yn}from"./chunk-index-0h4h76kw.js";import{Ye,qs,Bs,Fs,Gs,Zs}from"./chunk-index-zd76pr2k.js";import{$t}from"./chunk-index-43k1rjmx.js";var n={createFolder:(e)=>h("folders",{method:"POST",body:JSON.stringify({name:e})}),changeFolder:(e,t)=>h(`folders/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),deleteFolder:(e)=>h(`folders/${encodeURIComponent(e)}`,{method:"DELETE"}),muteFolder:(e,t)=>h(`folders/${encodeURIComponent(e)}/mute`,{method:"PUT",body:JSON.stringify({muted:t})}),placeRoom:(e,t,o)=>h(`rooms/${encodeURIComponent(e)}/folder`,{method:"PUT",body:JSON.stringify({folder:t,before:o})}),pinRoom:(e,t,o)=>h(`rooms/${encodeURIComponent(e)}/pin`,{method:"PUT",body:JSON.stringify({pinned:t,before:o})})};var a=(e)=>p(e,"danger"),l=(e)=>b.dispatch({type:"layout_loaded",pins:e.pins,folders:e.folders});async function i(e,t,o=a){let r=Xr();try{l(e(r))}catch{}try{let s=await t();return l(s),s}catch(s){l(r),b.dispatch({type:"changed"}),o(d(s));return}}var Ns=(e,t,o=null)=>i((r)=>Zs(r,e,t,o),()=>n.pinRoom(e,t,o)),Ht=(e,t,o=null)=>i((r)=>Gs(r,e,t,o),()=>n.placeRoom(e,t,o));function Vi(e,t){let o=$t(yn(),e);if(o.kind==="rest")return;let r=Ye(o.siblings,e,t);if(!r)return;return o.kind==="pinned"?Ns(e,!0,r.before):Ht(e,o.folder,r.before)}async function Er(e,t=a){try{let o=await n.createFolder(e);return l(o),o.folders.at(-1)?.id}catch(o){t(d(o));return}}var Cr=(e,t,o)=>i((r)=>qs(r,e,t),()=>n.changeFolder(e,{name:t}),o),to=(e,t)=>i((o)=>Bs(o,e,t),()=>n.changeFolder(e,{before:t}));function io(e,t){let o=Ye(Xr().folders.map((r)=>r.id),e,t);return o?to(e,o.before):void 0}var Ar=(e,t)=>i((o)=>Fs(o,e),()=>n.deleteFolder(e),t);async function ro(e,t){try{let o=await n.muteFolder(e,t);for(let r of o.rooms)b.dispatch({type:"room_muted",room:r,muted:o.muted});return!0}catch(o){return a(d(o)),!1}}function so(e,t){let o=Xs($t(yn(),e),e,t);if(!o)return;if(o.kind==="pin")return Ns(e,!0,o.before);if(o.kind==="folder")return Ht(e,o.folder,o.before);return Ht(e,null)}
2
- export{Ns,Ht,Vi,Er,Cr,to,io,Ar,ro,so};
@@ -1,2 +0,0 @@
1
- import{b,B}from"./chunk-index-84v7j6vh.js";var t={unread:{},reads:{},cursor:{},cards:{},rooms:{},lists:{},pages:{}},{emit:R,use:f,subscribe:Sr}=B();function s(e){t={...t,...e},R()}var Ee=(e)=>f(()=>e(t)),wr=()=>Object.values(t.unread).reduce((e,r)=>e+r,0),d=[],kr=d,_r=d;function l(e,r){return e.kind!=="system"&&e.id!==0&&(e.principalId===void 0||e.principalId!==r)}var y=(e)=>b.getState().focus===e&&document.visibilityState==="visible";function Di(e){let r={...t.unread};for(let[n,o]of Object.entries(e))r[n]=o;s({unread:r})}var p=new WeakSet;function g(){let e;for(let[r,n]of Object.entries(b.getState().rooms)){let o=n.view;if(!o||p.has(o))continue;p.add(o),e??={...t.unread},e[r]=o.unread??0}if(e)s({unread:e})}b.subscribe(g);g();function Ui(e,r,n){let o={};if(r)o.reads={...t.reads,[e]:r};if(n!==void 0&&n>(t.cursor[e]??0))o.cursor={...t.cursor,[e]:n};if(o.reads||o.cursor)s(o)}function Tr(e,r){s({cards:{...t.cards,[e]:r}})}var i=(e,r)=>({...e,[r]:(e[r]??0)+1});function no(e){switch(e.type){case"message":case"host_message":{let r=b.getState().principal?.id;if(!l(e.message,r)||y(e.room))return;s({unread:{...t.unread,[e.room]:(t.unread[e.room]??0)+1}});return}case"read":{let{room:r,principal:n,upTo:o}=e;if(n===b.getState().principal?.id){let a=(b.getState().rooms[r]?.messages??[]).filter((u)=>u.id>o&&l(u,n)).length;s({unread:{...t.unread,[r]:a},cursor:{...t.cursor,[r]:Math.max(o,t.cursor[r]??0)}});return}let m=(t.reads[r]??d).filter((a)=>a.principal!==n),c=t.reads[r]?.find((a)=>a.principal===n);if(c&&c.upTo>=o)return;s({reads:{...t.reads,[r]:[...m,{principal:n,name:e.name,upTo:o,at:e.at}]}});return}case"host_card":{let r=(t.cards[e.room]??d).filter((n)=>n.id!==e.card.id);s({cards:{...t.cards,[e.room]:[...r,e.card].sort((n,o)=>n.at<o.at?-1:n.at>o.at?1:0)}});return}case"room_changed":s({rooms:i(t.rooms,e.room)});return;case"list_changed":s({lists:i(t.lists,e.kind)});return;case"page_changed":s({pages:i(t.pages,e.page)});return;default:return}}
2
- export{Sr,Ee,wr,kr,_r,Di,Ui,Tr,no};
@@ -1,2 +0,0 @@
1
- import{e}from"./chunk-index-84v7j6vh.js";import{D}from"./chunk-index-9nents16.js";function de(t){return e(D,{open:t.open,title:t.title,onClose:t.onClose,...t.size&&t.size!=="default"?{size:t.size}:{},children:t.children})}
2
- export{de};
@@ -1,2 +0,0 @@
1
- import{B}from"./chunk-index-84v7j6vh.js";var o=!1,{emit:e,use:i}=B(),jn=()=>i(()=>o);function rr(t){if(o===t)return;o=t,e()}
2
- export{jn,rr};
@@ -1,2 +0,0 @@
1
- import{b,O,d,p}from"./chunk-index-84v7j6vh.js";async function tt(e,r){try{let t=await O.setMute(e,r);return b.dispatch({type:"room_muted",room:e,muted:t.muted}),!0}catch(t){return p(d(t),"danger"),!1}}
2
- export{tt};
@@ -1,2 +0,0 @@
1
- import{o,r,d,te}from"./chunk-index-84v7j6vh.js";function ye(u,e){let{version:s}=te(),[t,i]=r({data:void 0,error:void 0,subject:e});return o(()=>{let n=!0;return u().then((a)=>{if(n)i({data:a,error:void 0,subject:e})},(a)=>{if(n)i((f)=>({data:f.subject===e?f.data:void 0,error:d(a),subject:e}))}),()=>{n=!1}},[e,s]),t.subject===e?{data:t.data,error:t.error}:{data:void 0,error:void 0}}
2
- export{ye};
@@ -1 +0,0 @@
1
- import{B}from"./chunk-index-84v7j6vh.js";var i="roundtable-console:folders-collapsed";function a(){try{let e=localStorage.getItem(i),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter((o)=>typeof o==="string"):[])}catch{return new Set}}var l,{emit:d,use:c}=B(),n=()=>(l??=a(),l);function s(e){l=e;try{localStorage.setItem(i,JSON.stringify([...e]))}catch{}d()}var Ji=()=>c(n);function er(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function tr(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function nr(e){let t=new Set(e),o=n();if([...o].every((r)=>t.has(r)))return;s(new Set([...o].filter((r)=>t.has(r))))}export{Ji,er,tr,nr};
@@ -1,2 +0,0 @@
1
- import{o,ei,a,r,t,g,e,n,s,Se,u,_,Ke,ln,cn,he,Ct,Ze,gt,Ei,Ci,Ai,mn,Re}from"./chunk-index-84v7j6vh.js";import{D}from"./chunk-index-9nents16.js";function A(i,d,l,m){if(!i)return;let c=i.pending.at(-1);if(c&&!c.failed)return{id:`p${c.id}`,who:"owner",author:d,text:c.text,files:[],live:!1,pending:!0};if(i.typing&&i.progress.text!==""){let h=i.agent??m;return{id:`s${i.messages.at(-1)?.id??0}`,who:"agent",agent:h,author:l(h),text:i.progress.text,files:[],live:!0,pending:!1}}let p=i.live.at(-1);if(p)return{id:`l${p.live??p.id}`,who:"agent",agent:p.agent,author:p.author,text:p.text,files:p.files,live:!0,pending:!1};for(let h=i.messages.length-1;h>=0;h-=1){let f=i.messages[h];if(!f||f.kind==="system")continue;return{id:`m${f.id}`,who:f.kind==="owner"?"owner":"agent",agent:f.agent,author:f.author,text:f.text,files:f.files,live:!1,pending:!1}}return}function K(i,d,l){return i.cardOrder.map((c)=>({id:c,card:i.cards[c]})).filter((c)=>c.card?.room===d).filter((c)=>c.card.outcome===void 0||l===void 0||c.card.after>=l)}var W=90;function Z(i,d,l,m={}){if(m.instant)return d;let c=i+l/1000*(m.cps??W);return Math.min(d,Math.max(i,c))}function B(){let i,d="",l=0,m=0;return{get shown(){return Math.floor(m)},get done(){return Math.floor(m)>=l},feed(c,p){if(c!==i){let h=d!==""&&(p.startsWith(d)||d.startsWith(p));if(i=c,!h)m=0}if(d=p,l=Array.from(p).length,m>l)m=l},step(c,p){m=Z(m,l,c,{instant:p})},finish(){m=l}}}var O=(i,d)=>Array.from(i).slice(0,d).join("");function Kr(i,d){if(!i)return null;let l=d.find((m)=>m.name===i||m.key===i);return l?l.name:null}function Jr(i,d){if(!i||i.who!=="agent"||i.agent===void 0)return null;return d.includes(i.agent)?i.agent:null}function es(i,d,l){return l&&l.lineId===d?l.member:i}function j(i){let d=a(B()),[,l]=ei((h)=>h+1,0),m=Se();d.current.feed(i?.id??"",i?.text??"");let c=i?.text??"",p=i?.id;return o(()=>{let h=d.current;if(m||c===""||p===void 0){h.finish(),l();return}let f=performance.now(),v=0,w=()=>{let x=performance.now();if(h.step(x-f,!1),f=x,l(),!h.done)v=requestAnimationFrame(w)};if(!h.done)v=requestAnimationFrame(w);return()=>cancelAnimationFrame(v)},[m,p,c]),{shown:d.current.shown,done:d.current.done,finish(){d.current.finish(),l()}}}function ji(i){let d=u((f)=>f.rooms[i]),l=u((f)=>f.principal?.name)??t("You"),m=u((f)=>{let v={};for(let w of Object.values(f.rooms))if(w.view?.kind==="agent")v[w.view.name]=w.view.displayName;return v}),c=d?.view,h=A(d,l,(f)=>(f===void 0?void 0:m[f])??f??c?.displayName??i,c?.kind==="agent"?c.name:void 0);return{room:d,view:c,line:h}}function z(i){let{loaded:d,error:l}=i,m=u((f)=>f.rooms[i.roomKey]),[c,p]=r(!1),h=a(null);return o(()=>{if(i.open&&d)h.current?.scrollTo({top:h.current.scrollHeight})},[i.open,d]),e(D,{open:i.open,title:`${i.name} · ${t("Log")}`,onClose:i.onClose,children:n("div",{className:"scene-log",ref:h,children:[l?e("p",{className:"failure-text",children:l}):null,m?.more?e("button",{type:"button",className:"secondary older",disabled:c,onClick:async()=>{p(!0),await Ai(i.roomKey),p(!1)},children:c?t("Loading…"):t("Load earlier messages")}):null,e(mn,{roomKey:i.roomKey,enterAfter:void 0,quotable:!0})]})})}function Gn(i){let{roomKey:d}=i,l=Re(),m=_(),c=Ci(d),p=i.streams!==!1;o(()=>{if(!p)return;return l.focus(d),()=>l.focus(void 0)},[l,d,p]);let h=u((y)=>y.limits),f=u((y)=>K(y,d,y.rooms[d]?.messages.at(-1)?.id)),v=gt(),{room:w,view:x,line:b}=ji(d),C=x?.kind==="agent"?x:void 0,k=C?C.name:b?.who==="agent"?b.agent:void 0,F=Ze(k?v[k]:void 0),N=C?C.displayName:b?b.author:x?.displayName??d,{shown:E,done:L,finish:M}=j(b),[H,P]=r(!1),[S,T]=r(!1),I=b?.who==="owner"&&!C?{["--agent-accent"]:"var(--accent)"}:F,q=Boolean(w?.typing)&&(!b||b.who==="owner"),V=b?O(b.text,E):"";return n("section",{className:"scene-box","data-open":i.open||void 0,"data-collapsed":S||void 0,"data-who":b?.who,style:I,"aria-label":t("Log"),children:[n("header",{className:"scene-tab",children:[C||b?.who==="agent"?e("span",{className:"scene-chip",children:e(he,{spec:k?v[k]:void 0,name:k??N,size:34,live:!1})}):null,e("strong",{className:"scene-name",children:N}),n("span",{className:"scene-tools",children:[i.onBack?e("button",{type:"button",className:"icon-button","aria-label":t("Back to the whole table"),onClick:i.onBack,children:e(s,{name:"back"})}):null,i.onMenu?e("button",{type:"button",className:"icon-button scene-more","aria-label":t("More"),"aria-haspopup":"menu",onClick:(y)=>i.onMenu?.(y.currentTarget),children:e(s,{name:"more"})}):null,n("button",{type:"button",className:"icon-button scene-log-button","aria-label":t("Log"),"aria-haspopup":"dialog",onClick:()=>P(!0),children:[e(s,{name:"conversations"}),e("span",{children:t("Log")})]}),e("button",{type:"button",className:"icon-button scene-collapse","aria-label":S?t("Show the message box"):t("Hide the message box"),title:S?t("Show the message box"):t("Hide the message box"),"aria-expanded":!S,onClick:()=>T((y)=>!y),children:e(s,{name:"chevron",style:{rotate:S?"-90deg":"90deg"}})})]})]}),n("div",{className:"scene-body",children:[e("div",{className:"scene-line","data-live":b?.live||void 0,"aria-live":"polite",...L?{}:{role:"button",tabIndex:0,title:t("Tap to show the whole message"),onClick:M,onKeyDown:(y)=>{if(y.key==="Enter"||y.key===" ")y.preventDefault(),M()}},children:b?n(g,{children:[C&&b.who==="owner"?e("span",{className:"scene-from",children:b.author}):null,e(Ke,{source:V}),L?e(Ct,{files:b.files}):null]}):null}),q&&w?e(cn,{name:N,progress:w.progress}):null,f.map(({id:y,card:R})=>e("div",{className:"scene-card",children:e(Ei,{card:R,timeZone:m.timeZone})},y))]}),x?.readOnly?null:e("div",{className:"scene-composer",children:e(ln,{draftKey:d,name:x?.displayName??d,limits:h,stoppable:Boolean(w?.stoppable),onSend:(y,R)=>l.say(d,y,R),onStop:()=>l.send({type:"stop",room:d})},d)}),e(z,{roomKey:d,open:H,loaded:c.loaded,error:c.error,name:x?.displayName??d,onClose:()=>P(!1)})]})}
2
- export{Kr,Jr,es,ji,Gn};
@@ -1,2 +0,0 @@
1
- var Vs=40;class l extends Error{code;constructor(e){super(e);this.code=e;this.name="LayoutError"}}function Ln(e,n,r){if(r===n&&e.includes(n))return[...e];let t=e.filter((o)=>o!==n),i=r===null||r===void 0?-1:t.indexOf(r);if(i<0)return[...t,n];return[...t.slice(0,i),n,...t.slice(i)]}function Ye(e,n,r){let t=e.indexOf(n);if(t<0)return;if(r==="up")return t===0?void 0:{before:e[t-1]??null};return t===e.length-1?void 0:{before:e[t+2]??null}}function zr(e){let n=e.trim(),r=Array.from(n).length;if(r<1||r>40||/\p{Cc}/u.test(n))throw new l("bad-name");return n}var c=(e,n)=>e.toLocaleLowerCase()===n.toLocaleLowerCase();function u(e,n){let r=e.folders.findIndex((t)=>t.id===n);if(r<0)throw new l("no-folder");return r}var f=(e,n)=>({pins:e.pins,folders:n});function qs(e,n,r){let t=u(e,n),i=zr(r);if(e.folders.some((o)=>o.id!==n&&c(o.name,i)))throw new l("duplicate");return f(e,e.folders.map((o,s)=>s===t?{...o,name:i}:o))}function Bs(e,n,r){let t=u(e,n),i=e.folders[t],o=Ln(e.folders.map((s)=>s.id),n,r);return f(e,o.map((s)=>s===n?i:e.folders.find((a)=>a.id===s)))}function Fs(e,n){return u(e,n),f(e,e.folders.filter((r)=>r.id!==n))}var d=(e,n)=>({pins:e.pins.filter((r)=>r!==n),folders:e.folders.map((r)=>r.rooms.includes(n)?{...r,rooms:r.rooms.filter((t)=>t!==n)}:r)});function Gs(e,n,r,t){if(r!==null)u(e,r);let i=d(e,n);if(r===null)return i;return f(i,i.folders.map((o)=>o.id===r?{...o,rooms:Ln(o.rooms,n,t)}:o))}function Zs(e,n,r,t){let i=d(e,n);if(!r)return i;return{pins:Ln(e.pins.filter((o)=>o!==n),n,t),folders:i.folders}}
2
- export{Vs,Ln,Ye,zr,qs,Bs,Fs,Gs,Zs};
@@ -1 +0,0 @@
1
- import"./chunk-index-0xj30mzw.js";import"./chunk-index-b7jjca66.js";import{In}from"./chunk-index-frwa2fmc.js";var r=()=>In();export{r as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-0xj30mzw.js";import"./chunk-index-b7jjca66.js";import{Xn}from"./chunk-index-tmx30r1w.js";import"./chunk-index-frwa2fmc.js";import"./chunk-index-smw1n2pt.js";import"./chunk-index-029209sy.js";var t=()=>Xn();export{t as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-0xj30mzw.js";import"./chunk-index-b7jjca66.js";import{Nt}from"./chunk-index-smw1n2pt.js";import"./chunk-index-029209sy.js";var t=()=>Nt({jsx:!0});export{t as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-0xj30mzw.js";import"./chunk-index-b7jjca66.js";import{Nt}from"./chunk-index-smw1n2pt.js";import"./chunk-index-029209sy.js";var r=()=>Nt({typescript:!0,jsx:!0});export{r as language};
@@ -1 +0,0 @@
1
- import{Ns,Ht,Vi,Er,Cr,to,io,Ar,ro,so}from"./chunk-index-dep2e3f3.js";import"./chunk-index-0h4h76kw.js";export{Er as createFolder,Ar as deleteFolder,so as dropRoom,Ht as moveRoom,ro as muteFolder,io as nudgeFolder,Vi as nudgeRoom,Ns as pinRoom,to as placeFolderBefore,Cr as renameFolderTo};
@@ -1,2 +0,0 @@
1
- import{t,rn,b,p,Ss,fe,et,Et,we,St}from"./chunk-index-84v7j6vh.js";import"./chunk-index-51n20yhb.js";import{Lr}from"./chunk-index-c5x70d9g.js";import{tt}from"./chunk-index-satam151.js";import"./chunk-index-0h4h76kw.js";var m=(e)=>e();async function s(e){try{await navigator.clipboard.writeText(e),p(t("Copied"))}catch{p(t("Could not copy."),"danger")}}async function c(e){try{await navigator.share(e)}catch(n){if(n instanceof DOMException&&n.name==="AbortError")return;p(t("Could not share."),"danger")}}var f=()=>typeof navigator.share==="function";function I(e,n=m){let i=b.getState().rooms[e],o=i?.view;if(!o||o.kind==="thread")return;let l=i.mode,a=o.home?[]:Lr(e,n);if(o.kind==="agent"){let r=o.name;a.push({id:"edit",label:t("Edit knight"),icon:"profile",run:()=>n(()=>et(r))},{id:"look",label:t("Change look"),icon:"sparkle",run:()=>n(()=>et(r,{look:!0}))})}if(o.kind==="group"){let r=o.name;a.push({id:"edit-group",label:t("Edit group"),icon:"profile",run:()=>n(()=>St({kind:"group",name:r}))})}if(a.push({id:"notifications",label:t("Notifications"),icon:o.muted?"bell-off":"bell",checked:!o.muted,run:async()=>{let r=o.muted!==!0;if(!await tt(e,r))return;p(r?t("Notifications are off for {name}",{name:o.displayName}):t("Notifications are on for {name}",{name:o.displayName}))}}),!o.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});we({kind:"yolo",room:e,name:o.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:()=>we({kind:"start-over",room:e,name:o.displayName})});if(!o.readOnly&&!o.coordinator)a.push({id:"archive",label:o.kind==="group"?t("Archive group"):t("Archive knight"),icon:"archive",tone:"danger",run:()=>we({kind:"archive",room:e,name:o.displayName})});return{title:o.displayName,items:a}}function h(e=m){return{title:t("Add"),items:[{id:"new-agent",label:t("New knight"),icon:"profile",run:()=>e(()=>St({kind:"new-agent"}))},{id:"new-group",label:t("New group"),icon:"rooms",run:()=>e(()=>St({kind:"group"}))},{id:"archive-list",label:t("Archived"),icon:"archive",run:()=>e(()=>St({kind:"archive"}))}]}}function P(e,n){let i=e.getBoundingClientRect();fe({...h(n),at:{x:i.left,y:i.bottom},via:"key",source:e})}function O(e){let n=b.getState().rooms[e]?.view;if(n?.kind!=="agent")return;return{title:n.displayName,items:[{id:"leave",label:t("Leave the table"),icon:"bell-off",run:async()=>{if(!await tt(e,!0))return;p(t("{name} left the table",{name:n.displayName}))}}]}}function u(e,n){let i=e.querySelector(".bubble > .prose");if(!i)return n;return(i.innerText||i.textContent||n).trim()}function g(e){if(!e)return;let n=window.getSelection();if(!n)return;let i=document.createRange();i.selectNodeContents(e),n.removeAllRanges(),n.addRange(i)}function y(e){let n=window.getSelection();if(!n||n.isCollapsed)return"";return(n.anchorNode&&e.contains(n.anchorNode)?n.toString():"").trim()}function H(e,n,i){let o=[{id:"copy",label:t("Copy"),icon:"copy",run:()=>s(y(n)||u(n,e.text))},{id:"copy-markdown",label:t("Copy as Markdown"),icon:"notes",run:()=>s(e.text)}];if(i)o.push({id:"quote",label:t("Quote reply"),icon:"conversations",run:()=>Ss(e.room,e.text)});if(o.push({id:"select",label:t("Select text"),icon:"list",run:()=>g(n.querySelector(".bubble"))}),f())o.push({id:"share",label:t("Share"),icon:"send",run:()=>c({text:u(n,e.text)})});return{title:e.author,items:o}}function D(e,n){return{title:n,items:[{id:"profile",label:t("Knight profile"),icon:"profile",run:()=>et(e)}]}}var d=(e)=>[e.header?`${e.header}: ${e.question}`:e.question,...e.options.map((n)=>n.description?`- ${n.label}: ${n.description}`:`- ${n.label}`)];function v(e){let n=[e.title];switch(e.kind){case"approval":{n.push("",e.message);let{approval:i}=e;if(i){if(n.push("",`${t("Tool")}: ${i.tool}`,`${t("Action")}: ${i.action}`),Object.keys(i.input).length)n.push(JSON.stringify(i.input,null,2));for(let o of i.files??[])n.push(o.path)}break}case"ask":n.push("",...d({question:e.question,options:e.options,multi:e.multi,allowOther:e.allowOther}));break;case"questionnaire":for(let i of e.questions)n.push("",...d(i));break}return n.join(`
2
- `)}function Q(e){return{title:e.title,items:[{id:"copy-details",label:t("Copy details"),icon:"copy",run:()=>s(v(e))}]}}function w(e){let n=document.createElement("a");n.href=rn(e),n.download=e.name,n.hidden=!0,document.body.append(n),n.click(),n.remove()}async function M(e){let n=new URL(rn(e),window.location.href).href;if(typeof navigator.canShare==="function")try{let i=await fetch(n);if(i.ok){let o=new File([await i.blob()],e.name,{type:e.type});if(navigator.canShare({files:[o]})){await c({files:[o],title:e.name});return}}}catch{}await c({title:e.name,url:n})}function j(e){let n=[{id:"download",label:t("Download"),icon:"download",run:()=>w(e)}];if(f())n.push({id:"share",label:t("Share"),icon:"send",run:()=>M(e)});return{title:e.name,items:n}}export{h as addMenu,D as avatarMenu,v as cardDetails,Q as cardMenu,s as copyText,j as fileMenu,H as messageMenu,P as openAddMenu,I as roomMenu,O as seatMenu};
@@ -1 +0,0 @@
1
- import{Ki}from"./chunk-index-kw85ajap.js";export{Ki as ModeToggle};
@@ -1,75 +0,0 @@
1
- import{J,t,e,n,u,Ke,Gt,Ct}from"./chunk-index-84v7j6vh.js";import{it}from"./chunk-index-kfv996qe.js";var d=!1;function i(){if(d||typeof document>"u")return;if(d=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let o=new CSSStyleSheet;o.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,o];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)}i();var c=J(function(o){let{message:a}=o,m=u((l)=>l.principal?.id),r=a.principalId!==void 0&&a.principalId===m;return n("li",{className:"message","data-mid":a.id,"data-note":!0,"data-mine":r||void 0,"data-header":!0,"data-enter":o.enter||void 0,children:[r?null:e("span",{className:"message-avatar",children:e(it,{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:Gt(a.at,o.timeZone)})]}),n("div",{className:"bubble",children:[a.text?e(Ke,{source:a.text}):null,e(Ct,{files:a.files})]})]})]})}),k=c;export{k as default};
@@ -1 +0,0 @@
1
- import{z,o,A,a,r,t,c,e,n,O,d,S,m,k,P,_,ws,te}from"./chunk-index-84v7j6vh.js";import{ye}from"./chunk-index-th43f690.js";import{De}from"./chunk-index-cmxs5y22.js";import{de}from"./chunk-index-grkczq2c.js";import"./chunk-index-9nents16.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:v}=_(),{version:s}=te(),[u,l]=r("core"),[p,N]=r(""),[b,w]=r(),[f,L]=r(),[h,D]=r(),[C,E]=r(),[y,T]=r(),K=ye(()=>O.principals(),"principals").data,V=a(0),x=z(async(i)=>{let g=++V.current;try{let I=await O.notes(i.trim(),y);if(g!==V.current)return;w(I),L(void 0)}catch(I){if(g===V.current)L(d(I))}},[y]);o(()=>{let i=setTimeout(()=>void x(p),q);return()=>clearTimeout(i)},[p,x,s]);let R=(b??[]).filter((i)=>i.kind===u).sort((i,g)=>u==="event"?(i.eventDate??"").localeCompare(g.eventDate??""):i.id-g.id),W=ws(v);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:()=>D({draft:{kind:u,fact:"",eventDate:""}}),children:t("Add")})]}),K&&K.principals.length>1?e(B,{people:K,shown:y,choose:(i)=>{w(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((g)=>g.kind===i.kind).length}`:""]},i.kind))}),e("input",{type:"search",placeholder:t("Search (words separated by spaces)"),"aria-label":t("Search notes"),value:p,onChange:(i)=>N(i.target.value)})]}),e("p",{className:"hint",children:t(F.find((i)=>i.kind===u)?.hint??"")}),f?e(m,{message:f}):null,!b?e(S,{}):R.length===0?e(k,{children:p?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:()=>D({note:i,draft:{kind:i.kind,fact:i.fact,eventDate:i.eventDate??""}}),children:t("Edit")}),e("button",{type:"button",className:"danger",onClick:()=>E(i),children:t("Delete")})]})]})},i.id)),e(de,{open:h!==void 0,title:h?.note?t("Edit note"):t("Add note"),onClose:()=>D(void 0),children:h?e(H,{initial:h.draft,save:async(i)=>{if(h.note)await O.updateNote(h.note.id,i,y);else await O.addNote(i,y);D((g)=>g===h?void 0:g),await x(p)},cancel:()=>D(void 0)}):null}),e(de,{open:C!==void 0,title:t("Delete this note?"),onClose:()=>E(void 0),children:C?e(M,{text:C.fact,run:async()=>{await O.deleteNote(C.id,y),E((i)=>i===C?void 0:i),await x(p)},cancel:()=>E(void 0)}):null})]})}function B(v){let{people:s}=v,u=A();return n("label",{className:"inline",htmlFor:u,children:[t("Whose notes")," ",e(De,{id:u,value:v.shown??s.self,onChange:(l)=>v.choose(l.target.value===s.self?void 0:l.target.value),children:s.principals.map((l)=>e("option",{value:l.id,children:l.id===s.self?t("{name} (you)",{name:l.name}):l.disabled?t("{name} (disabled)",{name:l.name}):l.name},l.id))})]})}function H(v){let[s,u]=r(v.initial),[l,p]=r(!1),[N,b]=r(),w=async()=>{p(!0),b(void 0);try{await v.save({kind:s.kind,fact:s.fact,...s.kind==="event"&&s.eventDate?{eventDate:s.eventDate}:{}})}catch(f){b(d(f)),p(!1)}};return n("form",{className:"stack",onSubmit:(f)=>{f.preventDefault(),w()},children:[n("fieldset",{children:[e("legend",{children:t("Kind")}),e("div",{className:"tabs",children:F.map((f)=>e("button",{type:"button","aria-pressed":s.kind===f.kind,onClick:()=>u({...s,kind:f.kind}),children:t(f.label)},f.kind))})]}),s.kind==="event"?n("label",{children:[t("Date"),e("input",{type:"date",value:s.eventDate,onChange:(f)=>u({...s,eventDate:f.target.value})})]}):null,n("label",{children:[t("Text"),e("textarea",{rows:4,value:s.fact,onChange:(f)=>u({...s,fact:f.target.value})})]}),N?e(m,{message:N}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:v.cancel,children:t("Cancel")}),e("button",{type:"submit",disabled:l,children:l?t("Saving…"):t("Save")})]})]})}function M(v){let[s,u]=r(!1),[l,p]=r();return n("div",{className:"stack",children:[e("p",{className:"text",children:v.text}),l?e(m,{message:l}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:v.cancel,children:t("Cancel")}),e("button",{type:"button",className:"danger",disabled:s,onClick:()=>{u(!0),v.run().catch((N)=>{p(d(N)),u(!1)})},children:s?t("Deleting…"):t("Delete")})]})]})}export{ae as NotesPage};
@@ -1 +0,0 @@
1
- import"./chunk-index-0q15ysrb.js";import{t,e,n,s,x}from"./chunk-index-84v7j6vh.js";import{Zn}from"./chunk-index-ewj52be9.js";import"./chunk-index-cwc1vvpw.js";function r({current:a}){let{badge:o}=Zn();return n("a",{className:"icon-button bell",href:x("notices"),"aria-current":a?"page":void 0,"aria-label":o>0?t("Notices, {count} waiting",{count:o}):t("Notices"),children:[e(s,{name:"bell"}),o>0?e("span",{className:"bell-count","aria-hidden":"true",children:o>99?"99+":o}):null]})}export{r as default};
@@ -1 +0,0 @@
1
- import{z,o,a,r,t,g,e,n,s,x,d,S,m,An,Li}from"./chunk-index-84v7j6vh.js";import{j}from"./chunk-index-7bbqtdce.js";import"./chunk-index-0q15ysrb.js";import{Sn,Kt}from"./chunk-index-y00wke93.js";import"./chunk-index-9nents16.js";import{ce}from"./chunk-index-cwc1vvpw.js";var M=90000,A=2000,C=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),_=()=>/iPhone|iPad/.test(navigator.userAgent);function F({step:i,view:w,refresh:p}){let[c,u]=r(),[l,h]=r(i.done?"arrived":"idle"),[N,b]=r(),[k,v]=r(!1),[V,T]=r(!1),y=a(void 0);o(()=>(An().then(u,()=>u("unsupported")),()=>clearTimeout(y.current)),[]),o(()=>{if(i.done)h("arrived")},[i.done]);let I=z((f)=>{let P=async()=>{if((await p())?.steps.find((E)=>E.id===i.id)?.done){h("arrived");return}if(Date.now()-f>M){h("late");return}y.current=setTimeout(P,A)};y.current=setTimeout(P,A)},[p,i.id]),L=async()=>{v(!0),b(void 0),h("sending");try{await ce.pushTest(),h("waiting"),I(Date.now())}catch(f){h("idle"),b(d(f))}finally{v(!1)}},D=async()=>{v(!0),b(void 0);try{await Li(),u(await An()),await p()}catch(f){b(f instanceof Error&&f.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):d(f)),u(await An().catch(()=>"unsupported"))}finally{v(!1)}},O=c==="unsupported"&&_()&&!C();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:Sn(i)}),i.done?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:Kt(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":c==="on"||O===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:O?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):C()?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:k||c===void 0,onClick:D,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(g,{children:[e("button",{type:"button",className:"secondary",disabled:k||c!=="on"||l==="waiting",onClick:L,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]})]})]}),N?e(m,{message:N}):null,i.waiver&&!i.done&&!i.waived?n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>T(!0),children:t(i.waiver.label)}),e(j,{open:V,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>T(!1),onConfirm:async()=>{await ce.waive(i.id),await p()},children:e("p",{children:t(i.waiver.confirm)})})]}):null,w.push.devices>0&&!i.done?e("p",{className:"meta",children:t("{count} device(s) will get notifications.",{count:w.push.devices})}):null]})}function Z(){let[i,w]=r(),[p,c]=r(),u=z(async()=>{try{let l=await ce.onboarding();return w(l),l}catch(l){c(d(l));return}},[]);if(o(()=>{u()},[u]),p&&!i)return e(m,{message:p});if(!i)return e(S,{});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(F,{step:l,view:i,refresh:u},l.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:Sn(l)}),l.done||l.waived?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",l.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:x(l.open.page),children:t("Open")})]}),e("p",{className:"meta",children:Kt(l)})]},l.id)),i.steps.length===0?e("p",{className:"empty",children:t("There is nothing left to set up.")}):null]})}export{Z as OnboardingPage};
@@ -1 +0,0 @@
1
- import{o,N,a,r,t,e,n,s,x,K,u,an,he}from"./chunk-index-84v7j6vh.js";import{D}from"./chunk-index-9nents16.js";import{Wn}from"./chunk-index-6tpr6r6d.js";function T(m){let[f,v]=r(""),[p,h]=r(0),g=a(null),b=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=N(()=>[...b.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:()=>K("room",i.key)})),...m.pages.map((i)=>({id:i.pane,label:i.label,hint:t("Page"),icon:i.icon,go:()=>K(i.pane)}))].flatMap((i)=>{let c=Wn(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),[b,m.pages,f]);o(()=>h(0),[f]),o(()=>{if(m.open)v(""),requestAnimationFrame(()=>g.current?.focus())},[m.open]);let y=(l)=>{if(!l)return;m.onClose(),l.go()};return e(D,{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(s,{name:"search",size:18}),e("input",{ref:g,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)=>v(l.target.value),onKeyDown:(l)=>{if(an(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(),y(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?x("room",l.id):x(l.id),onClick:(c)=>{c.preventDefault(),y(l)},onMouseMove:()=>h(i),"aria-current":i===p?"true":void 0,children:[l.avatar?e(he,{spec:l.avatar.character,name:l.avatar.name,size:28,live:!1}):e("span",{className:"palette-icon",children:e(s,{name:l.icon??"list",size:16})}),e("span",{className:"palette-label",children:l.label}),e("span",{className:"meta",children:l.hint})]})},l.id))]})]})})}export{T as Palette};
@@ -1 +0,0 @@
1
- import{Lr,oo}from"./chunk-index-c5x70d9g.js";import"./chunk-index-51n20yhb.js";import"./chunk-index-0h4h76kw.js";export{oo as folderMenu,Lr as placementItems};
@@ -1 +0,0 @@
1
- import{o,r,t,e,n,d,S,m,k,P,_,ie}from"./chunk-index-84v7j6vh.js";import{dt}from"./chunk-index-4gk88a0x.js";import{D}from"./chunk-index-9nents16.js";function T(a){let{open:u,load:v}=a,{timeZone:y}=_(),[i,p]=r(),[c,g]=r(),[h,b]=r();o(()=>{if(!u)return;let s=!0;return p(void 0),g(void 0),b(void 0),v().then((f)=>s&&p(f),(f)=>s&&g(d(f))),()=>{s=!1}},[u]);let l=i?.find((s)=>s.id===h);return e(D,{open:u,title:a.title,size:"wide",onClose:a.onClose,children:n("div",{className:"stack history",children:[c?e(m,{message:c}):null,!i&&!c?e(S,{}):null,i?.length===0?e(k,{children:t("No changes have been kept yet.")}):null,i&&i.length>0?e("ul",{className:"menu",children:i.map((s)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":s.id===h,onClick:()=>b(s.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:s.by}),e("span",{className:"meta",children:ie(s.at,y)})]}),s.revert?e(P,{children:t("Back to the file version")}):null]})},s.id))}):null,l?n("section",{className:"stack","aria-label":t("This change"),children:[e(dt,{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{f,Q,w,z,o,A,r,t,c,g,e,n,s,le,d,p,S,m,k,P,_,ie}from"./chunk-index-84v7j6vh.js";import{$e,dt}from"./chunk-index-4gk88a0x.js";import{D}from"./chunk-index-9nents16.js";var M={"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(M[l]??l);var O=w(()=>(f("hgbtcn4b"),import("./chunk-prompt-history-hgbtcn4b.js")).then((l)=>({default:l.HistorySheet}))),Z=w(()=>(f("wc5xraev"),import("./chunk-confirm-wc5xraev.js")).then((l)=>({default:l.Confirm})));function me(){let{timeZone:l}=_(),[N,i]=r(),[h,y]=r(),[v,x]=r(),R=z(()=>{$e.prompts().then((u)=>i(u.documents),(u)=>y(d(u)))},[]);return o(R,[R]),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.")}),h?e(m,{message:h}):null,!N&&!h?e(S,{}):null,N?.length===0?e(k,{children:t("No prompts to edit.")}):null,N?.map((u)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:C(u.label)}),u.differs?e(P,{tone:"warn",children:t("Differs from the file version")}):null,u.broken?e(P,{tone:"warn",children:t("File version cannot be read")}):null]}),u.description?e("p",{children:C(u.description)}):null,u.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:u.override.by,time:ie(u.override.at,l)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>x(u.id),children:t("Edit")})})]},u.id)),v?e(q,{id:v,onClose:()=>{x(void 0),R()}}):null]})}function q({id:l,onClose:N}){let[i,h]=r(),[y,v]=r(""),[x,R]=r(),[u,E]=r(!1),[T,H]=r(!1),[V,B]=r(!1),[F,I]=r(!1),L=A();o(()=>{let a=!0;return $e.prompt(l).then((b)=>{if(!a)return;h(b),v(b.text)},(b)=>a&&R(d(b))),()=>{a=!1}},[l]);let U=async()=>{if(!i)return;H(!0);try{let a=await $e.savePrompt(l,{text:y,base:i.text});h(a),v(a.text),E(!1),p(t("Saved."))}catch(a){if(a instanceof le&&a.status===409){let{current:b}=a.body;h(b),p(a.message,"danger")}else p(d(a),"danger")}finally{H(!1)}},G=i!==void 0&&y!==i.text;return n(D,{open:!0,title:i?C(i.label):t("Main prompts"),size:"full",onClose:N,children:[x?e(m,{message:x}):null,!i&&!x?e(S,{}):null,i?.broken?e(m,{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,u?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(dt,{label:t("Prompt"),before:i.text,after:y}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:T,onClick:()=>E(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:T,onClick:U,children:T?t("Saving…"):t("Save")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:L,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>B(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:L,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:()=>I(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!G||!y.trim(),onClick:()=>E(!0),children:t("Review changes")})]})]}),V?e(Q,{fallback:null,children:e(O,{open:V,title:t("History of {name}",{name:C(i.label)}),load:async()=>(await $e.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),E(!1),B(!1)},onClose:()=>B(!1)})}):null,F?e(Q,{fallback:null,children:e(Z,{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 $e.revertPrompt(l,{base:i.text});h(a),v(a.text),E(!1),p(t("Back to the file version."))}catch(a){if(!(a instanceof le&&a.status===409))throw a;let{current:b}=a.body;h(b),p(a.message,"danger")}},onClose:()=>I(!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{me as PromptsPage};
@@ -1 +0,0 @@
1
- import{Wi}from"./chunk-index-d85x96q0.js";import"./chunk-index-grkczq2c.js";import"./chunk-index-7bbqtdce.js";import"./chunk-index-9nents16.js";import"./chunk-index-dep2e3f3.js";import"./chunk-index-51n20yhb.js";import"./chunk-index-0h4h76kw.js";export{Wi as RoomConfirmHost};
@@ -1 +0,0 @@
1
- import{f,r,t,g,e,n,s,x,u,_,et,Et,we,St}from"./chunk-index-84v7j6vh.js";import{Ce}from"./chunk-index-51n20yhb.js";import{ft}from"./chunk-index-1f0j335v.js";import{D}from"./chunk-index-9nents16.js";import{tt}from"./chunk-index-satam151.js";var p="room-menu-yolo",h="room-menu-long",N="room-menu-mute";function P(a){let[l,m]=r(!1),i=_().app?.modes!==!1,b=u((o)=>o.rooms[a.room]?.view?.home===!1,a.room),c=u((o)=>o.pins.includes(a.room),a.room),d=a.mode??{yolo:!1,longRunning:!1},y=async(o)=>{m(!0),await Et(a.room,{longRunning:o}),m(!1)};return e(D,{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:x("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(s,{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(s,{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:N,children:[e("span",{className:"menu-icon",children:e(s,{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(ft,{id:N,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{m(!0),await tt(a.room,!o),m(!1)},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:p,children:[e("span",{className:"menu-icon","data-tone":"yolo",children:e(s,{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(ft,{id:p,checked:d.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else m(!0),Et(a.room,{yolo:!1}).then(()=>m(!1))},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:h,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(s,{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(ft,{id:h,checked:d.longRunning,label:t("Long-running mode"),onChange:y,busy:l})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),et(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{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(s,{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(),St({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(s,{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(s,{name:"chevron",size:16})]})}):null,a.readOnly||!b?null:n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(f("cgghzj1w"),import("./chunk-layout-actions-cgghzj1w.js")).then((o)=>o.pinRoom(a.room,!c))},children:[e("span",{className:"menu-icon",children:e(s,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:c?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(s,{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(s,{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(s,{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(),we({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{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{P as RoomMenu};
@@ -1 +0,0 @@
1
- import{t,e,s,u}from"./chunk-index-84v7j6vh.js";import"./chunk-index-51n20yhb.js";import{Fn}from"./chunk-index-066vzexw.js";function r(){if(!u((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>Fn(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
@@ -1 +0,0 @@
1
- import{r,t,c,e,n,s,x,O,p,S,m,k,P,_,ie}from"./chunk-index-84v7j6vh.js";import{j}from"./chunk-index-7bbqtdce.js";import{ye}from"./chunk-index-th43f690.js";import"./chunk-index-9nents16.js";var g={mon:c("Mon"),tue:c("Tue"),wed:c("Wed"),thu:c("Thu"),fri:c("Fri"),sat:c("Sat"),sun:c("Sun")};function h(d){if(typeof d!=="object"||d===null)return"";let o=d,i=typeof o.time==="string"?o.time:"";switch(o.kind){case"once":return t("Once on {date} at {time}",{date:String(o.date??""),time:i});case"every":return Number(o.everyDays)===1?t("Every day at {time}",{time:i}):t("Every {count} days at {time}",{count:Number(o.everyDays),time:i});case"weekly":{let l=Array.isArray(o.weekdays)?o.weekdays.map((u)=>t(g[String(u)]??String(u))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:i})}default:return""}}function L(){let{timeZone:d}=_(),[o,i]=r(0),[l,u]=r(),{data:f,error:y}=ye(()=>O.schedules(),`schedules:${o}`);return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Schedules")})}),y?e(m,{message:y}):null,!f&&!y?e(S,{}):null,f&&f.schedules.length===0?e(k,{children:t("Nothing is scheduled. Ask a knight to remind you or to run something later.")}):null,e("ul",{className:"schedule-list",children:f?.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:ie(a.nextRun,d)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:x("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:()=>u(a),children:e(s,{name:"trash"})})]},a.id))}),e(j,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>u(void 0),onConfirm:async()=>{if(!l)return;await O.cancelSchedule(l.id),i((a)=>a+1),p(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{f,Q,w,z,o,A,N,a,r,t,c,g,e,n,s,K,u,le,O,d,p,S,m,k,fn,_s,Ts,we,oi,Ms,he,En}from"./chunk-index-84v7j6vh.js";import{j}from"./chunk-index-7bbqtdce.js";import"./chunk-index-51n20yhb.js";import"./chunk-index-dep2e3f3.js";import{xe,xt,Wi}from"./chunk-index-d85x96q0.js";import{On}from"./chunk-index-yrhbhmxz.js";import{$e,dt}from"./chunk-index-4gk88a0x.js";import{ft}from"./chunk-index-1f0j335v.js";import{De}from"./chunk-index-cmxs5y22.js";import"./chunk-index-grkczq2c.js";import{D}from"./chunk-index-9nents16.js";import{tt}from"./chunk-index-satam151.js";import"./chunk-index-0h4h76kw.js";function se(i){return n("fieldset",{className:"field",children:[e("legend",{children:i.label}),e("div",{className:"option-chips",children:i.options.map((h)=>e("button",{type:"button","aria-pressed":h.value===i.value,className:"option-chip",onClick:()=>i.onChange(h.value),children:h.label},h.value))})]})}var Fe=w(()=>(f("hgbtcn4b"),import("./chunk-prompt-history-hgbtcn4b.js")).then((i)=>({default:i.HistorySheet}))),He=w(()=>(f("k67f77w5"),import("./chunk-character-creator-k67f77w5.js")).then((i)=>({default:i.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")},B="default",be=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),Ve=c("Automatic"),me=(i)=>i==="auto"?t(Ve):t(ve[i]??i),fe=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??B,thinking:i.thinking??B});function ge(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??B)?{model:h.model}:{},...h.thinking!==(i.thinking??B)?{thinking:h.thinking}:{}}}function ye(){let i=Ts(),h=a(i);if(i)h.current=i;let l=h.current,C=i!==void 0;if(o(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)fn()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(D,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:fn,children:e(ze,{name:l.name,opened:l.id},l.name)})}function ze({name:i,opened:h}){let[l,C]=r(),[P,I]=r([]),[E,V]=r(),[M,F]=r(),[v,x]=r(!1),[R,G]=r(!1),[ee,J]=r(!1),[U,q]=r(!1),te=En(l?.room??""),W=a(null),X=l!==void 0,_=u((y)=>l?y.rooms[l.room]?.view?.muted===!0:!1,l?.room??""),[ae,H]=r(!1),ne=u((y)=>l?y.rooms[l.room]?.view?.coordinator===!0:!1,l?.room??""),Y=A(),Z=A(),L=A();o(()=>{if(!X||!_s()?.look)return;W.current?.scrollIntoView({block:"start"}),W.current?.focus({preventScroll:!0})},[X,h]);let b=a({});b.current={profile:l,draft:M},o(()=>{let y=!0;return Promise.all([O.agent(i),O.models()]).then(([ie,Te])=>{if(!y)return;let{profile:ue,draft:re}=b.current,Re=ue&&re&&Object.keys(ge(ue,re)).length>0;C(ie),I(Te.models),F(Re?re:fe(ie))},(ie)=>y&&V(d(ie))),()=>{y=!1}},[i,h]);let T=N(()=>l&&M?ge(l,M):{},[l,M]);if(E)return e(m,{message:E});if(!l||!M)return e(S,{});let de=Object.keys(T).length>0,Ie=Array.from(new Set([B,...P,M.model])),Pe=be(l),pe=async()=>{x(!0);try{let y=await O.updateAgent(i,T);C(y),F(fe(y)),G(!1),p(t("Saved."))}catch(y){p(d(y),"danger")}finally{x(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(he,{spec:l.character,name:l.name,size:72,state:te,label:l.displayName}),n("div",{children:[e("h3",{children:l.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:l.effective.model,thinking:me(l.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:L,children:[e("span",{className:"menu-icon",children:e(s,{name:_?"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(ft,{id:L,checked:!_,label:t("Notifications"),busy:ae,onChange:async(y)=>{H(!0),await tt(l.room,!y),H(!1)}})]})})}),R?e(Ke,{profile:l,draft:M,saving:v,onBack:()=>G(!1),onSave:pe}):n("form",{className:"stack form",onSubmit:(y)=>{if(y.preventDefault(),!de)return;if(T.prompt!==void 0)G(!0);else pe()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:M.displayName,onChange:(y)=>F({...M,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:()=>q(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>J(!0),children:[e(Be,{}),t("Full screen")]})]})]}),e("textarea",{id:Y,rows:8,value:M.prompt,onChange:(y)=>F({...M,prompt:y.target.value})})]}),e(se,{label:t("Model"),value:M.model,onChange:(y)=>F({...M,model:y}),options:Ie.map((y)=>({value:y,label:y===B?Pe:y}))}),e(se,{label:t("Thinking level"),value:M.thinking,onChange:(y)=>F({...M,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(Ge,{name:i,opened:h}),n("section",{className:"card stack",ref:W,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(S,{}),children:e(He,{name:l.name,displayName:l.displayName,prompt:l.prompt,character:l.character,onSaved:(y)=>C(y)})})]}),ne?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:()=>{fn(),we({kind:"archive",room:l.room,name:l.displayName})},children:t("Archive {name}",{name:l.displayName})})})]}),U?e(Q,{fallback:null,children:e(Fe,{open:U,title:t("History of the prompt"),load:async()=>(await $e.agentPromptHistory(i)).versions.map((y)=>({id:y.id,text:y.text,previous:y.previous,by:y.by,at:y.at})),onUse:(y)=>{F({...M,prompt:y}),q(!1)},onClose:()=>q(!1)})}):null,e(D,{open:ee,title:t("Prompt"),size:"full",onClose:()=>J(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:M.prompt,onChange:(y)=>F({...M,prompt:y.target.value})})})]})}function Ge({name:i,opened:h}){let[l,C]=r(),[P,I]=r(),[E,V]=r(),M=A();if(o(()=>{let v=!0;return xe.skills(i).then((x)=>v&&C(x),(x)=>{if(v&&!(x instanceof le&&x.status===404))V(d(x))}),()=>{v=!1}},[i,h]),E)return e(m,{message:E});if(!l)return null;let F=async(v,x)=>{I(v);try{C(await xe.setSkills(i,x?{add:[v]}:{remove:[v]}))}catch(R){p(d(R),"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:l.skills.map((v,x)=>{let R=`${M}-${x}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:R,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(ft,{id:R,checked:v.carried,label:v.name,busy:P===v.name,disabled:v.builtin,onChange:(G)=>F(v.name,G)})]})},v.name)})})]})}var Be=()=>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 Ke(i){let{profile:h,draft:l}=i,C=a(null);o(()=>C.current?.focus(),[]);let P=[];if(l.displayName!==h.displayName)P.push({label:t("Name"),before:h.displayName,after:l.displayName});let I=(E)=>E===B?be(h):E;if(l.model!==(h.model??B))P.push({label:t("Model"),before:I(h.model??B),after:I(l.model)});if(l.thinking!==(h.thinking??B))P.push({label:t("Thinking level"),before:me(h.thinking??B),after:me(l.thinking)});return n("section",{ref:C,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),P.length?e("ul",{className:"review-fields",children:P.map((E)=>n("li",{children:[e("strong",{children:E.label}),e("span",{className:"review-before",children:E.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:E.after})]},E.label))}):null,e(dt,{label:t("Prompt"),before:h.prompt,after:l.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:i.saving,onClick:i.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:i.saving,onClick:i.onSave,children:i.saving?t("Saving…"):t("Save")})]})]})}function Ne(){let[i,h]=r(),[l,C]=r(),[P,I]=r(),[E,V]=r(),M=z(async()=>{try{h((await xe.archive()).entries),C(void 0)}catch(v){C(d(v))}},[]);o(()=>{M()},[M]);let F=async(v)=>{I(v.name);try{if(v.kind==="agent")await xe.restoreAgent(v.name);else await xe.restoreGroup(v.name);await xt(),p(t("Restored {name}.",{name:v.displayName})),await M()}catch(x){p(d(x),"danger")}finally{I(void 0)}};if(l&&!i)return e(m,{message:l});if(!i)return e(S,{});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.")}),i.length===0?e(k,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:i.map((v)=>n("li",{className:"menu-item",children:[e("span",{className:"menu-icon",children:e(s,{name:v.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:v.displayName}),n("span",{className:"meta",children:[v.kind==="agent"?t("Knight"):t("Group")," ·"," ",v.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:P===v.name,onClick:()=>F(v),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:P===v.name,onClick:()=>V(v),children:t("Delete")})]},`${v.kind}:${v.name}`))}),e(j,{open:E!==void 0,title:t("Delete {name}?",{name:E?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>V(void 0),onConfirm:async()=>{if(!E)return;if(E.kind==="agent")await xe.deleteAgent(E.name);else await xe.deleteGroup(E.name);await xt(),p(t("Deleted {name}.",{name:E.displayName})),await M()},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:E?.displayName??""})})})]})}var ke=/^[a-z0-9-]{1,32}$/,Ce=2,Se=6,oe="\x00";function Ue(){let i=u((h)=>h.order.flatMap((l)=>{let C=h.rooms[l]?.view;return C?.kind==="agent"?[`${C.name}${oe}${C.displayName}`]:[]}).join(`${oe}${oe}`));return N(()=>i===""?[]:i.split(`${oe}${oe}`).map((h)=>{let[l="",C=""]=h.split(oe);return{name:l,displayName:C}}),[i])}function Ae(i){let h=Ue(),[l,C]=r(),[P,I]=r(),[E,V]=r(""),[M,F]=r(""),[v,x]=r(!1),[R,G]=r([]),[ee,J]=r(""),[U,q]=r(!1),[te,W]=r(i.name===void 0),X=A(),_=A();o(()=>{let L=i.name;if(L===void 0)return;let b=!0;return xe.group(L).then((T)=>{if(!b)return;C(T),V(T.displayName),G(T.members),J(T.host),W(!0)},(T)=>b&&I(d(T))),()=>{b=!1}},[i.name]);let ae=(L)=>h.find((b)=>b.name===L)?.displayName??L,H=R.includes(ee)?ee:R[0]??"",ne=l===void 0?!0:E.trim()!==l.displayName||R.join(",")!==l.members.join(",")||H!==l.host,Y=E.trim()!==""&&R.length>=Ce&&R.length<=Se&&(l!==void 0||ke.test(M));if(P&&!te)return e(m,{message:P});if(!te)return e(S,{});let Z=async()=>{q(!0),I(void 0);try{if(l){await xe.updateGroup(l.name,{...E.trim()!==l.displayName?{displayName:E.trim()}:{},...R.join(",")!==l.members.join(",")?{members:R}:{},...H!==l.host?{host:H}:{}}),await xt(),p(t("Saved.")),i.onDone();return}let L=await xe.createGroup({name:M,displayName:E.trim(),members:R,host:H});await xt(),p(t("Made {name}.",{name:L.displayName})),i.onDone(),K("room",L.room)}catch(L){I(d(L))}finally{q(!1)}};return n("form",{className:"stack form",onSubmit:(L)=>{if(L.preventDefault(),Y&&ne&&!U)Z()},children:[n("label",{htmlFor:X,children:[t("Name"),e("input",{id:X,value:E,autoComplete:"off",onChange:(L)=>{if(V(L.target.value),!l&&!v)F(L.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),l?null:n("label",{htmlFor:_,children:[t("Permanent name"),e("input",{id:_,value:M,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":M!==""&&!ke.test(M),onChange:(L)=>{x(!0),F(L.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 6 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:h.map((L)=>{let b=R.includes(L.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:b,disabled:!b&&R.length>=Se,onChange:()=>G(b?R.filter((T)=>T!==L.name):[...R,L.name])}),e("span",{className:"menu-text",children:e("strong",{children:L.displayName})})]})},L.name)})})]}),R.length>=Ce?e(se,{label:t("Host"),value:H,onChange:J,options:R.map((L)=>({value:L,label:ae(L)}))}):null,P?e(m,{message:P}):null,n("div",{className:"actions",children:[l?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),we({kind:"archive",room:l.room,name:l.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!Y||!ne||U,children:U?t("Saving…"):l?t("Save"):t("Make group")})]})]})}var _e=w(()=>(f("k67f77w5"),import("./chunk-character-creator-k67f77w5.js")).then((i)=>({default:i.CharacterCreator}))),Ee=/^[a-z0-9-]{1,32}$/,ce="default";function je(i){let h=[];for(let l of i){let C=l.indexOf("/"),P=C>0?l.slice(0,C):"",I=h.find((E)=>E.provider===P&&P!=="");if(I)I.models.push(l);else h.push({provider:P,models:[l]})}return h}var qe=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Me({onDone:i}){let[h,l]=r(""),[C,P]=r(""),[I,E]=r(!1),[V,M]=r(""),[F,v]=r(ce),[x,R]=r(""),[G,ee]=r(),[J,U]=r(!1),[q,te]=r([]),[W,X]=r(),[_,ae]=r(!1),H=[A(),A(),A(),A(),A()];o(()=>{let b=!0;return O.models().then((T)=>b&&te(T.models),()=>{return}),()=>{b=!1}},[]);let ne=N(()=>On({name:C,displayName:h,prompt:V}),[C,h,V]),Y=G?.spec??ne,Z=Ee.test(C)&&h.trim()!==""&&V.trim()!=="";if(J)return e(Q,{fallback:e(S,{}),children:e(_e,{name:C||"new",displayName:h,prompt:V,character:Y,onPick:(b,T)=>{ee({input:b,spec:T}),U(!1)},onCancel:()=>U(!1)})});let L=async()=>{ae(!0),X(void 0);try{let b={name:C,displayName:h.trim(),prompt:V,...F!==ce?{model:F}:{},...x.trim()?{task:x.trim()}:{},...G?{character:G.input}:{}},T=await xe.createAgent(b);await xt(),p(t("Made {name}.",{name:T.displayName})),i(),K("room",T.room)}catch(b){X(b instanceof le&&b.field?`${b.field}: ${d(b)}`:d(b))}finally{ae(!1)}};return n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),Z&&!_)L()},children:[n("label",{htmlFor:H[0],children:[t("Name"),e("input",{id:H[0],value:h,autoComplete:"off",onChange:(b)=>{if(l(b.target.value),!I)P(qe(b.target.value))}})]}),n("label",{htmlFor:H[1],children:[t("Permanent name"),e("input",{id:H[1],value:C,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":C!==""&&!Ee.test(C),onChange:(b)=>{E(!0),P(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:H[2],children:[t("Prompt"),e("textarea",{id:H[2],rows:6,value:V,onChange:(b)=>M(b.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:H[4],children:[t("Model"),n(De,{id:H[4],value:F,onChange:(b)=>v(b.target.value),children:[e("option",{value:ce,children:t("Default model")}),je(q).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:H[3],children:[t("Opening task"),e("textarea",{id:H[3],rows:3,value:x,onChange:(b)=>R(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(he,{spec:Y,name:C||"new",size:72,label:h}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:G?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>U(!0),children:t("Choose a look")})]})]}),W?e(m,{message:W}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!Z||_,children:_?t("Making…"):t("Make knight")})})]})}var We=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Le(){let i=Ms(),h=a(i);if(i)h.current=i;let l=h.current,C=i!==void 0;if(o(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)oi()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(D,{open:i!==void 0,title:We(l),size:"wide",onClose:oi,children:e("div",{className:"stack agent-sheet",children:l.kind==="new-agent"?e(Me,{onDone:oi}):l.kind==="archive"?e(Ne,{}):e(Ae,{...l.name===void 0?{}:{name:l.name},onDone:oi})},l.id)})}function ua(){return n(g,{children:[e(Wi,{}),e(ye,{}),e(Le,{})]})}export{ua as SheetHosts};
@@ -1,8 +0,0 @@
1
- import{f,Q,w,o,A,r,t,g,e,n,s,le,d,p,S,m}from"./chunk-index-84v7j6vh.js";import{$e,dt}from"./chunk-index-4gk88a0x.js";import{D}from"./chunk-index-9nents16.js";var M=w(()=>(f("hgbtcn4b"),import("./chunk-prompt-history-hgbtcn4b.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(),[h,v]=r(u?"":B),[b,I]=r(),[R,y]=r(!1),[C,x]=r(!1),[z,H]=r(!1),[T,N]=r(!1),L=A();o(()=>{if(!u)return;let a=!0;return $e.skillDocument(u).then((l)=>{if(!a)return;k(l),v(l.text)},(l)=>a&&I(d(l))),()=>{a=!1}},[u]);let E=i?.text??"",U=h!==E,F=u!==void 0&&!i&&!b,V=async()=>{x(!0);try{if(i){let a=await $e.saveSkillDocument(i.name,{text:h,baseHash:i.hash});k(a),v(a.text),y(!1),H(!1),p(t("Saved.")),c.onSaved()}else await $e.createSkillDocument({text:h}),p(t("Skill created.")),c.onSaved(),c.onClose()}catch(a){if(a instanceof le&&a.status===409){let{current:l}=a.body;k(l),H(!0)}else p(d(a),"danger")}finally{x(!1)}};return n(D,{open:!0,title:u??t("New skill"),size:"full",onClose:c.onClose,children:[b?e(m,{message:b}):null,F?e(S,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!F&&!b&&(!i||i.writable)?n("div",{className:"stack",children:[R?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),z?e(m,{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(dt,{label:"SKILL.md",before:E,after:h}),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(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:L,children:"SKILL.md"}),i?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>N(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:L,className:"prompt-full",spellCheck:!1,value:h,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||!h.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 $e.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),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
@@ -1 +0,0 @@
1
- import{f,dr,Q,w,o,r,t,g,e,n,s,O,d,S,m,k,P,Ft,Rt}from"./chunk-index-84v7j6vh.js";import{ye}from"./chunk-index-th43f690.js";import{de}from"./chunk-index-grkczq2c.js";import"./chunk-index-9nents16.js";function v({source:i}){return e("div",{className:"prose document",children:e(Ft,{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 E=w(()=>(f("n0y9pd90"),import("./chunk-skill-editor-n0y9pd90.js")).then((i)=>({default:i.SkillEditor})));function j(){let[i,a]=r(0),{data:c,error:l}=ye(()=>O.skills(),`skills:${i}`),[b,N]=r(),[p,h]=r();o(()=>{O.session().then(N,()=>{return})},[]);let y=b?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),y?n("button",{type:"button",className:"secondary",onClick:()=>h({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:y?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(m,{message:l}):null,!c&&!l?e(S,{}):null,c?.length===0?e(k,{children:t("No skills.")}):null,c?.map((u)=>e(V,{skill:u,onEdit:y&&u.source.kind==="written"?()=>h({name:u.name}):void 0},`${u.name}:${i}`)),p?e(Q,{fallback:null,children:e(E,{name:p.name,onSaved:()=>a((u)=>u+1),onClose:()=>h(void 0)},p.name??"")}):null]})}function D(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 V({skill:i,onEdit:a}){let[c,l]=r(!1),[b,N]=r(),[p,h]=r(),y=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:y}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(g,{children:[a?e("button",{type:"button",className:"secondary",onClick:a,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!b)h(void 0),O.skill(i.name).then(N).catch((u)=>h(d(u)))},children:"SKILL.md"})]})]}),e("p",{children:i.missing??i.description}),i.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(s,{name:"lock",size:14}),e("span",{children:D(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(de,{open:c,title:i.name,size:"wide",onClose:()=>l(!1),children:p?e(m,{message:p}):!b?e(S,{}):e(C,{title:i.name,detail:b})})]})}function C({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(dr,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(v,{source:a.body})]})}export{j as SkillsPage};
@@ -1 +0,0 @@
1
- import{N,a,r,t,ne,g,e,n,s,x,K,mt,Ve,u,an,Zt,hn,Ze,We,gn}from"./chunk-index-84v7j6vh.js";import{jn}from"./chunk-index-gzvkpe3e.js";import{Wn}from"./chunk-index-6tpr6r6d.js";import{Yn,Hn}from"./chunk-index-f3b5nch2.js";import{Dt}from"./chunk-index-a768zmp6.js";import{Ws}from"./chunk-index-43k1rjmx.js";Yn();function b(){let l=u((m)=>JSON.stringify(Ws(m,(o)=>Ve(m,o),(o)=>mt(m,o)>0,!0).map((o)=>({id:o.id,...o.title===void 0?{}:{title:o.title},entries:o.keys.map((f)=>({key:f,name:m.rooms[f]?.view?.displayName??f,waiting:mt(m,f)>0}))})))),d=jn(),p=a(l);if(!d)p.current=l;let c=p.current;return N(()=>JSON.parse(c),[c])}function k(l){let{key:d,name:p}=l.entry,c=u((i)=>i.rooms[d]),m=u((i)=>mt(i,d)),o=c?.view,f=Ze(o?.character),w=Dt(()=>Zt(d,l.onLeave),l.liftable&&!o?.home?Hn(d):void 0);if(!o)return null;return e("li",{...l.liftable&&!o.home?{"data-drop-item":"","data-key":d}:{},children:n("a",{className:"switcher-row",...w,href:x("room",d),"aria-current":d===l.current?"page":void 0,style:f,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(We,{view:o,size:40}),m?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:p}),c?.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(gn,{room:d}),m?e("span",{className:"badge badge-warn",children:ne(m,"{count} card waiting","{count} cards waiting")}):null,o.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(s,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,c?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(s,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,c?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(s,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function U(l){let[d,p]=r(""),c=b(),m=c.map((i)=>({...i,entries:i.entries.filter((h)=>Wn(d,h.name)!==void 0)})).filter((i)=>i.entries.length>0||d===""),o=(i)=>l.close(i===l.current?void 0:()=>K("room",i)),f=c.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),w=m.filter((i)=>i.entries.length>0).length>1;return n(g,{children:[n("div",{className:"switcher-search",children:[e(s,{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)=>p(i.target.value),onKeyDown:(i)=>{let h=m.flatMap((y)=>y.entries)[0];if(i.key==="Enter"&&h&&!an(i.nativeEvent))o(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>hn(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:m.map((i)=>{let h=i.id==="waiting",y=i.id==="pinned"?"pinned":i.id==="rest"?"rest":h||i.id==="home"?void 0:"folder";return n("section",{"aria-label":h?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?f:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...y?{"data-drop-zone":y,"data-zone-id":i.id,...y==="folder"?{"data-folder":i.id}:{}}:{},children:[h?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):w||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?f:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((v)=>e(k,{entry:v,current:l.current,onPick:o,onLeave:l.close,liftable:!h&&i.id!=="home"},v.key))})]},i.id)})})]})}export{U as SwitcherList};
@@ -1 +0,0 @@
1
- import{f,Q,w,be,o,r,t,e,n,Se,K,u,Ge,fe,Rs}from"./chunk-index-84v7j6vh.js";import"./chunk-index-934zgd18.js";import"./chunk-index-8f9jer8r.js";import"./chunk-index-dtste2ed.js";import{_n,Tn,Si,bs,wi,Jn,Bt}from"./chunk-index-2f5nfekb.js";import{Kr,Gn}from"./chunk-index-y4sqmenv.js";import"./chunk-index-9nents16.js";var W=w(()=>(f("qeytqe0m"),import("./chunk-table-seats-qeytqe0m.js")).then((a)=>({default:a.TableSeatsSheet}))),z=300;function D(a){let[b,c]=r(!1);return o(()=>{if(!a){c(!1);return}if(Se()){c(!0);return}let l=setTimeout(()=>c(!0),z);return()=>clearTimeout(l)},[a]),b}function H(a,b,c,l){Rs(a).then((h)=>{if(h)fe({...h,at:b,via:c,source:l})},()=>{return})}function I(){return bs((be(Ge)?.kinds??[]).map((a)=>a.kind)),null}function te({focus:a}){let[b,c]=r(),l=wi(void 0),h=Jn(),[N,v]=r(!1),[x,A]=r(!1),m=Tn(),R=Si(),y=_n(),E=u((s)=>s.listed),T=m?y.loaded:E&&(!R||y.loaded),M=new Set(y.views.map((s)=>s.key)),k=m?l:l.filter((s)=>!M.has(s.key)),i=m?null:Kr(a,k),g=k.find((s)=>s.name===i);o(()=>{if(a&&T&&i===null)K("table",void 0,{replace:!0})},[a,T,i]);let B=D(i!==null),S=(s)=>{if(m){let p=l.find((L)=>L.name===s);if(p)K("room",p.key);return}let d=l.find((p)=>p.name===s);if(d&&M.has(d.key)){K("room",d.key);return}if(s===i)return;K("table",s??void 0,{replace:i!==null})},C=()=>{A(!0),v(!0)},V=!m&&l.length===0&&h.length>0,F=m&&y.loaded&&l.length===0;return n("div",{className:"table-page","data-focused":i!==null||void 0,children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[b?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>S(null),children:t("Reset view")}):null,!m&&h.length>0?e("button",{type:"button",className:"secondary","aria-haspopup":"dialog",onClick:C,children:t("Who's at the table")}):null]})]}),n("div",{className:"table-frame","data-focused":i!==null||void 0,children:[V?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("Every knight has left the table. Choose who sits down.")}),e("button",{type:"button",onClick:C,children:t("Who's at the table")})]}):F?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(Bt,{onHandle:c,focus:i,onFocus:S,...m?{onMore:()=>K("rooms")}:{onSeat:S,onSeatMenu:(s)=>{let d=k.find((p)=>p.name===s.id);if(d)H(d.key,s.at,s.via,s.source)}}}),R?e(I,{}):null,g?e(Gn,{roomKey:g.key,open:B,onBack:()=>S(null),onMenu:(s)=>{let d=s.getBoundingClientRect();H(g.key,{x:d.left,y:d.bottom},"key",s)}},g.key):null]}),x?e(Q,{fallback:null,children:e(W,{open:N,onClose:()=>v(!1)})}):null]})}export{te as TablePage};
@@ -1 +0,0 @@
1
- import{A,r,t,e,n,We}from"./chunk-index-84v7j6vh.js";import"./chunk-index-934zgd18.js";import"./chunk-index-8f9jer8r.js";import"./chunk-index-dtste2ed.js";import{Jn}from"./chunk-index-2f5nfekb.js";import{ft}from"./chunk-index-1f0j335v.js";import{D}from"./chunk-index-9nents16.js";import{tt}from"./chunk-index-satam151.js";function u({view:s}){let o=A(),[a,m]=r(!1),l=s.muted===!0;return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",htmlFor:o,children:[e(We,{view:s,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:s.displayName}),l?e("span",{className:"meta",children:t("Off the table")}):null]}),e(ft,{id:o,checked:!l,label:s.displayName,busy:a,onChange:async(i)=>{m(!0),await tt(s.key,!i),m(!1)}})]})})}function g(s){let o=Jn();return e(D,{open:s.open,title:t("Who's at the table"),onClose:s.onClose,children:n("div",{className:"stack table-seats",children:[e("p",{className:"meta",children:t("A knight who leaves the table is muted: its room stops pushing to you. A card that waits for you is always pushed.")}),e("ul",{className:"menu",children:o.map((a)=>e(u,{view:a},a.key))})]})})}export{g as TableSeatsSheet};
@@ -1 +0,0 @@
1
- import{wn,sr,or,Tt,en,tn,Kn}from"./chunk-index-datrrs6b.js";import{Mt,qt}from"./chunk-index-31ays46f.js";var le="http://www.w3.org/2000/svg",t=(d,i={},p)=>{let y=document.createElementNS(le,d);for(let[E,R]of Object.entries(i))y.setAttribute(E,String(R));return p?.appendChild(y),y},ce=(d)=>{let i=/<svg[^>]*\swidth=/.test(d)?d:d.replace("<svg",'<svg width="256" height="256"');return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`},de=0;function fe(d,i){let p=i||d<=6?1:2;return{rows:p,perRow:Math.max(1,Math.ceil(d/p))}}function ye(d,i){let p=`t2d${++de}`,y=window.matchMedia("(prefers-reduced-motion: reduce)"),E=i.reducedMotion==="auto"||i.reducedMotion===void 0?y.matches:i.reducedMotion,R=i.labels??qt,{theme:O,scheme:I}=i,M=[],_=new Map,A=new Map,T=i.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 Q(e,s,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":s.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":s.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 x(){let e=wn(O,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 s=i.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,s?60:200);m.setAttribute("viewBox",`0 0 ${c} ${o}`),m.replaceChildren();let g=Math.max(M.length,1),{rows:a,perRow:l}=fe(g,s);t("rect",{width:c,height:o,fill:e.css.bg},m);let w=t("defs",{},m),C=c/2,N=s?o*0.82:o*0.62;if(t("ellipse",{cx:C,cy:N,rx:c*0.47,ry:s?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},m),!s)t("ellipse",{cx:C,cy:N,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 F=c/l,q=s?o*0.95:o/(a+0.6),h=Math.max(46,Math.min(F*0.94,132,q*1.05)),u=h*0.72,n=h*1.05;Q(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 te=(r)=>{if(s)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),oe=Math.min(l,g-k*l),ne=b-k*l,re=c/oe*(ne+0.5),ie=te(k),H=A.get(r.id)??"idle",f=t("g",{class:"seat","data-seat":r.id,"data-state":H,...T===r.id?{"data-focus":""}:{},transform:`translate(${re.toFixed(1)} ${ie.toFixed(1)})`,tabindex:i.listBelow?-1:0,role:"button","aria-label":R.seat(r.name,H),color:e.css.text,...i.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 B=t("g",{class:"lift"},f),j=_.get(r.id);if(j)t("image",{href:ce(j),x:-n/2,y:-u-n*0.78,width:n,height:n*0.88,filter:`url(#${p}-rim)`,...r.dim?{opacity:0.55}:{}},B);else{t("circle",{cx:0,cy:-u-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},B);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":Tt},B);v.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let X=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-X*0.2,width:h*1.08,height:X,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},f);let L=Math.max(11,Math.min(15,h*0.14)),K=Math.min(Math.max(h*0.9,L*5.5+14),Math.max(h*0.9,r.name.length*L*0.62+18),F*0.98),se=L+8;t("rect",{class:"plate",x:-K/2,y:-u*0.78,width:K,height:se,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},f);let ae=t("text",{x:0,y:-u*0.78+L+1.5,"text-anchor":"middle","font-size":L,"font-weight":700,"font-family":Tt,fill:e.plateInk},f);ae.textContent=or(r.name,(K-8)/L);let Z=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-u-n*0.78})`},f)),V=H==="done",D=H==="error",P=e.gold;if(V)P=sr.done;else if(D)P=sr.error;t("circle",{r:n*0.15,fill:P,stroke:e.ink,"stroke-width":2},Z);let U=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":Tt,fill:V||D?"#fff":e.ink},Z);if(U.textContent="!",V)U.textContent="✓";else if(D)U.textContent="✕";let J=t("g",{class:"orbit"},f);t("circle",{cx:n*0.4,cy:-u-n*0.5,r:n*0.05,fill:r.color},J),t("circle",{cx:-n*0.4,cy:-u-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},J),f.addEventListener("click",(v)=>i.onSeatClick({id:r.id,name:r.name,at:Mt(v,f)})),f.addEventListener("keydown",(v)=>{if(v.key==="Enter"||v.key===" ")v.preventDefault(),i.onSeatClick({id:r.id,name:r.name,at:Mt({clientX:0,clientY:0,detail:0},f)})})}),!s){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":Tt,fill:e.gold},m);k.textContent=or(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=wn(O,I),o=(g,a)=>{let l=setTimeout(()=>{G.delete(l),g()},a);G.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()},tn)}for(let g of e.leaving){let a=s.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,N,F]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let q=t("circle",{class:"puff",cx:C,cy:N,r:F,fill:c.paper,stroke:c.ink,"stroke-width":3},l);q.style.animationDelay=`${w*40}ms`}m.appendChild(l),o(()=>l.remove(),en)}},W=new ResizeObserver(x);W.observe(d);let Y=()=>{if(i.reducedMotion==="auto"||i.reducedMotion===void 0)z.setReducedMotion(y.matches)};y.addEventListener("change",Y);let z={kind:"svg",setTheme(e,s){O=e,I=s,x()},setSeats(e){let s=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)_.set(o.id,o.avatarSvg);if(x(),s.length>0||c.size>0)ee(Kn(s,e.map((o)=>o.id),E),c)},setState(e,s){if(A.get(e)===s)return;A.set(e,s),x()},setAvatar(e,s){return _.set(e,s),x(),Promise.resolve()},setReducedMotion(e){E=e,x()},resetCamera(){T=null,x(),i.onFocus?.(null)},focus(e){if(e===T)return;T=e,x()},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 G)clearTimeout(e);G.clear(),W.disconnect(),y.removeEventListener("change",Y),S.remove()}};return z.setSeats(i.seats),z}export{ye as createTable2D};