pi-roundtable-web 0.29.1 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/chunk-account-dq0nhfvj.js +1 -0
- package/dist/{chunk-action-menu-ap5xn7bf.js → chunk-action-menu-37zgbhje.js} +1 -1
- package/dist/chunk-agent-yqe6reej.js +1 -0
- package/dist/chunk-arranged-rooms-sx6xg9df.js +1 -0
- package/dist/{chunk-attachments-p5v9gqyt.js → chunk-attachments-3vbj05g5.js} +2 -2
- package/dist/chunk-bulk-actions-6pehrsgb.js +1 -0
- package/dist/{chunk-character-creator-m7tw20ef.js → chunk-character-creator-bg3tdc8p.js} +2 -2
- package/dist/chunk-codeeditor-102wa9bj.js +2 -0
- package/dist/chunk-confirm-ghxga720.js +1 -0
- package/dist/chunk-connectors-0jzzren3.js +37 -0
- package/dist/chunk-conversations-3276jq4q.js +1 -0
- package/dist/chunk-council-sheet-7m884s44.js +2 -0
- package/dist/chunk-council-view-rkzcxeg8.js +1 -0
- package/dist/{chunk-drag-d1bpy8w6.js → chunk-drag-sw692nr3.js} +1 -1
- package/dist/chunk-entry-mb6jd983.js +1 -0
- package/dist/chunk-folder-list-g7st6p1e.js +1 -0
- package/dist/chunk-folds-rb1b069h.js +1 -0
- package/dist/{chunk-gate-dt91egcd.js → chunk-gate-3rxxyfev.js} +1 -1
- package/dist/chunk-host-icons-cyj62pwp.js +1 -0
- package/dist/chunk-host-picture-9wnhqckv.js +1 -0
- package/dist/chunk-host-state-b858k3p8.js +1 -0
- package/dist/chunk-host-ui-j6wvj0pe.js +1 -0
- package/dist/{chunk-index-6s2pqwna.js → chunk-index-0qzqzp6t.js} +2 -2
- package/dist/{chunk-index-w17wgjby.js → chunk-index-0t68az7d.js} +3 -3
- package/dist/chunk-index-0xdptr30.js +2 -0
- package/dist/{chunk-index-8wpvj7k5.js → chunk-index-1tkzdy4s.js} +2 -2
- package/dist/chunk-index-2s48qyrs.js +2 -0
- package/dist/chunk-index-33cqx9v2.js +2 -0
- package/dist/chunk-index-36m3knsk.js +2 -0
- package/dist/{chunk-index-7mrkq793.js → chunk-index-50syrmaq.js} +2 -2
- package/dist/{chunk-index-5j1v2q7w.js → chunk-index-50w6yq2d.js} +1 -1
- package/dist/{chunk-index-ce7hsda9.js → chunk-index-5fyqxh0r.js} +2 -2
- package/dist/chunk-index-5x3h176v.js +2 -0
- package/dist/{chunk-index-6btdp13p.js → chunk-index-6cs1wvhy.js} +1 -1
- package/dist/{chunk-index-yr758n6t.js → chunk-index-6m25qpa7.js} +2 -2
- package/dist/{chunk-index-d4mx2vvf.js → chunk-index-6nja2vd8.js} +2 -2
- package/dist/{chunk-index-wgrx2ybn.js → chunk-index-6q3dx093.js} +2 -2
- package/dist/{chunk-index-6rdywten.js → chunk-index-6ycrvwzs.js} +2 -2
- package/dist/{chunk-index-1kb8tv4v.js → chunk-index-6yfcfcc8.js} +2 -2
- package/dist/{chunk-index-4a1tdadd.js → chunk-index-7gk2sdf4.js} +3 -3
- package/dist/{chunk-index-q4k9vk04.js → chunk-index-7p31pda8.js} +3 -3
- package/dist/chunk-index-91wnf1k9.js +1 -0
- package/dist/chunk-index-9ehqccfe.js +2 -0
- package/dist/chunk-index-ar1x9fhw.js +2 -0
- package/dist/chunk-index-axw4wkqq.js +2 -0
- package/dist/chunk-index-b5patef1.js +2 -0
- package/dist/chunk-index-dagc92hw.js +2 -0
- package/dist/chunk-index-ddssgba9.js +2 -0
- package/dist/chunk-index-dpgn7kzp.js +2 -0
- package/dist/{chunk-index-cmzvq3nf.js → chunk-index-e8535c4h.js} +2 -2
- package/dist/{chunk-index-vpq2cj14.js → chunk-index-edjyj761.js} +1 -1
- package/dist/chunk-index-eez0kbk4.js +2 -0
- package/dist/chunk-index-ekp5mmvp.js +2 -0
- package/dist/{chunk-index-en728705.js → chunk-index-eyythjdx.js} +2 -2
- package/dist/chunk-index-fdg2qd3f.js +2 -0
- package/dist/chunk-index-g0sdxjxr.js +2 -0
- package/dist/{chunk-index-prq011b6.js → chunk-index-gmbk3sra.js} +1 -1
- package/dist/chunk-index-hsc9yz2x.js +2 -0
- package/dist/{chunk-index-ffnd0jcj.js → chunk-index-jrj09r5c.js} +2 -2
- package/dist/chunk-index-kvztbfqj.js +2 -0
- package/dist/{chunk-index-53fwc7sc.js → chunk-index-m7wzrmcd.js} +2 -2
- package/dist/{chunk-index-cfesmk1f.js → chunk-index-m8bv51r9.js} +2 -2
- package/dist/{chunk-index-v9jqyr1f.js → chunk-index-mey1p7h8.js} +3 -3
- package/dist/{chunk-index-0h99xcs3.js → chunk-index-mzw7nmkc.js} +2 -2
- package/dist/{chunk-index-3tksdmx7.js → chunk-index-n2v2bz8d.js} +2 -2
- package/dist/chunk-index-nncy9wxw.js +2 -0
- package/dist/chunk-index-p2e7rwac.js +2 -0
- package/dist/chunk-index-p98tt12y.js +2 -0
- package/dist/chunk-index-qdtmetsy.js +120 -0
- package/dist/{chunk-index-ysv36nbk.js → chunk-index-qedt9szy.js} +2 -2
- package/dist/{chunk-index-gdh7wsd5.js → chunk-index-qk7rp7fk.js} +11 -11
- package/dist/{chunk-index-nr275sa7.js → chunk-index-qq86fxda.js} +2 -2
- package/dist/{chunk-index-xbj816p0.js → chunk-index-qw9a7ken.js} +2 -2
- package/dist/chunk-index-s356ybxk.js +50 -0
- package/dist/{chunk-index-dr0jr7d3.js → chunk-index-sk8cvb4e.js} +3 -3
- package/dist/{chunk-index-m76gdwnk.js → chunk-index-syxwqhry.js} +2 -2
- package/dist/{chunk-index-ze9p4npm.js → chunk-index-tasbd41t.js} +2 -2
- package/dist/chunk-index-vxqzavgz.js +2 -0
- package/dist/{chunk-index-fn6305vn.js → chunk-index-x5xq9g9a.js} +3 -3
- package/dist/chunk-index-xx0kecz9.js +2 -0
- package/dist/{chunk-index-sz381vda.js → chunk-index-y1xv3dxs.js} +100 -4
- package/dist/{chunk-index-8pbwr3rs.js → chunk-index-yn1vvxj2.js} +1 -1
- package/dist/chunk-lang-css-rwkzd784.js +1 -0
- package/dist/{chunk-lang-dockerfile-y24eejnh.js → chunk-lang-dockerfile-e87ssppx.js} +1 -1
- package/dist/{chunk-lang-go-qzgv1161.js → chunk-lang-go-kbcbn346.js} +2 -2
- package/dist/chunk-lang-html-zhngbs9v.js +1 -0
- package/dist/chunk-lang-javascript-bk2s6a56.js +1 -0
- package/dist/{chunk-lang-json-99v80v88.js → chunk-lang-json-4pe1fv7e.js} +1 -1
- package/dist/{chunk-lang-markdown-gn8he877.js → chunk-lang-markdown-67cm3tjx.js} +5 -5
- package/dist/{chunk-lang-python-prsw4p4k.js → chunk-lang-python-mnfhcvww.js} +2 -2
- package/dist/{chunk-lang-rust-g6xqta16.js → chunk-lang-rust-e4a9s76x.js} +1 -1
- package/dist/{chunk-lang-shell-dmpnzc6w.js → chunk-lang-shell-43nea8tq.js} +1 -1
- package/dist/{chunk-lang-sql-wz7ca27b.js → chunk-lang-sql-28364npv.js} +2 -2
- package/dist/{chunk-lang-toml-160prtq4.js → chunk-lang-toml-a83hr7bw.js} +1 -1
- package/dist/chunk-lang-typescript-r5npc6zf.js +1 -0
- package/dist/{chunk-lang-xml-9htkz2dd.js → chunk-lang-xml-2hv5xc8n.js} +1 -1
- package/dist/{chunk-lang-yaml-08749wd5.js → chunk-lang-yaml-vw22drt8.js} +1 -1
- package/dist/chunk-layout-actions-rw5myg2t.js +1 -0
- package/dist/chunk-menu-items-q0hy5kzd.js +1 -0
- package/dist/chunk-mode-toggle-yk2t0tcy.js +1 -0
- package/dist/{chunk-note-row-28e5x7n8.js → chunk-note-row-c0trzayj.js} +3 -3
- package/dist/chunk-notes-0xcmm938.js +1 -0
- package/dist/chunk-notice-bell-f9nhxg71.js +1 -0
- package/dist/{chunk-notices-d0cwvk27.js → chunk-notices-gkaqncqz.js} +1 -1
- package/dist/chunk-onboarding-fkq9ptcw.js +1 -0
- package/dist/{chunk-overview-9sb3ywa8.js → chunk-overview-yssxbg0d.js} +1 -1
- package/dist/{chunk-palette-5sfhrv4x.js → chunk-palette-w6qbr7zp.js} +1 -1
- package/dist/chunk-placement-items-wcwy91mp.js +1 -0
- package/dist/chunk-profile-9sjgayrx.js +1 -0
- package/dist/chunk-prompt-history-kn42sf8y.js +1 -0
- package/dist/chunk-prompts-824fwgvh.js +1 -0
- package/dist/chunk-room-confirms-hvs9tra4.js +1 -0
- package/dist/{chunk-room-menu-hwkjyxwe.js → chunk-room-menu-pkd0487m.js} +1 -1
- package/dist/chunk-rooms-menu-button-w5hfhsfv.js +1 -0
- package/dist/chunk-schedules-m9mn68gt.js +1 -0
- package/dist/{chunk-seat-menu-n2bcw0mf.js → chunk-seat-menu-3tdcr44t.js} +1 -1
- package/dist/chunk-section-fold-g0tx68cj.js +1 -0
- package/dist/chunk-settings-18qmhcyr.js +1 -0
- package/dist/chunk-sheet-hosts-tsppnmvv.js +29 -0
- package/dist/{chunk-shortcut-help-434sqnxc.js → chunk-shortcut-help-wnm0cm8n.js} +2 -2
- package/dist/chunk-shortcuts-qee393s5.js +1 -0
- package/dist/{chunk-skill-editor-98492yrt.js → chunk-skill-editor-pryntvpr.js} +2 -2
- package/dist/{chunk-skills-mfv8ppfh.js → chunk-skills-sap3rysr.js} +1 -1
- package/dist/{chunk-start-over-line-m526193z.js → chunk-start-over-line-azexcxj1.js} +2 -2
- package/dist/chunk-switcher-list-6hacxjfe.js +1 -0
- package/dist/{chunk-tab-dot-tzjkahj5.js → chunk-tab-dot-h0eskhrt.js} +1 -1
- package/dist/{chunk-table-xbtbex2z.js → chunk-table-jtn49c2m.js} +1 -1
- package/dist/chunk-table2d-vy4w4r5k.js +1 -0
- package/dist/{chunk-table3d-5a7vbgyj.js → chunk-table3d-0a62jerb.js} +24 -24
- package/dist/chunk-thread-actions-31scmndt.js +1 -0
- package/dist/{chunk-thread-cards-n0n603vf.js → chunk-thread-cards-mwxzy02t.js} +1 -1
- package/dist/{chunk-thread-list-7bkdn51x.js → chunk-thread-list-52mx2m9p.js} +2 -2
- package/dist/chunk-transcript-p5q2m795.js +1 -0
- package/dist/{chunk-waiting-chip-y83c90v3.js → chunk-waiting-chip-wvkbsnw5.js} +2 -2
- package/dist/chunk-waiting-s7nm3q0p.js +1 -0
- package/dist/chunk-where-j99f8pb8.js +1 -0
- package/dist/{chunk-workspace-dw71mshw.js → chunk-workspace-ne2nkf4h.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-account-66e6ezdq.js +0 -1
- package/dist/chunk-agent-sapt5qhn.js +0 -1
- package/dist/chunk-arranged-rooms-n6bk696f.js +0 -1
- package/dist/chunk-bulk-actions-aze4ewc4.js +0 -1
- package/dist/chunk-codeeditor-yy6pq8mv.js +0 -2
- package/dist/chunk-confirm-0cajsfhk.js +0 -1
- package/dist/chunk-connectors-tw0tbm21.js +0 -37
- package/dist/chunk-conversations-wkm23m5r.js +0 -1
- package/dist/chunk-council-sheet-mz7s23nq.js +0 -2
- package/dist/chunk-council-view-zgvzxtgn.js +0 -1
- package/dist/chunk-entry-7zr5b1fp.js +0 -1
- package/dist/chunk-folder-list-bs4eh3g9.js +0 -1
- package/dist/chunk-folds-eez1q41c.js +0 -1
- package/dist/chunk-host-icons-nfe2t8tk.js +0 -1
- package/dist/chunk-host-picture-4rtswxwa.js +0 -1
- package/dist/chunk-host-state-1vxzmmq6.js +0 -1
- package/dist/chunk-host-ui-x38bf0et.js +0 -1
- package/dist/chunk-index-24cggw6k.js +0 -50
- package/dist/chunk-index-2g8xtwqg.js +0 -2
- package/dist/chunk-index-3n38xe7m.js +0 -2
- package/dist/chunk-index-55ps4x5n.js +0 -2
- package/dist/chunk-index-5w6tb7p0.js +0 -2
- package/dist/chunk-index-6m7dwsmv.js +0 -1
- package/dist/chunk-index-7xcbpeqz.js +0 -2
- package/dist/chunk-index-88wh5eyj.js +0 -2
- package/dist/chunk-index-97dcp1vh.js +0 -1
- package/dist/chunk-index-a7e6rhxy.js +0 -2
- package/dist/chunk-index-bxf8eq1s.js +0 -2
- package/dist/chunk-index-c8gm1crh.js +0 -120
- package/dist/chunk-index-d74tpnkd.js +0 -2
- package/dist/chunk-index-fb3kzyyp.js +0 -2
- package/dist/chunk-index-mr391t49.js +0 -2
- package/dist/chunk-index-n3khm9fq.js +0 -2
- package/dist/chunk-index-nn4w6a04.js +0 -2
- package/dist/chunk-index-pgxgq61x.js +0 -2
- package/dist/chunk-index-rgdaec7y.js +0 -2
- package/dist/chunk-index-rjs1can6.js +0 -2
- package/dist/chunk-index-s4a8e4qm.js +0 -2
- package/dist/chunk-index-vsaggfns.js +0 -2
- package/dist/chunk-index-wsv46y9p.js +0 -2
- package/dist/chunk-index-zfdvyrjt.js +0 -2
- package/dist/chunk-lang-css-3h22se37.js +0 -1
- package/dist/chunk-lang-html-9rvrmmpg.js +0 -1
- package/dist/chunk-lang-javascript-4kv8s3tk.js +0 -1
- package/dist/chunk-lang-typescript-mp0yw903.js +0 -1
- package/dist/chunk-layout-actions-tdx896xf.js +0 -1
- package/dist/chunk-menu-items-trhybv1g.js +0 -1
- package/dist/chunk-mode-toggle-4dtfphq4.js +0 -1
- package/dist/chunk-notes-5nkayhw8.js +0 -1
- package/dist/chunk-notice-bell-xz8a04am.js +0 -1
- package/dist/chunk-onboarding-zs4rtea9.js +0 -1
- package/dist/chunk-placement-items-e2neja55.js +0 -1
- package/dist/chunk-profile-jffhtpqf.js +0 -1
- package/dist/chunk-prompt-history-1jz2gk3v.js +0 -1
- package/dist/chunk-prompts-0t30ttd0.js +0 -1
- package/dist/chunk-room-confirms-6595921h.js +0 -1
- package/dist/chunk-rooms-menu-button-k0eq1tcr.js +0 -1
- package/dist/chunk-schedules-e12y8fw2.js +0 -1
- package/dist/chunk-sheet-hosts-myvm2vhd.js +0 -29
- package/dist/chunk-shortcuts-mjxph0g7.js +0 -1
- package/dist/chunk-switcher-list-5ngjar24.js +0 -1
- package/dist/chunk-table2d-61bvrykm.js +0 -1
- package/dist/chunk-thread-actions-bf6vf2mt.js +0 -1
- package/dist/chunk-transcript-8ztrkt6g.js +0 -1
- package/dist/chunk-waiting-s273kcgz.js +0 -1
- package/dist/chunk-where-jr791gzj.js +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{o,r,t,g,e,n,h,y,l,f,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import{ln}from"./chunk-index-2g8xtwqg.js";import{xe}from"./chunk-index-55ps4x5n.js";import{Re}from"./chunk-index-dr0jr7d3.js";import{H}from"./chunk-index-s4a8e4qm.js";import"./chunk-index-cmzvq3nf.js";import{Y}from"./chunk-index-d941ae7c.js";var P=(a,s)=>({method:a,body:JSON.stringify(s)}),U=encodeURIComponent,A={list:()=>h("connectors/managed"),add:(a)=>h("connectors/managed",P("POST",a)),describe:(a,s)=>h(`connectors/managed/${U(a)}`,P("PATCH",{description:s})),remove:(a)=>h(`connectors/managed/${U(a)}`,{method:"DELETE"}),grants:()=>h("connectors/grants"),channels:()=>h("connectors/grants/channels"),authorize:(a)=>h("connectors/grants",P("POST",a)),describeGrant:(a,s,i)=>h(`connectors/grants/${U(a)}/${U(s)}`,P("PATCH",i)),revoke:(a,s)=>h(`connectors/grants/${U(a)}/${U(s)}`,{method:"DELETE"}),rotate:(a)=>h(`connectors/grants/${U(a)}/rotate`,{method:"POST"})};var z={name:"",url:"",description:"",header:"",token:""};function j(a){let[s,i]=r(z),[d,b]=r(),[C,w]=r(!1),p=(c)=>(M)=>i((x)=>({...x,[c]:M}));return n("form",{className:"stack",onSubmit:async(c)=>{c.preventDefault(),w(!0),b(void 0);try{let{connector:M,skipped:x}=await A.add({name:s.name,url:s.url,description:s.description,...s.header.trim()?{header:s.header}:{},...s.token?{token:s.token}:{}});i(z),f(x.length?t("Added {name}. Left out tools whose names are too long: {tools}",{name:M.name,tools:x.join(", ")}):t("Added {name}.",{name:M.name})),a.onDone()}catch(M){b(l(M))}finally{w(!1)}},autoComplete:"off",children:[n("label",{children:[t("Name"),e("input",{value:s.name,maxLength:12,placeholder:"notion",required:!0,onChange:(c)=>p("name")(c.target.value)}),e("span",{className:"meta",children:t("Lowercase letters, digits and -, up to 12; it becomes the prefix of its tool names.")})]}),n("label",{children:[t("MCP URL"),e("input",{type:"url",value:s.url,maxLength:500,placeholder:"https://mcp.example.com/mcp",required:!0,onChange:(c)=>p("url")(c.target.value)}),e("span",{className:"meta",children:t("A Streamable HTTP endpoint; one ending in /sse uses SSE. A credential may be part of the URL.")})]}),n("label",{children:[t("Purpose"),e("textarea",{value:s.description,maxLength:1000,rows:3,required:!0,onChange:(c)=>p("description")(c.target.value)}),e("span",{className:"meta",children:t("The knights decide from this text when to use the connector.")})]}),n("div",{className:"form-row",children:[n("label",{children:[t("Header name (optional)"),e("input",{value:s.header,maxLength:100,placeholder:"X-API-Key",onChange:(c)=>p("header")(c.target.value)}),e("span",{className:"meta",children:t("Leave empty to send Authorization: Bearer <token>.")})]}),n("label",{children:[t("Token (optional)"),e("input",{type:"password",value:s.token,maxLength:4000,autoComplete:"new-password",onChange:(c)=>p("token")(c.target.value)}),e("span",{className:"meta",children:t("Stored encrypted by the gateway and never shown again; leave empty if the credential is in the URL.")})]})]}),d?e(m,{message:d}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:C,children:t("Add connector")})]})]})}function J(a){let[s,i]=r(a.connector.description),[d,b]=r(),[C,w]=r(!1);return n("form",{className:"stack",onSubmit:async(N)=>{N.preventDefault(),w(!0),b(void 0);try{await A.describe(a.connector.name,s),f(t("Purpose updated.")),a.onDone()}catch(c){b(l(c))}finally{w(!1)}},children:[n("label",{children:[t("Purpose"),e("textarea",{value:s,maxLength:1000,rows:4,required:!0,onChange:(N)=>i(N.target.value)}),e("span",{className:"meta",children:t("From the next message on, the knights follow the new purpose.")})]}),d?e(m,{message:d}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:C,children:t("Save")})]})]})}function F(){let{data:a,error:s,reload:i}=ln(()=>A.list()),[d,b]=r(!1),[C,w]=r(),[p,N]=r();return n("section",{className:"stack","aria-labelledby":"connectors-mine",children:[n("div",{className:"card-head",children:[e("h3",{id:"connectors-mine",children:t("MCP connectors")}),e("button",{type:"button",onClick:()=>b(!0),children:t("Add connector")})]}),s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?.length===0?e(k,{children:t("No connectors yet.")}):null,a?.map((c)=>n("article",{className:"card connector-card",children:[n("div",{className:"card-head",children:[e("strong",{children:c.name}),c.tools===void 0?e(Q,{tone:"warn",children:t("Tools unreadable")}):e(Q,{children:t("{count} tools",{count:c.tools})})]}),e("p",{className:"meta connector-url",children:c.displayUrl??t("(the URL cannot be parsed)")}),e("p",{children:c.description}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>w(c),children:t("Edit purpose")}),e("button",{type:"button",className:"danger",onClick:()=>N(c),children:t("Remove")})]})]},c.name)),e(H,{open:d,title:t("Add an MCP connector"),onClose:()=>b(!1),children:d?e(j,{onCancel:()=>b(!1),onDone:()=>{b(!1),i()}}):null}),e(H,{open:C!==void 0,title:t("Edit purpose of {name}",{name:C?.name??""}),onClose:()=>w(void 0),children:C?e(J,{connector:C,onCancel:()=>w(void 0),onDone:()=>{w(void 0),i()}},C.name):null}),e(D,{open:p!==void 0,title:t("Remove connector"),confirmLabel:t("Remove"),tone:"danger",onClose:()=>N(void 0),onConfirm:async()=>{if(!p)return;await A.remove(p.name),f(t("Removed {name}.",{name:p.name})),i()},children:e("p",{children:t("Remove {name} and its token? From the next message on, the knights no longer use it.",{name:p?.name??""})})})]})}var T=" new",K=(a,s)=>a.map((i)=>s.find((d)=>d.id===i)?.label??i).join(", ");function X(a){return e(H,{open:a.shown!==void 0,title:t("MCP URL of {bundle}",{bundle:a.shown?.bundle??""}),onClose:a.onClose,children:n("div",{className:"stack",children:[e("p",{children:t("This URL is the access credential and is shown only this once. Add a remote MCP server in the AI client and paste it; no separate token is needed.")}),e("input",{readOnly:!0,"aria-label":t("MCP URL"),className:"mcp-url",value:a.shown?.url??"",onFocus:(s)=>s.target.select()}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>{navigator.clipboard?.writeText(a.shown?.url??"").then(()=>f(t("Copied")))},children:t("Copy")}),e("button",{type:"button",onClick:a.onClose,children:t("Done")})]})]})})}function Z(a){return n("fieldset",{className:"field",children:[e("legend",{children:t("Allowed operations")}),e("ul",{className:"menu",children:a.operations.map((s)=>{let i=a.chosen.includes(s.id);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:i,onChange:()=>a.onChange(i?a.chosen.filter((d)=>d!==s.id):[...a.chosen,s.id])}),e("span",{className:"menu-text",children:e("strong",{children:s.label})})]})},s.id)})})]})}function ee(a){let{view:s}=a,[i,d]=r(),[b,C]=r(s.bundles[0]?.name??T),[w,p]=r(""),[N,c]=r(""),[M,x]=r([]),[L,R]=r(""),[E,W]=r(""),[V,I]=r(),[B,O]=r(!1);return o(()=>{A.channels().then((u)=>{d(u),c((S)=>S||u[0]?.id||"")},(u)=>I(l(u)))},[]),n("form",{className:"stack",onSubmit:async(u)=>{u.preventDefault(),O(!0),I(void 0);try{let S=await A.authorize({bundle:b===T?w:b,channelId:N,operations:M,...L.trim()?{displayName:L}:{},...E.trim()?{description:E}:{}});f(t("Authorized the channel in {bundle}.",{bundle:S.bundle})),a.onDone(S.url?{bundle:S.bundle,url:S.url}:void 0)}catch(S){I(l(S))}finally{O(!1)}},children:[n("label",{htmlFor:"mcp-bundle",children:[t("Bundle"),n(Re,{id:"mcp-bundle",value:b,onChange:(u)=>C(u.target.value),children:[s.bundles.map((u)=>e("option",{value:u.name,children:u.name},u.name)),e("option",{value:T,children:t("New bundle…")})]})]}),b===T?n("label",{children:[t("New bundle name"),e("input",{value:w,maxLength:80,required:!0,onChange:(u)=>p(u.target.value)}),e("span",{className:"meta",children:t("Channels in one bundle share one MCP URL.")})]}):null,n("label",{htmlFor:"mcp-channel",children:[t("Channel"),i===void 0&&!V?e(v,{}):e(Re,{id:"mcp-channel",value:N,required:!0,onChange:(u)=>c(u.target.value),children:(i??[]).map((u)=>e("option",{value:u.id,children:`${u.guild} › #${u.name}`},u.id))})]}),e(Z,{operations:s.operations,chosen:M,onChange:x}),n("label",{children:[t("Name outside AI clients see (optional)"),e("input",{value:L,maxLength:100,onChange:(u)=>R(u.target.value)})]}),n("label",{children:[t("Purpose (optional)"),e("textarea",{value:E,maxLength:1000,rows:2,onChange:(u)=>W(u.target.value)})]}),V?e(m,{message:V}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:B,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:B||!N||M.length===0,children:t("Authorize")})]})]})}function ne(a){let{bundle:s,grant:i}=a.target,[d,b]=r(i.displayName),[C,w]=r(i.description),[p,N]=r(),[c,M]=r(!1);return n("form",{className:"stack",onSubmit:async(L)=>{L.preventDefault(),M(!0),N(void 0);try{await A.describeGrant(s,i.channelId,{displayName:d,description:C}),f(t("Updated what outside AI clients see.")),a.onDone()}catch(R){N(l(R))}finally{M(!1)}},children:[n("label",{children:[t("Name outside AI clients see"),e("input",{value:d,maxLength:100,required:!0,onChange:(L)=>b(L.target.value)})]}),n("label",{children:[t("Purpose"),e("textarea",{value:C,maxLength:1000,rows:3,onChange:(L)=>w(L.target.value)}),e("span",{className:"meta",children:t("The channel's name and topic on Discord stay as they are.")})]}),p?e(m,{message:p}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:c,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:c,children:t("Save")})]})]})}function te(a){let{grant:s}=a,{timeZone:i}=_();return n("li",{className:"grant",children:[n("div",{className:"card-head",children:[e("strong",{children:s.displayName}),s.visible?null:e(Q,{tone:"warn",children:t("Not visible now")})]}),e("p",{className:"meta",children:`${s.guildName} › #${s.channelName}`}),e("p",{children:s.description||t("No purpose set.")}),e("p",{className:"meta",children:t("Allowed: {operations}",{operations:K(s.operations,a.operations)})}),s.audit.length?n("details",{children:[e("summary",{children:t("Recent activity")}),e("ul",{className:"audit",children:s.audit.map((d)=>n("li",{children:[e("time",{dateTime:d.at,children:oe(d.at,i)})," ",e("code",{children:d.tool})," ",d.status]},`${d.at}-${d.tool}`))})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:a.onDescribe,children:t("Rename / purpose")}),e("button",{type:"button",className:"danger",onClick:a.onRevoke,children:t("Revoke")})]})]})}function G(){let{data:a,error:s,reload:i}=ln(()=>A.grants()),[d,b]=r(!1),[C,w]=r(),[p,N]=r(),[c,M]=r(),[x,L]=r();return n("section",{className:"stack","aria-labelledby":"mcp-grants",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h3",{id:"mcp-grants",children:t("MCP authorizations")}),e("p",{className:"hint",children:t("Which channels outside AI clients may use through each bundle's MCP URL, and with which operations.")})]}),e("button",{type:"button",disabled:!a,onClick:()=>b(!0),children:t("Authorize a channel")})]}),s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?.bundles.length===0?e(k,{children:t("There are no authorizations yet.")}):null,a?.bundles.map((R)=>n("article",{className:"card bundle-card",children:[n("div",{className:"card-head",children:[e("strong",{children:R.name}),e("button",{type:"button",className:"secondary",onClick:()=>M(R.name),children:t("New URL")})]}),R.grants.length===0?e(k,{children:t("No channels")}):null,e("ul",{className:"grants",children:R.grants.map((E)=>e(te,{bundle:R.name,grant:E,operations:a.operations,onDescribe:()=>w({bundle:R.name,grant:E}),onRevoke:()=>N({bundle:R.name,grant:E})},E.channelId))})]},R.name)),e(H,{open:d,title:t("Authorize a channel"),onClose:()=>b(!1),children:d&&a?e(ee,{view:a,onCancel:()=>b(!1),onDone:(R)=>{if(b(!1),R)L(R);i()}}):null}),e(H,{open:C!==void 0,title:t("What outside AI clients see"),onClose:()=>w(void 0),children:C?e(ne,{target:C,onCancel:()=>w(void 0),onDone:()=>{w(void 0),i()}},`${C.bundle}/${C.grant.channelId}`):null}),e(D,{open:p!==void 0,title:t("Revoke the channel"),confirmLabel:t("Revoke"),tone:"danger",onClose:()=>N(void 0),onConfirm:async()=>{if(!p)return;await A.revoke(p.bundle,p.grant.channelId),f(t("Revoked.")),i()},children:e("p",{children:t("Remove {channel} from bundle {bundle}? Its other channels and its URL keep working; operations already sent are not undone.",{channel:p?.grant.displayName??"",bundle:p?.bundle??""})})}),e(D,{open:c!==void 0,title:t("Replace the MCP URL"),confirmLabel:t("Replace URL"),tone:"danger",onClose:()=>M(void 0),onConfirm:async()=>{if(!c)return;let{bundle:R,url:E}=await A.rotate(c);if(E)L({bundle:R,url:E});i()},children:e("p",{children:t("Replace the URL of bundle {bundle}? The old URL stops working at once; every channel setting stays.",{bundle:c??""})})}),e(X,{...x?{shown:x}:{},onClose:()=>L(void 0)})]})}var ae=`
|
|
2
|
-
/* The Connectors page's management: an address never breaks the layout, a bundle's channels sit as rows. */
|
|
3
|
-
.connector-url,
|
|
4
|
-
.connectors-page .grant .meta {
|
|
5
|
-
overflow-wrap: anywhere;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.connectors-page .grants,
|
|
9
|
-
.connectors-page .audit {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
margin: 0;
|
|
13
|
-
padding: 0;
|
|
14
|
-
list-style: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.connectors-page .grant {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
gap: var(--space-1);
|
|
21
|
-
padding: var(--space-3) 0;
|
|
22
|
-
border-top: 1px solid var(--border);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.connectors-page .grant p {
|
|
26
|
-
margin: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.connectors-page .audit {
|
|
30
|
-
gap: var(--space-1);
|
|
31
|
-
font-size: var(--text-sm);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.mcp-url {
|
|
35
|
-
font-family: var(--font-mono);
|
|
36
|
-
}
|
|
37
|
-
`,q=()=>Y("connectors",ae);function _e(){q();let{connectorAdminUrl:a,connectorParts:s}=_(),i=s??{gateways:!0};return n("section",{className:"stack connectors-page",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Connectors")}),a?e("a",{href:a,target:"_blank",rel:"noreferrer",children:t("Open connector admin")}):null]}),e("p",{className:"hint",children:t("Upstream MCP gateways and virtual servers used by the knights.")}),i.manage?e(F,{}):null,i.grants?e(G,{}):null,i.gateways?e(se,{}):null]})}function se(){let{data:a,error:s}=xe(()=>y.connectors(),"connectors");return n("section",{className:"stack",children:[s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?n(g,{children:[e("h3",{children:t("Upstream gateways")}),a.gateways.length===0?e(k,{children:t("No gateways.")}):null,a.gateways.map((i)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(Q,{children:i.enabled?t("Enabled"):t("Disabled")}),e(Q,{tone:i.reachable?"plain":"warn",children:i.reachable?t("Reachable"):t("Unreachable")}),e(Q,{children:t("{count} tools",{count:i.tools})})]})},i.name)),e("h3",{children:t("Virtual servers")}),a.servers.length===0?e(k,{children:t("No virtual servers.")}):null,a.servers.map((i)=>n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(Q,{children:t("{count} tools",{count:i.tools.length})})]}),n("p",{children:[t("Used by"),": ",i.usedBy.join(", ")||t("None")]}),n("details",{children:[e("summary",{children:t("Tool list")}),e("ul",{children:i.tools.map((d)=>e("li",{children:d},d))})]})]},i.name))]}):null]})}export{_e as ConnectorsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,u,g,e,n,S,y,v,m,k,Q,_,we,oe,Pe,gn,ki,te}from"./chunk-index-24cggw6k.js";import{xe}from"./chunk-index-55ps4x5n.js";var h=[{kind:"owner",title:u("Owner channels"),note:u("Direct messages and channels where the owner talks to a knight.")},{kind:"agent",title:u("Bot server channels"),note:u("The bot server's one-to-one channels.")},{kind:"group",title:u("Group channels"),note:u("The bot server's group channels.")},{kind:"outside",title:u("Outside AI clients"),note:u("Conversations an outside AI client holds over MCP.")},{kind:"plugin",title:u("Plugin conversations"),note:u("Conversations a plugin runs, such as a web chat, as the host recorded them.")}];function Z(){let{timeZone:o}=_(),{now:i}=te(),{data:a,error:s}=xe(()=>y.conversations(),"conversations"),c=a?.conversations;if(!c)return s?e(m,{message:s}):e(v,{});return n(g,{children:[s?e(m,{message:s}):null,h.map((r)=>{let d=c.filter((l)=>l.kind===r.kind);return n("section",{className:"stack",children:[e("h2",{children:t(r.title)}),e("p",{className:"hint",children:t(r.note)}),d.length===0?e(k,{children:t("None stored.")}):null,d.map((l)=>e(p,{item:l,now:i,timeZone:o},l.key))]},r.kind)})]})}function p(o){let{item:i}=o,a=gn(i.channel,i.id),s=ki(i);return n("a",{className:"card card-link",href:S("conversations",i.key),children:[n("div",{className:"card-head",children:[e("strong",{children:s}),i.busy>0?e(Q,{tone:"busy",children:t("running")}):null,i.liveBytes===0?e(Q,{children:t("archived only")}):null]}),n("p",{className:"meta",children:[(i.kind==="outside"||i.kind==="plugin")&&i.startedAt?`${t("Started")} ${oe(i.startedAt,o.timeZone)} · `:a.detail?`${a.detail} · `:"",i.principal?`${i.visibility==="private"?t("Private to {name}",{name:i.principal.name}):t("Shared · {name}",{name:i.principal.name})} · `:"",t("Last active")," ",we(i.lastActive,o.now,o.timeZone)," ·"," ",Pe(i.liveBytes)," ·"," ",t("{count} archived",{count:i.archives})]})]})}export{Z as ConversationsPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o,L,C,r,t,g,e,n,X,l,f,m,Ue}from"./chunk-index-24cggw6k.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-ze9p4npm.js";import"./chunk-index-ce7hsda9.js";import"./chunk-index-nr275sa7.js";import{fi}from"./chunk-index-c8gm1crh.js";import{Ft}from"./chunk-index-3tksdmx7.js";import{R}from"./chunk-index-cmzvq3nf.js";import{tn,Hn,go,Ai,As,$s,Ns,Ls,Xs}from"./chunk-index-wsv46y9p.js";import{re,Ne}from"./chunk-index-wgrx2ybn.js";var Q=(a)=>X("table",a.name,{replace:!0});function W(a){let{view:i}=a;return e("li",{children:n("button",{type:"button",className:"menu-item council-row","aria-current":a.current||void 0,onClick:a.onPick,children:[e(Ue,{view:i,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:i.displayName}),e("span",{className:"meta",children:t("{count} knights",{count:i.members?.length??0})})]})]})})}function Y(a){let{council:i}=a,w=Ai(),d=fi(),[v,A]=r([]),[y,M]=r(),[B,S]=r(""),[O,I]=r(!1),[P,j]=r(""),[b,k]=r(!1),[z,G]=r(),E=L(),x=i?.name,D=i?.members?.join(`
|
|
2
|
-
`);o(()=>{if(!a.open)return;if(G(void 0),I(i===void 0),j(""),k(!1),M(void 0),S(""),A(i?[...i.members??[]]:As(d)),!x)return;let s=!0;return re.group(x).then((c)=>{if(!s)return;M(c),S(c.host)},()=>{return}),()=>{s=!1}},[a.open,x,D]);let H=C(()=>new Set(d.map((s)=>s.name)),[d]),U=d.find((s)=>s.home)?.name,u=Ns(v,(s)=>H.has(s)),h=Ls(u,B||void 0,U),_=(s)=>d.find((c)=>c.name===s)?.displayName??s,F=u.length>=tn,N=u.length>=Hn,q=i===void 0||u.join(",")!==(i.members??[]).join(",")||y!==void 0&&h!==y.host,T=async(s)=>{k(!0),G(void 0);try{await s(),await Ne()}catch(c){return G(l(c)),k(!1),!1}return k(!1),!0},J=async()=>{if(!i)return;if(!await T(async()=>{await re.updateGroup(i.name,{...u.join(",")!==(i.members??[]).join(",")?{members:u}:{},...y&&h!==y.host?{host:h}:{}})}))return;f(t("Saved.")),a.onClose()},K=async()=>{let s=P.trim();if(s==="")return;let c=new Set([...d.map((V)=>V.name),...w.map((V)=>V.name)]),p;if(!await T(async()=>{p=await re.createGroup({name:Xs(s,c),displayName:s,members:u,host:h})})||!p)return;go(p.room),a.go({key:p.room,name:p.name}),f(t("Made {name}.",{name:p.displayName})),a.onClose()};return n("div",{className:"stack council-sheet",children:[w.length>0?n("section",{className:"stack","aria-label":t("Councils"),children:[e("h3",{children:t("Councils")}),e("ul",{className:"menu",children:w.map((s)=>e(W,{view:s,current:s.key===i?.key,onPick:()=>{go(s.key),a.go(s),a.onClose()}},s.key))})]}):null,n("fieldset",{className:"field council-pick",children:[e("legend",{children:i?t("Edit this council"):t("Pick who sits")}),n("span",{className:"meta council-count","aria-live":"polite",children:[t("{count} of {max} picked",{count:u.length,max:tn}),F?` · ${t("At most {max} knights",{max:tn})}`:""]}),e("ul",{className:"menu",children:d.map((s)=>{let c=v.includes(s.name);return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",children:[e("input",{type:"checkbox",checked:c,disabled:!c&&F,onChange:()=>A($s(v,s.name,tn))}),e(Ue,{view:s,size:32}),e("span",{className:"menu-text",children:e("strong",{children:s.displayName})})]})},s.key)})})]}),N?e(Ft,{label:t("Host"),value:h,onChange:S,options:u.map((s)=>({value:s,label:_(s)}))}):e("span",{className:"meta",children:t("A council needs at least {min} knights.",{min:Hn})}),O?n("label",{htmlFor:E,children:[t("Council name"),e("input",{id:E,value:P,autoComplete:"off",onChange:(s)=>j(s.target.value)})]}):null,z?e(m,{message:z}):null,e("div",{className:"actions",children:i&&!O?n(g,{children:[e("button",{type:"button",className:"secondary",disabled:!N||b,onClick:()=>I(!0),children:t("Save as a new council")}),e("button",{type:"button",disabled:!N||!q||b,onClick:J,children:b?t("Saving…"):t("Done")})]}):e("button",{type:"button",disabled:!N||P.trim()===""||b,onClick:K,children:b?t("Saving…"):i?t("Save as a new council"):t("Make council")})})]})}function fe(a){return e(R,{open:a.open,title:t("Council"),onClose:a.onClose,size:"default",children:e(Y,{open:a.open,council:a.council,onClose:a.onClose,go:a.go??Q})})}export{fe as CouncilSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Bi,Fi,Qr}from"./chunk-index-c8gm1crh.js";import"./chunk-index-ce7hsda9.js";import"./chunk-index-ze9p4npm.js";import"./chunk-index-cmzvq3nf.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-nr275sa7.js";export{Bi as CouncilChip,Qr as CouncilView,Fi as useCouncilSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ct,Gt}from"./chunk-index-pgxgq61x.js";import{p}from"./chunk-index-24cggw6k.js";function H(){try{let c=document.createElement("canvas");return!!(c.getContext("webgl2")||c.getContext("webgl"))}catch{return!1}}function x(c,n){return[c,n.includes("?")?n.slice(n.indexOf("?")):""].some((d)=>{let u=new URLSearchParams(d).get("nogl");return u!==null&&u!=="0"&&u!=="false"})}async function I(c,n,T){let d=n.variant==="compact",u=n.labels??Gt,l=new Map,E=(e)=>{l.clear();for(let t of e)l.set(t.id,{...t})};E(n.seats);let f={t:n.theme,s:n.scheme},a=null,o=document.createElement("div");o.className="rt-table",o.dataset.variant=d?"compact":"full";let g=document.createElement("div");g.className="rt-table-stage",o.appendChild(g);let r=null,y=!1,A=()=>!d&&(Boolean(n.listBelow)||y);c.appendChild(o);let m=new Map,S=()=>{if(!A()){r?.remove(),r=null,m.clear(),delete o.dataset.list;return}if(!r)r=document.createElement("ul"),r.className="rt-table-list",r.setAttribute("aria-label",u.table),o.appendChild(r),o.dataset.list="";for(let e of[...m.keys()])if(!l.has(e))m.delete(e);for(let e of l.values()){let t=m.get(e.id);if(!t){t=document.createElement("button"),t.type="button",t.dataset.seat=e.id;let s=e.id;t.addEventListener("click",(i)=>{let b=l.get(s);if(b)n.onSeatClick({id:b.id,name:b.name,at:Ct(i,i.currentTarget)})}),m.set(e.id,t)}t.textContent=u.seat(e.name,e.state??"idle"),t.style.setProperty("--seat",e.color)}r.replaceChildren(...[...l.values()].map((e)=>{let t=document.createElement("li"),s=m.get(e.id);if(s)t.appendChild(s);return t}))};S();let w=(e)=>{y=!e,S(),n.onNames?.(e)},v=async()=>{let{createTable2D:e}=await (p("61bvrykm"),import("./chunk-table2d-61bvrykm.js"));a=e(g,{...n,theme:f.t,scheme:f.s,seats:[...l.values()]}),w(!0)},C=async()=>{let{createTable3D:e}=await (p("5a7vbgyj"),import("./chunk-table3d-5a7vbgyj.js"));a=e(g,{...n,theme:f.t,scheme:f.s,seats:[...l.values()],onNames:w},()=>{a?.dispose(),v()})};if(d||T==="svg"||T!=="webgl"&&(x(location.search,location.hash)||!H()))await v();else try{await C()}catch{await v()}let M,L=n.onSeatMenu;if(L&&!d){let{attachSeatMenu:e}=await (p("n2bcw0mf"),import("./chunk-seat-menu-n2bcw0mf.js"));M=e(o,(t,s,i)=>{let b=t instanceof Element?t.closest("[data-seat]")?.dataset.seat:void 0,h=l.get(b??a?.seatAt?.(s,i)??"");return h?{id:h.id,name:h.name}:void 0},L)}return{get kind(){return a.kind},setTheme(e,t){f={t:e,s:t},a.setTheme(e,t)},setSeats(e){E(e),S(),a.setSeats(e)},setState(e,t){let s=l.get(e);if(s)s.state=t;S(),a.setState(e,t)},setMark:(e,t)=>a.setMark(e,t),setAvatar(e,t,s){let i=l.get(e);if(i)if(i.avatarSvg=t,s===void 0)delete i.talkSvg;else i.talkSvg=s;return a.setAvatar(e,t,s)},setReducedMotion:(e)=>a.setReducedMotion(e),resetCamera:()=>a.resetCamera(),focus:(e,t)=>a.focus(e,t),focused:()=>a.focused(),seatAt:(e,t)=>a.seatAt?.(e,t)??null,getStats:()=>a.getStats(),dispose(){M?.(),a?.dispose(),o.remove()}}}export{I as mountRoundTable};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,o,L,t,G,g,e,n,s,Ke,d,ge,Ue,Wn,Tn}from"./chunk-index-24cggw6k.js";import{Er,$r,Nr,Lr}from"./chunk-index-97dcp1vh.js";import"./chunk-index-5j1v2q7w.js";import{Zt}from"./chunk-index-bxf8eq1s.js";import{zi}from"./chunk-index-6rdywten.js";var v=()=>(p("tdx896xf"),import("./chunk-layout-actions-tdx896xf.js")),k=(a)=>(p("e2neja55"),import("./chunk-placement-items-e2neja55.js")).then((r)=>r.folderMenu(a)),F=(a)=>({mode:"folder",key:a,item:(r)=>r.closest("[data-folder-block]"),root:(r)=>r.closest("[data-folder-block]")?.parentElement??null,onDrop:(r)=>{if(r.type==="folder")v().then((i)=>i.placeFolderBefore(a,r.before))},open:Nr});function b(a){let{id:r,name:i}=a,m=Er().has(r),l=a.holdsActive||!m,c=L(),h=Zt(()=>k(r),F(r)),N=(u)=>{k(r).then((f)=>{if(!f)return;let y=u.getBoundingClientRect();ge({...f,at:{x:y.left,y:y.bottom},via:"key",source:u})},()=>{return})};return n("section",{className:"folder","aria-label":i,"data-folder-block":"","data-key":r,"data-drop-zone":"folder","data-zone-id":r,"data-folder":r,"data-collapsed":l?void 0:"",children:[n("header",{className:"folder-head","data-folder-head":"",...h,children:[n("button",{type:"button",className:"folder-toggle","aria-expanded":l,"aria-controls":c,"aria-label":l?t("Collapse {name}",{name:i}):t("Expand {name}",{name:i}),onClick:()=>$r(r),children:[e(s,{name:"chevron",size:16,className:"folder-chevron","data-open":l||void 0}),e("strong",{children:i}),e("span",{className:"meta",children:G(a.count,"{count} room","{count} rooms")}),l?null:a.stack]}),a.muted==="none"?null:e(s,{name:"bell-off",size:14,className:"muted-mark","data-partial":a.muted==="some"||void 0,role:"img","aria-hidden":!1,"aria-label":a.muted==="all"?t("Notifications are off"):t("Some notifications are off")}),l?null:a.summary,e("button",{type:"button",className:"icon-button folder-more","aria-haspopup":"menu","aria-label":t("Folder menu"),onClick:(u)=>N(u.currentTarget),children:e(s,{name:"more",size:18})})]}),e("div",{id:c,className:"folder-body",hidden:!l,children:l?a.count===0?e("p",{className:"meta folder-empty",children:t("No rooms in this folder yet.")}):a.children:null})]})}var R=4;function S(a){let r=a.rooms.slice(0,R),i=d((l)=>r.map((c)=>l.rooms[c]?.view),r.join(",")),m=a.rooms.length-r.length;return n("span",{className:"folder-stack","aria-hidden":"true",children:[i.map((l)=>l?e("span",{className:"folder-stack-item",children:e(Ue,{view:l,size:28})},l.key):null),m>0?n("span",{className:"folder-stack-more",children:["+",m]}):null]})}function M(a){let r=d((i)=>({waiting:a.rooms.reduce((m,l)=>m+Ke(i,l),0),typing:a.rooms.some((m)=>i.rooms[m]?.typing)}),a.rooms.join(","));return n(g,{children:[r.typing?e(Wn,{}):null,r.waiting?e(Tn,{count:r.waiting}):null]})}function w(a){return d((r)=>zi(a,(i)=>r.rooms[i]?.view?.muted===!0),a.join(","))}function U(a){let r=a.folders.map((i)=>i.id).join(",");return o(()=>{if(a.listed)Lr(r?r.split(","):[])},[a.listed,r]),e(g,{children:a.folders.map((i)=>e(C,{folder:i,...a},i.id))})}function C(a){let{folder:r}=a,i=w(r.rooms);return e(b,{id:r.id,name:r.name,count:r.rooms.length,holdsActive:a.active!==void 0&&r.rooms.includes(a.active),muted:i,summary:e(M,{rooms:r.rooms}),stack:e(S,{rooms:r.rooms}),children:a.rooms(r.rooms)})}export{U as FolderList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Er,Ar,$r,Nr,Lr}from"./chunk-index-97dcp1vh.js";export{Ar as collapsedNow,Nr as expandFolder,Lr as pruneCollapsed,$r as toggleCollapsed,Er as useCollapsed};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-8pbwr3rs.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt}from"./chunk-index-q4k9vk04.js";export{lt as HostPicture};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ko,Le,_o,To,Po,Qo,Mo,sn,xr,Ro,Ra}from"./chunk-index-nr275sa7.js";export{Ro as keepCards,xr as keepReads,Mo as noCards,Qo as noReads,Ra as onFrame,sn as seedUnread,ko as subscribeHost,To as totalUnread,Po as unreadCounts,_o as unreadOf,Le as useHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ee,E,o,L,Te,C,a,r,t,G,g,e,n,s,S,pn,O,d,fe,l,f,v,m,k,Q,Yt,qn,Et,_,Zr,we,Ht,On,At,nr,Qe,yn,Lt,jr,te,kn,cr,ur,dr,$e}from"./chunk-index-24cggw6k.js";import{In}from"./chunk-index-ze9p4npm.js";import{Yi,ss,Ze,Hi}from"./chunk-index-ce7hsda9.js";import{D}from"./chunk-index-6btdp13p.js";import{Le,Qo,Mo,sn,xr,Ro}from"./chunk-index-nr275sa7.js";import{at,lt}from"./chunk-index-q4k9vk04.js";import{Ir}from"./chunk-index-4a1tdadd.js";import"./chunk-index-8pbwr3rs.js";import{Re}from"./chunk-index-dr0jr7d3.js";import{H}from"./chunk-index-s4a8e4qm.js";import"./chunk-index-cmzvq3nf.js";function Ke(c){let i={};for(let u of c)if(u.type==="multiselect")i[u.name]=[...Ve(u.initial)];else i[u.name]=Ve(u.initial)[0]??"";return i}var Ve=(c)=>c===void 0?[]:typeof c==="string"?[c]:[...c];function et(c,i){let u={};for(let p of c){let y=i[p.name];if(y===void 0||y===""||y.length===0)continue;u[p.name]=y}return u}function tt(c){let{field:i,value:u}=c,[p,y]=r(""),N=i.search?i.options.filter((h)=>h.label.toLowerCase().includes(p.trim().toLowerCase())):i.options,R=i.search?e("input",{type:"search",value:p,placeholder:t("Search…"),"aria-label":t("Search {name}",{name:i.label}),onChange:(h)=>y(h.target.value)}):null;if(i.type==="select")return n(g,{children:[R,n(Re,{id:c.id,value:String(u),required:i.required===!0,"aria-describedby":c.described,...i.search?{size:6}:{},onChange:(h)=>c.onChange(h.target.value),children:[i.required?null:e("option",{value:"",children:t("None")}),N.map((h)=>e("option",{value:h.value,children:h.label},h.value))]})]});let b=new Set(Array.isArray(u)?u:[]);return n(g,{children:[R,e("fieldset",{"aria-describedby":c.described,children:N.map((h)=>n("label",{children:[e("input",{type:"checkbox",checked:b.has(h.value),onChange:(M)=>{let w=new Set(b);if(M.target.checked)w.add(h.value);else w.delete(h.value);c.onChange(i.options.filter((V)=>w.has(V.value)).map((V)=>V.value))}}),h.label]},h.value))})]})}function nt(c){let{field:i,value:u}=c,p=L(),y="hint"in i?i.hint:void 0,N=c.error||y?`${p}-note`:void 0,R;if("options"in i)R=e(tt,{field:i,id:p,value:u,described:N,onChange:c.onChange});else if(i.type==="textarea")R=e("textarea",{id:p,rows:5,value:String(u),maxLength:i.max??8000,required:i.required===!0,"aria-describedby":N,onChange:(b)=>c.onChange(b.target.value)});else R=e("input",{id:p,type:i.type==="url"?"url":"text",value:String(u),maxLength:i.max??500,required:i.required===!0,"aria-describedby":N,onChange:(b)=>c.onChange(b.target.value)});return n("div",{className:"host-field",children:[i.type==="multiselect"?e("span",{className:"field-label",children:i.label}):e("label",{htmlFor:p,children:i.label}),R,c.error||y?e("span",{id:`${p}-note`,className:c.error?"field-error":"hint",role:c.error?"alert":void 0,children:c.error??y}):null]})}function me(c){let{spec:i}=c,[u,p]=r(()=>Ke(i.fields)),[y,N]=r(!1),[R,b]=r();return n("form",{className:"host-form",onSubmit:async(M)=>{if(M.preventDefault(),y)return;N(!0),b(void 0);try{b(await c.onSubmit(et(i.fields,u)))}catch(w){b({error:l(w)})}finally{N(!1)}},children:[i.fields.map((M)=>e(nt,{field:M,value:u[M.name]??"",error:R?.field===M.name?R.error:void 0,onChange:(w)=>p((V)=>({...V,[M.name]:w}))},M.name)),R&&!i.fields.some((M)=>M.name===R.field)?e(m,{message:R.error}):null,n("div",{className:"actions",children:[c.onCancel?e("button",{type:"button",className:"secondary",disabled:y,onClick:c.onCancel,children:t("Cancel")}):null,e("button",{type:"submit",disabled:y,children:i.submit})]})]})}function rt(c){if(!c.ok)return{error:Yi(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)Hi(c.open);return}function oe(c){let[i,u]=r(),[p,y]=r(!1),N=async(b,h)=>rt(await c.run(b,h)),R=async(b)=>{if(b.form||b.confirm){u(b);return}y(!0);try{let h=await N(b,{});if(h)f(h.error,"danger")}catch(h){f(l(h),"danger")}finally{y(!1)}};if(c.actions.length===0)return null;return n("div",{className:c.className??"host-actions",children:[c.actions.map((b)=>e("button",{type:"button",className:b.style==="danger"?"danger":b.style==="secondary"?"secondary":"",disabled:p,onClick:()=>R(b),children:b.label},b.id)),i?.form?e(H,{open:!0,title:i.form.title,onClose:()=>u(void 0),children:e(me,{spec:i.form,onCancel:()=>u(void 0),onSubmit:async(b)=>{let h=await N(i,b);if(!h)u(void 0);return h}})}):i?e(D,{open:!0,title:i.label,confirmLabel:i.label,tone:i.style==="danger"?"danger":"primary",onConfirm:async()=>{let b=await N(i,{});if(b)throw Error(b.error)},onClose:()=>u(void 0),children:e("p",{children:i.confirm})}):null]})}var Pe=/^file:([A-Za-z0-9_-]{1,64})$/;function Oe(c){let i=URL.parse(c,document.baseURI);return i!==null&&i.origin===window.location.origin}function ot({id:c,alt:i}){return e("img",{className:"file-image",src:`api/files/${encodeURIComponent(c)}`,alt:i,loading:"lazy",decoding:"async",onError:(u)=>{let p=document.createElement("span");p.textContent=i||t("Image"),u.currentTarget.replaceWith(p)}})}var re=ee(function({source:i}){return e("div",{className:"prose",children:e(Yt,{remarkPlugins:[Et],urlTransform:(u)=>Pe.test(u)?u:qn(u),components:{a:({href:u,children:p})=>u&&/^https?:\/\//.test(u)&&!Oe(u)?e("a",{href:u,target:"_blank",rel:"noreferrer noopener",children:p}):u&&Oe(u)?e("a",{href:u,children:p}):e("span",{children:p}),img:({src:u,alt:p})=>{let y=typeof u==="string"?Pe.exec(u):null;return y?.[1]?e(ot,{id:y[1],alt:p??""}):e("span",{children:p})},pre:Zr,table:({children:u})=>e("div",{className:"table-wrap",children:e("table",{children:u})})},children:i})})});function st(c){switch(c??"open"){case"working":return t("Working…");case"done":return t("Done");case"superseded":return t("Replaced");case"expired":return t("Expired");default:return""}}var Ne=(c)=>(c.state??"open")==="open";function ae(c){let{card:i}=c,u=st(i.state);return n("article",{className:"host-card","data-tone":i.tone??"note","data-state":i.state??"open",children:[n("header",{children:[e("h3",{children:i.title}),u?e(Q,{tone:i.state==="working"?"busy":"plain",children:u}):null]}),i.body?e(re,{source:i.body}):null,i.links?.length?e("div",{className:"host-card-links",children:i.links.map((p)=>e("a",{href:p.url,...p.url.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.label},`${p.url}`))}):null,Ne(i)&&i.buttons?.length?e(oe,{actions:i.buttons,run:c.run}):null]})}at();function it(){let[c,i]=r(()=>In().toString());return o(()=>{let u=()=>i(In().toString());return window.addEventListener("popstate",u),window.addEventListener("hashchange",u),()=>{window.removeEventListener("popstate",u),window.removeEventListener("hashchange",u)}},[]),c}function ct(c){if(!c.ok)return{error:Yi(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)Hi(c.open);return}function dt(c){let{section:i}=c;switch(i.kind){case"markdown":return e(re,{source:i.text});case"card":return e(ae,{card:i.card,run:c.run});case"form":return n("section",{className:"stack",children:[e("h2",{className:"section-title",children:i.form.title}),e(me,{spec:i.form,onSubmit:(u)=>c.submit(i.action,u)})]});case"list":return n("section",{className:"stack",children:[i.title?e("h2",{className:"section-title",children:i.title}):null,i.rows.length===0?e(k,{children:t("Nothing here.")}):null,e("ul",{className:"host-list",children:mt(i.rows).map(([u,p])=>n("li",{children:[p.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null,n("div",{className:"host-list-main",children:[p.open?e("a",{href:p.open,...p.open.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.title}):e("strong",{children:p.title}),p.subtitle?e("span",{children:p.subtitle}):null]}),p.actions?.length?e(oe,{actions:p.actions,run:c.run}):null]},u))})]})}}function ut({routeKey:c}){let i=c??"",u=it(),p=Le((w)=>w.pages[i]??0),[y,N]=r(0),[R,b]=r({});o(()=>{let w=!0;return Ze.page(i,Object.fromEntries(new URLSearchParams(u))).then((V)=>w&&b({page:V}),(V)=>{if(!w)return;let P=V instanceof fe&&V.status===404;b((q)=>({...P||!q.page?{}:{page:q.page},error:l(V),gone:P}))}),()=>{w=!1}},[i,u,p,y]);let h=async(w,V)=>{let P=await Ze.pageAct(i,{action:w,input:V}),q=ct(P);if(!q)N((I)=>I+1);return q},M=async(w,V)=>{let P=await Ze.pageAct(i,{action:w.id,input:V});if(P.ok)N((q)=>q+1);return P};if(R.gone)return e("div",{className:"page",children:e(k,{children:t("This page is not available.")})});if(!R.page)return e("div",{className:"page",children:R.error?e(m,{message:R.error}):e(v,{})});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:R.page.title})}),R.error?e(m,{message:R.error}):null,R.page.sections.map((w,V)=>e(dt,{section:w,run:M,submit:h},V))]})}function mt(c){let i=new Map;return c.map((u)=>{let p=i.get(u.title)??0;return i.set(u.title,p+1),[`${u.title}:${p}`,u]})}function _e(c){let i=Le((M)=>M.cards[c.room]??Mo),u=Qe("(min-width: 720px) and (min-height: 760px)"),[p,y]=r();if(i.length===0)return null;let N=i.filter((M)=>Ne(M)||M.state==="working"),R=i.filter((M)=>!N.includes(M)),b=p??(u&&N.length>0),h=N[0];return n("div",{className:"host-cards","data-open":b||void 0,children:[n("button",{type:"button",className:"host-cards-toggle","aria-expanded":b,onClick:()=>y(!b),children:[e(s,{name:"chevron",size:14}),h?n("span",{children:[e("strong",{children:G(N.length,"{count} card waiting","{count} cards waiting")}),`: ${h.title}`]}):e("span",{children:t("Earlier cards ({count})",{count:R.length})})]}),b?n("div",{className:"host-cards-body",children:[N.map((M)=>e(ae,{card:M,run:c.run(M.id)},M.id)),R.length?n("details",{className:"host-cards-older",children:[e("summary",{children:t("Earlier cards ({count})",{count:R.length})}),R.map((M)=>e(ae,{card:M,run:c.run(M.id)},M.id))]}):null]}):null]})}var ft=/https?:\/\/[^\s<>"']+/g,pt=/[.,;:!?)\]}\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff09\u300d\u300f]+$/;function gt(c){let i=c.replace(pt,""),u=URL.parse(i);return u&&(u.protocol==="https:"||u.protocol==="http:")?i:""}function qe({text:c}){let i=[],u=0;for(let p of c.matchAll(ft)){let y=gt(p[0]);if(y==="")continue;let N=p.index;if(N>u)i.push(c.slice(u,N));i.push(e("a",{href:y,target:"_blank",rel:"noreferrer noopener",children:y},`${N}`)),u=N+y.length}if(u<c.length)i.push(c.slice(u));return e("span",{className:"plain",children:i})}var ze=ee(function(i){let{message:u}=i,p=u.authorKind??"external";if(p==="notice")return n("li",{className:"host-notice","data-mid":u.id,"data-highlight":i.highlighted||void 0,"data-enter":i.enter||void 0,children:[e(s,{name:"bell",size:14}),e(re,{source:u.text}),e("time",{dateTime:u.at,children:Ht(u.at,i.timeZone)})]});let y=p==="member"&&u.principalId!==void 0&&u.principalId===i.me;return n("li",{className:"message","data-mid":u.id,"data-author":p,"data-mine":y||void 0,"data-header":i.header||void 0,"data-enter":i.enter||void 0,"data-unread":i.unread||void 0,"data-highlight":i.highlighted||void 0,children:[y?null:e("span",{className:"message-avatar",children:i.header?e(lt,{picture:u.picture,name:u.author}):null}),n("div",{className:"message-main",children:[i.header?n("div",{className:"message-meta",children:[e("strong",{children:u.author}),u.authorLabel?e("span",{className:"label-chip",children:u.authorLabel}):null,e("time",{dateTime:u.at,children:Ht(u.at,i.timeZone)})]}):null,n("div",{className:"bubble",children:[e(jr,{files:u.files}),u.text?p==="assistant"?e(re,{source:u.text}):e(qe,{text:u.text}):null,e(Lt,{files:u.files,message:u}),u.expiredFiles?e("p",{className:"message-expired",children:G(u.expiredFiles,"{count} file was removed","{count} files were removed")}):null]}),u.edited?e("span",{className:"message-edited",children:t("edited")}):null]})]})});var ht=1500,bt=96,pe=new Set,He=new Map;function yt(c){if(document.visibilityState!=="visible")return!1;return!c||c.scrollHeight-c.scrollTop-c.clientHeight<bt}function De(c){if(!(c instanceof Element))return;let i=c.closest("[data-unread][data-mid]");return i?Number(i.dataset.mid):void 0}function Ue(c){let{room:i,scroller:u,messages:p,began:y,enterAfter:N,me:R,shared:b}=c,h=a({seen:void 0,watched:new Set}),[,M]=r(0),w=He.get(i)??pe;if(N!==void 0&&p){let F=h.current;F.seen??=N;let x=yt(u.current),W=F.seen;for(let T of p){if(T.id<=F.seen)continue;if(x)F.watched.add(T.id);W=Math.max(W,T.id)}F.seen=W}let V=C(()=>{if(y===void 0||N===void 0||!p)return pe;let F=new Set;for(let x of p){if(x.id===0||x.id<=y)continue;if(x.kind==="system"||x.note)continue;if(x.authorKind==="notice")continue;if(x.principalId===void 0?x.kind==="owner"&&!b:x.principalId===R)continue;if(h.current.watched.has(x.id)||w.has(x.id))continue;F.add(x.id)}return F.size===0?pe:F},[p,y,N,R,b,w]),P=E((F)=>{let x=He.get(i)??pe;if(x.has(F))return;He.set(i,new Set(x).add(F)),M((W)=>W+1)},[i]),q=V.size>0;o(()=>{let F=u.current;if(!F||!q)return;let x=(T)=>{if(T.pointerType==="touch")return;let B=De(T.target);if(B!==void 0)P(B)},W=(T)=>{let B=De(T.target);if(B!==void 0)P(B)};return F.addEventListener("pointerover",x,{passive:!0}),F.addEventListener("focusin",W,{passive:!0}),F.addEventListener("click",W,{passive:!0}),()=>{F.removeEventListener("pointerover",x),F.removeEventListener("focusin",W),F.removeEventListener("click",W)}},[u,P,q]);let I=a(new Map),U=[...V].join(",");return o(()=>{let F=u.current,x=I.current;for(let[Z,Y]of x)if(!V.has(Z))clearTimeout(Y),x.delete(Z);if(!F||!q||typeof IntersectionObserver!=="function"||!matchMedia("(pointer: coarse)").matches)return;let W=(Z)=>{let Y=x.get(Z);if(Y===void 0)return;clearTimeout(Y),x.delete(Z)},T=new IntersectionObserver((Z)=>{for(let Y of Z){let ne=Number(Y.target.dataset.mid),le=Y.rootBounds;if(!(Y.isIntersecting&&(Y.intersectionRatio>=0.5||le!==null&&Y.intersectionRect.height>=le.height*0.5))){W(ne);continue}if(x.has(ne))continue;x.set(ne,setTimeout(()=>{if(x.delete(ne),document.visibilityState==="visible")P(ne)},ht))}},{root:F,threshold:[0,0.25,0.5,0.75,1]}),B=[...F.querySelectorAll("[data-unread][data-mid]")];for(let Z of B)T.observe(Z);let j=()=>{if(document.visibilityState!=="visible")return;for(let Z of B)T.unobserve(Z),T.observe(Z)};return document.addEventListener("visibilitychange",j),()=>{document.removeEventListener("visibilitychange",j),T.disconnect()}},[u,P,q,U]),o(()=>{let F=I.current;return()=>{for(let x of F.values())clearTimeout(x);F.clear()}},[]),V}at();var vt=3;function wt({marks:c}){let[i,u]=r(!1);return n("li",{className:"seen",children:[n("button",{type:"button",className:"seen-toggle","aria-expanded":i,onClick:()=>u((p)=>!p),children:[c.slice(0,vt).map((p)=>e(lt,{picture:{principal:p.principal},name:p.name,size:16},p.principal)),e("span",{children:t("Seen by {count}",{count:c.length})})]}),i?e("span",{className:"seen-names",children:c.map((p)=>p.name).join(t(", "))}):null]})}function kt(c,i){let u=$e(),p=d((y)=>y.connects);o(()=>{let y=i.current;if(!y)return;let N=0,R=0,b,h,M=()=>{if(h=void 0,document.visibilityState!=="visible")return;let P=y.getBoundingClientRect(),q=0;for(let U of y.querySelectorAll("[data-mid]")){let F=U.getBoundingClientRect();if(F.bottom>P.top&&F.top<P.bottom-4)q=Math.max(q,Number(U.dataset.mid))}if(q<=N)return;let I=R+1000-Date.now();if(I>0){clearTimeout(b),b=setTimeout(w,I);return}if(u.send({type:"read",room:c,upTo:q}))N=q,R=Date.now()},w=()=>{if(h===void 0)h=requestAnimationFrame(M)};y.addEventListener("scroll",w,{passive:!0}),document.addEventListener("visibilitychange",w),window.addEventListener("resize",w);let V=new MutationObserver(w);return V.observe(y,{childList:!0,subtree:!0}),w(),()=>{if(y.removeEventListener("scroll",w),document.removeEventListener("visibilitychange",w),window.removeEventListener("resize",w),V.disconnect(),clearTimeout(b),h!==void 0)cancelAnimationFrame(h)}},[u,c,i,p])}function ge(c){let{roomKey:i}=c;kt(i,c.scroller);let u=d((w)=>w.principal?.id),p=d((w)=>w.rooms[i]?.messages),y=Le((w)=>w.reads[i]??Qo),N=Le((w)=>w.cursor[i]),R=a(void 0);if(R.current===void 0&&N!==void 0)R.current=N;let b=d((w)=>w.rooms[i]?.view?.notes===!0),h=Ue({room:i,scroller:c.scroller,messages:p,began:R.current,enterAfter:c.enterAfter,me:u,shared:c.host===!0||b}),M=C(()=>{let V=(p??[]).filter((I)=>I.kind!=="system"),P=R.current===void 0?void 0:V.find((I)=>I.id>(R.current??0)&&(I.principalId===void 0||I.principalId!==u))?.id,q=new Map;for(let I of y){if(I.principal===u)continue;let U=V.findLast((F)=>F.id<=I.upTo);if(U)q.set(U.id,[...q.get(U.id)??[],I])}return{before:(I)=>I.id===P?e("li",{className:"new-divider",children:e("span",{children:t("New messages")})}):null,after:(I)=>{let U=q.get(I.id);return U?e(wt,{marks:U}):null},unread:(I)=>h.has(I.id),...c.host?{message:(I,U)=>I.kind==="system"&&I.authorKind===void 0?void 0:e(ze,{message:I,header:U.header,enter:U.enter,unread:U.unread,timeZone:U.timeZone,me:u,highlighted:c.highlight===I.id})}:{}}},[p,y,u,c.host,c.highlight,h]);return e(kn,{roomKey:i,enterAfter:c.enterAfter,quotable:c.quotable,decor:M})}at();var Nt=20,Rt=2600,Be;function St(c,i,u){let p=d((b)=>b.connects),y=Le((b)=>b.rooms[c]??0),[N,R]=r({view:void 0,error:void 0,gone:!1});return o(()=>{let b=!0;return Ze.open(i,u).then((h)=>{if(!b)return;O.dispatch({type:"history_loaded",room:c,messages:h.messages,more:h.more,older:!1}),xr(c,h.reads,h.cursor),Ro(c,h.cards),R({view:h,error:void 0,gone:!1})},(h)=>{if(!b)return;let M=h instanceof fe&&h.status===404;R((w)=>({view:M?void 0:w.view,error:l(h),gone:M}))}),()=>{b=!1}},[c,i,u,p,y]),N}function Ct(c){let{header:i}=c;return n(g,{children:[i.banner?e("p",{className:"host-banner","data-tone":i.banner.tone,role:"status",children:i.banner.text}):null,i.fields.length?e("dl",{className:"host-head-fields",children:i.fields.map((u)=>n("div",{children:[e("dt",{children:u.label}),e("dd",{children:u.link?e("a",{href:u.link,...u.link.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:u.value}):u.value})]},`${u.label}:${u.value}`))}):null,e(oe,{className:"host-actions bar",actions:i.actions,run:c.run})]})}function Tt({roomKey:c}){let i=$e(),u=ss(c),p=u?.kind??"",y=u?.id??"",{view:N,error:R,gone:b}=St(c,p,y),h=d((A)=>A.rooms[c]),M=d((A)=>A.limits),w=d((A)=>A.connects),V=d((A)=>A.connection==="open"),P=a(null),q=a(null),{away:I,onScroll:U,onGrow:F,toEnd:x}=dr(P),[W,T]=r(!1),[B,j]=r(),[Z,Y]=r(Be),[ne,le]=r(!1),[Ae,Ee]=r(),be=a(void 0),se=a(void 0),J=N!==void 0,ce=cr(!Qe("(min-width: 1024px)"));if(o(()=>{if(!u||b||!J)return;return i.send({type:"subscribe",room:c}),i.focus(c),()=>{i.focus(void 0),i.send({type:"unsubscribe",room:c})}},[i,c,w,b,J]),J&&be.current===void 0)be.current=h?.messages.at(-1)?.id??0;Te(()=>{if(J)x(!1)},[J]),Te(()=>{let A=P.current;if(A&&se.current!==void 0)A.scrollTop+=A.scrollHeight-se.current,se.current=void 0},[h?.messages[0]?.id]),o(()=>{let A=q.current;if(!A||typeof ResizeObserver>"u")return;let z=new ResizeObserver(F);return z.observe(A),()=>z.disconnect()},[F]);let ye=E(async()=>{let A=O.getState().rooms[c]?.messages[0];if(!A)return!1;let z=await Ze.older(p,y,A.id,pn);return O.dispatch({type:"history_loaded",room:c,messages:z.messages,more:z.more,older:!0}),xr(c,z.reads,void 0),z.more},[c,p,y]),de=a(void 0);o(()=>{let A=()=>{let z=Number(In().get("message"));de.current=Number.isSafeInteger(z)&&z>0?z:void 0};return A(),window.addEventListener("popstate",A),()=>window.removeEventListener("popstate",A)},[]);let ve=h?.messages[0]?.id,Ce=h?.more===!0;o(()=>{let A=de.current,z=P.current;if(!J||A===void 0||!z)return;let X=z.querySelector(`[data-mid="${A}"]`);if(X){de.current=void 0,X.scrollIntoView({block:"center"}),Ee(A),requestAnimationFrame(()=>z.dispatchEvent(new Event("scroll"))),setTimeout(()=>Ee(void 0),Rt);return}if(ve!==void 0&&A<ve&&Ce){let ie=0;(async()=>{if(ie+=1,!await ye().catch(()=>!1)||ie>=Nt)de.current=void 0})()}},[J,ve,Ce,h?.messages.length,ye]);let Me=(A,z={},X)=>Ze.act(p,y,{action:A.id,...X===void 0?{}:{card:X},input:z}),Ye=(A,z)=>Me(A,z),Je=(A)=>(z,X)=>Me(z,X,A);if(b||!J&&!R&&!u)return e("section",{className:"room",children:n("div",{className:"page",children:[e(k,{children:t("This room is not available.")}),e("a",{className:"back",href:S("rooms"),children:t("Back to rooms")})]})});let K=N?.access.send??[],ke=K.length>1,Fe=ke&&ne,xe=Z&&K.includes(Z)?Z:K.includes("turn")?"turn":K[0],Ie=Fe||xe==="turn",Xe=Ie?N?.wording?.turn?.placeholder??t("Ask AI…"):N?.wording?.note?.placeholder??t("Write an internal note…"),ue=N?.header.title??c,je=h?.messages??[];return n("section",{className:"room",...ce.surface,onDragOver:(A)=>{if(K.length&&A.dataTransfer.types.includes("Files"))A.preventDefault()},onDrop:(A)=>{if(!K.length||!A.dataTransfer.files.length)return;A.preventDefault(),j([...A.dataTransfer.files])},children:[n("header",{className:"room-head",children:[e("a",{className:"icon-button room-back",href:S("rooms"),"aria-label":t("Back to rooms"),children:e(s,{name:"back"})}),e(nr,{open:ce.enabled?ce.show:void 0,children:e(lt,{name:ue,size:40})}),n("div",{className:"room-title",children:[e("h1",{children:ue}),e("span",{className:"room-status","data-working":h?.typing||void 0,children:h?.typing?t("Working…"):t("Host room")})]})]}),!V?n("div",{className:"offline-banner",role:"status",children:[e("span",{className:"spinner","aria-hidden":"true"}),t("Reconnecting… messages wait here until it is back.")]}):null,N?e(Ct,{header:N.header,run:Ye}):null,e("div",{className:"room-scroll",ref:P,onScroll:U,children:n("div",{className:"room-content",ref:q,children:[R?e(m,{message:R}):null,!J&&!R?e(v,{}):null,h?.more?e("button",{type:"button",className:"secondary older",disabled:W,onClick:async()=>{T(!0),se.current=P.current?.scrollHeight;try{await ye()}catch(A){se.current=void 0,f(l(A),"danger")}finally{T(!1)}},children:W?t("Loading…"):t("Load earlier messages")}):null,J&&je.length===0?e(k,{children:t("No messages yet.")}):null,e(ge,{roomKey:c,enterAfter:be.current,quotable:!1,scroller:P,host:!0,highlight:Ae}),h?.typing?e(yn,{name:ue,progress:h.progress}):null]})}),I?n("button",{type:"button",className:"to-end",onClick:()=>x(!0),children:[e(s,{name:"send",size:16,style:{transform:"rotate(180deg)"}}),t("Latest")]}):null,N?e(_e,{room:c,run:Je}):null,N&&K.length===0?e("p",{className:"room-note",children:t("You can read this room but not write in it.")}):null,N&&K.length>0?e(g,{children:e(At,{draftKey:c,name:ue,placeholder:Xe,onAddressed:le,...ke?{above:e(Ir,{on:Ie,label:N?.wording?.turn?.label??t("@AI"),...Fe?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(A)=>{let z=A?"turn":"note";Be=z,Y(z)}})}:{},limits:M,stoppable:Boolean(h?.stoppable),onSend:(A,z,X)=>{if(ke&&X){let ie=On(A);i.say(c,ie===""&&z.length===0?A:ie,z,"turn")}else i.say(c,A,z,xe);x(!0)},onStop:()=>i.send({type:"stop",room:c}),...B?{incoming:B,onIncomingTaken:()=>j(void 0)}:{}},c)}):null,e(ur,{...ce.drawer,current:c})]})}at();function he({room:c}){let i=Le((u)=>u.unread[c]??0);if(i<=0)return null;return e("span",{className:"unread-mark",role:"img","aria-label":G(i,"{count} unread message","{count} unread messages"),children:i>99?"99+":i})}at();var Mt=6,Ft=250;function Se(c){let{kind:i}=c,{timeZone:u}=_(),{now:p}=te(),y=d((T)=>T.connects),N=Le((T)=>T.lists[i]??0),[R,b]=r(""),[h,M]=r(""),[w,V]=r(),[P,q]=r(),[I,U]=r(),[F,x]=r(!1);o(()=>{let T=setTimeout(()=>M(R.trim()),Ft);return()=>clearTimeout(T)},[R]),o(()=>{let T=!0;return Ze.list(i,h||void 0).then((B)=>{if(!T)return;sn(Object.fromEntries(B.rooms.map((j)=>[j.key,j.unread??0]))),V(B.rooms),q(B.cursor),U(void 0)},(B)=>T&&U(l(B))),()=>{T=!1}},[i,h,y,N]);let W=async()=>{if(!P||F)return;x(!0);try{let T=await Ze.list(i,h||void 0,P);sn(Object.fromEntries(T.rooms.map((B)=>[B.key,B.unread??0]))),V((B)=>[...B??[],...T.rooms]),q(T.cursor)}catch(T){U(l(T))}finally{x(!1)}};return n("section",{className:"stack",children:[n("h2",{className:"section-title",children:[c.icon?e(s,{name:c.icon,size:14,className:"section-icon"}):null,c.label]}),w&&(w.length>=Mt||h||R)?e("input",{type:"search",className:"kind-filter",value:R,placeholder:t("Search {name}",{name:c.label}),"aria-label":t("Search {name}",{name:c.label}),onChange:(T)=>b(T.target.value)}):null,I?e(m,{message:I}):null,!w&&!I?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,w&&w.length===0?e(k,{children:h?t("Nothing matches."):t("No rooms yet.")}):null,w&&w.length>0?e("ul",{className:"room-list",children:w.map((T)=>e("li",{children:n("a",{className:"room-row",href:S("room",T.key),"aria-current":T.key===c.active?"page":void 0,children:[n("span",{className:"kind-row-picture",children:[e(lt,{picture:T.picture,name:T.title,size:44}),T.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null]}),n("span",{className:"room-row-main",children:[n("span",{className:"room-row-top",children:[e("strong",{children:T.title}),e(he,{room:T.key}),e("span",{className:"room-row-time",children:T.lastAt?we(T.lastAt,p,u):""})]}),e("span",{className:"room-row-preview",children:e("span",{children:T.subtitle??""})})]}),e(s,{name:"chevron",size:16,className:"room-row-chevron"})]})},T.key))}):null,P?e("button",{type:"button",className:"secondary",disabled:F,onClick:W,children:F?t("Loading…"):t("Show more")}):null]})}function Ge(c){return c.kinds.map((i)=>e(Se,{kind:i.kind,label:i.label,...i.icon?{icon:i.icon}:{},active:c.active},i.kind))}function We(){let c=(_().pages??[]).filter((i)=>i.place==="settings");if(c.length===0)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("More settings")}),c.map((i)=>n("a",{className:"menu-item menu-link",href:S("p",i.id),children:[e("span",{className:"menu-text",children:e("strong",{children:i.label})}),e(s,{name:"chevron",size:16})]},i.id))]})}export{Ge as HostKinds,ut as HostPage,Tt as HostRoomPage,We as HostSettingsPages,ge as ReadLog,he as UnreadMark};
|