pi-roundtable-web 0.26.0 → 0.26.1

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 (198) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +23 -7
  3. package/dist/chunk-account-ghq105t4.js +1 -0
  4. package/dist/{chunk-action-menu-rm5cyqkj.js → chunk-action-menu-me0g9qsc.js} +1 -1
  5. package/dist/{chunk-agent-b017vswv.js → chunk-agent-rdv7ekrt.js} +1 -1
  6. package/dist/chunk-arranged-rooms-81rqhx9x.js +1 -0
  7. package/dist/chunk-character-creator-bd426yjw.js +1 -0
  8. package/dist/chunk-codeeditor-ajhgd33t.js +2 -0
  9. package/dist/chunk-confirm-p3mts8mx.js +1 -0
  10. package/dist/{chunk-connectors-hrm06nx8.js → chunk-connectors-bkv3xn83.js} +1 -1
  11. package/dist/{chunk-conversations-e26rrf01.js → chunk-conversations-0e0vbxwr.js} +1 -1
  12. package/dist/{chunk-drag-v41gx2mc.js → chunk-drag-peyb8t0k.js} +1 -1
  13. package/dist/{chunk-entry-jxxb3ath.js → chunk-entry-mv7q8br0.js} +1 -1
  14. package/dist/chunk-folder-list-era3tksh.js +1 -0
  15. package/dist/chunk-folds-hvws0bd5.js +1 -0
  16. package/dist/{chunk-gate-8k61stsc.js → chunk-gate-hc7dd0fx.js} +1 -1
  17. package/dist/chunk-group-scene-dkbpmbh5.js +1 -0
  18. package/dist/chunk-group-table-fqmxgdfw.js +1 -0
  19. package/dist/chunk-host-icons-4xde9ntk.js +1 -0
  20. package/dist/chunk-host-picture-014yzk20.js +1 -0
  21. package/dist/chunk-host-state-t56e5sdy.js +1 -0
  22. package/dist/chunk-host-ui-p1zy9nmp.js +1 -0
  23. package/dist/chunk-index-0fmmvgee.js +2 -0
  24. package/dist/chunk-index-0q15ysrb.js +1 -0
  25. package/dist/chunk-index-0xh24y25.js +2 -0
  26. package/dist/chunk-index-2yebd9tb.js +426 -0
  27. package/dist/chunk-index-4t0r3t3b.js +2 -0
  28. package/dist/chunk-index-5yzfrf7b.js +138 -0
  29. package/dist/{chunk-index-2d0kg096.js → chunk-index-6twb7ccd.js} +2 -2
  30. package/dist/chunk-index-73gh7kgr.js +920 -0
  31. package/dist/chunk-index-7xffskfa.js +8 -0
  32. package/dist/chunk-index-aqw7cy5j.js +1 -0
  33. package/dist/{chunk-index-d1prgfbp.js → chunk-index-b6ca02e8.js} +2 -2
  34. package/dist/chunk-index-b8nvhcx5.js +2 -0
  35. package/dist/{chunk-index-014rjv9k.js → chunk-index-cvbdf2ca.js} +2 -2
  36. package/dist/chunk-index-czdketze.js +2 -0
  37. package/dist/{chunk-index-y8rnq8zf.js → chunk-index-dt9775ka.js} +3 -3
  38. package/dist/chunk-index-eg55mqqe.js +1 -0
  39. package/dist/{chunk-index-xgkd15n3.js → chunk-index-gr6e0hse.js} +1 -1
  40. package/dist/chunk-index-gyary7np.js +13 -0
  41. package/dist/chunk-index-j214tczc.js +1 -0
  42. package/dist/chunk-index-jd6632ef.js +2 -0
  43. package/dist/chunk-index-jw7dtshr.js +2 -0
  44. package/dist/{chunk-index-wnjp6wv0.js → chunk-index-k7t14rwa.js} +2 -2
  45. package/dist/{chunk-index-c07p8k0x.js → chunk-index-kwcx62wb.js} +3 -3
  46. package/dist/{chunk-index-hby0ap91.js → chunk-index-m7fvw92f.js} +2 -2
  47. package/dist/chunk-index-mmg788a1.js +2 -0
  48. package/dist/chunk-index-mq0dacwr.js +2 -0
  49. package/dist/chunk-index-p53ak25v.js +2 -0
  50. package/dist/{chunk-index-rhtvcbsq.js → chunk-index-pk1yxkv4.js} +2 -2
  51. package/dist/{chunk-index-2stynxw6.css → chunk-index-rbcz9jd4.css} +1 -1
  52. package/dist/{chunk-index-km40bhsz.js → chunk-index-rmxbdmn2.js} +2 -2
  53. package/dist/chunk-index-rnxj3z8k.js +2 -0
  54. package/dist/{chunk-index-hssjbr1k.js → chunk-index-snzzfhk3.js} +2 -2
  55. package/dist/chunk-index-v3bmr0nw.js +2 -0
  56. package/dist/{chunk-index-awx6nnta.js → chunk-index-vcyzwtk2.js} +1 -1
  57. package/dist/{chunk-index-nqfkwkfp.js → chunk-index-w2j3njb6.js} +2 -2
  58. package/dist/{chunk-index-e5sd30xy.js → chunk-index-w31c4yjv.js} +2 -2
  59. package/dist/chunk-index-wrm8w165.js +2 -0
  60. package/dist/chunk-index-xh0mg9cw.js +2 -0
  61. package/dist/chunk-index-ybtvvx85.js +2 -0
  62. package/dist/{chunk-index-dhpt8qr9.js → chunk-index-yzsgsvnp.js} +2 -2
  63. package/dist/{chunk-index-66nskrdj.js → chunk-index-z9x4cnzf.js} +2 -2
  64. package/dist/chunk-index-zrvg23jd.js +2 -0
  65. package/dist/chunk-index-zynq0b0w.js +50 -0
  66. package/dist/chunk-lang-css-88v3hp3d.js +1 -0
  67. package/dist/{chunk-lang-dockerfile-hrav55t7.js → chunk-lang-dockerfile-k728ewsf.js} +1 -1
  68. package/dist/{chunk-lang-go-x9ahv6e5.js → chunk-lang-go-wjwgay4v.js} +2 -2
  69. package/dist/chunk-lang-html-07d47es4.js +1 -0
  70. package/dist/chunk-lang-javascript-fmhhgzwd.js +1 -0
  71. package/dist/{chunk-lang-json-hsemyd0r.js → chunk-lang-json-7gd89mvs.js} +1 -1
  72. package/dist/{chunk-lang-markdown-zkwb4c9n.js → chunk-lang-markdown-b6qbe8bt.js} +5 -5
  73. package/dist/{chunk-lang-python-tewx7006.js → chunk-lang-python-3v56y31b.js} +2 -2
  74. package/dist/{chunk-lang-rust-0ydx84s1.js → chunk-lang-rust-kh0z74d1.js} +1 -1
  75. package/dist/{chunk-lang-shell-gq1tmdz4.js → chunk-lang-shell-9zv0zvbx.js} +1 -1
  76. package/dist/{chunk-lang-sql-xt1qyycg.js → chunk-lang-sql-yw6bf3t7.js} +2 -2
  77. package/dist/{chunk-lang-toml-0hamc5fc.js → chunk-lang-toml-tg1r96nq.js} +1 -1
  78. package/dist/chunk-lang-typescript-etjjvr2g.js +1 -0
  79. package/dist/{chunk-lang-xml-wf6h5pt2.js → chunk-lang-xml-ev1mndd4.js} +1 -1
  80. package/dist/{chunk-lang-yaml-7vk521h1.js → chunk-lang-yaml-fz5qpb3r.js} +1 -1
  81. package/dist/chunk-layout-actions-48ecgtkg.js +1 -0
  82. package/dist/{chunk-menu-items-1n9qargb.js → chunk-menu-items-1epy3h0t.js} +2 -2
  83. package/dist/chunk-mode-toggle-fxmfxsa4.js +1 -0
  84. package/dist/chunk-note-row-kd0fy7ee.js +75 -0
  85. package/dist/{chunk-notes-t15bh04m.js → chunk-notes-yb8f057c.js} +1 -1
  86. package/dist/chunk-notice-bell-wr4f1rph.js +1 -0
  87. package/dist/chunk-notices-x07da5bb.js +1 -0
  88. package/dist/chunk-onboarding-csrkbh9z.js +1 -0
  89. package/dist/{chunk-overview-km5vq375.js → chunk-overview-avc2d30t.js} +1 -1
  90. package/dist/{chunk-palette-a8txdgd0.js → chunk-palette-9nhp95bz.js} +1 -1
  91. package/dist/chunk-placement-items-q694dpgk.js +1 -0
  92. package/dist/chunk-profile-6qemf3m7.js +1 -0
  93. package/dist/{chunk-prompt-history-wm9dsy6s.js → chunk-prompt-history-7enzp2p3.js} +1 -1
  94. package/dist/chunk-prompts-nv6mrn0q.js +1 -0
  95. package/dist/chunk-room-confirms-zz7n61y7.js +1 -0
  96. package/dist/{chunk-room-menu-2tm2xtfx.js → chunk-room-menu-rr6nzap1.js} +1 -1
  97. package/dist/{chunk-rooms-menu-button-wxnsxjwc.js → chunk-rooms-menu-button-zbtwj47d.js} +1 -1
  98. package/dist/chunk-schedules-rw57nr0m.js +1 -0
  99. package/dist/{chunk-seat-menu-d3npdtx1.js → chunk-seat-menu-ys5v9abz.js} +1 -1
  100. package/dist/chunk-sheet-hosts-jhvaacst.js +1 -0
  101. package/dist/chunk-skill-editor-sz8an8qr.js +8 -0
  102. package/dist/{chunk-skills-shkdwes8.js → chunk-skills-tnr1h16h.js} +1 -1
  103. package/dist/chunk-switcher-list-17enhrse.js +1 -0
  104. package/dist/chunk-tab-dot-r6brdbmw.js +1 -0
  105. package/dist/chunk-table-r12cja6p.js +1 -0
  106. package/dist/chunk-table-seats-g3t392zz.js +1 -0
  107. package/dist/{chunk-table2d-n26b7gd0.js → chunk-table2d-p3ezsdcj.js} +1 -1
  108. package/dist/{chunk-table3d-8aysyf56.js → chunk-table3d-4x2n2b00.js} +20 -20
  109. package/dist/chunk-thread-actions-qc6ezkha.js +1 -0
  110. package/dist/chunk-transcript-n2s6dher.js +1 -0
  111. package/dist/chunk-where-f3scdydc.js +1 -0
  112. package/dist/chunk-workspace-xs023bxm.js +1 -0
  113. package/dist/chunk-zh-tw-efvmk3fd.js +1 -0
  114. package/dist/index.html +1 -1
  115. package/dist/sw.js +1 -1
  116. package/package.json +2 -2
  117. package/src/api-types.ts +58 -3
  118. package/src/app/app.ts +5 -0
  119. package/src/app/room-log.ts +16 -4
  120. package/src/app/rooms.ts +39 -0
  121. package/src/app/routes.ts +44 -2
  122. package/src/app/socket.ts +45 -9
  123. package/src/app/threads.ts +31 -2
  124. package/src/auth/authenticator.ts +10 -4
  125. package/src/auth/login-page.ts +4 -2
  126. package/src/auth/oidc-pages.ts +2 -0
  127. package/src/auth/oidc.ts +39 -1
  128. package/src/authz.ts +2 -1
  129. package/src/console-server.ts +32 -6
  130. package/src/host/cards.ts +18 -5
  131. package/src/host/context.ts +72 -25
  132. package/src/host/forms.ts +3 -0
  133. package/src/host/frames.ts +8 -1
  134. package/src/host/host-app.ts +6 -4
  135. package/src/host/host-routes.ts +36 -3
  136. package/src/host/room-views.ts +6 -6
  137. package/src/host/rooms-service.ts +16 -1
  138. package/src/host/views.ts +3 -0
  139. package/src/i18n/zh-tw.ts +9 -2
  140. package/src/index.ts +15 -1
  141. package/src/options.ts +36 -0
  142. package/src/page-presentation.ts +47 -2
  143. package/src/pwa.ts +32 -4
  144. package/src/web-app.ts +47 -3
  145. package/src/web-plugin.ts +20 -9
  146. package/dist/chunk-account-hw49gd0d.js +0 -1
  147. package/dist/chunk-arranged-rooms-q5v3dm1r.js +0 -1
  148. package/dist/chunk-character-creator-5dxcvd16.js +0 -1
  149. package/dist/chunk-codeeditor-pyt09fwg.js +0 -2
  150. package/dist/chunk-confirm-521yqmta.js +0 -1
  151. package/dist/chunk-folder-list-b97xk12b.js +0 -1
  152. package/dist/chunk-folds-b8q7eags.js +0 -1
  153. package/dist/chunk-group-scene-dx6wt19m.js +0 -1
  154. package/dist/chunk-group-table-e4jr8r3a.js +0 -1
  155. package/dist/chunk-host-state-g7e7c0k5.js +0 -1
  156. package/dist/chunk-host-ui-x7k6n07v.js +0 -939
  157. package/dist/chunk-index-2qd81wbx.js +0 -2
  158. package/dist/chunk-index-459drsft.js +0 -2
  159. package/dist/chunk-index-4mfj596y.js +0 -2
  160. package/dist/chunk-index-bbsytycb.js +0 -2
  161. package/dist/chunk-index-cq1e9xdz.js +0 -2
  162. package/dist/chunk-index-g351921r.js +0 -1
  163. package/dist/chunk-index-k2qq1gdj.js +0 -2
  164. package/dist/chunk-index-ke9ynm0n.js +0 -2
  165. package/dist/chunk-index-kpscvg85.js +0 -2
  166. package/dist/chunk-index-m0d100mg.js +0 -2
  167. package/dist/chunk-index-mb72snk9.js +0 -2
  168. package/dist/chunk-index-mjqqver5.js +0 -4
  169. package/dist/chunk-index-nwqk447w.js +0 -2
  170. package/dist/chunk-index-pcfhpm8v.js +0 -302
  171. package/dist/chunk-index-q8h8xzbm.js +0 -2
  172. package/dist/chunk-index-r5vszgfs.js +0 -2
  173. package/dist/chunk-index-rjv7vrwd.js +0 -13
  174. package/dist/chunk-index-v23m38p6.js +0 -50
  175. package/dist/chunk-index-va0g7d88.js +0 -1
  176. package/dist/chunk-index-z3k18atc.js +0 -2
  177. package/dist/chunk-lang-css-6bepqpnx.js +0 -1
  178. package/dist/chunk-lang-html-8jc72zt4.js +0 -1
  179. package/dist/chunk-lang-javascript-2p2qtbnf.js +0 -1
  180. package/dist/chunk-lang-typescript-82xf7z2e.js +0 -1
  181. package/dist/chunk-layout-actions-zh7bezk7.js +0 -1
  182. package/dist/chunk-notice-bell-w3y0h0sr.js +0 -1
  183. package/dist/chunk-notices-fa3g7qze.js +0 -1
  184. package/dist/chunk-onboarding-34v3nr17.js +0 -1
  185. package/dist/chunk-placement-items-wgaxsbvs.js +0 -1
  186. package/dist/chunk-profile-ypxdbsk1.js +0 -1
  187. package/dist/chunk-prompts-7mhhq7zs.js +0 -1
  188. package/dist/chunk-room-confirms-t11a1gsw.js +0 -1
  189. package/dist/chunk-schedules-2ft6xxyw.js +0 -1
  190. package/dist/chunk-sheet-hosts-vngvp7wv.js +0 -1
  191. package/dist/chunk-skill-editor-65n2hsq4.js +0 -8
  192. package/dist/chunk-switcher-list-g6hhmr1t.js +0 -1
  193. package/dist/chunk-table-1b6bsq2y.js +0 -1
  194. package/dist/chunk-table-seats-vy1qhdks.js +0 -1
  195. package/dist/chunk-transcript-355faceq.js +0 -1
  196. package/dist/chunk-where-j5qdt8a4.js +0 -1
  197. package/dist/chunk-workspace-vrbs6zx1.js +0 -1
  198. package/dist/chunk-zh-tw-zeg600bk.js +0 -1
@@ -0,0 +1 @@
1
+ import{X,a,o,r,t,c,m,e,n,s,y,u,x,p,P,Pi}from"./chunk-index-zynq0b0w.js";import{j}from"./chunk-index-w31c4yjv.js";import"./chunk-index-0q15ysrb.js";import"./chunk-index-vcyzwtk2.js";import{le}from"./chunk-index-0xh24y25.js";var T=3000;function B({profile:i}){return n("div",{className:"who",children:[i.picture?e("img",{className:"who-picture",src:`api/people/${encodeURIComponent(i.principal)}/picture`,alt:""}):e("span",{className:"who-initial","aria-hidden":"true",children:Array.from(i.name)[0]??"?"}),n("div",{className:"stack",children:[e("strong",{children:i.name}),i.tier?n("span",{className:"meta",children:[e(s,{name:"shield",size:14})," ",t(z[i.tier])]}):null]})]})}function R({link:i,labels:C,changed:d}){let[l,f]=r(),[h,k]=r(!1),[L,V]=r(),[b,w]=r(!1),N=i.pending!==void 0||l!==void 0,q=o(void 0);a(()=>{if(!N||i.linked)return;return q.current=setInterval(()=>{le.links().then((v)=>{let I=v.links.find((A)=>A.provider===i.provider);if(I)d(I)},()=>{return})},T),()=>clearInterval(q.current)},[N,i.linked,i.provider,d]);let S=async(v)=>{k(!0),V(void 0);try{await v()}catch(I){V(u(I))}finally{k(!1)}},g=i.blockedBy.length>0;return n("li",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:i.label}),i.linked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Linked"),i.linked.displayName?` · ${i.linked.displayName}`:""]}):i.step==="required"?e(P,{tone:"warn",children:t("Required")}):i.step==="nudge"?e(P,{children:t("Recommended")}):null]}),L?e(p,{message:L}):null,i.linked?i.linked.locked?e("p",{className:"meta",children:t("The server's configuration links this account.")}):n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:h,onClick:()=>w(!0),children:t("Unlink")}),e(j,{open:b,title:t("Unlink {name}?",{name:i.label}),confirmLabel:t("Unlink"),tone:"danger",onClose:()=>w(!1),onConfirm:async()=>{d(await le.unlink(i.provider)),f(void 0)},children:e("p",{children:t("The app will no longer know this account is yours. You can link it again later.")})})]}):N?n("div",{className:"stack",children:[l?n(m,{children:[e("p",{children:l.instructions}),e("p",{className:"meta",children:t("Your code")}),e("code",{className:"link-code",children:l.code}),e("p",{className:"meta",children:t("The code works until {time}.",{time:new Date(l.expiresAt).toLocaleTimeString()})})]}):e("p",{className:"meta",children:t("A code is waiting to be used.")}),i.pending?.redeemedBy?n("p",{children:[e(s,{name:"check",size:14})," ",t("{name} used the code. Confirm that this is you.",{name:i.pending.redeemedBy.displayName})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:h,onClick:()=>S(async()=>{d(await le.cancelLink(i.provider)),f(void 0)}),children:t("Cancel")}),e("button",{type:"button",disabled:h,onClick:()=>S(async()=>{let v=l?.request??i.pending?.request;if(!v)return;d(await le.confirmLink(i.provider,v)),f(void 0)}),children:t("I did it")})]})]}):n("div",{className:"stack",children:[g?e("p",{className:"meta",children:t("Link {name} first.",{name:i.blockedBy.map((v)=>C[v]??v).join(", ")})}):null,e("div",{className:"actions",children:e("button",{type:"button",disabled:h||g,onClick:()=>S(async()=>{f(await le.issueLink(i.provider)),d((await le.links()).links.find((v)=>v.provider===i.provider)??i)}),children:t("Link")})})]})]})}function E(){let i=Intl.DateTimeFormat().resolvedOptions().timeZone,[C,d]=r(),[l,f]=r({start:"22:00",end:"07:00"}),[h,k]=r(!1),[L,V]=r(!1),[b,w]=r(),[N,q]=r();a(()=>{le.pushPrefs().then((g)=>{if(d(g.quiet),g.quiet)f(g.quiet);k(!0)},()=>k(!0))},[]);let S=async(g)=>{V(!0),q(void 0),w(void 0);try{await g()}catch(v){q(u(v))}finally{V(!1)}};if(!h)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("Notifications")}),e("p",{className:"meta",children:t("In your quiet hours a normal notice waits in the bell instead of ringing your phone. An urgent one still rings.")}),n("div",{className:"quiet-row",children:[n("label",{children:[t("From")," ",e("input",{type:"time",value:l.start,onChange:(g)=>f({...l,start:g.target.value})})]}),n("label",{children:[t("To")," ",e("input",{type:"time",value:l.end,onChange:(g)=>f({...l,end:g.target.value})})]}),e("span",{className:"meta",children:i})]}),N?e(p,{message:N}):null,b?e("p",{className:"meta",children:b}):null,n("div",{className:"actions",children:[C?e("button",{type:"button",className:"secondary",disabled:L,onClick:()=>S(async()=>{await le.setPushPrefs(null),d(void 0)}),children:t("Turn off quiet hours")}):null,e("button",{type:"button",className:"secondary",disabled:L,onClick:()=>S(async()=>{await le.pushTest(),w(t("A test notification is on its way."))}),children:t("Send a test notification")}),e("button",{type:"button",disabled:L||l.start===l.end,onClick:()=>S(async()=>{let g=await le.setPushPrefs({...l,timeZone:i});d(g.quiet)}),children:t("Save")})]})]})}function O({profile:i,changed:C}){let[d,l]=r();if(i.sources.length===0)return null;let f=async(h)=>{l(void 0);try{C(await le.chooseSource(h))}catch(k){l(u(k))}};return n("section",{className:"card stack",children:[e("h2",{children:t("Shown as")}),e("p",{className:"meta",children:t("The name and picture of this account are what others see in the app.")}),n("fieldset",{className:"choice",children:[e("legend",{className:"visually-hidden",children:t("Shown as")}),n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===void 0,onChange:()=>f(null)}),t("Automatic")]}),i.sources.map((h)=>n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===h.provider,onChange:()=>f(h.provider)}),t(h.label)]},h.provider))]}),d?e(p,{message:d}):null]})}function G(){let[i,C]=r(),[d,l]=r(),[f,h]=r(),[k,L]=r();a(()=>{y.session().then(C,(b)=>L(u(b))),le.profile().then(l,()=>{return}),le.links().then(h,()=>{return})},[]);let V=X((b)=>{h((w)=>w?{links:w.links.map((N)=>N.provider===b.provider?b:N)}:w),le.profile().then(l,()=>{return})},[]);if(k)return e(p,{message:k});if(!i)return e(x,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Profile")})}),n("section",{className:"card stack",children:[e("h2",{children:t("Account")}),d?e(B,{profile:d}):e("p",{className:"meta",children:t("Signed in as {name}.",{name:i.principal.name})}),e(Pi,{auth:i.auth})]}),f&&f.links.length>0?n("section",{className:"stack",children:[e("h2",{children:t("Your accounts")}),e("ul",{className:"stack notices",children:f.links.map((b)=>e(R,{link:b,labels:Object.fromEntries(f.links.map((w)=>[w.provider,w.label])),changed:V},b.provider))})]}):null,d?e(O,{profile:d,changed:l}):null,i.push?e(E,{}):null]})}var z={owner:c("Owner"),admin:c("Admin"),member:c("Member")};export{G as ProfilePage};
@@ -1 +1 @@
1
- import{a,r,t,e,n,u,v,h,_,P,k,te}from"./chunk-index-v23m38p6.js";import{et}from"./chunk-index-c07p8k0x.js";import{I}from"./chunk-index-awx6nnta.js";function U(i){let{open:m,load:y}=i,{timeZone:N}=k(),[s,f]=r(),[c,p]=r(),[g,b]=r();a(()=>{if(!m)return;let o=!0;return f(void 0),p(void 0),b(void 0),y().then((d)=>o&&f(d),(d)=>o&&p(u(d))),()=>{o=!1}},[m]);let l=s?.find((o)=>o.id===g);return e(I,{open:m,title:i.title,size:"wide",onClose:i.onClose,children:n("div",{className:"stack history",children:[c?e(h,{message:c}):null,!s&&!c?e(v,{}):null,s?.length===0?e(_,{children:t("No changes have been kept yet.")}):null,s&&s.length>0?e("ul",{className:"menu",children:s.map((o)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":o.id===g,onClick:()=>b(o.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:o.by}),e("span",{className:"meta",children:te(o.at,N)})]}),o.revert?e(P,{children:t("Back to the file version")}):null]})},o.id))}):null,l?n("section",{className:"stack","aria-label":t("This change"),children:[e(et,{label:t("This change"),before:l.previous,after:l.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>i.onUse(l.text),children:t("Use this text")})})]}):null]})})}export{U as HistorySheet};
1
+ import{a,r,t,e,n,u,x,p,_,P,k,te}from"./chunk-index-zynq0b0w.js";import{at}from"./chunk-index-kwcx62wb.js";import{I}from"./chunk-index-vcyzwtk2.js";function U(i){let{open:m,load:v}=i,{timeZone:y}=k(),[s,f]=r(),[c,g]=r(),[h,b]=r();a(()=>{if(!m)return;let o=!0;return f(void 0),g(void 0),b(void 0),v().then((d)=>o&&f(d),(d)=>o&&g(u(d))),()=>{o=!1}},[m]);let l=s?.find((o)=>o.id===h);return e(I,{open:m,title:i.title,size:"wide",onClose:i.onClose,children:n("div",{className:"stack history",children:[c?e(p,{message:c}):null,!s&&!c?e(x,{}):null,s?.length===0?e(_,{children:t("No changes have been kept yet.")}):null,s&&s.length>0?e("ul",{className:"menu",children:s.map((o)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":o.id===h,onClick:()=>b(o.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:o.by}),e("span",{className:"meta",children:te(o.at,y)})]}),o.revert?e(P,{children:t("Back to the file version")}):null]})},o.id))}):null,l?n("section",{className:"stack","aria-label":t("This change"),children:[e(at,{label:t("This change"),before:l.previous,after:l.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>i.onUse(l.text),children:t("Use this text")})})]}):null]})})}export{U as HistorySheet};
@@ -0,0 +1 @@
1
+ import{h,M,w,X,a,D,r,t,c,m,e,n,s,oe,u,O,x,p,_,P,k,te}from"./chunk-index-zynq0b0w.js";import{Ee,at}from"./chunk-index-kwcx62wb.js";import{I}from"./chunk-index-vcyzwtk2.js";var U={"Shared prompt":c("Shared prompt"),"Guest prompt":c("Guest prompt"),"The base every agent's prompt starts with, the main assistant's included.":c("The base every agent's prompt starts with, the main assistant's included."),"Used instead of the shared prompt when the person speaking is not the owner.":c("Used instead of the shared prompt when the person speaking is not the owner.")},C=(l)=>t(U[l]??l);var G=w(()=>(h("7enzp2p3"),import("./chunk-prompt-history-7enzp2p3.js")).then((l)=>({default:l.HistorySheet}))),Z=w(()=>(h("p3mts8mx"),import("./chunk-confirm-p3mts8mx.js")).then((l)=>({default:l.Confirm})));function me(){let{timeZone:l}=k(),[N,i]=r(),[f,b]=r(),[v,y]=r(),S=X(()=>{Ee.prompts().then((d)=>i(d.documents),(d)=>b(u(d)))},[]);return a(S,[S]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Main prompts")})}),e("p",{className:"hint",children:t("The texts the assistant and the agents start from. A text you save here replaces the one from the file from the next turn on, until you go back to the file's.")}),f?e(p,{message:f}):null,!N&&!f?e(x,{}):null,N?.length===0?e(_,{children:t("No prompts to edit.")}):null,N?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:C(d.label)}),d.differs?e(P,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(P,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:C(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:te(d.override.at,l)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>y(d.id),children:t("Edit")})})]},d.id)),v?e(q,{id:v,onClose:()=>{y(void 0),S()}}):null]})}function q({id:l,onClose:N}){let[i,f]=r(),[b,v]=r(""),[y,S]=r(),[d,R]=r(!1),[E,B]=r(!1),[H,T]=r(!1),[V,F]=r(!1),z=D();a(()=>{let o=!0;return Ee.prompt(l).then((g)=>{if(!o)return;f(g),v(g.text)},(g)=>o&&S(u(g))),()=>{o=!1}},[l]);let A=async()=>{if(!i)return;B(!0);try{let o=await Ee.savePrompt(l,{text:b,base:i.text});f(o),v(o.text),R(!1),O(t("Saved."))}catch(o){if(o instanceof oe&&o.status===409){let{current:g}=o.body;f(g),O(o.message,"danger")}else O(u(o),"danger")}finally{B(!1)}},L=i!==void 0&&b!==i.text;return n(I,{open:!0,title:i?C(i.label):t("Main prompts"),size:"full",onClose:N,children:[y?e(p,{message:y}):null,!i&&!y?e(x,{}):null,i?.broken?e(p,{message:t("The file version of this prompt cannot be read, so it cannot be changed here until it can: {reason}",{reason:i.broken})}):null,i&&!i.broken?n("div",{className:"stack",children:[i.differs?e("p",{className:"hint",children:e(P,{tone:"warn",children:t("Differs from the file version")})}):null,d?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(at,{label:t("Prompt"),before:i.text,after:b}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:E,onClick:()=>R(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:E,onClick:A,children:E?t("Saving…"):t("Save")})]})]}):n(m,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:z,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>T(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:z,className:"prompt-full",value:b,maxLength:i.maxChars,onChange:(o)=>v(o.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>F(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!L||!b.trim(),onClick:()=>R(!0),children:t("Review changes")})]})]}),H?e(M,{fallback:null,children:e(G,{open:H,title:t("History of {name}",{name:C(i.label)}),load:async()=>(await Ee.promptHistory(l)).versions.map((o)=>({id:o.id,text:o.text,previous:o.previous,by:o.by,at:o.at,revert:o.action==="revert"})),onUse:(o)=>{v(o),R(!1),T(!1)},onClose:()=>T(!1)})}):null,V?e(M,{fallback:null,children:e(Z,{open:V,title:t("Revert {name} to the file version?",{name:C(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let o=await Ee.revertPrompt(l,{base:i.text});f(o),v(o.text),R(!1),O(t("Back to the file version."))}catch(o){if(!(o instanceof oe&&o.status===409))throw o;let{current:g}=o.body;f(g),O(o.message,"danger")}},onClose:()=>F(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{me as PromptsPage};
@@ -0,0 +1 @@
1
+ import{Di}from"./chunk-index-v3bmr0nw.js";import"./chunk-index-ybtvvx85.js";import"./chunk-index-w31c4yjv.js";import"./chunk-index-vcyzwtk2.js";import"./chunk-index-p53ak25v.js";import"./chunk-index-wrm8w165.js";import"./chunk-index-b8nvhcx5.js";export{Di as RoomConfirmHost};
@@ -1 +1 @@
1
- import{O,r,t,p,e,n,s,x,d,k,Fe,St,Me,ht}from"./chunk-index-v23m38p6.js";import{Te}from"./chunk-index-nwqk447w.js";import{nt}from"./chunk-index-rhtvcbsq.js";import{I}from"./chunk-index-awx6nnta.js";import{Ge}from"./chunk-index-bbsytycb.js";var g="room-menu-yolo",h="room-menu-long",N="room-menu-mute";function T(a){let[l,m]=r(!1),i=k().app?.modes!==!1,f=d((o)=>o.rooms[a.room]?.view?.home===!1,a.room),u=d((o)=>o.pins.includes(a.room),a.room),c=a.mode??{yolo:!1,longRunning:!1},b=async(o)=>{m(!0),await St(a.room,{longRunning:o}),m(!1)};return e(I,{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 agent 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(nt,{id:N,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{m(!0),await Ge(a.room,!o),m(!1)},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:g,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(nt,{id:g,checked:c.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else m(!0),St(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(nt,{id:h,checked:c.longRunning,label:t("Long-running mode"),onChange:b,busy:l})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Fe(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit agent")}),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(),ht({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||!f?null:n(p,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(O("zh7bezk7"),import("./chunk-layout-actions-zh7bezk7.js")).then((o)=>o.pinRoom(a.room,!u))},children:[e("span",{className:"menu-icon",children:e(s,{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(),Te({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(),Me({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 agent")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{T as RoomMenu};
1
+ import{h,r,t,m,e,n,s,S,d,k,Ye,Qt,Ce,bt}from"./chunk-index-zynq0b0w.js";import{Me}from"./chunk-index-wrm8w165.js";import{ot}from"./chunk-index-pk1yxkv4.js";import{I}from"./chunk-index-vcyzwtk2.js";import{He}from"./chunk-index-mq0dacwr.js";var p="room-menu-yolo",N="room-menu-long",f="room-menu-mute";function T(a){let[i,l]=r(!1),u=k().app?.modes!==!1,b=d((o)=>o.rooms[a.room]?.view?.home===!1,a.room),c=d((o)=>o.pins.includes(a.room),a.room),g=a.mode??{yolo:!1,longRunning:!1},y=async(o)=>{l(!0),await Qt(a.room,{longRunning:o}),l(!1)};return e(I,{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:S("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 agent 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:f,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(ot,{id:f,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{l(!0),await He(a.room,!o),l(!1)},busy:i})]})}),a.readOnly||!u?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(ot,{id:p,checked:g.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else l(!0),Qt(a.room,{yolo:!1}).then(()=>l(!1))},busy:i})]})}),a.readOnly||!u?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,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(ot,{id:N,checked:g.longRunning,label:t("Long-running mode"),onChange:y,busy:i})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ye(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit agent")}),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(),bt({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(m,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(h("48ecgtkg"),import("./chunk-layout-actions-48ecgtkg.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(),Me({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(),Ce({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 agent")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{T as RoomMenu};
@@ -1 +1 @@
1
- import{t,e,s,d}from"./chunk-index-v23m38p6.js";import"./chunk-index-nwqk447w.js";import{En}from"./chunk-index-cq1e9xdz.js";function r(){if(!d((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>En(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
1
+ import{t,e,s,d}from"./chunk-index-zynq0b0w.js";import"./chunk-index-wrm8w165.js";import{Ln}from"./chunk-index-4t0r3t3b.js";function r(){if(!d((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>Ln(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
@@ -0,0 +1 @@
1
+ import{r,t,c,e,n,s,S,y,O,x,p,_,P,k,te}from"./chunk-index-zynq0b0w.js";import{j}from"./chunk-index-w31c4yjv.js";import{Oe}from"./chunk-index-gr6e0hse.js";import"./chunk-index-vcyzwtk2.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(m){if(typeof m!=="object"||m===null)return"";let o=m,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((d)=>t(g[String(d)]??String(d))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:i})}default:return""}}function L(){let{timeZone:m}=k(),[o,i]=r(0),[l,d]=r(),{data:u,error:f}=Oe(()=>y.schedules(),`schedules:${o}`);return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Schedules")})}),f?e(p,{message:f}):null,!u&&!f?e(x,{}):null,u&&u.schedules.length===0?e(_,{children:t("Nothing is scheduled. Ask an agent to remind you or to run something later.")}):null,e("ul",{className:"schedule-list",children:u?.schedules.map((a)=>n("li",{className:"card schedule",children:[n("div",{className:"schedule-main",children:[n("div",{className:"card-head",children:[e("strong",{children:a.title}),a.lastStatus?e(P,{children:a.lastStatus}):null]}),n("p",{className:"meta",children:[h(a.recurrence)," ·"," ",t("next {when}",{when:te(a.nextRun,m)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:S("room",a.room),children:a.label}):a.label," ","· ",t("set by {name}",{name:a.createdBy})]})]}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Cancel {title}",{title:a.title}),onClick:()=>d(a),children:e(s,{name:"trash"})})]},a.id))}),e(j,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>d(void 0),onConfirm:async()=>{if(!l)return;await y.cancelSchedule(l.id),i((a)=>a+1),O(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{ci}from"./chunk-index-v23m38p6.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 ci((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{bi}from"./chunk-index-zynq0b0w.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 bi((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,M,w,X,a,D,A,o,r,t,c,m,e,n,s,K,d,oe,y,u,O,x,p,_,on,ps,ms,Ce,jn,ys,de,_n}from"./chunk-index-zynq0b0w.js";import{j}from"./chunk-index-w31c4yjv.js";import"./chunk-index-wrm8w165.js";import"./chunk-index-p53ak25v.js";import{ve,gt,Di}from"./chunk-index-v3bmr0nw.js";import{dn}from"./chunk-index-z9x4cnzf.js";import{Ee,at}from"./chunk-index-kwcx62wb.js";import{ot}from"./chunk-index-pk1yxkv4.js";import"./chunk-index-ybtvvx85.js";import{I}from"./chunk-index-vcyzwtk2.js";import{He}from"./chunk-index-mq0dacwr.js";import"./chunk-index-b8nvhcx5.js";function ie(l){return n("fieldset",{className:"field",children:[e("legend",{children:l.label}),e("div",{className:"option-chips",children:l.options.map((f)=>e("button",{type:"button","aria-pressed":f.value===l.value,className:"option-chip",onClick:()=>l.onChange(f.value),children:f.label},f.value))})]})}var Re=w(()=>(h("7enzp2p3"),import("./chunk-prompt-history-7enzp2p3.js")).then((l)=>({default:l.HistorySheet}))),Te=w(()=>(h("bd426yjw"),import("./chunk-character-creator-bd426yjw.js")).then((l)=>({default:l.CharacterCreator}))),xe=["default","off","minimal","low","medium","high","xhigh"],be={default:c("Follow the assistant (automatic)"),off:c("Off"),minimal:c("Minimal"),low:c("Low"),medium:c("Medium"),high:c("High"),xhigh:c("Very high")},G="default",me=(l)=>t(be[l]??l),he=(l)=>({displayName:l.displayName,prompt:l.prompt,model:l.model??G,thinking:l.thinking??G});function ge(l,f){return{...f.displayName!==l.displayName?{displayName:f.displayName}:{},...f.prompt!==l.prompt?{prompt:f.prompt}:{},...f.model!==(l.model??G)?{model:f.model}:{},...f.thinking!==(l.thinking??G)?{thinking:f.thinking}:{}}}function ye(){let l=ms(),f=o(l);if(l)f.current=l;let i=f.current,N=l!==void 0;if(a(()=>{if(!N)return;let L=window.location.href,E=()=>{if(window.location.href!==L)on()};return window.addEventListener("popstate",E),window.addEventListener("hashchange",E),()=>{window.removeEventListener("popstate",E),window.removeEventListener("hashchange",E)}},[N]),!i)return null;return e(I,{open:l!==void 0,title:t("Edit agent"),size:"wide",onClose:on,children:e(Oe,{name:i.name,opened:i.id},i.name)})}function Oe({name:l,opened:f}){let[i,N]=r(),[L,E]=r([]),[k,V]=r(),[C,T]=r(),[g,R]=r(!1),[F,z]=r(!1),[ee,Q]=r(!1),[B,q]=r(!1),te=_n(i?.room??""),W=o(null),Y=i!==void 0,U=d((b)=>i?b.rooms[i.room]?.view?.muted===!0:!1,i?.room??""),[ae,H]=r(!1),ne=d((b)=>i?b.rooms[i.room]?.view?.coordinator===!0:!1,i?.room??""),J=D(),Z=D(),S=D();a(()=>{if(!Y||!ps()?.look)return;W.current?.scrollIntoView({block:"start"}),W.current?.focus({preventScroll:!0})},[Y,f]);let v=o({});v.current={profile:i,draft:C},a(()=>{let b=!0;return Promise.all([y.agent(l),y.models()]).then(([re,Pe])=>{if(!b)return;let{profile:fe,draft:le}=v.current,Fe=fe&&le&&Object.keys(ge(fe,le)).length>0;N(re),E(Pe.models),T(Fe?le:he(re))},(re)=>b&&V(u(re))),()=>{b=!1}},[l,f]);let P=A(()=>i&&C?ge(i,C):{},[i,C]);if(k)return e(p,{message:k});if(!i||!C)return e(x,{});let pe=Object.keys(P).length>0,De=Array.from(new Set([G,...L,C.model])),ue=async()=>{R(!0);try{let b=await y.updateAgent(l,P);N(b),T(he(b)),z(!1),O(t("Saved."))}catch(b){O(u(b),"danger")}finally{R(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(de,{spec:i.character,name:i.name,size:72,state:te,label:i.displayName}),n("div",{children:[e("h3",{children:i.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:i.effective.model,thinking:me(i.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:S,children:[e("span",{className:"menu-icon",children:e(s,{name:U?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(ot,{id:S,checked:!U,label:t("Notifications"),busy:ae,onChange:async(b)=>{H(!0),await He(i.room,!b),H(!1)}})]})})}),F?e(ze,{profile:i,draft:C,saving:g,onBack:()=>z(!1),onSave:ue}):n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),!pe)return;if(P.prompt!==void 0)z(!0);else ue()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:C.displayName,onChange:(b)=>T({...C,displayName:b.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:J,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>q(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>Q(!0),children:[e(Ve,{}),t("Full screen")]})]})]}),e("textarea",{id:J,rows:8,value:C.prompt,onChange:(b)=>T({...C,prompt:b.target.value})})]}),e(ie,{label:t("Model"),value:C.model,onChange:(b)=>T({...C,model:b}),options:De.map((b)=>({value:b,label:b===G?t("Follow the assistant"):b}))}),e(ie,{label:t("Thinking level"),value:C.thinking,onChange:(b)=>T({...C,thinking:b}),options:xe.map((b)=>({value:b,label:t(be[b])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!pe||g,children:g?t("Saving…"):P.prompt!==void 0?t("Review changes"):t("Save")})})]}),e($e,{name:l,opened:f}),n("section",{className:"card stack",ref:W,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(M,{fallback:e(x,{}),children:e(Te,{name:i.name,displayName:i.displayName,prompt:i.prompt,character:i.character,onSaved:(b)=>N(b)})})]}),ne?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived agent 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:()=>{on(),Ce({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive {name}",{name:i.displayName})})})]}),B?e(M,{fallback:null,children:e(Re,{open:B,title:t("History of the prompt"),load:async()=>(await Ee.agentPromptHistory(l)).versions.map((b)=>({id:b.id,text:b.text,previous:b.previous,by:b.by,at:b.at})),onUse:(b)=>{T({...C,prompt:b}),q(!1)},onClose:()=>q(!1)})}):null,e(I,{open:ee,title:t("Prompt"),size:"full",onClose:()=>Q(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:C.prompt,onChange:(b)=>T({...C,prompt:b.target.value})})})]})}function $e({name:l,opened:f}){let[i,N]=r(),[L,E]=r(),[k,V]=r(),C=D();if(a(()=>{let g=!0;return ve.skills(l).then((R)=>g&&N(R),(R)=>{if(g&&!(R instanceof oe&&R.status===404))V(u(R))}),()=>{g=!1}},[l,f]),k)return e(p,{message:k});if(!i)return null;let T=async(g,R)=>{E(g);try{N(await ve.setSkills(l,R?{add:[g]}:{remove:[g]}))}catch(F){O(u(F),"danger")}finally{E(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 agent can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:i.skills.map((g,R)=>{let F=`${C}-${R}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:F,children:[n("span",{className:"menu-text",children:[e("strong",{children:g.name}),e("span",{className:"meta",children:g.missing?t("Its file cannot be read."):g.builtin?t("Built in: every agent carries it."):g.description??""})]}),e(ot,{id:F,checked:g.carried,label:g.name,busy:L===g.name,disabled:g.builtin,onChange:(z)=>T(g.name,z)})]})},g.name)})})]})}var Ve=()=>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 ze(l){let{profile:f,draft:i}=l,N=o(null);a(()=>N.current?.focus(),[]);let L=[];if(i.displayName!==f.displayName)L.push({label:t("Name"),before:f.displayName,after:i.displayName});let E=(k)=>k===G?t("Follow the assistant"):k;if(i.model!==(f.model??G))L.push({label:t("Model"),before:E(f.model??G),after:E(i.model)});if(i.thinking!==(f.thinking??G))L.push({label:t("Thinking level"),before:me(f.thinking??G),after:me(i.thinking)});return n("section",{ref:N,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),L.length?e("ul",{className:"review-fields",children:L.map((k)=>n("li",{children:[e("strong",{children:k.label}),e("span",{className:"review-before",children:k.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:k.after})]},k.label))}):null,e(at,{label:t("Prompt"),before:f.prompt,after:i.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:l.saving,onClick:l.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:l.saving,onClick:l.onSave,children:l.saving?t("Saving…"):t("Save")})]})]})}function Ne(){let[l,f]=r(),[i,N]=r(),[L,E]=r(),[k,V]=r(),C=X(async()=>{try{f((await ve.archive()).entries),N(void 0)}catch(g){N(u(g))}},[]);a(()=>{C()},[C]);let T=async(g)=>{E(g.name);try{if(g.kind==="agent")await ve.restoreAgent(g.name);else await ve.restoreGroup(g.name);await gt(),O(t("Restored {name}.",{name:g.displayName})),await C()}catch(R){O(u(R),"danger")}finally{E(void 0)}};if(i&&!l)return e(p,{message:i});if(!l)return e(x,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived agents and groups no longer answer. Their history is kept until you delete them.")}),l.length===0?e(_,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:l.map((g)=>n("li",{className:"menu-item",children:[e("span",{className:"menu-icon",children:e(s,{name:g.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:g.displayName}),n("span",{className:"meta",children:[g.kind==="agent"?t("Agent"):t("Group")," ·"," ",g.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:L===g.name,onClick:()=>T(g),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:L===g.name,onClick:()=>V(g),children:t("Delete")})]},`${g.kind}:${g.name}`))}),e(j,{open:k!==void 0,title:t("Delete {name}?",{name:k?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>V(void 0),onConfirm:async()=>{if(!k)return;if(k.kind==="agent")await ve.deleteAgent(k.name);else await ve.deleteGroup(k.name);await gt(),O(t("Deleted {name}.",{name:k.displayName})),await C()},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:k?.displayName??""})})})]})}var we=/^[a-z0-9-]{1,32}$/,ke=2,Se=6,se="\x00";function Ge(){let l=d((f)=>f.order.flatMap((i)=>{let N=f.rooms[i]?.view;return N?.kind==="agent"?[`${N.name}${se}${N.displayName}`]:[]}).join(`${se}${se}`));return A(()=>l===""?[]:l.split(`${se}${se}`).map((f)=>{let[i="",N=""]=f.split(se);return{name:i,displayName:N}}),[l])}function Ae(l){let f=Ge(),[i,N]=r(),[L,E]=r(),[k,V]=r(""),[C,T]=r(""),[g,R]=r(!1),[F,z]=r([]),[ee,Q]=r(""),[B,q]=r(!1),[te,W]=r(l.name===void 0),Y=D(),U=D();a(()=>{let S=l.name;if(S===void 0)return;let v=!0;return ve.group(S).then((P)=>{if(!v)return;N(P),V(P.displayName),z(P.members),Q(P.host),W(!0)},(P)=>v&&E(u(P))),()=>{v=!1}},[l.name]);let ae=(S)=>f.find((v)=>v.name===S)?.displayName??S,H=F.includes(ee)?ee:F[0]??"",ne=i===void 0?!0:k.trim()!==i.displayName||F.join(",")!==i.members.join(",")||H!==i.host,J=k.trim()!==""&&F.length>=ke&&F.length<=Se&&(i!==void 0||we.test(C));if(L&&!te)return e(p,{message:L});if(!te)return e(x,{});let Z=async()=>{q(!0),E(void 0);try{if(i){await ve.updateGroup(i.name,{...k.trim()!==i.displayName?{displayName:k.trim()}:{},...F.join(",")!==i.members.join(",")?{members:F}:{},...H!==i.host?{host:H}:{}}),await gt(),O(t("Saved.")),l.onDone();return}let S=await ve.createGroup({name:C,displayName:k.trim(),members:F,host:H});await gt(),O(t("Made {name}.",{name:S.displayName})),l.onDone(),K("room",S.room)}catch(S){E(u(S))}finally{q(!1)}};return n("form",{className:"stack form",onSubmit:(S)=>{if(S.preventDefault(),J&&ne&&!B)Z()},children:[n("label",{htmlFor:Y,children:[t("Name"),e("input",{id:Y,value:k,autoComplete:"off",onChange:(S)=>{if(V(S.target.value),!i&&!g)T(S.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),i?null:n("label",{htmlFor:U,children:[t("Permanent name"),e("input",{id:U,value:C,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":C!==""&&!we.test(C),onChange:(S)=>{R(!0),T(S.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 agents. They take turns in the order picked.")}),e("ul",{className:"menu",children:f.map((S)=>{let v=F.includes(S.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:v,disabled:!v&&F.length>=Se,onChange:()=>z(v?F.filter((P)=>P!==S.name):[...F,S.name])}),e("span",{className:"menu-text",children:e("strong",{children:S.displayName})})]})},S.name)})})]}),F.length>=ke?e(ie,{label:t("Host"),value:H,onChange:Q,options:F.map((S)=>({value:S,label:ae(S)}))}):null,L?e(p,{message:L}):null,n("div",{className:"actions",children:[i?e("button",{type:"button",className:"danger",onClick:()=>{l.onDone(),Ce({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!J||!ne||B,children:B?t("Saving…"):i?t("Save"):t("Make group")})]})]})}var Be=w(()=>(h("bd426yjw"),import("./chunk-character-creator-bd426yjw.js")).then((l)=>({default:l.CharacterCreator}))),Me=/^[a-z0-9-]{1,32}$/,ce="default";function Ke(l){let f=[];for(let i of l){let N=i.indexOf("/"),L=N>0?i.slice(0,N):"",E=f.find((k)=>k.provider===L&&L!=="");if(E)E.models.push(i);else f.push({provider:L,models:[i]})}return f}var Ue=(l)=>l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Le({onDone:l}){let[f,i]=r(""),[N,L]=r(""),[E,k]=r(!1),[V,C]=r(""),[T,g]=r(ce),[R,F]=r(""),[z,ee]=r(),[Q,B]=r(!1),[q,te]=r([]),[W,Y]=r(),[U,ae]=r(!1),H=[D(),D(),D(),D(),D()];a(()=>{let v=!0;return y.models().then((P)=>v&&te(P.models),()=>{return}),()=>{v=!1}},[]);let ne=A(()=>dn({name:N,displayName:f,prompt:V}),[N,f,V]),J=z?.spec??ne,Z=Me.test(N)&&f.trim()!==""&&V.trim()!=="";if(Q)return e(M,{fallback:e(x,{}),children:e(Be,{name:N||"new",displayName:f,prompt:V,character:J,onPick:(v,P)=>{ee({input:v,spec:P}),B(!1)},onCancel:()=>B(!1)})});let S=async()=>{ae(!0),Y(void 0);try{let v={name:N,displayName:f.trim(),prompt:V,...T!==ce?{model:T}:{},...R.trim()?{task:R.trim()}:{},...z?{character:z.input}:{}},P=await ve.createAgent(v);await gt(),O(t("Made {name}.",{name:P.displayName})),l(),K("room",P.room)}catch(v){Y(v instanceof oe&&v.field?`${v.field}: ${u(v)}`:u(v))}finally{ae(!1)}};return n("form",{className:"stack form",onSubmit:(v)=>{if(v.preventDefault(),Z&&!U)S()},children:[n("label",{htmlFor:H[0],children:[t("Name"),e("input",{id:H[0],value:f,autoComplete:"off",onChange:(v)=>{if(i(v.target.value),!E)L(Ue(v.target.value))}})]}),n("label",{htmlFor:H[1],children:[t("Permanent name"),e("input",{id:H[1],value:N,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":N!==""&&!Me.test(N),onChange:(v)=>{k(!0),L(v.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("label",{htmlFor:H[2],children:[t("Prompt"),e("textarea",{id:H[2],rows:6,value:V,onChange:(v)=>C(v.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:H[4],children:[t("Model"),n("select",{id:H[4],value:T,onChange:(v)=>g(v.target.value),children:[e("option",{value:ce,children:t("Follow the assistant")}),Ke(q).map((v)=>v.provider===""?v.models.map((P)=>e("option",{value:P,children:P},P)):e("optgroup",{label:v.provider,children:v.models.map((P)=>e("option",{value:P,children:P},P))},v.provider))]})]}),n("label",{htmlFor:H[3],children:[t("Opening task"),e("textarea",{id:H[3],rows:3,value:R,onChange:(v)=>F(v.target.value)}),e("span",{className:"meta",children:t("Optional. The agent starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(de,{spec:J,name:N||"new",size:72,label:f}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:z?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>B(!0),children:t("Choose a look")})]})]}),W?e(p,{message:W}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!Z||U,children:U?t("Making…"):t("Make agent")})})]})}var _e=(l)=>l.kind==="new-agent"?t("New agent"):l.kind==="archive"?t("Archived"):l.name===void 0?t("New group"):t("Edit group");function Ie(){let l=ys(),f=o(l);if(l)f.current=l;let i=f.current,N=l!==void 0;if(a(()=>{if(!N)return;let L=window.location.href,E=()=>{if(window.location.href!==L)jn()};return window.addEventListener("popstate",E),window.addEventListener("hashchange",E),()=>{window.removeEventListener("popstate",E),window.removeEventListener("hashchange",E)}},[N]),!i)return null;return e(I,{open:l!==void 0,title:_e(i),size:"wide",onClose:jn,children:e("div",{className:"stack agent-sheet",children:i.kind==="new-agent"?e(Le,{onDone:jn}):i.kind==="archive"?e(Ne,{}):e(Ae,{...i.name===void 0?{}:{name:i.name},onDone:jn})},i.id)})}function la(){return n(m,{children:[e(Di,{}),e(ye,{}),e(Ie,{})]})}export{la as SheetHosts};
@@ -0,0 +1,8 @@
1
+ import{h,M,w,a,D,r,t,m,e,n,s,oe,u,O,x,p}from"./chunk-index-zynq0b0w.js";import{Ee,at}from"./chunk-index-kwcx62wb.js";import{I}from"./chunk-index-vcyzwtk2.js";var K=w(()=>(h("7enzp2p3"),import("./chunk-prompt-history-7enzp2p3.js")).then((c)=>({default:c.HistorySheet}))),B=`---
2
+ name: my-skill
3
+ description: "Use when "
4
+ ---
5
+
6
+ # My skill
7
+
8
+ `;function _(c){let{name:d}=c,[l,y]=r(),[f,v]=r(d?"":B),[b,F]=r(),[R,g]=r(!1),[k,C]=r(!1),[z,N]=r(!1),[H,S]=r(!1),T=D();a(()=>{if(!d)return;let i=!0;return Ee.skillDocument(d).then((o)=>{if(!i)return;y(o),v(o.text)},(o)=>i&&F(u(o))),()=>{i=!1}},[d]);let L=l?.text??"",A=f!==L,E=d!==void 0&&!l&&!b,U=async()=>{C(!0);try{if(l){let i=await Ee.saveSkillDocument(l.name,{text:f,baseHash:l.hash});y(i),v(i.text),g(!1),N(!1),O(t("Saved.")),c.onSaved()}else await Ee.createSkillDocument({text:f}),O(t("Skill created.")),c.onSaved(),c.onClose()}catch(i){if(i instanceof oe&&i.status===409){let{current:o}=i.body;y(o),N(!0)}else O(u(i),"danger")}finally{C(!1)}};return n(I,{open:!0,title:d??t("New skill"),size:"full",onClose:c.onClose,children:[b?e(p,{message:b}):null,E?e(x,{}):null,l&&!l.writable?e(p,{message:t("This skill cannot be edited here.")}):null,!E&&!b&&(!l||l.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(p,{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(at,{label:"SKILL.md",before:L,after:f}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:k,onClick:()=>g(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:k,onClick:U,children:k?t("Saving…"):l?t("Save"):t("Create skill")})]})]}):n(m,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:T,children:"SKILL.md"}),l?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>S(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:T,className:"prompt-full",spellCheck:!1,value:f,onChange:(i)=>v(i.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:!A||!f.trim(),onClick:()=>g(!0),children:t("Review changes")})})]}),H&&l?e(M,{fallback:null,children:e(K,{open:H,title:t("History of {name}",{name:l.name}),load:async()=>{let{versions:i}=await Ee.skillHistory(l.name);return i.map((o,V)=>({id:o.id,text:o.text,previous:i[V+1]?.text??"",by:o.by,at:o.at}))},onUse:(i)=>{v(i),g(!1),S(!1)},onClose:()=>S(!1)})}):null]}):null]})}export{_ as SkillEditor};
@@ -1 +1 @@
1
- import{O,zi,C,S,a,r,t,p,e,n,s,y,u,v,h,_,P,Nt,vt}from"./chunk-index-v23m38p6.js";import{Oe}from"./chunk-index-xgkd15n3.js";import{ue}from"./chunk-index-r5vszgfs.js";import"./chunk-index-awx6nnta.js";function b({source:i}){return e("div",{className:"prose document",children:e(Nt,{remarkPlugins:[vt],components:{a:({href:o,children:d})=>o&&/^https?:\/\//.test(o)?e("a",{href:o,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:o})=>e("span",{children:o}),pre:({children:o})=>e("div",{className:"code-block",children:e("pre",{children:o})}),table:({children:o})=>e("div",{className:"table-wrap",children:e("table",{children:o})})},children:i})})}var N=S(()=>(O("65n2hsq4"),import("./chunk-skill-editor-65n2hsq4.js")).then((i)=>({default:i.SkillEditor})));function q(){let[i,o]=r(0),{data:d,error:l}=Oe(()=>y.skills(),`skills:${i}`),[k,w]=r(),[m,g]=r();a(()=>{y.session().then(w,()=>{return})},[]);let f=k?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),f?n("button",{type:"button",className:"secondary",onClick:()=>g({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:f?t("Registered skills and their carriers. A skill an agent wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask an agent on Discord to edit their contents.")}),l?e(h,{message:l}):null,!d&&!l?e(v,{}):null,d?.length===0?e(_,{children:t("No skills.")}):null,d?.map((c)=>e(D,{skill:c,onEdit:f&&c.source.kind==="written"?()=>g({name:c.name}):void 0},`${c.name}:${i}`)),m?e(C,{fallback:null,children:e(N,{name:m.name,onSaved:()=>o((c)=>c+1),onClose:()=>g(void 0)},m.name??"")}):null]})}function E(i){switch(i.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:i.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${i.repo}:${i.path}`});default:return}}function D({skill:i,onEdit:o}){let[d,l]=r(!1),[k,w]=r(),[m,g]=r(),f=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Assistant-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:f}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(p,{children:[o?e("button",{type:"button",className:"secondary",onClick:o,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!k)g(void 0),y.skill(i.name).then(w).catch((c)=>g(u(c)))},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:E(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All agents"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(ue,{open:d,title:i.name,size:"wide",onClose:()=>l(!1),children:m?e(h,{message:m}):!k?e(v,{}):e(V,{title:i.name,detail:k})})]})}function V({title:i,detail:o}){let d=o.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(zi,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(b,{source:o.body})]})}export{q as SkillsPage};
1
+ import{h,er,M,w,a,r,t,m,e,n,s,y,u,x,p,_,P,Vt,Pt}from"./chunk-index-zynq0b0w.js";import{Oe}from"./chunk-index-gr6e0hse.js";import{ue}from"./chunk-index-ybtvvx85.js";import"./chunk-index-vcyzwtk2.js";function N({source:i}){return e("div",{className:"prose document",children:e(Vt,{remarkPlugins:[Pt],components:{a:({href:o,children:d})=>o&&/^https?:\/\//.test(o)?e("a",{href:o,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:o})=>e("span",{children:o}),pre:({children:o})=>e("div",{className:"code-block",children:e("pre",{children:o})}),table:({children:o})=>e("div",{className:"table-wrap",children:e("table",{children:o})})},children:i})})}var v=w(()=>(h("sz8an8qr"),import("./chunk-skill-editor-sz8an8qr.js")).then((i)=>({default:i.SkillEditor})));function q(){let[i,o]=r(0),{data:d,error:l}=Oe(()=>y.skills(),`skills:${i}`),[f,S]=r(),[g,k]=r();a(()=>{y.session().then(S,()=>{return})},[]);let b=f?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),b?n("button",{type:"button",className:"secondary",onClick:()=>k({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:b?t("Registered skills and their carriers. A skill an agent wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask an agent on Discord to edit their contents.")}),l?e(p,{message:l}):null,!d&&!l?e(x,{}):null,d?.length===0?e(_,{children:t("No skills.")}):null,d?.map((c)=>e(D,{skill:c,onEdit:b&&c.source.kind==="written"?()=>k({name:c.name}):void 0},`${c.name}:${i}`)),g?e(M,{fallback:null,children:e(v,{name:g.name,onSaved:()=>o((c)=>c+1),onClose:()=>k(void 0)},g.name??"")}):null]})}function E(i){switch(i.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:i.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${i.repo}:${i.path}`});default:return}}function D({skill:i,onEdit:o}){let[d,l]=r(!1),[f,S]=r(),[g,k]=r(),b=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Assistant-written"):i.source.kind==="package"?i.source.package:`${i.source.repo}:${i.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(P,{children:b}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(m,{children:[o?e("button",{type:"button",className:"secondary",onClick:o,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!f)k(void 0),y.skill(i.name).then(S).catch((c)=>k(u(c)))},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:E(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All agents"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(ue,{open:d,title:i.name,size:"wide",onClose:()=>l(!1),children:g?e(p,{message:g}):!f?e(x,{}):e(V,{title:i.name,detail:f})})]})}function V({title:i,detail:o}){let d=o.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(er,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(N,{source:o.body})]})}export{q as SkillsPage};
@@ -0,0 +1 @@
1
+ import{A,o,r,t,xe,m,e,n,s,S,K,dt,Ie,d,nn,Bt,ln,Ve,vt,_i}from"./chunk-index-zynq0b0w.js";import{In,Dn,Un,Xt}from"./chunk-index-2yebd9tb.js";import{Vn}from"./chunk-index-cvbdf2ca.js";import{Ls}from"./chunk-index-zrvg23jd.js";In();function v(){let l=d((f)=>JSON.stringify(Ls(f,(a)=>Ie(f,a),(a)=>dt(f,a)>0,!0).map((a)=>({id:a.id,...a.title===void 0?{}:{title:a.title},entries:a.keys.map((h)=>({key:h,name:f.rooms[h]?.view?.displayName??h,waiting:dt(f,h)>0}))})))),c=Un(),y=o(l);if(!c)y.current=l;let u=y.current;return A(()=>JSON.parse(u),[u])}function b(l){let{key:c,name:y}=l.entry,u=d((i)=>i.rooms[c]),f=d((i)=>dt(i,c)),a=u?.view,h=Ve(a?.character),g=Xt(()=>Bt(c,l.onLeave),l.liftable&&!a?.home?Dn(c):void 0);if(!a)return null;return e("li",{...l.liftable&&!a.home?{"data-drop-item":"","data-key":c}:{},children:n("a",{className:"switcher-row",...g,href:S("room",c),"aria-current":c===l.current?"page":void 0,style:h,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(c)},children:[n("span",{className:"switcher-picture",children:[e(vt,{view:a,size:40}),f?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:y}),u?.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(_i,{room:c}),f?e("span",{className:"badge badge-warn",children:xe(f,"{count} card waiting","{count} cards waiting")}):null,a.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(s,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,u?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(s,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,u?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(s,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[c,y]=r(""),u=v(),f=u.map((i)=>({...i,entries:i.entries.filter((p)=>Vn(c,p.name)!==void 0)})).filter((i)=>i.entries.length>0||c===""),a=(i)=>l.close(i===l.current?void 0:()=>K("room",i)),h=u.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),g=f.filter((i)=>i.entries.length>0).length>1;return n(m,{children:[n("div",{className:"switcher-search",children:[e(s,{name:"search",size:16}),e("input",{type:"search",value:c,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>y(i.target.value),onKeyDown:(i)=>{let p=f.flatMap((w)=>w.entries)[0];if(i.key==="Enter"&&p&&!nn(i.nativeEvent))a(p.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>ln(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:f.map((i)=>{let p=i.id==="waiting",w=i.id==="pinned"?"pinned":i.id==="rest"?"rest":p||i.id==="home"?void 0:"folder";return n("section",{"aria-label":p?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?h:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...w?{"data-drop-zone":w,"data-zone-id":i.id,...w==="folder"?{"data-folder":i.id}:{}}:{},children:[p?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):g||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?h:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((N)=>e(b,{entry:N,current:l.current,onPick:a,onLeave:l.close,liftable:!p&&i.id!=="home"},N.key))})]},i.id)})})]})}export{Y as SwitcherList};
@@ -0,0 +1 @@
1
+ import{b,xs,Qi}from"./chunk-index-zynq0b0w.js";import{fr,hr}from"./chunk-index-rnxj3z8k.js";import{oi,Fr}from"./chunk-index-czdketze.js";import"./chunk-index-0xh24y25.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+hr(),a=()=>xs(s());h({count:()=>Qi(b.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};b.subscribe(t),Fr(t),fr(t)},render:g}),a()}export{H as startPageTabDot};
@@ -0,0 +1 @@
1
+ import{h,M,w,ge,a,r,t,e,n,ut,K,d,Ge,ye,bs}from"./chunk-index-zynq0b0w.js";import"./chunk-index-yzsgsvnp.js";import"./chunk-index-0fmmvgee.js";import"./chunk-index-rnxj3z8k.js";import{bn,fi,ls,hi,Bn,Ut}from"./chunk-index-7xffskfa.js";import{Vr,Xn}from"./chunk-index-b6ca02e8.js";import"./chunk-index-vcyzwtk2.js";var V=w(()=>(h("g3t392zz"),import("./chunk-table-seats-g3t392zz.js")).then((s)=>({default:s.TableSeatsSheet}))),F=300;function L(s){let[f,c]=r(!1);return a(()=>{if(!s){c(!1);return}if(ut()){c(!0);return}let l=setTimeout(()=>c(!0),F);return()=>clearTimeout(l)},[s]),f}function R(s,f,c,l){bs(s).then((p)=>{if(p)ye({...p,at:f,via:c,source:l})},()=>{return})}function W(){return ls((ge(Ge)?.kinds??[]).map((s)=>s.kind)),null}function Y({focus:s}){let[f,c]=r(),l=hi(void 0),p=Bn(),[C,v]=r(!1),[N,H]=r(!1),u=fi(),S=bn(),x=d((o)=>o.listed),k=u?S.loaded:x,i=u?null:Vr(s,l),b=l.find((o)=>o.name===i);a(()=>{if(s&&k&&i===null)K("table",void 0,{replace:!0})},[s,k,i]);let A=L(i!==null),g=(o)=>{if(u){let m=l.find((y)=>y.name===o);if(m)K("room",m.key);return}if(o===i)return;K("table",o??void 0,{replace:i!==null})},T=()=>{H(!0),v(!0)},E=!u&&l.length===0&&p.length>0,B=u&&S.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:[f?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>g(null),children:t("Reset view")}):null,!u&&p.length>0?e("button",{type:"button",className:"secondary","aria-haspopup":"dialog",onClick:T,children:t("Who's at the table")}):null]})]}),n("div",{className:"table-frame","data-focused":i!==null||void 0,children:[E?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("Every agent has left the table. Choose who sits down.")}),e("button",{type:"button",onClick:T,children:t("Who's at the table")})]}):B?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(Ut,{onHandle:c,focus:i,onFocus:g,onSeat:g,...u?{onMore:()=>K("rooms")}:{onSeatMenu:(o)=>{let m=l.find((y)=>y.name===o.id);if(m)R(m.key,o.at,o.via,o.source)}}}),u?e(W,{}):null,b?e(Xn,{roomKey:b.key,open:A,onBack:()=>g(null),onMenu:(o)=>{let m=o.getBoundingClientRect();R(b.key,{x:m.left,y:m.bottom},"key",o)}},b.key):null]}),N?e(M,{fallback:null,children:e(V,{open:C,onClose:()=>v(!1)})}):null]})}export{Y as TablePage};
@@ -0,0 +1 @@
1
+ import{D,r,t,e,n,vt}from"./chunk-index-zynq0b0w.js";import"./chunk-index-yzsgsvnp.js";import"./chunk-index-0fmmvgee.js";import"./chunk-index-rnxj3z8k.js";import{Bn}from"./chunk-index-7xffskfa.js";import{ot}from"./chunk-index-pk1yxkv4.js";import{I}from"./chunk-index-vcyzwtk2.js";import{He}from"./chunk-index-mq0dacwr.js";function u({view:s}){let o=D(),[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(vt,{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(ot,{id:o,checked:!l,label:s.displayName,busy:a,onChange:async(i)=>{m(!0),await He(s.key,!i),m(!1)}})]})})}function g(s){let o=Bn();return e(I,{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("An agent 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{fn,Ci,Ai,gt,qt,Bt,Ln}from"./chunk-index-2d0kg096.js";import{At}from"./chunk-index-k2qq1gdj.js";var le="http://www.w3.org/2000/svg",t=(d,i={},p)=>{let y=document.createElementNS(le,d);for(let[v,R]of Object.entries(i))y.setAttribute(v,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)"),v=i.reducedMotion==="auto"||i.reducedMotion===void 0?y.matches:i.reducedMotion,R=i.labels??At,{theme:O,scheme:I}=i,S=[],_=new Map,L=new Map,E=i.focus??null,M=document.createElement("div");M.className="t2d";let f=t("svg",{role:"group","aria-label":R.table});if(M.appendChild(f),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(M);function X(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=fn(O,I);M.classList.toggle("reduced",v),M.classList.toggle("focus",E!==null),M.classList.toggle("dim",S.some((r)=>L.get(r.id)==="speaking"));let s=i.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,s?60:200);f.setAttribute("viewBox",`0 0 ${c} ${o}`),f.replaceChildren();let g=Math.max(S.length,1),{rows:a,perRow:l}=fe(g,s);t("rect",{width:c,height:o,fill:e.css.bg},f);let w=t("defs",{},f),T=c/2,N=s?o*0.82:o*0.62;if(t("ellipse",{cx:T,cy:N,rx:c*0.47,ry:s?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},f),!s)t("ellipse",{cx:T,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},f);let F=c/l,q=s?o*0.95:o/(a+0.6),m=Math.max(46,Math.min(F*0.94,132,q*1.05)),h=m*0.72,n=m*1.05;X(w,e,n),S.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(S.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=L.get(r.id)??"idle",u=t("g",{class:"seat","data-seat":r.id,"data-state":H,...E===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"}:{}},f);t("ellipse",{cx:0,cy:3,rx:m*0.55,ry:m*0.1,fill:"#000",opacity:0.35},u),t("ellipse",{class:"halo",cx:0,cy:-h-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${p}-h${b})`},u),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},u);let B=t("g",{class:"lift"},u),Y=_.get(r.id);if(Y)t("image",{href:ce(Y),x:-n/2,y:-h-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:-h-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},B);let A=t("text",{x:0,y:-h-n*0.3+n*0.1,"text-anchor":"middle","font-size":n*0.3,"font-weight":700,fill:"#fff","font-family":gt},B);A.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let Z=h*0.22;t("path",{d:`M ${-m*0.5} ${-h} L ${m*0.5} ${-h} L ${m*0.42} 0 L ${-m*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},u),t("rect",{x:-m*0.54,y:-h-Z*0.2,width:m*1.08,height:Z,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},u);let C=Math.max(11,Math.min(15,m*0.14)),K=Math.min(Math.max(m*0.9,C*5.5+14),Math.max(m*0.9,r.name.length*C*0.62+18),F*0.98),se=C+8;t("rect",{class:"plate",x:-K/2,y:-h*0.78,width:K,height:se,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},u);let ae=t("text",{x:0,y:-h*0.78+C+1.5,"text-anchor":"middle","font-size":C,"font-weight":700,"font-family":gt,fill:e.plateInk},u);ae.textContent=Ai(r.name,(K-8)/C);let J=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-h-n*0.78})`},u)),V=H==="done",D=H==="error",P=e.gold;if(V)P=Ci.done;else if(D)P=Ci.error;t("circle",{r:n*0.15,fill:P,stroke:e.ink,"stroke-width":2},J);let U=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":gt,fill:V||D?"#fff":e.ink},J);if(U.textContent="!",V)U.textContent="✓";else if(D)U.textContent="✕";let Q=t("g",{class:"orbit"},u);t("circle",{cx:n*0.4,cy:-h-n*0.5,r:n*0.05,fill:r.color},Q),t("circle",{cx:-n*0.4,cy:-h-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},Q),u.addEventListener("click",()=>i.onSeatClick({id:r.id,name:r.name})),u.addEventListener("keydown",(A)=>{if(A.key==="Enter"||A.key===" ")A.preventDefault(),i.onSeatClick({id:r.id,name:r.name})})}),!s){let r=Math.min(c*0.34,190),b=o-6;t("rect",{x:T-r/2,y:b-22,width:r,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},f);let k=t("text",{x:T,y:b-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":gt,fill:e.gold},f);k.textContent=Ai(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=fn(O,I),o=(g,a)=>{let l=setTimeout(()=>{G.delete(l),g()},a);G.add(l)};for(let g of e.joining){let a=[...f.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()},Bt)}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,[T,N,F]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let q=t("circle",{class:"puff",cx:T,cy:N,r:F,fill:c.paper,stroke:c.ink,"stroke-width":3},l);q.style.animationDelay=`${w*40}ms`}f.appendChild(l),o(()=>l.remove(),qt)}},W=new ResizeObserver(x);W.observe(d);let j=()=>{if(i.reducedMotion==="auto"||i.reducedMotion===void 0)z.setReducedMotion(y.matches)};y.addEventListener("change",j);let z={kind:"svg",setTheme(e,s){O=e,I=s,x()},setSeats(e){let s=S.map((o)=>o.id),c=new Map([...f.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));S=e;for(let o of e)if(L.set(o.id,o.state??"idle"),o.avatarSvg)_.set(o.id,o.avatarSvg);if(x(),s.length>0||c.size>0)ee(Ln(s,e.map((o)=>o.id),v),c)},setState(e,s){if(L.get(e)===s)return;L.set(e,s),x()},setAvatar(e,s){return _.set(e,s),x(),Promise.resolve()},setReducedMotion(e){v=e,x()},resetCamera(){E=null,x(),i.onFocus?.(null)},focus(e){if(e===E)return;E=e,x()},focused:()=>E,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:v,loop:"idle",seats:S.length,renders:0}},dispose(){for(let e of G)clearTimeout(e);G.clear(),W.disconnect(),y.removeEventListener("change",j),M.remove()}};return z.setSeats(i.seats),z}export{ye as createTable2D};
1
+ import{gn,Wi,Yi,_t,Ht,jt,qn}from"./chunk-index-6twb7ccd.js";import{Dt}from"./chunk-index-jw7dtshr.js";var le="http://www.w3.org/2000/svg",t=(d,i={},p)=>{let y=document.createElementNS(le,d);for(let[v,R]of Object.entries(i))y.setAttribute(v,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)"),v=i.reducedMotion==="auto"||i.reducedMotion===void 0?y.matches:i.reducedMotion,R=i.labels??Dt,{theme:O,scheme:I}=i,S=[],_=new Map,L=new Map,E=i.focus??null,M=document.createElement("div");M.className="t2d";let f=t("svg",{role:"group","aria-label":R.table});if(M.appendChild(f),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(M);function X(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=gn(O,I);M.classList.toggle("reduced",v),M.classList.toggle("focus",E!==null),M.classList.toggle("dim",S.some((r)=>L.get(r.id)==="speaking"));let s=i.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,s?60:200);f.setAttribute("viewBox",`0 0 ${c} ${o}`),f.replaceChildren();let g=Math.max(S.length,1),{rows:a,perRow:l}=fe(g,s);t("rect",{width:c,height:o,fill:e.css.bg},f);let w=t("defs",{},f),T=c/2,N=s?o*0.82:o*0.62;if(t("ellipse",{cx:T,cy:N,rx:c*0.47,ry:s?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},f),!s)t("ellipse",{cx:T,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},f);let F=c/l,q=s?o*0.95:o/(a+0.6),m=Math.max(46,Math.min(F*0.94,132,q*1.05)),h=m*0.72,n=m*1.05;X(w,e,n),S.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(S.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=L.get(r.id)??"idle",u=t("g",{class:"seat","data-seat":r.id,"data-state":H,...E===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"}:{}},f);t("ellipse",{cx:0,cy:3,rx:m*0.55,ry:m*0.1,fill:"#000",opacity:0.35},u),t("ellipse",{class:"halo",cx:0,cy:-h-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${p}-h${b})`},u),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},u);let B=t("g",{class:"lift"},u),Y=_.get(r.id);if(Y)t("image",{href:ce(Y),x:-n/2,y:-h-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:-h-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},B);let A=t("text",{x:0,y:-h-n*0.3+n*0.1,"text-anchor":"middle","font-size":n*0.3,"font-weight":700,fill:"#fff","font-family":_t},B);A.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let Z=h*0.22;t("path",{d:`M ${-m*0.5} ${-h} L ${m*0.5} ${-h} L ${m*0.42} 0 L ${-m*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},u),t("rect",{x:-m*0.54,y:-h-Z*0.2,width:m*1.08,height:Z,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},u);let C=Math.max(11,Math.min(15,m*0.14)),K=Math.min(Math.max(m*0.9,C*5.5+14),Math.max(m*0.9,r.name.length*C*0.62+18),F*0.98),se=C+8;t("rect",{class:"plate",x:-K/2,y:-h*0.78,width:K,height:se,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},u);let ae=t("text",{x:0,y:-h*0.78+C+1.5,"text-anchor":"middle","font-size":C,"font-weight":700,"font-family":_t,fill:e.plateInk},u);ae.textContent=Yi(r.name,(K-8)/C);let J=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-h-n*0.78})`},u)),V=H==="done",D=H==="error",P=e.gold;if(V)P=Wi.done;else if(D)P=Wi.error;t("circle",{r:n*0.15,fill:P,stroke:e.ink,"stroke-width":2},J);let U=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":_t,fill:V||D?"#fff":e.ink},J);if(U.textContent="!",V)U.textContent="✓";else if(D)U.textContent="✕";let Q=t("g",{class:"orbit"},u);t("circle",{cx:n*0.4,cy:-h-n*0.5,r:n*0.05,fill:r.color},Q),t("circle",{cx:-n*0.4,cy:-h-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},Q),u.addEventListener("click",()=>i.onSeatClick({id:r.id,name:r.name})),u.addEventListener("keydown",(A)=>{if(A.key==="Enter"||A.key===" ")A.preventDefault(),i.onSeatClick({id:r.id,name:r.name})})}),!s){let r=Math.min(c*0.34,190),b=o-6;t("rect",{x:T-r/2,y:b-22,width:r,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},f);let k=t("text",{x:T,y:b-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":_t,fill:e.gold},f);k.textContent=Yi(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=gn(O,I),o=(g,a)=>{let l=setTimeout(()=>{G.delete(l),g()},a);G.add(l)};for(let g of e.joining){let a=[...f.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()},jt)}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,[T,N,F]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let q=t("circle",{class:"puff",cx:T,cy:N,r:F,fill:c.paper,stroke:c.ink,"stroke-width":3},l);q.style.animationDelay=`${w*40}ms`}f.appendChild(l),o(()=>l.remove(),Ht)}},W=new ResizeObserver(x);W.observe(d);let j=()=>{if(i.reducedMotion==="auto"||i.reducedMotion===void 0)z.setReducedMotion(y.matches)};y.addEventListener("change",j);let z={kind:"svg",setTheme(e,s){O=e,I=s,x()},setSeats(e){let s=S.map((o)=>o.id),c=new Map([...f.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));S=e;for(let o of e)if(L.set(o.id,o.state??"idle"),o.avatarSvg)_.set(o.id,o.avatarSvg);if(x(),s.length>0||c.size>0)ee(qn(s,e.map((o)=>o.id),v),c)},setState(e,s){if(L.get(e)===s)return;L.set(e,s),x()},setAvatar(e,s){return _.set(e,s),x(),Promise.resolve()},setReducedMotion(e){v=e,x()},resetCamera(){E=null,x(),i.onFocus?.(null)},focus(e){if(e===E)return;E=e,x()},focused:()=>E,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:v,loop:"idle",seats:S.length,renders:0}},dispose(){for(let e of G)clearTimeout(e);G.clear(),W.disconnect(),y.removeEventListener("change",j),M.remove()}};return z.setSeats(i.seats),z}export{ye as createTable2D};