pi-roundtable-web 0.26.2 → 0.26.3

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 (196) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +16 -1
  3. package/dist/chunk-account-hck7mhf8.js +1 -0
  4. package/dist/{chunk-action-menu-ec9jqtxq.js → chunk-action-menu-beqh40k6.js} +1 -1
  5. package/dist/chunk-agent-znnth24t.js +1 -0
  6. package/dist/chunk-arranged-rooms-wfakrddk.js +1 -0
  7. package/dist/chunk-bulk-actions-c4tkvk9g.js +1 -0
  8. package/dist/chunk-character-creator-qwcsdytw.js +1 -0
  9. package/dist/{chunk-codeeditor-jm2sm333.js → chunk-codeeditor-6xavqntt.js} +2 -2
  10. package/dist/chunk-confirm-z95j9jt3.js +1 -0
  11. package/dist/{chunk-connectors-mhnw6d79.js → chunk-connectors-7xqsg5q5.js} +1 -1
  12. package/dist/{chunk-conversations-yjyq4g1y.js → chunk-conversations-zc4mv6vj.js} +1 -1
  13. package/dist/{chunk-drag-nyq52ck7.js → chunk-drag-0mefcvp3.js} +1 -1
  14. package/dist/{chunk-entry-red1597w.js → chunk-entry-hrt97qed.js} +1 -1
  15. package/dist/chunk-folder-list-nemtqbnc.js +1 -0
  16. package/dist/chunk-folds-xpg9qcwf.js +1 -0
  17. package/dist/chunk-gate-86r8a2vf.js +1 -0
  18. package/dist/chunk-group-scene-g24kxz6f.js +1 -0
  19. package/dist/chunk-group-table-851jm8ef.js +1 -0
  20. package/dist/chunk-host-icons-23zhqpmc.js +1 -0
  21. package/dist/chunk-host-picture-8tnh2wam.js +1 -0
  22. package/dist/chunk-host-state-j41sp065.js +1 -0
  23. package/dist/chunk-host-ui-cje7a9t9.js +1 -0
  24. package/dist/chunk-index-1fn8q4ps.js +2 -0
  25. package/dist/{chunk-index-kfv996qe.js → chunk-index-30vw4nhh.js} +35 -3
  26. package/dist/{chunk-index-tmx30r1w.js → chunk-index-3aa5czxj.js} +2 -2
  27. package/dist/chunk-index-3k7sdph2.js +1 -0
  28. package/dist/{chunk-index-7bbqtdce.js → chunk-index-3wbyq10m.js} +2 -2
  29. package/dist/{chunk-index-9nents16.js → chunk-index-47yspxa4.js} +2 -2
  30. package/dist/chunk-index-4s1qj9we.js +2 -0
  31. package/dist/chunk-index-5fz5e1ct.js +2 -0
  32. package/dist/{chunk-index-kw85ajap.js → chunk-index-67p2sc14.js} +3 -3
  33. package/dist/{chunk-index-0xj30mzw.js → chunk-index-6c8mewwy.js} +12 -12
  34. package/dist/{chunk-index-934zgd18.js → chunk-index-84wbc80d.js} +2 -2
  35. package/dist/{chunk-index-y00wke93.js → chunk-index-8eexybcx.js} +2 -2
  36. package/dist/{chunk-index-1f0j335v.js → chunk-index-agrvqf5b.js} +2 -2
  37. package/dist/chunk-index-azrnzgev.js +2 -0
  38. package/dist/chunk-index-c2ag3qw2.js +2 -0
  39. package/dist/chunk-index-e90kztkx.js +4 -0
  40. package/dist/chunk-index-efgm0066.js +2 -0
  41. package/dist/{chunk-index-b7jjca66.js → chunk-index-eh0wb6g0.js} +2 -2
  42. package/dist/{chunk-index-yrhbhmxz.js → chunk-index-eyc2rkq5.js} +2 -2
  43. package/dist/{chunk-index-datrrs6b.js → chunk-index-fe0m5mht.js} +2 -2
  44. package/dist/{chunk-index-f3b5nch2.js → chunk-index-gt42wjby.js} +3 -3
  45. package/dist/{chunk-index-6tpr6r6d.js → chunk-index-hc0dgmrs.js} +2 -2
  46. package/dist/{chunk-index-0n6ja7my.js → chunk-index-hczrjnky.js} +1 -1
  47. package/dist/chunk-index-hrtyanda.js +2 -0
  48. package/dist/chunk-index-j479p62w.js +2 -0
  49. package/dist/{chunk-index-cmxs5y22.js → chunk-index-jq970hsd.js} +3 -3
  50. package/dist/chunk-index-kankja6p.js +50 -0
  51. package/dist/chunk-index-kb44jp50.js +2 -0
  52. package/dist/{chunk-index-029209sy.js → chunk-index-m65cv329.js} +2 -2
  53. package/dist/chunk-index-mnwdbb4n.js +2 -0
  54. package/dist/chunk-index-n6zrc05a.js +2 -0
  55. package/dist/chunk-index-n93wqszt.js +8 -0
  56. package/dist/{chunk-index-43k1rjmx.js → chunk-index-nrexxkar.js} +2 -2
  57. package/dist/chunk-index-pgxgq61x.js +2 -0
  58. package/dist/chunk-index-q5vzjqr5.js +2 -0
  59. package/dist/chunk-index-qqwk157d.js +2 -0
  60. package/dist/{chunk-index-ewj52be9.js → chunk-index-r1v895tj.js} +2 -2
  61. package/dist/chunk-index-r3tqhew8.js +2 -0
  62. package/dist/chunk-index-raf772z6.js +2 -0
  63. package/dist/{chunk-index-smw1n2pt.js → chunk-index-rcxz5w5d.js} +5 -5
  64. package/dist/chunk-index-rg9vh59e.js +1 -0
  65. package/dist/chunk-index-sxq69p1f.js +2 -0
  66. package/dist/chunk-index-taq2psr6.js +2 -0
  67. package/dist/{chunk-index-frwa2fmc.js → chunk-index-tsxsy4qs.js} +2 -2
  68. package/dist/chunk-index-wc83vb0a.js +2 -0
  69. package/dist/chunk-index-xbs8q4kn.js +2 -0
  70. package/dist/chunk-index-xxbveevc.js +2 -0
  71. package/dist/chunk-index-zx6yka30.js +2 -0
  72. package/dist/chunk-lang-css-yrc25qk9.js +1 -0
  73. package/dist/{chunk-lang-dockerfile-46rk929v.js → chunk-lang-dockerfile-tjxsnhr9.js} +1 -1
  74. package/dist/{chunk-lang-go-qb0qdpg7.js → chunk-lang-go-drmfa25k.js} +3 -3
  75. package/dist/chunk-lang-html-rwe8epvf.js +1 -0
  76. package/dist/chunk-lang-javascript-d6x6qjtg.js +1 -0
  77. package/dist/{chunk-lang-json-1q4fp694.js → chunk-lang-json-790swysy.js} +1 -1
  78. package/dist/{chunk-lang-markdown-5w7t28wa.js → chunk-lang-markdown-483dkxcq.js} +5 -5
  79. package/dist/{chunk-lang-python-3dq0p4rf.js → chunk-lang-python-v9s40bzj.js} +2 -2
  80. package/dist/{chunk-lang-rust-70pa0agr.js → chunk-lang-rust-z4gry1bf.js} +1 -1
  81. package/dist/{chunk-lang-shell-4pxt7hf4.js → chunk-lang-shell-egsvk8rj.js} +1 -1
  82. package/dist/{chunk-lang-sql-kgcbh2a9.js → chunk-lang-sql-75j3denr.js} +2 -2
  83. package/dist/{chunk-lang-toml-99t95pab.js → chunk-lang-toml-7dbjvhex.js} +1 -1
  84. package/dist/chunk-lang-typescript-1rv9vdcz.js +1 -0
  85. package/dist/{chunk-lang-xml-mnbv9yfa.js → chunk-lang-xml-jg1sv4h2.js} +1 -1
  86. package/dist/{chunk-lang-yaml-2by9g1dy.js → chunk-lang-yaml-g3v7s5je.js} +1 -1
  87. package/dist/chunk-layout-actions-6assr93n.js +1 -0
  88. package/dist/chunk-menu-items-9szcza00.js +2 -0
  89. package/dist/chunk-mode-toggle-bzbq7ycq.js +1 -0
  90. package/dist/{chunk-note-row-72n6cqyk.js → chunk-note-row-g20h11pm.js} +2 -2
  91. package/dist/chunk-notes-gc8bssxn.js +1 -0
  92. package/dist/chunk-notice-bell-jehad6sx.js +1 -0
  93. package/dist/{chunk-notices-evny44be.js → chunk-notices-prqkv7ge.js} +1 -1
  94. package/dist/chunk-onboarding-mdtc2mb7.js +1 -0
  95. package/dist/{chunk-overview-42h45ehd.js → chunk-overview-2j1s6kqg.js} +1 -1
  96. package/dist/chunk-palette-4qt6ewem.js +1 -0
  97. package/dist/chunk-placement-items-2eect825.js +1 -0
  98. package/dist/{chunk-profile-bqcgkgk4.js → chunk-profile-pfzyc04p.js} +1 -1
  99. package/dist/chunk-prompt-history-2bcp2rky.js +1 -0
  100. package/dist/chunk-prompts-052mb05y.js +1 -0
  101. package/dist/chunk-room-confirms-asvmjh5s.js +1 -0
  102. package/dist/{chunk-room-menu-7s0feajw.js → chunk-room-menu-dm2r2hk6.js} +1 -1
  103. package/dist/chunk-rooms-menu-button-32hemzxc.js +1 -0
  104. package/dist/{chunk-schedules-zba7krac.js → chunk-schedules-64h9gfwn.js} +1 -1
  105. package/dist/{chunk-seat-menu-ca5p4e9q.js → chunk-seat-menu-vrpc40v9.js} +1 -1
  106. package/dist/chunk-sheet-hosts-jaqx490x.js +1 -0
  107. package/dist/chunk-shortcut-help-bdbkdcs9.js +26 -0
  108. package/dist/chunk-shortcuts-qft33r8t.js +1 -0
  109. package/dist/{chunk-skill-editor-n0y9pd90.js → chunk-skill-editor-z3dx2895.js} +2 -2
  110. package/dist/{chunk-skills-ea4vb2s4.js → chunk-skills-4jfcv39n.js} +1 -1
  111. package/dist/chunk-switcher-list-xysjd4tw.js +1 -0
  112. package/dist/{chunk-tab-dot-4tkpxqeh.js → chunk-tab-dot-1p68ybf8.js} +1 -1
  113. package/dist/chunk-table-0v4q4dx3.js +1 -0
  114. package/dist/{chunk-table-seats-qeytqe0m.js → chunk-table-seats-f683hx8k.js} +1 -1
  115. package/dist/{chunk-table2d-18y029k9.js → chunk-table2d-1a6atjhj.js} +1 -1
  116. package/dist/{chunk-table3d-q2s31ae0.js → chunk-table3d-k0ffeffj.js} +23 -23
  117. package/dist/chunk-thread-actions-4rpfg4fq.js +1 -0
  118. package/dist/chunk-thread-cards-t794fp4d.js +1 -0
  119. package/dist/chunk-thread-list-1pcygpka.js +1 -0
  120. package/dist/chunk-transcript-km4e3aey.js +1 -0
  121. package/dist/chunk-where-phjwqggy.js +1 -0
  122. package/dist/{chunk-workspace-h0p32ygy.js → chunk-workspace-d064v56e.js} +2 -2
  123. package/dist/chunk-zh-tw-qf18hcxc.js +1 -0
  124. package/dist/index.html +1 -1
  125. package/dist/sw.js +1 -1
  126. package/package.json +2 -2
  127. package/src/api-types.ts +22 -0
  128. package/src/app/routes.ts +105 -2
  129. package/src/app/threads.ts +11 -0
  130. package/src/host/host-app.ts +15 -1
  131. package/src/host/read-all.ts +80 -0
  132. package/src/host/reads.ts +67 -0
  133. package/src/i18n/zh-tw.ts +18 -4
  134. package/dist/chunk-account-nhpd9j90.js +0 -1
  135. package/dist/chunk-agent-d1xfrawq.js +0 -1
  136. package/dist/chunk-arranged-rooms-bga8yk2v.js +0 -1
  137. package/dist/chunk-character-creator-k67f77w5.js +0 -1
  138. package/dist/chunk-confirm-wc5xraev.js +0 -1
  139. package/dist/chunk-folder-list-x56y26yq.js +0 -1
  140. package/dist/chunk-folds-3p7s2nvx.js +0 -1
  141. package/dist/chunk-gate-h41bv4y9.js +0 -1
  142. package/dist/chunk-group-scene-7eb6jyev.js +0 -1
  143. package/dist/chunk-group-table-rca48kt0.js +0 -1
  144. package/dist/chunk-host-icons-x318gjqp.js +0 -1
  145. package/dist/chunk-host-picture-xswcakgy.js +0 -1
  146. package/dist/chunk-host-state-bpahvk54.js +0 -1
  147. package/dist/chunk-host-ui-tsbwwk38.js +0 -1
  148. package/dist/chunk-index-066vzexw.js +0 -2
  149. package/dist/chunk-index-0h4h76kw.js +0 -2
  150. package/dist/chunk-index-2f5nfekb.js +0 -8
  151. package/dist/chunk-index-31ays46f.js +0 -2
  152. package/dist/chunk-index-4gk88a0x.js +0 -4
  153. package/dist/chunk-index-4mf29sbx.js +0 -2
  154. package/dist/chunk-index-51n20yhb.js +0 -2
  155. package/dist/chunk-index-84v7j6vh.js +0 -50
  156. package/dist/chunk-index-8f9jer8r.js +0 -2
  157. package/dist/chunk-index-91z3g774.js +0 -1
  158. package/dist/chunk-index-9w0sar6s.js +0 -2
  159. package/dist/chunk-index-a768zmp6.js +0 -2
  160. package/dist/chunk-index-c5x70d9g.js +0 -2
  161. package/dist/chunk-index-cwc1vvpw.js +0 -2
  162. package/dist/chunk-index-d85x96q0.js +0 -2
  163. package/dist/chunk-index-dep2e3f3.js +0 -2
  164. package/dist/chunk-index-dtste2ed.js +0 -2
  165. package/dist/chunk-index-grkczq2c.js +0 -2
  166. package/dist/chunk-index-gzvkpe3e.js +0 -2
  167. package/dist/chunk-index-satam151.js +0 -2
  168. package/dist/chunk-index-th43f690.js +0 -2
  169. package/dist/chunk-index-ths2hxpe.js +0 -1
  170. package/dist/chunk-index-y4sqmenv.js +0 -2
  171. package/dist/chunk-index-zd76pr2k.js +0 -2
  172. package/dist/chunk-lang-css-fa7c0zfj.js +0 -1
  173. package/dist/chunk-lang-html-47mf2y0v.js +0 -1
  174. package/dist/chunk-lang-javascript-d32qrvxz.js +0 -1
  175. package/dist/chunk-lang-typescript-4k1d8z7s.js +0 -1
  176. package/dist/chunk-layout-actions-cgghzj1w.js +0 -1
  177. package/dist/chunk-menu-items-24cfwawa.js +0 -2
  178. package/dist/chunk-mode-toggle-v4baz3r1.js +0 -1
  179. package/dist/chunk-notes-83s3tsey.js +0 -1
  180. package/dist/chunk-notice-bell-a4ty5h1p.js +0 -1
  181. package/dist/chunk-onboarding-q1avjbrx.js +0 -1
  182. package/dist/chunk-palette-e44qepmh.js +0 -1
  183. package/dist/chunk-placement-items-v466t0sv.js +0 -1
  184. package/dist/chunk-prompt-history-hgbtcn4b.js +0 -1
  185. package/dist/chunk-prompts-czs8y6r1.js +0 -1
  186. package/dist/chunk-room-confirms-h8cdj3ng.js +0 -1
  187. package/dist/chunk-rooms-menu-button-gawqvpsr.js +0 -1
  188. package/dist/chunk-sheet-hosts-ssbz6hf2.js +0 -1
  189. package/dist/chunk-switcher-list-pj5csqr9.js +0 -1
  190. package/dist/chunk-table-j8nmtdnn.js +0 -1
  191. package/dist/chunk-thread-actions-w3eadnh7.js +0 -1
  192. package/dist/chunk-thread-cards-fbpky3c9.js +0 -1
  193. package/dist/chunk-thread-list-pghe84be.js +0 -1
  194. package/dist/chunk-transcript-eqzxgqys.js +0 -1
  195. package/dist/chunk-where-ygyr4jdj.js +0 -1
  196. package/dist/chunk-zh-tw-k6xx1hp2.js +0 -1
@@ -1 +1 @@
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
+ import{h,r,t,g,e,n,o,v,d,_,tt,$t,Ne,_t}from"./chunk-index-kankja6p.js";import{Ee}from"./chunk-index-qqwk157d.js";import{pt}from"./chunk-index-agrvqf5b.js";import{L}from"./chunk-index-47yspxa4.js";import{nt}from"./chunk-index-q5vzjqr5.js";var p="room-menu-yolo",N="room-menu-long",f="room-menu-mute";function P(a){let[l,m]=r(!1),i=_().app?.modes!==!1,b=d((s)=>s.rooms[a.room]?.view?.home===!1,a.room),u=d((s)=>s.pins.includes(a.room),a.room),c=a.mode??{yolo:!1,longRunning:!1},y=async(s)=>{m(!0),await $t(a.room,{longRunning:s}),m(!1)};return e(L,{open:a.open,title:t("Room menu"),onClose:a.onClose,children:n("ul",{className:"menu",children:[a.readOnly?e("li",{children:a.parent?n("a",{className:"menu-item menu-link",href:v("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(o,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(o,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:f,children:[e("span",{className:"menu-icon",children:e(o,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(pt,{id:f,checked:!a.muted,label:t("Notifications"),onChange:async(s)=>{m(!0),await nt(a.room,!s),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(o,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(pt,{id:p,checked:c.yolo,label:t("Yolo mode"),onChange:(s)=>{if(s)a.onAskYolo();else m(!0),$t(a.room,{yolo:!1}).then(()=>m(!1))},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(o,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(pt,{id:N,checked:c.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(),tt(a.agent)},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit knight")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(o,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),_t({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(o,{name:"chevron",size:16})]})}):null,a.readOnly||!b?null:n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(h("6assr93n"),import("./chunk-layout-actions-6assr93n.js")).then((s)=>s.pinRoom(a.room,!u))},children:[e("span",{className:"menu-icon",children:e(o,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:u?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(),Ee({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(o,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(o,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),Ne({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{P as RoomMenu};
@@ -0,0 +1 @@
1
+ import{t,e,o,d}from"./chunk-index-kankja6p.js";import"./chunk-index-qqwk157d.js";import"./chunk-index-raf772z6.js";import{Wn}from"./chunk-index-r3tqhew8.js";import"./chunk-index-sxq69p1f.js";import"./chunk-index-xxbveevc.js";function n(){if(!d((r)=>r.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(r)=>Wn(r.currentTarget),children:e(o,{name:"more",size:18})})}export{n as default};
@@ -1 +1 @@
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
+ import{r,t,c,e,n,o,v,O,p,w,m,k,P,_,ie}from"./chunk-index-kankja6p.js";import{K}from"./chunk-index-3wbyq10m.js";import{ye}from"./chunk-index-wc83vb0a.js";import"./chunk-index-47yspxa4.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 i=d,s=typeof i.time==="string"?i.time:"";switch(i.kind){case"once":return t("Once on {date} at {time}",{date:String(i.date??""),time:s});case"every":return Number(i.everyDays)===1?t("Every day at {time}",{time:s}):t("Every {count} days at {time}",{count:Number(i.everyDays),time:s});case"weekly":{let l=Array.isArray(i.weekdays)?i.weekdays.map((u)=>t(g[String(u)]??String(u))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:s})}default:return""}}function L(){let{timeZone:d}=_(),[i,s]=r(0),[l,u]=r(),{data:f,error:y}=ye(()=>O.schedules(),`schedules:${i}`);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(w,{}):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:v("room",a.room),children:a.label}):a.label," ","· ",t("set by {name}",{name:a.createdBy})]})]}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Cancel {title}",{title:a.title}),onClick:()=>u(a),children:e(o,{name:"trash"})})]},a.id))}),e(K,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>u(void 0),onConfirm:async()=>{if(!l)return;await O.cancelSchedule(l.id),s((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 +1 @@
1
- import{dn}from"./chunk-index-84v7j6vh.js";function M(t,l,d,g){let r,a=-1,i=!1,f=(e)=>e instanceof Element?e.closest("button, [data-seat]")??t:t,o=()=>{r?.cancel(),r=void 0,a=-1},p=(e)=>{if(i=!1,e.pointerType==="mouse"||!e.isPrimary)return;o();let n=l(e.target,e.clientX,e.clientY);if(!n)return;let u=f(e.target);a=e.pointerId,r=new dn((s)=>{if(i=!0,typeof navigator.vibrate==="function")navigator.vibrate(10);d({...n,at:s,via:"hold",source:u})},g),r.begin(e.clientX,e.clientY)},m=(e)=>{if(e.pointerId===a&&r&&!i){if(!r.move(e.clientX,e.clientY))o()}},c=(e)=>{if(e.pointerId===a)o()},E=(e)=>{let n=l(e.target,e.clientX,e.clientY);if(!n)return;if(e.preventDefault(),i)return;o(),d({...n,at:{x:e.clientX,y:e.clientY},via:"contextmenu",source:f(e.target)})},v=(e)=>{if(i=!1,e.key!=="ContextMenu"&&!(e.key==="F10"&&e.shiftKey))return;let n=l(e.target,-1,-1);if(!n)return;e.preventDefault();let u=f(e.target),s=u.getBoundingClientRect();d({...n,at:{x:s.left+Math.min(s.width/2,48),y:s.top+24},via:"key",source:u})},L=(e)=>{if(!i)return;i=!1,e.preventDefault(),e.stopPropagation()};return t.addEventListener("pointerdown",p),t.addEventListener("pointermove",m),t.addEventListener("pointerup",c),t.addEventListener("pointercancel",c),t.addEventListener("contextmenu",E),t.addEventListener("keydown",v),t.addEventListener("click",L,!0),()=>{o(),t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",m),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),t.removeEventListener("contextmenu",E),t.removeEventListener("keydown",v),t.removeEventListener("click",L,!0)}}export{M as attachSeatMenu};
1
+ import{hn}from"./chunk-index-kankja6p.js";function M(t,l,d,g){let r,a=-1,i=!1,f=(e)=>e instanceof Element?e.closest("button, [data-seat]")??t:t,o=()=>{r?.cancel(),r=void 0,a=-1},p=(e)=>{if(i=!1,e.pointerType==="mouse"||!e.isPrimary)return;o();let n=l(e.target,e.clientX,e.clientY);if(!n)return;let u=f(e.target);a=e.pointerId,r=new hn((s)=>{if(i=!0,typeof navigator.vibrate==="function")navigator.vibrate(10);d({...n,at:s,via:"hold",source:u})},g),r.begin(e.clientX,e.clientY)},m=(e)=>{if(e.pointerId===a&&r&&!i){if(!r.move(e.clientX,e.clientY))o()}},c=(e)=>{if(e.pointerId===a)o()},E=(e)=>{let n=l(e.target,e.clientX,e.clientY);if(!n)return;if(e.preventDefault(),i)return;o(),d({...n,at:{x:e.clientX,y:e.clientY},via:"contextmenu",source:f(e.target)})},v=(e)=>{if(i=!1,e.key!=="ContextMenu"&&!(e.key==="F10"&&e.shiftKey))return;let n=l(e.target,-1,-1);if(!n)return;e.preventDefault();let u=f(e.target),s=u.getBoundingClientRect();d({...n,at:{x:s.left+Math.min(s.width/2,48),y:s.top+24},via:"key",source:u})},L=(e)=>{if(!i)return;i=!1,e.preventDefault(),e.stopPropagation()};return t.addEventListener("pointerdown",p),t.addEventListener("pointermove",m),t.addEventListener("pointerup",c),t.addEventListener("pointercancel",c),t.addEventListener("contextmenu",E),t.addEventListener("keydown",v),t.addEventListener("click",L,!0),()=>{o(),t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",m),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),t.removeEventListener("contextmenu",E),t.removeEventListener("keydown",v),t.removeEventListener("click",L,!0)}}export{M as attachSeatMenu};
@@ -0,0 +1 @@
1
+ import{h,Q,S,X,s,A,N,a,r,t,c,g,e,n,o,F,d,le,O,u,p,w,m,k,pn,Io,Do,Ne,ui,qo,he,An}from"./chunk-index-kankja6p.js";import{co}from"./chunk-index-n6zrc05a.js";import{K}from"./chunk-index-3wbyq10m.js";import"./chunk-index-qqwk157d.js";import"./chunk-index-kb44jp50.js";import{xe,wt,Ji}from"./chunk-index-efgm0066.js";import{bn}from"./chunk-index-eyc2rkq5.js";import{$e,ht}from"./chunk-index-e90kztkx.js";import{pt}from"./chunk-index-agrvqf5b.js";import{Ue}from"./chunk-index-jq970hsd.js";import"./chunk-index-j479p62w.js";import{L}from"./chunk-index-47yspxa4.js";import{nt}from"./chunk-index-q5vzjqr5.js";import"./chunk-index-hrtyanda.js";function se(i){return n("fieldset",{className:"field",children:[e("legend",{children:i.label}),e("div",{className:"option-chips",children:i.options.map((f)=>e("button",{type:"button","aria-pressed":f.value===i.value,className:"option-chip",onClick:()=>i.onChange(f.value),children:f.label},f.value))})]})}var Re=S(()=>(h("2bcp2rky"),import("./chunk-prompt-history-2bcp2rky.js")).then((i)=>({default:i.HistorySheet}))),Te=S(()=>(h("qwcsdytw"),import("./chunk-character-creator-qwcsdytw.js")).then((i)=>({default:i.CharacterCreator}))),Fe=["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)"),Oe=c("Automatic"),me=(i)=>i==="auto"?t(Oe):t(ve[i]??i),fe=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??B,thinking:i.thinking??B});function ge(i,f){return{...f.displayName!==i.displayName?{displayName:f.displayName}:{},...f.prompt!==i.prompt?{prompt:f.prompt}:{},...f.model!==(i.model??B)?{model:f.model}:{},...f.thinking!==(i.thinking??B)?{thinking:f.thinking}:{}}}function ye(){let i=Do(),f=a(i);if(i)f.current=i;let l=f.current,C=i!==void 0;if(s(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)pn()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(L,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:pn,children:e(Ve,{name:l.name,opened:l.id},l.name)})}function Ve({name:i,opened:f}){let[l,C]=r(),[P,I]=r([]),[E,z]=r(),[M,x]=r(),[v,T]=r(!1),[R,G]=r(!1),[ee,J]=r(!1),[U,j]=r(!1),te=An(l?.room??""),q=a(null),W=l!==void 0,_=d((y)=>l?y.rooms[l.room]?.view?.muted===!0:!1,l?.room??""),[ae,V]=r(!1),ne=d((y)=>l?y.rooms[l.room]?.view?.coordinator===!0:!1,l?.room??""),Y=A(),Z=A(),D=A();s(()=>{if(!W||!Io()?.look)return;q.current?.scrollIntoView({block:"start"}),q.current?.focus({preventScroll:!0})},[W,f]);let b=a({});b.current={profile:l,draft:M},s(()=>{let y=!0;return Promise.all([O.agent(i),O.models()]).then(([ie,Pe])=>{if(!y)return;let{profile:ue,draft:re}=b.current,He=ue&&re&&Object.keys(ge(ue,re)).length>0;C(ie),I(Pe.models),x(He?re:fe(ie))},(ie)=>y&&z(u(ie))),()=>{y=!1}},[i,f]);let H=N(()=>l&&M?ge(l,M):{},[l,M]);if(E)return e(m,{message:E});if(!l||!M)return e(w,{});let de=Object.keys(H).length>0,Le=Array.from(new Set([B,...P,M.model])),Ie=be(l),pe=async()=>{T(!0);try{let y=await O.updateAgent(i,H);C(y),x(fe(y)),G(!1),p(t("Saved."))}catch(y){p(u(y),"danger")}finally{T(!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:D,children:[e("span",{className:"menu-icon",children:e(o,{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(pt,{id:D,checked:!_,label:t("Notifications"),busy:ae,onChange:async(y)=>{V(!0),await nt(l.room,!y),V(!1)}})]})})}),R?e(Be,{profile:l,draft:M,saving:v,onBack:()=>G(!1),onSave:pe}):n("form",{className:"stack form",onSubmit:(y)=>{if(y.preventDefault(),!de)return;if(H.prompt!==void 0)G(!0);else pe()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:M.displayName,onChange:(y)=>x({...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:()=>j(!0),children:[e(o,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>J(!0),children:[e(Ge,{}),t("Full screen")]})]})]}),e("textarea",{id:Y,rows:8,value:M.prompt,onChange:(y)=>x({...M,prompt:y.target.value})})]}),e(se,{label:t("Model"),value:M.model,onChange:(y)=>x({...M,model:y}),options:Le.map((y)=>({value:y,label:y===B?Ie:y}))}),e(se,{label:t("Thinking level"),value:M.thinking,onChange:(y)=>x({...M,thinking:y}),options:Fe.map((y)=>({value:y,label:t(ve[y])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!de||v,children:v?t("Saving…"):H.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(ze,{name:i,opened:f}),n("section",{className:"card stack",ref:q,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(Q,{fallback:e(w,{}),children:e(Te,{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:()=>{pn(),Ne({kind:"archive",room:l.room,name:l.displayName})},children:t("Archive {name}",{name:l.displayName})})})]}),U?e(Q,{fallback:null,children:e(Re,{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)=>{x({...M,prompt:y}),j(!1)},onClose:()=>j(!1)})}):null,e(L,{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)=>x({...M,prompt:y.target.value})})})]})}function ze({name:i,opened:f}){let[l,C]=r(),[P,I]=r(),[E,z]=r(),M=A();if(s(()=>{let v=!0;return xe.skills(i).then((T)=>v&&C(T),(T)=>{if(v&&!(T instanceof le&&T.status===404))z(u(T))}),()=>{v=!1}},[i,f]),E)return e(m,{message:E});if(!l)return null;let x=async(v,T)=>{I(v);try{C(await xe.setSkills(i,T?{add:[v]}:{remove:[v]}))}catch(R){p(u(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,T)=>{let R=`${M}-${T}`;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(pt,{id:R,checked:v.carried,label:v.name,busy:P===v.name,disabled:v.builtin,onChange:(G)=>x(v.name,G)})]})},v.name)})})]})}var Ge=()=>e("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e("path",{d:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"})});function Be(i){let{profile:f,draft:l}=i,C=a(null);s(()=>C.current?.focus(),[]);let P=[];if(l.displayName!==f.displayName)P.push({label:t("Name"),before:f.displayName,after:l.displayName});let I=(E)=>E===B?be(f):E;if(l.model!==(f.model??B))P.push({label:t("Model"),before:I(f.model??B),after:I(l.model)});if(l.thinking!==(f.thinking??B))P.push({label:t("Thinking level"),before:me(f.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(ht,{label:t("Prompt"),before:f.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 ke(){let[i,f]=r(),[l,C]=r(),[P,I]=r(),[E,z]=r(),M=X(async()=>{try{f((await xe.archive()).entries),C(void 0)}catch(v){C(u(v))}},[]);s(()=>{M()},[M]);let x=async(v)=>{I(v.name);try{if(v.kind==="agent")await xe.restoreAgent(v.name);else await xe.restoreGroup(v.name);await wt(),p(t("Restored {name}.",{name:v.displayName})),await M()}catch(T){p(u(T),"danger")}finally{I(void 0)}};if(l&&!i)return e(m,{message:l});if(!i)return e(w,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived knights and groups no longer answer. Their history is kept until you delete them.")}),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(o,{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:()=>x(v),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:P===v.name,onClick:()=>z(v),children:t("Delete")})]},`${v.kind}:${v.name}`))}),e(K,{open:E!==void 0,title:t("Delete {name}?",{name:E?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>z(void 0),onConfirm:async()=>{if(!E)return;if(E.kind==="agent")await xe.deleteAgent(E.name);else await xe.deleteGroup(E.name);await wt(),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 we=/^[a-z0-9-]{1,32}$/,Ce=2,Se=6,oe="\x00";function Ke(){let i=d((f)=>f.order.flatMap((l)=>{let C=f.rooms[l]?.view;return C?.kind==="agent"?[`${C.name}${oe}${C.displayName}`]:[]}).join(`${oe}${oe}`));return N(()=>i===""?[]:i.split(`${oe}${oe}`).map((f)=>{let[l="",C=""]=f.split(oe);return{name:l,displayName:C}}),[i])}function Ae(i){let f=Ke(),[l,C]=r(),[P,I]=r(),[E,z]=r(""),[M,x]=r(""),[v,T]=r(!1),[R,G]=r([]),[ee,J]=r(""),[U,j]=r(!1),[te,q]=r(i.name===void 0),W=A(),_=A();s(()=>{let D=i.name;if(D===void 0)return;let b=!0;return xe.group(D).then((H)=>{if(!b)return;C(H),z(H.displayName),G(H.members),J(H.host),q(!0)},(H)=>b&&I(u(H))),()=>{b=!1}},[i.name]);let ae=(D)=>f.find((b)=>b.name===D)?.displayName??D,V=R.includes(ee)?ee:R[0]??"",ne=l===void 0?!0:E.trim()!==l.displayName||R.join(",")!==l.members.join(",")||V!==l.host,Y=E.trim()!==""&&R.length>=Ce&&R.length<=Se&&(l!==void 0||we.test(M));if(P&&!te)return e(m,{message:P});if(!te)return e(w,{});let Z=async()=>{j(!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}:{},...V!==l.host?{host:V}:{}}),await wt(),p(t("Saved.")),i.onDone();return}let D=await xe.createGroup({name:M,displayName:E.trim(),members:R,host:V});await wt(),p(t("Made {name}.",{name:D.displayName})),i.onDone(),F("room",D.room)}catch(D){I(u(D))}finally{j(!1)}};return n("form",{className:"stack form",onSubmit:(D)=>{if(D.preventDefault(),Y&&ne&&!U)Z()},children:[n("label",{htmlFor:W,children:[t("Name"),e("input",{id:W,value:E,autoComplete:"off",onChange:(D)=>{if(z(D.target.value),!l&&!v)x(D.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!==""&&!we.test(M),onChange:(D)=>{T(!0),x(D.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:f.map((D)=>{let b=R.includes(D.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((H)=>H!==D.name):[...R,D.name])}),e("span",{className:"menu-text",children:e("strong",{children:D.displayName})})]})},D.name)})})]}),R.length>=Ce?e(se,{label:t("Host"),value:V,onChange:J,options:R.map((D)=>({value:D,label:ae(D)}))}):null,P?e(m,{message:P}):null,n("div",{className:"actions",children:[l?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),Ne({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=S(()=>(h("qwcsdytw"),import("./chunk-character-creator-qwcsdytw.js")).then((i)=>({default:i.CharacterCreator}))),Ee=/^[a-z0-9-]{1,32}$/,ce="default";function je(i){let f=[];for(let l of i){let C=l.indexOf("/"),P=C>0?l.slice(0,C):"",I=f.find((E)=>E.provider===P&&P!=="");if(I)I.models.push(l);else f.push({provider:P,models:[l]})}return f}var qe=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Me({onDone:i}){let[f,l]=r(""),[C,P]=r(""),[I,E]=r(!1),[z,M]=r(""),[x,v]=r(ce),[T,R]=r(""),[G,ee]=r(),[J,U]=r(!1),[j,te]=r([]),[q,W]=r(),[_,ae]=r(!1),V=[A(),A(),A(),A(),A()];s(()=>{let b=!0;return O.models().then((H)=>b&&te(H.models),()=>{return}),()=>{b=!1}},[]);let ne=N(()=>bn({name:C,displayName:f,prompt:z}),[C,f,z]),Y=G?.spec??ne,Z=Ee.test(C)&&f.trim()!==""&&z.trim()!=="";if(J)return e(Q,{fallback:e(w,{}),children:e(_e,{name:C||"new",displayName:f,prompt:z,character:Y,onPick:(b,H)=>{ee({input:b,spec:H}),U(!1)},onCancel:()=>U(!1)})});let D=async()=>{ae(!0),W(void 0);try{let b={name:C,displayName:f.trim(),prompt:z,...x!==ce?{model:x}:{},...T.trim()?{task:T.trim()}:{},...G?{character:G.input}:{}},H=await xe.createAgent(b);await wt(),p(t("Made {name}.",{name:H.displayName})),i(),F("room",H.room)}catch(b){W(b instanceof le&&b.field?`${b.field}: ${u(b)}`:u(b))}finally{ae(!1)}};return n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),Z&&!_)D()},children:[n("label",{htmlFor:V[0],children:[t("Name"),e("input",{id:V[0],value:f,autoComplete:"off",onChange:(b)=>{if(l(b.target.value),!I)P(qe(b.target.value))}})]}),n("label",{htmlFor:V[1],children:[t("Permanent name"),e("input",{id:V[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:V[2],children:[t("Prompt"),e("textarea",{id:V[2],rows:6,value:z,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:V[4],children:[t("Model"),n(Ue,{id:V[4],value:x,onChange:(b)=>v(b.target.value),children:[e("option",{value:ce,children:t("Default model")}),je(j).map((b)=>b.provider===""?b.models.map((H)=>e("option",{value:H,children:H},H)):e("optgroup",{label:b.provider,children:b.models.map((H)=>e("option",{value:H,children:H},H))},b.provider))]})]}),n("label",{htmlFor:V[3],children:[t("Opening task"),e("textarea",{id:V[3],rows:3,value:T,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:f}),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")})]})]}),q?e(m,{message:q}):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 De(){let i=qo(),f=a(i);if(i)f.current=i;let l=f.current,C=i!==void 0;if(s(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)ui()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(L,{open:i!==void 0,title:We(l),size:"wide",onClose:ui,children:e("div",{className:"stack agent-sheet",children:l.kind==="new-agent"?e(Me,{onDone:ui}):l.kind==="archive"?e(ke,{}):e(Ae,{...l.name===void 0?{}:{name:l.name},onDone:ui})},l.id)})}var Xe=S(()=>(h("bdbkdcs9"),import("./chunk-shortcut-help-bdbkdcs9.js")));function Ye(){let i=co(),f=a(!1);if(i)f.current=!0;if(!f.current)return null;return e(Q,{fallback:null,children:e(Xe,{open:i})})}function va(){return n(g,{children:[e(Ji,{}),e(ye,{}),e(De,{}),e(Ye,{})]})}export{va as SheetHosts};
@@ -0,0 +1,26 @@
1
+ import{t,e,n}from"./chunk-index-kankja6p.js";import{Zn,fo}from"./chunk-index-n6zrc05a.js";import{tn}from"./chunk-index-jq970hsd.js";import{L}from"./chunk-index-47yspxa4.js";var l=`
2
+ .shortcut-list {
3
+ display: grid;
4
+ grid-template-columns: max-content minmax(0, 1fr);
5
+ align-items: center;
6
+ gap: var(--space-3) var(--space-4);
7
+ margin: 0;
8
+ }
9
+
10
+ .shortcut-list dt {
11
+ display: flex;
12
+ flex-wrap: wrap;
13
+ gap: var(--space-1);
14
+ }
15
+
16
+ .shortcut-list dd {
17
+ margin: 0;
18
+ }
19
+
20
+ .shortcut-list kbd {
21
+ display: inline-block;
22
+ min-width: 1.6rem;
23
+ text-align: center;
24
+ font-size: var(--text-sm);
25
+ }
26
+ `;function r(){let o=fo(),s=o?"⌥":"Alt",a=o?"⌘":"Ctrl";return[{keys:[s,"↑"],label:t("Previous room")},{keys:[s,"↓"],label:t("Next room")},{keys:[s,"Shift","↑"],label:t("Previous room with unread messages")},{keys:[s,"Shift","↓"],label:t("Next room with unread messages")},{keys:[a,"K"],label:t("Find a room")},{keys:["Esc"],label:t("Close the open menu or sheet, or leave the message box")},{keys:["?"],label:t("Show these shortcuts")}]}function i({open:o}){return tn("shortcut-help",l),e(L,{open:o,title:t("Keyboard shortcuts"),onClose:Zn,children:n("div",{className:"stack",children:[e("dl",{className:"shortcut-list",children:r().map((s)=>n("div",{style:{display:"contents"},children:[e("dt",{children:s.keys.map((a)=>e("kbd",{children:a},a))}),e("dd",{children:s.label})]},s.label))}),e("p",{className:"meta",children:t("In a message box the arrow shortcuts switch rooms only when it is empty or the caret is at its very start (up) or very end (down).")})]})})}export{i as default};
@@ -0,0 +1 @@
1
+ import{oi,v,F,_e,y,Je,kt}from"./chunk-index-kankja6p.js";import{rr}from"./chunk-index-rg9vh59e.js";import{Ur}from"./chunk-index-raf772z6.js";import{lo,Zn,uo}from"./chunk-index-n6zrc05a.js";import{it}from"./chunk-index-nrexxkar.js";function m(e,t){let{collapsed:o,expanded:r,current:s}=t,n=it(e,t.at),a=[],c=(i,d)=>{a.push({key:i,shown:d});let f=n.threads[i];if(!f)return;for(let l of f.open)a.push({key:l,shown:d});for(let l of f.closed)a.push({key:l,shown:d&&(r.has(l)||l===s)})};for(let i of n.home)c(i,!0);for(let i of n.pinned)c(i,!0);for(let i of n.folders){let d=!o.has(i.id)||s!==void 0&&i.rooms.includes(s);for(let f of i.rooms)c(f,d)}let u=n.folders.length>0?n.rest:[...n.restAgents,...n.restGroups];for(let i of u)c(i,!0);let{orphans:p}=n;for(let i of p.open)a.push({key:i,shown:!0});for(let i of p.closed)a.push({key:i,shown:r.has(i)||i===s});return a}function h(e,t,o,r){let s=o===1?-1:e.length;if(t!==void 0){if(s=e.findIndex((n)=>n.key===t),s<0)return}for(let n=s+o;n>=0&&n<e.length;n+=o){let a=e[n];if(a&&r(a))return a.key}return}var w=new Set(["","text","search","url","tel","email","password","number","date","datetime-local","month","time","week"]);function S(e){if(!(e instanceof HTMLElement))return;if(e instanceof HTMLTextAreaElement)return e;if(e instanceof HTMLSelectElement)return e;if(e instanceof HTMLInputElement)return w.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function b(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:n,selectionEnd:a}=e;if(n===null||a===null||n!==a)return!1;return t?n===0:n===e.value.length}if((e.textContent??"")==="")return!0;let o=window.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;let r=o.getRangeAt(0),s=document.createRange();if(s.selectNodeContents(e),t)s.setEnd(r.startContainer,r.startOffset);else s.setStart(r.endContainer,r.endOffset);return s.toString()===""}function k(e){if(e.defaultPrevented||Je(e))return;let{key:t}=e;if(t==="Escape")return e.altKey||e.ctrlKey||e.metaKey?void 0:"escape";if(e.altKey&&!e.ctrlKey&&!e.metaKey){if(t!=="ArrowUp"&&t!=="ArrowDown")return;let o=t==="ArrowUp",r=S(e.target);if(r&&!b(r,o))return;if(e.shiftKey)return o?"previous-unread":"next-unread";return o?"previous":"next"}if(t==="?"&&!e.ctrlKey&&!e.metaKey&&!e.repeat)return S(e.target)?void 0:"help";return}function x(){let e=new Set;for(let t of document.querySelectorAll("details.thread-closed[open] [data-thread]"))if(t.dataset.thread)e.add(t.dataset.thread);return e}var g=()=>document.querySelector('dialog[open], .action-popover, .switcher:not([data-state="closed"])')!==null;function E(e,t=12){let o=v("room",e),r=[...document.querySelectorAll('.room-row[aria-current="page"], .thread-link[aria-current="page"]')].find((s)=>s.getAttribute("href")===o);if(r)r.scrollIntoView?.({block:"nearest"});else if(t>0)requestAnimationFrame(()=>E(e,t-1))}function T(e,t){let o=y.getState(),r=oi(),s=r.pane==="room"?r.key:void 0,n=m(o,{at:(u)=>_e(o,u),collapsed:rr(),expanded:x(),current:s});if(r.pane==="room"&&!n.some((u)=>u.key===s))return;let c=h(n,s,e,t?(u)=>Ur(u.key)>0:(u)=>u.shown);if(c===void 0)return;F("room",c),E(c)}function H(e){if(document.querySelector(".action-popover")){e.preventDefault(),kt();return}if(document.querySelector("dialog[open]"))return;let t=document.activeElement;if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&w.has(t.type))e.preventDefault(),t.blur()}function K(e,t){switch(e){case"escape":H(t);break;case"help":if(t.preventDefault(),uo())Zn();else if(!g())lo();break;default:if(g())break;t.preventDefault(),T(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function P(){let e=(t)=>{let o=k(t);if(o)K(o,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{P as startShortcuts};
@@ -1,8 +1,8 @@
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=`---
1
+ import{h,Q,S,s,A,r,t,g,e,n,o,le,u,p,w,m}from"./chunk-index-kankja6p.js";import{$e,ht}from"./chunk-index-e90kztkx.js";import{L}from"./chunk-index-47yspxa4.js";var M=S(()=>(h("2bcp2rky"),import("./chunk-prompt-history-2bcp2rky.js")).then((c)=>({default:c.HistorySheet}))),B=`---
2
2
  name: my-skill
3
3
  description: "Use when "
4
4
  ---
5
5
 
6
6
  # My skill
7
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};
8
+ `;function _(c){let{name:d}=c,[i,k]=r(),[f,v]=r(d?"":B),[b,I]=r(),[R,y]=r(!1),[C,x]=r(!1),[z,D]=r(!1),[H,N]=r(!1),T=A();s(()=>{if(!d)return;let a=!0;return $e.skillDocument(d).then((l)=>{if(!a)return;k(l),v(l.text)},(l)=>a&&I(u(l))),()=>{a=!1}},[d]);let E=i?.text??"",U=f!==E,F=d!==void 0&&!i&&!b,V=async()=>{x(!0);try{if(i){let a=await $e.saveSkillDocument(i.name,{text:f,baseHash:i.hash});k(a),v(a.text),y(!1),D(!1),p(t("Saved.")),c.onSaved()}else await $e.createSkillDocument({text:f}),p(t("Skill created.")),c.onSaved(),c.onClose()}catch(a){if(a instanceof le&&a.status===409){let{current:l}=a.body;k(l),D(!0)}else p(u(a),"danger")}finally{x(!1)}};return n(L,{open:!0,title:d??t("New skill"),size:"full",onClose:c.onClose,children:[b?e(m,{message:b}):null,F?e(w,{}):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(ht,{label:"SKILL.md",before:E,after:f}),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:T,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(o,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:T,className:"prompt-full",spellCheck:!1,value:f,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||!f.trim(),onClick:()=>y(!0),children:t("Review changes")})})]}),H&&i?e(Q,{fallback:null,children:e(M,{open:H,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 +1 @@
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
+ import{h,mr,Q,S,s,r,t,g,e,n,o,O,u,w,m,k,P,Zt,At}from"./chunk-index-kankja6p.js";import{ye}from"./chunk-index-wc83vb0a.js";import{de}from"./chunk-index-j479p62w.js";import"./chunk-index-47yspxa4.js";function v({source:i}){return e("div",{className:"prose document",children:e(Zt,{remarkPlugins:[At],components:{a:({href:a,children:d})=>a&&/^https?:\/\//.test(a)?e("a",{href:a,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),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=S(()=>(h("z3dx2895"),import("./chunk-skill-editor-z3dx2895.js")).then((i)=>({default:i.SkillEditor})));function j(){let[i,a]=r(0),{data:d,error:l}=ye(()=>O.skills(),`skills:${i}`),[b,N]=r(),[p,f]=r();s(()=>{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:()=>f({name:void 0}),children:[e(o,{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,!d&&!l?e(w,{}):null,d?.length===0?e(k,{children:t("No skills.")}):null,d?.map((c)=>e(V,{skill:c,onEdit:y&&c.source.kind==="written"?()=>f({name:c.name}):void 0},`${c.name}:${i}`)),p?e(Q,{fallback:null,children:e(E,{name:p.name,onSaved:()=>a((c)=>c+1),onClose:()=>f(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[d,l]=r(!1),[b,N]=r(),[p,f]=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)f(void 0),O.skill(i.name).then(N).catch((c)=>f(u(c)))},children:"SKILL.md"})]})]}),e("p",{children:i.missing??i.description}),i.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(o,{name:"lock",size:14}),e("span",{children: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:d,title:i.name,size:"wide",onClose:()=>l(!1),children:p?e(m,{message:p}):!b?e(w,{}):e(C,{title:i.name,detail:b})})]})}function C({title:i,detail:a}){let d=a.metadata.filter((l)=>!(l.key==="name"&&l.value===i));return n("div",{className:"skill-document",children:[d.length?e("dl",{className:"skill-meta",children:d.map((l)=>n(mr,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(v,{source:a.body})]})}export{j as SkillsPage};
@@ -0,0 +1 @@
1
+ import{N,a,r,t,te,g,e,n,o,v,F,Ot,_e,d,Je,Yt,mn,Ze,We,yn}from"./chunk-index-kankja6p.js";import{ti}from"./chunk-index-azrnzgev.js";import{Kn}from"./chunk-index-hc0dgmrs.js";import{Jn,ei}from"./chunk-index-gt42wjby.js";import{qt}from"./chunk-index-1fn8q4ps.js";import{cs}from"./chunk-index-nrexxkar.js";Jn();function k(){let l=d((c)=>JSON.stringify(cs(c,(s)=>_e(c,s),(s)=>Ot(c,s)>0,!0).map((s)=>({id:s.id,...s.title===void 0?{}:{title:s.title},entries:s.keys.map((u)=>({key:u,name:c.rooms[u]?.view?.displayName??u,waiting:Ot(c,u)>0}))})))),m=ti(),p=a(l);if(!m)p.current=l;let f=p.current;return N(()=>JSON.parse(f),[f])}function z(l){let{key:m,name:p}=l.entry,f=d((i)=>i.rooms[m]),c=d((i)=>Ot(i,m)),s=f?.view,u=Ze(s?.character),w=qt(()=>Yt(m,l.onLeave),l.liftable&&!s?.home?ei(m):void 0);if(!s)return null;return e("li",{...l.liftable&&!s.home?{"data-drop-item":"","data-key":m}:{},children:n("a",{className:"switcher-row",...w,href:v("room",m),"aria-current":m===l.current?"page":void 0,style:u,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(m)},children:[n("span",{className:"switcher-picture",children:[e(We,{view:s,size:40}),c?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:p}),f?.typing?n("span",{className:"switcher-working",children:[n("span",{className:"typing","aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t("Working")]}):null]}),e(yn,{room:m}),c?e("span",{className:"badge badge-warn",children:te(c,"{count} card waiting","{count} cards waiting")}):null,s.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(o,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,f?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(o,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,f?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(o,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[m,p]=r(""),f=k(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>Kn(m,h.name)!==void 0)})).filter((i)=>i.entries.length>0||m===""),s=(i)=>l.close(i===l.current?void 0:()=>F("room",i)),u=f.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),w=c.filter((i)=>i.entries.length>0).length>1;return n(g,{children:[n("div",{className:"switcher-search",children:[e(o,{name:"search",size:16}),e("input",{type:"search",value:m,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=c.flatMap((y)=>y.entries)[0];if(i.key==="Enter"&&h&&!Je(i.nativeEvent))s(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>mn(i.currentTarget,l.close),children:e(o,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:c.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"?u: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"?u:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((b)=>e(z,{entry:b,current:l.current,onPick:s,onLeave:l.close,liftable:!h&&i.id!=="home"},b.key))})]},i.id)})})]})}export{Y as SwitcherList};
@@ -1 +1 @@
1
- import{b,As,zi}from"./chunk-index-84v7j6vh.js";import{Sr,wr}from"./chunk-index-dtste2ed.js";import{Oi,ts}from"./chunk-index-ewj52be9.js";import"./chunk-index-cwc1vvpw.js";var c=64;async function g(s){let a=new Image;a.src=s,await a.decode();let r=document.createElement("canvas");r.width=r.height=c;let t=r.getContext("2d");if(!t)throw Error("the page has no 2d canvas");t.drawImage(a,0,0,c,c);let i=c*0.175,o=c-i-2,e=i+2;return t.fillStyle="#ffffff",t.beginPath(),t.arc(o,e,i+2.5,0,Math.PI*2),t.fill(),t.fillStyle="#ef4444",t.beginPath(),t.arc(o,e,i,0,Math.PI*2),t.fill(),r.toDataURL("image/png")}var u=()=>[...document.head.querySelectorAll('link[rel~="icon"]')];function h(s){let a=new Map,r=!1,t=0,i=(e)=>{if(e.dataset.plainHref===void 0)return;if(e.setAttribute("href",e.dataset.plainHref),e.dataset.plainType)e.type=e.dataset.plainType;else e.removeAttribute("type");if(e.dataset.plainSizes)e.setAttribute("sizes",e.dataset.plainSizes);else e.removeAttribute("sizes");delete e.dataset.plainHref,delete e.dataset.plainType,delete e.dataset.plainSizes},o=async()=>{let e=++t,p=s.count()>0;if(p===r)return;if(!p){for(let n of u())i(n);r=!1;return}let l=u(),d=(l.find((n)=>n.dataset.plainHref===void 0&&n.type==="image/png")??l[0])?.href;if(!d)return;let f=a.get(d);if(!f)f=s.render(d),a.set(d,f);let m=await f.catch((n)=>{a.delete(d),console.warn("the tab icon's dot failed to draw",n);return});if(!m||e!==t)return;for(let n of u()){if(n.dataset.plainHref===void 0)n.dataset.plainHref=n.getAttribute("href")??"",n.dataset.plainType=n.type,n.dataset.plainSizes=n.getAttribute("sizes")??"";n.href=m,n.type="image/png",n.removeAttribute("sizes")}r=!0};s.subscribe(()=>void o()),o()}function H(){let s=()=>Oi().badge+wr(),a=()=>As(s());h({count:()=>zi(b.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};b.subscribe(t),ts(t),Sr(t)},render:g}),a()}export{H as startPageTabDot};
1
+ import{y,Zo,Bi}from"./chunk-index-kankja6p.js";import{Dr,Vr}from"./chunk-index-raf772z6.js";import{Pi,yo}from"./chunk-index-r1v895tj.js";import"./chunk-index-c2ag3qw2.js";var c=64;async function m(s){let a=new Image;a.src=s,await a.decode();let r=document.createElement("canvas");r.width=r.height=c;let t=r.getContext("2d");if(!t)throw Error("the page has no 2d canvas");t.drawImage(a,0,0,c,c);let i=c*0.175,o=c-i-2,e=i+2;return t.fillStyle="#ffffff",t.beginPath(),t.arc(o,e,i+2.5,0,Math.PI*2),t.fill(),t.fillStyle="#ef4444",t.beginPath(),t.arc(o,e,i,0,Math.PI*2),t.fill(),r.toDataURL("image/png")}var u=()=>[...document.head.querySelectorAll('link[rel~="icon"]')];function g(s){let a=new Map,r=!1,t=0,i=(e)=>{if(e.dataset.plainHref===void 0)return;if(e.setAttribute("href",e.dataset.plainHref),e.dataset.plainType)e.type=e.dataset.plainType;else e.removeAttribute("type");if(e.dataset.plainSizes)e.setAttribute("sizes",e.dataset.plainSizes);else e.removeAttribute("sizes");delete e.dataset.plainHref,delete e.dataset.plainType,delete e.dataset.plainSizes},o=async()=>{let e=++t,p=s.count()>0;if(p===r)return;if(!p){for(let n of u())i(n);r=!1;return}let l=u(),d=(l.find((n)=>n.dataset.plainHref===void 0&&n.type==="image/png")??l[0])?.href;if(!d)return;let f=a.get(d);if(!f)f=s.render(d),a.set(d,f);let b=await f.catch((n)=>{a.delete(d),console.warn("the tab icon's dot failed to draw",n);return});if(!b||e!==t)return;for(let n of u()){if(n.dataset.plainHref===void 0)n.dataset.plainHref=n.getAttribute("href")??"",n.dataset.plainType=n.type,n.dataset.plainSizes=n.getAttribute("sizes")??"";n.href=b,n.type="image/png",n.removeAttribute("sizes")}r=!0};s.subscribe(()=>void o()),o()}function H(){let s=()=>Pi().badge+Vr(),a=()=>Zo(s());g({count:()=>Bi(y.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};y.subscribe(t),yo(t),Dr(t)},render:m}),a()}export{H as startPageTabDot};
@@ -0,0 +1 @@
1
+ import{h,Q,S,be,s,r,t,e,n,Se,F,d,Ge,fe,Bo}from"./chunk-index-kankja6p.js";import"./chunk-index-84wbc80d.js";import"./chunk-index-zx6yka30.js";import"./chunk-index-raf772z6.js";import{kn,_n,wi,go,ki,Hn,Vt}from"./chunk-index-n93wqszt.js";import{ho,Yn}from"./chunk-index-5fz5e1ct.js";import"./chunk-index-47yspxa4.js";var W=S(()=>(h("f683hx8k"),import("./chunk-table-seats-f683hx8k.js")).then((a)=>({default:a.TableSeatsSheet}))),z=300;function D(a){let[p,c]=r(!1);return s(()=>{if(!a){c(!1);return}if(Se()){c(!0);return}let l=setTimeout(()=>c(!0),z);return()=>clearTimeout(l)},[a]),p}function N(a,p,c,l){Bo(a).then((b)=>{if(b)fe({...b,at:p,via:c,source:l})},()=>{return})}function I(){return go((be(Ge)?.kinds??[]).map((a)=>a.kind)),null}function te({focus:a}){let[p,c]=r(),l=ki(void 0),b=Hn(),[w,R]=r(!1),[x,A]=r(!1),m=_n(),T=wi(),y=kn(),E=d((o)=>o.listed),M=m?y.loaded:E&&(!T||y.loaded),C=new Set(y.views.map((o)=>o.key)),v=m?l:l.filter((o)=>!C.has(o.key)),i=m?null:ho(a,v),g=v.find((o)=>o.name===i);s(()=>{if(a&&M&&i===null)F("table",void 0,{replace:!0})},[a,M,i]);let B=D(i!==null),k=(o)=>{if(m){let f=l.find((L)=>L.name===o);if(f)F("room",f.key);return}let u=l.find((f)=>f.name===o);if(u&&C.has(u.key)){F("room",u.key);return}if(o===i)return;F("table",o??void 0,{replace:i!==null})},H=()=>{A(!0),R(!0)},V=!m&&l.length===0&&b.length>0,K=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:[p?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>k(null),children:t("Reset view")}):null,!m&&b.length>0?e("button",{type:"button",className:"secondary","aria-haspopup":"dialog",onClick:H,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:H,children:t("Who's at the table")})]}):K?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("There are no rooms to seat yet.")})]}):e(Vt,{onHandle:c,focus:i,onFocus:k,...m?{onMore:()=>F("rooms")}:{onSeat:k,onSeatMenu:(o)=>{let u=v.find((f)=>f.name===o.id);if(u)N(u.key,o.at,o.via,o.source)}}}),T?e(I,{}):null,g?e(Yn,{roomKey:g.key,open:B,onBack:()=>k(null),onMenu:(o)=>{let u=o.getBoundingClientRect();N(g.key,{x:u.left,y:u.bottom},"key",o)}},g.key):null]}),x?e(Q,{fallback:null,children:e(W,{open:w,onClose:()=>R(!1)})}):null]})}export{te as TablePage};
@@ -1 +1 @@
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
+ import{A,r,t,e,n,We}from"./chunk-index-kankja6p.js";import"./chunk-index-84wbc80d.js";import"./chunk-index-zx6yka30.js";import"./chunk-index-raf772z6.js";import{Hn}from"./chunk-index-n93wqszt.js";import{pt}from"./chunk-index-agrvqf5b.js";import{L}from"./chunk-index-47yspxa4.js";import{nt}from"./chunk-index-q5vzjqr5.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(pt,{id:o,checked:!l,label:s.displayName,busy:a,onChange:async(i)=>{m(!0),await nt(s.key,!i),m(!1)}})]})})}function g(s){let o=Hn();return e(L,{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 +1 @@
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};
1
+ import{Qn,ur,dr,Mt,on,sn,ni}from"./chunk-index-fe0m5mht.js";import{Ct,Gt}from"./chunk-index-pgxgq61x.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??Gt,{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=Qn(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":Mt},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":Mt,fill:e.plateInk},f);ae.textContent=dr(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=ur.done;else if(D)P=ur.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":Mt,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:Ct(v,f)})),f.addEventListener("keydown",(v)=>{if(v.key==="Enter"||v.key===" ")v.preventDefault(),i.onSeatClick({id:r.id,name:r.name,at:Ct({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":Mt,fill:e.gold},m);k.textContent=dr(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=Qn(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()},sn)}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(),on)}},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(ni(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};