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 +1 @@
|
|
|
1
|
-
import{p,r,t,g,e,n,
|
|
1
|
+
import{p,r,t,g,e,n,o,S,u,_,Ke,Lt,_e,_t}from"./chunk-index-s356ybxk.js";import{De}from"./chunk-index-axw4wkqq.js";import"./chunk-index-50w6yq2d.js";import{Mt}from"./chunk-index-syxwqhry.js";import{C}from"./chunk-index-e8535c4h.js";import{on}from"./chunk-index-eyythjdx.js";var h="room-menu-yolo",N="room-menu-long",b="room-menu-mute";function P(a){let[l,m]=r(!1),i=_().app?.modes!==!1,f=u((s)=>s.rooms[a.room]?.view?.home===!1,a.room),c=u((s)=>s.pins.includes(a.room),a.room),d=a.mode??{yolo:!1,longRunning:!1},k=async(s)=>{m(!0),await Lt(a.room,{longRunning:s}),m(!1)};return e(C,{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(o,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(o,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:b,children:[e("span",{className:"menu-icon",children:e(o,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(Mt,{id:b,checked:!a.muted,label:t("Notifications"),onChange:async(s)=>{m(!0),await on(a.room,!s),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":"yolo",children:e(o,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(Mt,{id:h,checked:d.yolo,label:t("Yolo mode"),onChange:(s)=>{if(s)a.onAskYolo();else m(!0),Lt(a.room,{yolo:!1}).then(()=>m(!1))},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(o,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(Mt,{id:N,checked:d.longRunning,label:t("Long-running mode"),onChange:k,busy:l})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ke(a.agent)},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit knight")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(o,{name:"chevron",size:16})]})}):null,a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ke(a.agent,{skills:!0})},children:[e("span",{className:"menu-icon",children:e(o,{name:"skills"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Skills")}),e("span",{className:"meta",children:t("Choose the skills this knight carries.")})]}),e(o,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),_t({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(o,{name:"chevron",size:16})]})}):null,a.readOnly||!f?null:n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(p("rw5myg2t"),import("./chunk-layout-actions-rw5myg2t.js")).then((s)=>s.pinRoom(a.room,!c))},children:[e("span",{className:"menu-icon",children:e(o,{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(),De({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(o,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(o,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),_e({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{P as RoomMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,e,o,u}from"./chunk-index-s356ybxk.js";import"./chunk-index-50w6yq2d.js";import"./chunk-index-qq86fxda.js";import"./chunk-index-axw4wkqq.js";import{mi}from"./chunk-index-33cqx9v2.js";import"./chunk-index-xx0kecz9.js";import"./chunk-index-6m25qpa7.js";function n(){if(!u((r)=>r.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(r)=>mi(r.currentTarget),children:e(o,{name:"more",size:18})})}export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,t,c,e,n,o,S,y,f,x,m,k,P,_,oe}from"./chunk-index-s356ybxk.js";import{D}from"./chunk-index-6cs1wvhy.js";import{Se}from"./chunk-index-b5patef1.js";import"./chunk-index-e8535c4h.js";var h={mon:c("Mon"),tue:c("Tue"),wed:c("Wed"),thu:c("Thu"),fri:c("Fri"),sat:c("Sat"),sun:c("Sun")};function w(d){if(typeof d!=="object"||d===null)return"";let i=d,s=typeof i.time==="string"?i.time:"";switch(i.kind){case"once":return t("Once on {date} at {time}",{date:String(i.date??""),time:s});case"every":return Number(i.everyDays)===1?t("Every day at {time}",{time:s}):t("Every {count} days at {time}",{count:Number(i.everyDays),time:s});case"weekly":{let l=Array.isArray(i.weekdays)?i.weekdays.map((u)=>t(h[String(u)]??String(u))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:s})}default:return""}}function V(){let{timeZone:d}=_(),[i,s]=r(0),[l,u]=r(),{data:p,error:g}=Se(()=>y.schedules(),`schedules:${i}`);return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Schedules")})}),g?e(m,{message:g}):null,!p&&!g?e(x,{}):null,p&&p.schedules.length===0?e(k,{children:t("Nothing is scheduled. Ask a knight to remind you or to run something later.")}):null,e("ul",{className:"schedule-list",children:p?.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:[w(a.recurrence)," ·"," ",t("next {when}",{when:oe(a.nextRun,d)})]}),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:()=>u(a),children:e(o,{name:"trash"})})]},a.id))}),e(D,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>u(void 0),onConfirm:async()=>{if(!l)return;await y.cancelSchedule(l.id),s((a)=>a+1),f(t("Schedule cancelled."))},children:e("p",{children:t("“{title}” will not run again. Runs that already happened stay in the conversation.",{title:l?.title??""})})})]})}export{V as SchedulesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wn}from"./chunk-index-s356ybxk.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 wn((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{ir,rr}from"./chunk-index-y1xv3dxs.js";import"./chunk-index-50w6yq2d.js";import"./chunk-index-qq86fxda.js";export{ir as FoldToggle,rr as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T,v,E,s,r,t,c,g,e,n,o,S,u,y,l,f,_,hr,Yn,vs,at,Be}from"./chunk-index-s356ybxk.js";import{bi}from"./chunk-index-dagc92hw.js";import{fn,as,xi,Vn}from"./chunk-index-5x3h176v.js";var I;if(typeof window<"u")window.addEventListener("beforeinstallprompt",(d)=>{d.preventDefault(),I=d});var A=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),z=[{value:"system",label:c("System"),icon:"system"},{value:"light",label:c("Light"),icon:"sun"},{value:"dark",label:c("Dark"),icon:"moon"}],x=[{value:"modern",label:c("Modern"),hint:c("Plain and neutral, with round avatars.")},{value:"camelot",label:c("Camelot"),hint:c("Parchment by day, night castle by night, gold rules, shield avatars and wax seals.")}];function H({enabled:d,quietHours:p}){let[m,k]=r(),[w,h]=r([]),[N,L]=r(),[b,P]=r(!1),a=E(async()=>{k(await fn()),L(await as()),h((await y.pushDevices()).devices)},[]);if(s(()=>{if(d)a().catch(()=>k("unsupported"))},[d,a]),!d)return null;let C=async(i)=>{P(!0);try{await i()}catch(D){f(D instanceof Error&&D.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):l(D),"danger")}finally{await a().catch(()=>{return}),P(!1)}};return n("section",{className:"card stack",children:[e("h2",{children:t("Notifications")}),e("p",{className:"meta",children:m==="unsupported"?t("This browser cannot get push notifications. On iPhone and iPad, install the app from Share, Add to Home Screen, and open it from there."):m==="blocked"?t("Notifications are blocked for this site. Allow them in the browser's site settings."):t("Get a notification on this device when a card waits for you or a knight reports on its own, while the app is not open.")}),p?e("p",{className:"meta",children:t("Quiet hours, {start} to {end} ({zone}): no notification for a knight's report or a notice. A card waiting for you still notifies. The server sets the hours.",{start:p.start,end:p.end,zone:p.timeZone})}):null,m==="off"||m==="on"?e("div",{className:"actions",children:e("button",{type:"button",className:m==="on"?"secondary":void 0,disabled:b,onClick:()=>C(m==="on"?Vn:xi),children:m==="on"?t("Turn off on this device"):t("Turn on for this device")})}):null,w.length>0?e("ul",{className:"stack",children:w.map((i)=>n("li",{className:"card-head",children:[n("span",{children:[i.label??t("Device"),i.id===N?` (${t("this device")})`:""]}),e("button",{type:"button",className:"secondary",disabled:b,onClick:()=>C(async()=>{if(i.id===N)await Vn();else await y.removePushDevice(i.id)}),children:t("Remove")})]},i.id))}):null]})}var M=v(()=>Be().then((d)=>({default:d.HostSettingsPages})));function X(){let{preference:d}=Yn(),p=at(),m=_(),k=m.look??"modern",w=u((a)=>a.principal),[h,N]=r(),[L,b]=r(I!==void 0);s(()=>{y.session().then(N,()=>{return});let a=()=>b(!0);return window.addEventListener("beforeinstallprompt",a),()=>window.removeEventListener("beforeinstallprompt",a)},[]);let P=A();return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Settings")})}),m.pages?.some((a)=>a.place==="settings")?e(T,{fallback:null,children:e(M,{})}):null,n("section",{className:"card stack",children:[e("h2",{children:t("Appearance")}),n("fieldset",{className:"segmented segmented-wide",children:[e("legend",{className:"visually-hidden",children:t("Color scheme")}),z.map((a)=>n("label",{"data-checked":d===a.value,children:[e("input",{type:"radio",name:"theme",checked:d===a.value,onChange:(C)=>{let i=C.target.getBoundingClientRect();hr(a.value,{x:i.left+i.width/2,y:i.top+i.height/2})}}),e(o,{name:a.icon,size:18}),t(a.label)]},a.value))]}),n("fieldset",{className:"segmented segmented-wide",children:[e("legend",{className:"visually-hidden",children:t("Look")}),x.map((a)=>n("label",{"data-checked":p===a.value,children:[e("input",{type:"radio",name:"look",checked:p===a.value,onChange:()=>vs(a.value===k?void 0:a.value)}),n("span",{className:"look-swatch","data-swatch":a.value,"aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t(a.label)]},a.value))]}),e("p",{className:"meta",children:t(x.find((a)=>a.value===p)?.hint??"")})]}),n("section",{className:"card stack",children:[e("h2",{children:t("Install")}),P?e("p",{className:"meta",children:t("This page is installed on this device.")}):L?n(g,{children:[e("p",{className:"meta",children:t("Install it to open from your home screen or dock, in its own window.")}),e("div",{className:"actions",children:n("button",{type:"button",onClick:async()=>{await I?.prompt(),I=void 0,b(!1)},children:[e(o,{name:"download",size:16}),t("Install the app")]})})]}):e("p",{className:"meta",children:t("To install it, use your browser's Install option, or on iPhone and iPad, Share and then Add to Home Screen.")})]}),h?.prompts?n("section",{className:"card stack",children:[e("h2",{children:t("Main prompts")}),e("ul",{className:"menu",children:e("li",{children:n("a",{className:"menu-item menu-link",href:S("prompts"),children:[n("span",{className:"menu-text",children:[e("strong",{children:t("Edit the main prompts")}),e("span",{className:"meta",children:t("The texts the main knight and the other knights start from, with a diff to read before you save and a way back to the file's text.")})]}),e(o,{name:"chevron",size:16})]})})})]}):null,e(H,{enabled:h?.push===!0,quietHours:h?.quietHours}),n("section",{className:"card stack",children:[e("h2",{children:t("Account")}),e("p",{className:"meta",children:w?t("Signed in as {name}.",{name:w.name}):h?t("Signed in as {name}.",{name:h.principal.name}):""}),h?e(bi,{auth:h.auth}):null]})]})}export{X as SettingsPage};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{p,T,v,E,s,A,R,a,r,t,c,g,e,n,o,X,u,fe,y,l,f,x,m,k,_,ke,kn,to,Ss,_e,Ai,_s,he,Pn,te,Ve,jn}from"./chunk-index-s356ybxk.js";import{es}from"./chunk-index-ekp5mmvp.js";import{D}from"./chunk-index-6cs1wvhy.js";import{Qo,aa,la,Mo,ua}from"./chunk-index-2s48qyrs.js";import{Is,So,Ds}from"./chunk-index-36m3knsk.js";import"./chunk-index-axw4wkqq.js";import"./chunk-index-fdg2qd3f.js";import"./chunk-index-50w6yq2d.js";import{Xr}from"./chunk-index-m8bv51r9.js";import"./chunk-index-qq86fxda.js";import"./chunk-index-nncy9wxw.js";import"./chunk-index-vxqzavgz.js";import{ti}from"./chunk-index-x5xq9g9a.js";import{Cn}from"./chunk-index-50syrmaq.js";import{gn,ar,Gr,lr}from"./chunk-index-p2e7rwac.js";import{de}from"./chunk-index-gmbk3sra.js";import{yt}from"./chunk-index-mey1p7h8.js";import{Zt}from"./chunk-index-n2v2bz8d.js";import{Mt}from"./chunk-index-syxwqhry.js";import{Ee}from"./chunk-index-sk8cvb4e.js";import{H}from"./chunk-index-9ehqccfe.js";import{C}from"./chunk-index-e8535c4h.js";import"./chunk-index-g0sdxjxr.js";import{on}from"./chunk-index-eyythjdx.js";import"./chunk-index-xx0kecz9.js";import{re,ze}from"./chunk-index-6q3dx093.js";import"./chunk-index-6m25qpa7.js";import"./chunk-index-kvztbfqj.js";import"./chunk-index-6ycrvwzs.js";import{Y}from"./chunk-index-d941ae7c.js";var Ke=v(()=>(p("kn42sf8y"),import("./chunk-prompt-history-kn42sf8y.js")).then((i)=>({default:i.HistorySheet}))),Qe=v(()=>(p("bg3tdc8p"),import("./chunk-character-creator-bg3tdc8p.js")).then((i)=>({default:i.CharacterCreator}))),Ue=["default","off","minimal","low","medium","high","xhigh"],Se={default:c("Default"),off:c("Off"),minimal:c("Minimal"),low:c("Low"),medium:c("Medium"),high:c("High"),xhigh:c("Very high")},q="default",Ce=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),qe=c("Automatic"),pe=(i)=>i==="auto"?t(qe):t(Se[i]??i),Ne=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??q,thinking:i.thinking??q});function we(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??q)?{model:h.model}:{},...h.thinking!==(i.thinking??q)?{thinking:h.thinking}:{}}}function Ae(){let i=Ss(),h=a(i);if(i)h.current=i;let d=h.current,N=i!==void 0;if(s(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)kn()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!d)return null;return e(C,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:kn,children:e(Ze,{name:d.name,opened:d.id},d.name)})}function Ze({name:i,opened:h}){let[d,N]=r(),[w,b]=r([]),[I,B]=r(),[L,z]=r(),[G,Q]=r(!1),[S,M]=r(!1),[V,W]=r(!1),[K,Z]=r(!1),se=jn(d?.room??""),ee=a(null),ne=d!==void 0,J=u((F)=>d?F.rooms[d.room]?.view?.muted===!0:!1,d?.room??""),[ie,U]=r(!1),le=u((F)=>d?F.rooms[d.room]?.view?.coordinator===!0:!1,d?.room??""),oe=A(),ae=A(),O=A();s(()=>{if(!ne||!to()?.look)return;ee.current?.scrollIntoView({block:"start"}),ee.current?.focus({preventScroll:!0})},[ne,h]);let P=a({});P.current={profile:d,draft:L},s(()=>{let F=!0;return Promise.all([y.agent(i),y.models()]).then(([ce,We])=>{if(!F)return;let{profile:ye,draft:ue}=P.current,je=ye&&ue&&Object.keys(we(ye,ue)).length>0;N(ce),b(We.models),z(je?ue:Ne(ce))},(ce)=>F&&B(l(ce))),()=>{F=!1}},[i,h]);let j=R(()=>d&&L?we(d,L):{},[d,L]);if(I)return e(m,{message:I});if(!d||!L)return e(x,{});let ve=Object.keys(j).length>0,Oe=Array.from(new Set([q,...w,L.model])),Be=Ce(d),be=async()=>{Q(!0);try{let F=await y.updateAgent(i,j);N(F),z(Ne(F)),M(!1),f(t("Saved."))}catch(F){f(l(F),"danger")}finally{Q(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(he,{spec:d.character,name:d.name,size:72,state:se,label:d.displayName}),n("div",{children:[e("h3",{children:d.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:d.effective.model,thinking:pe(d.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:O,children:[e("span",{className:"menu-icon",children:e(o,{name:J?"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(Mt,{id:O,checked:!J,label:t("Notifications"),busy:ie,onChange:async(F)=>{U(!0),await on(d.room,!F),U(!1)}})]})})}),S?e(et,{profile:d,draft:L,saving:G,onBack:()=>M(!1),onSave:be}):n("form",{className:"stack form",onSubmit:(F)=>{if(F.preventDefault(),!ve)return;if(j.prompt!==void 0)M(!0);else be()},children:[n("label",{htmlFor:ae,children:[t("Name"),e("input",{id:ae,value:L.displayName,onChange:(F)=>z({...L,displayName:F.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:oe,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>Z(!0),children:[e(o,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>W(!0),children:[e(Je,{}),t("Full screen")]})]})]}),e("textarea",{id:oe,rows:8,value:L.prompt,onChange:(F)=>z({...L,prompt:F.target.value})})]}),e(Zt,{label:t("Model"),value:L.model,onChange:(F)=>z({...L,model:F}),options:Oe.map((F)=>({value:F,label:F===q?Be:F}))}),e(Zt,{label:t("Thinking level"),value:L.thinking,onChange:(F)=>z({...L,thinking:F}),options:Ue.map((F)=>({value:F,label:t(Se[F])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ve||G,children:G?t("Saving…"):j.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(Xe,{name:i,opened:h}),n("section",{className:"card stack",ref:ee,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(T,{fallback:e(x,{}),children:e(Qe,{name:d.name,displayName:d.displayName,prompt:d.prompt,character:d.character,onSaved:(F)=>N(F)})})]}),le?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived knight stops answering and its schedules are cancelled. Its history is kept, and you can restore it from Archived.")}),e("div",{className:"actions",children:e("button",{type:"button",className:"danger",onClick:()=>{kn(),_e({kind:"archive",room:d.room,name:d.displayName})},children:t("Archive {name}",{name:d.displayName})})})]}),K?e(T,{fallback:null,children:e(Ke,{open:K,title:t("History of the prompt"),load:async()=>(await de.agentPromptHistory(i)).versions.map((F)=>({id:F.id,text:F.text,previous:F.previous,by:F.by,at:F.at})),onUse:(F)=>{z({...L,prompt:F}),Z(!1)},onClose:()=>Z(!1)})}):null,e(C,{open:V,title:t("Prompt"),size:"full",onClose:()=>W(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:L.prompt,onChange:(F)=>z({...L,prompt:F.target.value})})})]})}function Xe({name:i,opened:h}){let[d,N]=r(),[w,b]=r(),[I,B]=r(),L=A(),z=a(null),G=d!==void 0;if(s(()=>{if(!G||!to()?.skills)return;z.current?.scrollIntoView({block:"start"}),z.current?.focus({preventScroll:!0})},[G,h]),s(()=>{let M=!0;return re.skills(i).then((V)=>M&&N(V),(V)=>{if(M&&!(V instanceof fe&&V.status===404))B(l(V))}),()=>{M=!1}},[i,h]),I)return e(m,{message:I});if(!d)return null;let Q=()=>re.skills(i).then(N,(M)=>{f(l(M),"danger")}),S=async(M,V)=>{b(M);try{N(await re.setSkills(i,V?{add:[M]}:{remove:[M]}))}catch(W){f(l(W),"danger")}finally{b(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),ref:z,tabIndex:-1,children:[e("h3",{children:t("Skills ({count})",{count:d.skills.filter((M)=>M.carried).length})}),e("p",{className:"meta",children:t("What the knight can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:d.skills.map((M,V)=>{let W=`${L}-${V}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:W,children:[n("span",{className:"menu-text",children:[e("strong",{children:M.name}),e("span",{className:"meta",children:M.missing?t("Its file cannot be read."):M.builtin?t("Built in: every knight carries it."):M.description??""})]}),e(Mt,{id:W,checked:M.carried,label:M.name,busy:w===M.name,disabled:M.builtin,onChange:(K)=>S(M.name,K)})]})},M.name)})}),e(Ye,{name:i,view:d,onApplied:Q})]})}function Ye({name:i,view:h,onApplied:d}){let[N,w]=r(),[b,I]=r(),B=A();if(s(()=>{let S=!0;return de.skillGroups().then((M)=>S&&w(M.groups),()=>{return}),()=>{S=!1}},[]),!N?.length)return null;let L=new Set(h.skills.filter((S)=>S.carried).map((S)=>S.name)),z=new Set(h.skills.filter((S)=>S.builtin).map((S)=>S.name)),G=(S)=>S.skills.filter((M)=>!L.has(M)),Q=(S)=>S.skills.filter((M)=>L.has(M)&&!z.has(M));return n("div",{className:"stack skill-apply",children:[e("h4",{children:t("Skill groups")}),e("p",{className:"meta",children:t("Switching a group on switches on its skills this knight lacks; switching it off switches off its skills, built-in ones excepted.")}),e("ul",{className:"menu",children:N.map((S,M)=>{let V=G(S),W=V.length===0;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:`${B}-group-${M}`,children:[n("span",{className:"menu-text",children:[e("strong",{children:S.name}),e("span",{className:"meta",children:W?t("Carries all of it."):t("Lacks {count}: {skills}",{count:V.length,skills:V.join(", ")})})]}),e(Mt,{id:`${B}-group-${M}`,checked:W,label:t("Skill group {name}",{name:S.name}),disabled:W&&Q(S).length===0,onChange:(K)=>I({group:S,on:K})})]})},S.name)})}),e(D,{open:b!==void 0,title:b?.on?t("Switch this skill group on?"):t("Switch this skill group off?"),confirmLabel:b?.on?t("Switch on"):t("Switch off"),tone:b?.on?"primary":"danger",onClose:()=>I(void 0),onConfirm:async()=>{if(!b)return;let{added:S,removed:M}=await de.applySkillGroup(b.group.name,i,b.on);f(S.length?t("Switched on: {skills}",{skills:S.join(", ")}):M.length?t("Switched off: {skills}",{skills:M.join(", ")}):t("Nothing changed for {name}.",{name:b.group.name})),d()},children:e("p",{children:b?b.on?t("{agent} will also carry: {skills}.",{agent:i,skills:G(b.group).join(", ")}):t("{agent} will no longer carry: {skills}.",{agent:i,skills:Q(b.group).join(", ")}):null})})]})}var Je=()=>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 et(i){let{profile:h,draft:d}=i,N=a(null);s(()=>N.current?.focus(),[]);let w=[];if(d.displayName!==h.displayName)w.push({label:t("Name"),before:h.displayName,after:d.displayName});let b=(I)=>I===q?Ce(h):I;if(d.model!==(h.model??q))w.push({label:t("Model"),before:b(h.model??q),after:b(d.model)});if(d.thinking!==(h.thinking??q))w.push({label:t("Thinking level"),before:pe(h.thinking??q),after:pe(d.thinking)});return n("section",{ref:N,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),w.length?e("ul",{className:"review-fields",children:w.map((I)=>n("li",{children:[e("strong",{children:I.label}),e("span",{className:"review-before",children:I.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:I.after})]},I.label))}):null,e(yt,{label:t("Prompt"),before:h.prompt,after:d.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:i.saving,onClick:i.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:i.saving,onClick:i.onSave,children:i.saving?t("Saving…"):t("Save")})]})]})}var tt=300000;function xe(){let i=la(),[h,d]=r(i);if(i&&i!==h)d(i);if(!h)return null;return e(C,{open:i!==void 0,title:t("Archived conversation"),size:"wide",onClose:aa,children:e(nt,{room:h.room,until:h.until},`${h.room}:${h.until}`)})}function nt(i){Y("archived-log",".archived-log .messages { padding: 0; }");let{timeZone:h}=_(),d=Ve(),[N,w]=r(),[b,I]=r(!1),[B,L]=r(),[z,G]=r(!1),{room:Q,until:S}=i;s(()=>{let V=!0;return Qo.page(Q,S).then((W)=>{if(!V)return;w(W.messages),I(W.more)},(W)=>{if(V)L(l(W))}),()=>{V=!1}},[Q,S]);let M=async()=>{let V=N?.[0];if(!V||z)return;G(!0);try{let W=await Qo.page(Q,S,V.id);w((K)=>[...W.messages,...K??[]]),I(W.more)}catch(W){L(l(W))}G(!1)};if(B)return e(m,{message:B});if(!N)return e(x,{});if(N.length===0)return e(k,{children:t("The archived conversation has no messages.")});return n("div",{className:"archived-log",children:[b?e("button",{type:"button",className:"secondary older",disabled:z,onClick:M,children:z?t("Loading…"):t("Load earlier messages")}):null,e("ol",{className:"messages",children:N.map((V,W)=>{let K=N[W-1],Z=!K||K.kind!==V.kind||K.author!==V.author||Date.parse(V.at)-Date.parse(K.at)>tt;return e(Pn,{message:V,character:V.agent?d[V.agent]:void 0,header:Z,enter:!1,unread:!1,timeZone:h,quotable:!1},V.id)})})]})}function ot(i){let{message:h}=i,[d,N]=r(h.text),w=a(null);s(()=>{w.current?.focus(),w.current?.setSelectionRange(d.length,d.length)},[d.length]);let b=d.trim(),I=b===""&&h.files.length===0;return n("form",{className:"stack",onSubmit:(L)=>{if(L.preventDefault(),I)return;if(b!==h.text)Is(h,b);i.onClose()},children:[e("div",{className:"field",children:e("textarea",{ref:w,className:"queued-edit-text",rows:6,value:d,"aria-label":t("Edit"),onChange:(L)=>N(L.target.value)})}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:I,children:t("Save")})]})]})}function Me(){let i=Ds(),h=a(void 0);if(i)h.current=i;let d=h.current;if(!d)return null;return e(H,{open:i!==void 0,title:t("Edit"),onClose:So,children:e(ot,{message:d,onClose:So},d.id)})}var at=`
|
|
2
|
+
.sheet:has(.select-text) {
|
|
3
|
+
-webkit-user-select: none;
|
|
4
|
+
user-select: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.select-text {
|
|
8
|
+
flex: 1;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: var(--space-3);
|
|
11
|
+
overflow-wrap: anywhere;
|
|
12
|
+
white-space: pre-wrap;
|
|
13
|
+
border: 1px solid var(--border);
|
|
14
|
+
border-radius: var(--radius-md);
|
|
15
|
+
background: var(--surface-2);
|
|
16
|
+
font: inherit;
|
|
17
|
+
line-height: 1.6;
|
|
18
|
+
-webkit-touch-callout: default;
|
|
19
|
+
-webkit-user-select: text;
|
|
20
|
+
user-select: text;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.select-text-actions {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: flex-end;
|
|
26
|
+
gap: var(--space-2);
|
|
27
|
+
margin-top: var(--space-3);
|
|
28
|
+
}
|
|
29
|
+
`;function Le(){let i=ua(),[h,d]=r(i);if(i&&i!==h)d(i);if(!h)return null;return Y("select-text",at),n(C,{open:i!==void 0,title:t("Select text"),size:"full",onClose:Mo,children:[e("p",{className:"hint",children:h.author}),e("pre",{className:"select-text",children:h.text}),n("div",{className:"select-text-actions",children:[e("button",{type:"button",className:"secondary",onClick:Mo,children:t("Close")}),e("button",{type:"button",onClick:()=>ti(h.text),children:t("Copy all")})]})]})}function st(i){let h=i.filter((w)=>w.parent!==void 0),d=i.filter((w)=>w.parent===void 0),N=new Set(d.map((w)=>w.name));return[...d.flatMap((w)=>[w,...h.filter((b)=>b.parent===w.name)]),...h.filter((w)=>!N.has(w.parent??""))]}function Te(){let[i,h]=r(),[d,N]=r(),[w,b]=r(),[I,B]=r(),L=E(async()=>{try{h((await re.archive()).entries),N(void 0)}catch(G){N(l(G))}},[]);s(()=>{L()},[L]);let z=async(G)=>{b(G.name);try{if(G.kind==="agent")await re.restoreAgent(G.name);else await re.restoreGroup(G.name);await ze(),f(t("Restored {name}.",{name:G.displayName})),await L()}catch(Q){f(l(Q),"danger")}finally{b(void 0)}};if(d&&!i)return e(m,{message:d});if(!i)return e(x,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived knights and groups no longer answer. Their history is kept until you delete them.")}),i.length===0?e(k,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:st(i).map((G)=>n("li",{className:"menu-item","data-helper":G.parent??void 0,style:G.parent?{paddingLeft:"var(--space-6)"}:void 0,children:[e("span",{className:"menu-icon",children:e(o,{name:G.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:G.displayName}),n("span",{className:"meta",children:[G.parent?t("Temp knight of {name}",{name:G.parent}):G.kind==="agent"?t("Knight"):t("Group")," ","· ",G.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:w===G.name,onClick:()=>z(G),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:w===G.name,onClick:()=>B(G),children:t("Delete")})]},`${G.kind}:${G.name}`))}),e(D,{open:I!==void 0,title:t("Delete {name}?",{name:I?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>B(void 0),onConfirm:async()=>{if(!I)return;if(I.kind==="agent")await re.deleteAgent(I.name);else await re.deleteGroup(I.name);await ze(),f(t("Deleted {name}.",{name:I.displayName})),await L()},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:I?.displayName??""})})})]})}var De=/^[a-z0-9-]{1,32}$/,He=2,Re=8,me="\x00";function rt(){let i=u((h)=>h.order.flatMap((d)=>{let N=h.rooms[d]?.view;return N?.kind==="agent"&&!N.helper?[`${N.name}${me}${N.displayName}`]:[]}).join(`${me}${me}`));return R(()=>i===""?[]:i.split(`${me}${me}`).map((h)=>{let[d="",N=""]=h.split(me);return{name:d,displayName:N}}),[i])}function Ie(i){let h=rt(),[d,N]=r(),[w,b]=r(),[I,B]=r(""),[L,z]=r(""),[G,Q]=r(!1),[S,M]=r([]),[V,W]=r(""),[K,Z]=r(!1),[se,ee]=r(i.name===void 0),ne=A(),J=A();s(()=>{let O=i.name;if(O===void 0)return;let P=!0;return re.group(O).then((j)=>{if(!P)return;N(j),B(j.displayName),M(j.members),W(j.host),ee(!0)},(j)=>P&&b(l(j))),()=>{P=!1}},[i.name]);let ie=(O)=>h.find((P)=>P.name===O)?.displayName??O,U=S.includes(V)?V:S[0]??"",le=d===void 0?!0:I.trim()!==d.displayName||S.join(",")!==d.members.join(",")||U!==d.host,oe=I.trim()!==""&&S.length>=He&&S.length<=Re&&(d!==void 0||De.test(L));if(w&&!se)return e(m,{message:w});if(!se)return e(x,{});let ae=async()=>{Z(!0),b(void 0);try{if(d){await re.updateGroup(d.name,{...I.trim()!==d.displayName?{displayName:I.trim()}:{},...S.join(",")!==d.members.join(",")?{members:S}:{},...U!==d.host?{host:U}:{}}),await ze(),f(t("Saved.")),i.onDone();return}let O=await re.createGroup({name:L,displayName:I.trim(),members:S,host:U});await ze(),f(t("Made {name}.",{name:O.displayName})),i.onDone(),X("room",O.room)}catch(O){b(l(O))}finally{Z(!1)}};return n("form",{className:"stack form",onSubmit:(O)=>{if(O.preventDefault(),oe&&le&&!K)ae()},children:[n("label",{htmlFor:ne,children:[t("Name"),e("input",{id:ne,value:I,autoComplete:"off",onChange:(O)=>{if(B(O.target.value),!d&&!G)z(O.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),d?null:n("label",{htmlFor:J,children:[t("Permanent name"),e("input",{id:J,value:L,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":L!==""&&!De.test(L),onChange:(O)=>{Q(!0),z(O.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Members")}),e("span",{className:"meta",children:t("Pick 2 to 8 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:h.map((O)=>{let P=S.includes(O.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:P,disabled:!P&&S.length>=Re,onChange:()=>M(P?S.filter((j)=>j!==O.name):[...S,O.name])}),e("span",{className:"menu-text",children:e("strong",{children:O.displayName})})]})},O.name)})})]}),S.length>=He?e(Zt,{label:t("Host"),value:U,onChange:W,options:S.map((O)=>({value:O,label:ie(O)}))}):null,w?e(m,{message:w}):null,n("div",{className:"actions",children:[d?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),_e({kind:"archive",room:d.room,name:d.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!oe||!le||K,children:K?t("Saving…"):d?t("Save"):t("Make group")})]})]})}var it=v(()=>(p("bg3tdc8p"),import("./chunk-character-creator-bg3tdc8p.js")).then((i)=>({default:i.CharacterCreator}))),Pe=/^[a-z0-9-]{1,32}$/,ge="default";function lt(i){let h=[];for(let d of i){let N=d.indexOf("/"),w=N>0?d.slice(0,N):"",b=h.find((I)=>I.provider===w&&w!=="");if(b)b.models.push(d);else h.push({provider:w,models:[d]})}return h}var mt=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function $e({onDone:i}){let[h,d]=r(""),[N,w]=r(""),[b,I]=r(!1),[B,L]=r(""),[z,G]=r(ge),[Q,S]=r(""),[M,V]=r(),[W,K]=r(!1),[Z,se]=r([]),[ee,ne]=r(),[J,ie]=r(!1),U=[A(),A(),A(),A(),A()];s(()=>{let P=!0;return y.models().then((j)=>P&&se(j.models),()=>{return}),()=>{P=!1}},[]);let le=R(()=>Cn({name:N,displayName:h,prompt:B}),[N,h,B]),oe=M?.spec??le,ae=Pe.test(N)&&h.trim()!==""&&B.trim()!=="";if(W)return e(T,{fallback:e(x,{}),children:e(it,{name:N||"new",displayName:h,prompt:B,character:oe,onPick:(P,j)=>{V({input:P,spec:j}),K(!1)},onCancel:()=>K(!1)})});let O=async()=>{ie(!0),ne(void 0);try{let P={name:N,displayName:h.trim(),prompt:B,...z!==ge?{model:z}:{},...Q.trim()?{task:Q.trim()}:{},...M?{character:M.input}:{}},j=await re.createAgent(P);await ze(),f(t("Made {name}.",{name:j.displayName})),i(),X("room",j.room)}catch(P){ne(P instanceof fe&&P.field?`${P.field}: ${l(P)}`:l(P))}finally{ie(!1)}};return n("form",{className:"stack form",onSubmit:(P)=>{if(P.preventDefault(),ae&&!J)O()},children:[n("label",{htmlFor:U[0],children:[t("Name"),e("input",{id:U[0],value:h,autoComplete:"off",onChange:(P)=>{if(d(P.target.value),!b)w(mt(P.target.value))}})]}),n("label",{htmlFor:U[1],children:[t("Permanent name"),e("input",{id:U[1],value:N,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":N!==""&&!Pe.test(N),onChange:(P)=>{I(!0),w(P.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("label",{htmlFor:U[2],children:[t("Prompt"),e("textarea",{id:U[2],rows:6,value:B,onChange:(P)=>L(P.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:U[4],children:[t("Model"),n(Ee,{id:U[4],value:z,onChange:(P)=>G(P.target.value),children:[e("option",{value:ge,children:t("Default model")}),lt(Z).map((P)=>P.provider===""?P.models.map((j)=>e("option",{value:j,children:j},j)):e("optgroup",{label:P.provider,children:P.models.map((j)=>e("option",{value:j,children:j},j))},P.provider))]})]}),n("label",{htmlFor:U[3],children:[t("Opening task"),e("textarea",{id:U[3],rows:3,value:Q,onChange:(P)=>S(P.target.value)}),e("span",{className:"meta",children:t("Optional. The knight starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(he,{spec:oe,name:N||"new",size:72,label:h}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:M?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>K(!0),children:t("Choose a look")})]})]}),ee?e(m,{message:ee}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ae||J,children:J?t("Making…"):t("Make knight")})})]})}var ct=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Fe(){let i=_s(),h=a(i);if(i)h.current=i;let d=h.current,N=i!==void 0;if(s(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)Ai()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!d)return null;return e(C,{open:i!==void 0,title:ct(d),size:"wide",onClose:Ai,children:e("div",{className:"stack agent-sheet",children:d.kind==="new-agent"?e($e,{onDone:Ai}):d.kind==="archive"?e(Te,{}):e(Ie,{...d.name===void 0?{}:{name:d.name},onDone:Ai})},d.id)})}function Ge(){let i=Gr(),h=a(!1);if(i)h.current=!0;return h.current?e(ut,{open:i}):null}function ut({open:i}){let h=_(),{now:d}=te(),N=u((b)=>gn(b).map(({id:I,card:B})=>{let L=b.rooms[B.room]?.view,z=L?.parent?b.rooms[L.parent]?.view:void 0;return{id:I,room:z?`${z.displayName} › ${L?.displayName??""}`:L?.displayName??B.room,title:B.frame.title,at:B.frame.at}})),w=N.length===0;return s(()=>{if(i&&w)ar()},[i,w]),e(C,{open:i&&!w,title:t("Cards waiting"),onClose:ar,children:e("ul",{className:"waiting-list",children:N.map((b)=>e("li",{children:n("button",{type:"button",onClick:()=>lr(b.id),children:[e("strong",{children:b.title}),n("span",{className:"meta",children:[b.room,b.at?` · ${ke(b.at,d,h.timeZone)}`:""]})]})},b.id))})})}var dt=v(()=>(p("wnm0cm8n"),import("./chunk-shortcut-help-wnm0cm8n.js")));function pt(){let i=es(),h=a(!1);if(i)h.current=!0;if(!h.current)return null;return e(T,{fallback:null,children:e(dt,{open:i})})}function To(){return n(g,{children:[e(Xr,{}),e(Me,{}),e(Ae,{}),e(Fe,{}),e(xe,{}),e(Le,{}),e(Ge,{}),e(pt,{})]})}export{To as SheetHosts};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t,e,n}from"./chunk-index-
|
|
1
|
+
import{t,e,n}from"./chunk-index-s356ybxk.js";import{pi,ns}from"./chunk-index-ekp5mmvp.js";import{C}from"./chunk-index-e8535c4h.js";import{Y}from"./chunk-index-d941ae7c.js";var o=`
|
|
2
2
|
.shortcut-list {
|
|
3
3
|
display: grid;
|
|
4
4
|
grid-template-columns: max-content minmax(0, 1fr);
|
|
@@ -23,4 +23,4 @@ import{t,e,n}from"./chunk-index-24cggw6k.js";import{li,Yo}from"./chunk-index-7xc
|
|
|
23
23
|
text-align: center;
|
|
24
24
|
font-size: var(--text-sm);
|
|
25
25
|
}
|
|
26
|
-
`;function r(){let a=
|
|
26
|
+
`;function r(){let a=ns(),s=a?"⌥":"Alt",l=a?"⌘":"Ctrl";return[{keys:[s,"↑"],label:t("Previous room")},{keys:[s,"↓"],label:t("Next room")},{keys:[s,"Shift","↑"],label:t("Previous room with unread messages")},{keys:[s,"Shift","↓"],label:t("Next room with unread messages")},{keys:[l,"K"],label:t("Find a room")},{keys:["Esc"],label:t("Close the open menu or sheet, or leave the message box")},{keys:["↑"],label:t("Edit your latest message that is still waiting, from an empty message box")},{keys:["?"],label:t("Show these shortcuts")}]}function i({open:a}){return Y("shortcut-help",o),e(C,{open:a,title:t("Keyboard shortcuts"),onClose:pi,children:n("div",{className:"stack",children:[e("dl",{className:"shortcut-list",children:r().map((s)=>n("div",{style:{display:"contents"},children:[e("dt",{children:s.keys.map((l)=>e("kbd",{children:l},l))}),e("dd",{children:s.label})]},s.label))}),e("p",{className:"meta",children:t("In a message box the arrow shortcuts switch rooms only when it is empty or the caret is at its very start (up) or very end (down).")})]})})}export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Gn,S,X,Qe,Le,O,st,kt,Ae,io}from"./chunk-index-s356ybxk.js";import{Rr}from"./chunk-index-qq86fxda.js";import{zi,Ii}from"./chunk-index-36m3knsk.js";import{Jo,pi,ts}from"./chunk-index-ekp5mmvp.js";import{lt}from"./chunk-index-6ycrvwzs.js";function y(e,t){let{collapsed:n,expanded:r,current:s}=t,o=lt(e,t.at),u=[],c=(i,f)=>{u.push({key:i,shown:f});let l=o.threads[i];if(!l)return;for(let d of l.open)u.push({key:d,shown:f});for(let d of l.closed)u.push({key:d,shown:f&&(r.has(d)||d===s)})};for(let i of o.home)c(i,!0);let a=(i,f)=>{let l=n.has(i);for(let d of f)c(d,!l||d===s||t.stays?.(d)===!0)};a(Ae("pinned"),o.pinned);for(let i of o.folders)a(i.id,i.rooms);if(o.folders.length>0)a(Ae("rest"),o.rest);else a(Ae("agents"),o.restAgents),a(Ae("groups"),o.restGroups);let{orphans:m}=o;for(let i of m.open)u.push({key:i,shown:!0});for(let i of m.closed)u.push({key:i,shown:r.has(i)||i===s});return u}function h(e,t,n,r){let s=n===1?-1:e.length;if(t!==void 0){if(s=e.findIndex((o)=>o.key===t),s<0)return}for(let o=s+n;o>=0&&o<e.length;o+=n){let u=e[o];if(u&&r(u))return u.key}return}var b=new Set(["","text","search","url","tel","email","password","number","date","datetime-local","month","time","week"]);function g(e){if(!(e instanceof HTMLElement))return;if(e instanceof HTMLTextAreaElement)return e;if(e instanceof HTMLSelectElement)return e;if(e instanceof HTMLInputElement)return b.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function k(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:o,selectionEnd:u}=e;if(o===null||u===null||o!==u)return!1;return t?o===0:o===e.value.length}if((e.textContent??"")==="")return!0;let n=window.getSelection();if(!n||n.rangeCount===0||!n.isCollapsed)return!1;let r=n.getRangeAt(0),s=document.createRange();if(s.selectNodeContents(e),t)s.setEnd(r.startContainer,r.startOffset);else s.setStart(r.endContainer,r.endOffset);return s.toString()===""}function w(){let e=Gn();if(e.pane!=="room"||e.key===void 0)return;return(O.getState().rooms[e.key]?.messages??[]).findLast(zi)}var x=(e)=>e instanceof HTMLTextAreaElement&&e.closest(".composer")!==null&&e.value===""&&!e.readOnly;function T(e){if(e.defaultPrevented||st(e))return;let{key:t}=e;if(t==="Escape")return e.altKey||e.ctrlKey||e.metaKey?void 0:"escape";if(e.altKey&&!e.ctrlKey&&!e.metaKey){if(t!=="ArrowUp"&&t!=="ArrowDown")return;let n=t==="ArrowUp",r=g(e.target);if(r&&!k(r,n))return;if(e.shiftKey)return n?"previous-unread":"next-unread";return n?"previous":"next"}if(t==="ArrowUp"&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.repeat)return x(e.target)&&w()?"edit-queued":void 0;if(t==="?"&&!e.ctrlKey&&!e.metaKey&&!e.repeat)return g(e.target)?void 0:"help";return}function K(){let e=new Set;for(let t of document.querySelectorAll("details.thread-closed[open] [data-thread]"))if(t.dataset.thread)e.add(t.dataset.thread);return e}var p=()=>document.querySelector('dialog[open], .action-popover, .switcher:not([data-state="closed"])')!==null;function E(e,t=12){let n=S("room",e),r=[...document.querySelectorAll('.room-row[aria-current="page"], .thread-link[aria-current="page"]')].find((s)=>s.getAttribute("href")===n);if(r)r.scrollIntoView?.({block:"nearest"});else if(t>0)requestAnimationFrame(()=>E(e,t-1))}function H(e,t){let n=O.getState(),r=Gn(),s=r.pane==="room"?r.key:void 0,o=y(n,{at:(a)=>Le(n,a),collapsed:io(),stays:(a)=>Qe(n,a)>0||Rr(a)>0,expanded:K(),current:s});if(r.pane==="room"&&!o.some((a)=>a.key===s))return;let c=h(o,s,e,t?(a)=>Rr(a.key)>0:(a)=>a.shown);if(c===void 0)return;X("room",c),E(c)}function L(e){if(document.querySelector(".action-popover")){e.preventDefault(),kt();return}if(document.querySelector("dialog[open]"))return;let t=document.activeElement;if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&b.has(t.type))e.preventDefault(),t.blur()}function A(e,t){switch(e){case"escape":L(t);break;case"help":if(t.preventDefault(),ts())pi();else if(!p())Jo();break;case"edit-queued":{if(p())break;let n=w();if(!n)break;t.preventDefault(),Ii(n);break}default:if(p())break;t.preventDefault(),H(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function V(){let e=(t)=>{let n=T(t);if(n)A(n,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{V as startShortcuts};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{p,T,
|
|
1
|
+
import{p,T,v,s,A,r,t,g,e,n,o,fe,l,f,x,m}from"./chunk-index-s356ybxk.js";import{de}from"./chunk-index-gmbk3sra.js";import{yt}from"./chunk-index-mey1p7h8.js";import{C}from"./chunk-index-e8535c4h.js";var B=v(()=>(p("kn42sf8y"),import("./chunk-prompt-history-kn42sf8y.js")).then((d)=>({default:d.HistorySheet}))),O=`---
|
|
2
2
|
name: my-skill
|
|
3
3
|
description: "Use when "
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# My skill
|
|
7
7
|
|
|
8
|
-
`;function _(d){let{name:u}=d,[i,w]=r(),[h,b]=r(u?"":O),[y,
|
|
8
|
+
`;function _(d){let{name:u}=d,[i,w]=r(),[h,b]=r(u?"":O),[y,R]=r(),[z,k]=r(!1),[S,D]=r(!1),[U,H]=r(!1),[L,N]=r(!1),E=A();s(()=>{if(!u)return;let a=!0;return de.skillDocument(u).then((c)=>{if(!a)return;w(c),b(c.text)},(c)=>a&&R(l(c))),()=>{a=!1}},[u]);let F=i?.text??"",V=h!==F,I=u!==void 0&&!i&&!y,K=async()=>{D(!0);try{if(i){let a=await de.saveSkillDocument(i.name,{text:h,baseHash:i.hash});w(a),b(a.text),k(!1),H(!1),f(t("Saved.")),d.onSaved()}else await de.createSkillDocument({text:h}),f(t("Skill created.")),d.onSaved(),d.onClose()}catch(a){if(a instanceof fe&&a.status===409){let{current:c}=a.body;w(c),H(!0)}else f(l(a),"danger")}finally{D(!1)}};return n(C,{open:!0,title:u??t("New skill"),size:"full",onClose:d.onClose,children:[y?e(m,{message:y}):null,I?e(x,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!I&&!y&&(!i||i.writable)?n("div",{className:"stack",children:[z?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),U?e(m,{message:t("This skill changed while you were editing it. The changes below are against the version there now; save again to replace it, or go back to edit.")}):null,e(yt,{label:"SKILL.md",before:F,after:h}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:S,onClick:()=>k(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:S,onClick:K,children:S?t("Saving…"):i?t("Save"):t("Create skill")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:E,children:"SKILL.md"}),i?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>N(!0),children:[e(o,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:E,className:"prompt-full",spellCheck:!1,value:h,onChange:(a)=>b(a.target.value)}),e("p",{className:"meta",children:t("Frontmatter holds the name, which cannot change, and a description that starts with “Use when”. The rest is the skill.")})]}),e("div",{className:"actions",children:e("button",{type:"button",disabled:!V||!h.trim(),onClick:()=>k(!0),children:t("Review changes")})})]}),L&&i?e(T,{fallback:null,children:e(B,{open:L,title:t("History of {name}",{name:i.name}),load:async()=>{let{versions:a}=await de.skillHistory(i.name);return a.map((c,M)=>({id:c.id,text:c.text,previous:a[M+1]?.text??"",by:c.by,at:c.at}))},onUse:(a)=>{b(a),k(!1),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p,
|
|
1
|
+
import{p,Yr,T,v,s,r,t,g,e,n,o,y,l,f,x,m,k,P,jt,At}from"./chunk-index-s356ybxk.js";import{D}from"./chunk-index-6cs1wvhy.js";import{un}from"./chunk-index-eez0kbk4.js";import{de}from"./chunk-index-gmbk3sra.js";import{Se}from"./chunk-index-b5patef1.js";import{H}from"./chunk-index-9ehqccfe.js";import"./chunk-index-e8535c4h.js";function F({source:a}){return e("div",{className:"prose document",children:e(jt,{remarkPlugins:[At],components:{a:({href:i,children:d})=>i&&/^https?:\/\//.test(i)?e("a",{href:i,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:i})=>e("span",{children:i}),pre:({children:i})=>e("div",{className:"code-block",children:e("pre",{children:i})}),table:({children:i})=>e("div",{className:"table-wrap",children:e("table",{children:i})})},children:a})})}function B(a){let{data:i,error:d,reload:c}=un(()=>de.skillGroups()),[w,u]=r(),[N,E]=r(),h=()=>{c(),a.onChanged()};return n("section",{className:"stack","aria-label":t("Skill groups"),children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skill groups")}),n("button",{type:"button",className:"secondary",onClick:()=>u({group:void 0}),children:[e(o,{name:"plus",size:16}),t("New group")]})]}),e("p",{className:"hint",children:t("A group lists skills to switch on for a knight in one step, from the knight's sheet. Knights carry the skills, not the group.")}),d?e(m,{message:d}):null,!i&&!d?e(x,{}):null,i?.groups.length===0?e(k,{children:t("No skill groups.")}):null,i?.groups.map((b)=>n("article",{className:"card skill-group",children:[n("div",{className:"card-head",children:[e("strong",{children:b.name}),e("button",{type:"button",className:"secondary",onClick:()=>u({group:b}),children:t("Edit")}),e("button",{type:"button",className:"secondary",onClick:()=>E(b),children:t("Delete")})]}),e("p",{children:b.description}),n("p",{className:"hint",children:[t("Skills"),": ",b.skills.join(", ")||t("None")]})]},b.name)),e(H,{open:w!==void 0,title:w?.group?t("Edit {name}",{name:w.group.name}):t("New skill group"),onClose:()=>u(void 0),children:w?e(A,{group:w.group,catalog:a.catalog,onCancel:()=>u(void 0),onDone:()=>{u(void 0),h()}},w.group?.name??""):null}),e(D,{open:N!==void 0,title:t("Delete this skill group?"),confirmLabel:t("Delete group"),tone:"danger",onClose:()=>E(void 0),onConfirm:async()=>{if(!N)return;await de.deleteSkillGroup(N.name),f(t("Deleted {name}.",{name:N.name})),h()},children:e("p",{children:t("{name} will be deleted. Its skills stay, and so does every knight that carries them.",{name:N?.name??""})})})]})}function A(a){let[i,d]=r(a.group?.name??""),[c,w]=r(a.group?.description??""),[u,N]=r(a.group?.skills??[]),[E,h]=r(),[b,V]=r(!1);return n("form",{className:"stack",onSubmit:async(C)=>{C.preventDefault(),V(!0),h(void 0);try{let G=a.group?.name;await de.saveSkillGroup(i.trim(),{description:c,skills:[...a.catalog.map((L)=>L.name).filter((L)=>u.includes(L)),...u.filter((L)=>!a.catalog.some((z)=>z.name===L))],...G?{from:G}:{}}),f(t("Saved {name}.",{name:i.trim()})),a.onDone()}catch(G){h(l(G))}finally{V(!1)}},autoComplete:"off",children:[n("label",{children:[t("Name"),e("input",{value:i,maxLength:64,placeholder:"coding",required:!0,onChange:(C)=>d(C.target.value)}),e("span",{className:"meta",children:t("Lowercase letters, digits and single hyphens, up to 64.")})]}),n("label",{children:[t("Description"),e("textarea",{value:c,maxLength:1000,rows:2,required:!0,onChange:(C)=>w(C.target.value)})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Skills")}),e("ul",{className:"menu",children:a.catalog.map((C)=>{let G=u.includes(C.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:G,onChange:()=>N(G?u.filter((L)=>L!==C.name):[...u,C.name])}),n("span",{className:"menu-text",children:[e("strong",{children:C.name}),C.description?e("span",{className:"meta",children:C.description}):null]})]})},C.name)})})]}),E?e(m,{message:E}):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,children:t("Save group")})]})]})}var I=v(()=>(p("pryntvpr"),import("./chunk-skill-editor-pryntvpr.js")).then((a)=>({default:a.SkillEditor})));function ye(){let[a,i]=r(0),{data:d,error:c}=Se(()=>y.skills(),`skills:${a}`),[w,u]=r(),[N,E]=r(),[h,b]=r();s(()=>{y.session().then(u,()=>{return})},[]);let V=w?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),V?n("button",{type:"button",className:"secondary",onClick:()=>E({name:void 0}),children:[e(o,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:V?t("Registered skills and their carriers. A skill a knight wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask a knight on Discord to edit their contents.")}),c?e(m,{message:c}):null,!d&&!c?e(x,{}):null,d?.length===0?e(k,{children:t("No skills.")}):null,d?.map((S)=>e(R,{skill:S,onEdit:V&&S.source.kind==="written"?()=>E({name:S.name}):void 0,onDelete:V&&S.source.kind==="written"?()=>b(S):void 0},`${S.name}:${a}`)),V?e(B,{catalog:d??[],onChanged:()=>i((S)=>S+1)}):null,N?e(T,{fallback:null,children:e(I,{name:N.name,onSaved:()=>i((S)=>S+1),onClose:()=>E(void 0)},N.name??"")}):null,e(D,{open:h!==void 0,title:t("Delete this skill?"),confirmLabel:t("Delete skill"),tone:"danger",onClose:()=>b(void 0),onConfirm:async()=>{if(!h)return;await de.deleteSkillDocument(h.name),i((S)=>S+1),f(t("Deleted {name}.",{name:h.name}))},children:h?e(M,{skill:h}):null})]})}function M({skill:a}){return n(g,{children:[e("p",{children:a.carriers.length?t("{name} will be deleted and taken from the knights that carry it: {carriers}.",{name:a.name,carriers:a.carriers.join(", ")}):t("{name} will be deleted. No knight carries it.",{name:a.name})}),a.groups.length?e("p",{children:t("It also leaves the skill groups {groups}.",{groups:a.groups.join(", ")})}):null,e("p",{children:t("This cannot be undone.")})]})}function O(a){switch(a.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:a.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${a.repo}:${a.path}`});default:return}}function R({skill:a,onEdit:i,onDelete:d}){let[c,w]=r(!1),[u,N]=r(),[E,h]=r(),b=a.source.kind==="builtin"?t("Built-in"):a.source.kind==="written"?t("Knight-written"):a.source.kind==="package"?a.source.package:`${a.source.repo}:${a.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(P,{children:b}),a.missing?e(P,{tone:"warn",children:t("File missing")}):n(g,{children:[i?e("button",{type:"button",className:"secondary",onClick:i,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(w(!0),!u)h(void 0),y.skill(a.name).then(N).catch((V)=>h(l(V)))},children:"SKILL.md"})]}),d?e("button",{type:"button",className:"secondary",onClick:d,children:t("Delete")}):null]}),e("p",{children:a.missing??a.description}),a.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(o,{name:"lock",size:14}),e("span",{children:O(a.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",a.source.kind==="builtin"?t("All knights"):a.carriers.join(", ")||t("None")]}),a.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",a.groups.join(", ")]}):null,e(H,{open:c,title:a.name,size:"wide",onClose:()=>w(!1),children:E?e(m,{message:E}):!u?e(x,{}):e(K,{title:a.name,detail:u})})]})}function K({title:a,detail:i}){let d=i.metadata.filter((c)=>!(c.key==="name"&&c.value===a));return n("div",{className:"skill-document",children:[d.length?e("dl",{className:"skill-meta",children:d.map((c)=>n(Yr,{children:[e("dt",{children:c.key}),e("dd",{children:c.value})]},c.key))}):null,e(F,{source:i.body})]})}export{ye as SkillsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t,g,e,n,
|
|
1
|
+
import{t,g,e,n,o,u}from"./chunk-index-s356ybxk.js";import{sa}from"./chunk-index-2s48qyrs.js";import{Y}from"./chunk-index-d941ae7c.js";var l=`
|
|
2
2
|
.line.start-over {
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
margin-top: var(--space-4);
|
|
@@ -13,4 +13,4 @@ import{t,g,e,n,s,d}from"./chunk-index-24cggw6k.js";import{Hs}from"./chunk-index-
|
|
|
13
13
|
margin-top: var(--space-6);
|
|
14
14
|
font-size: var(--text-sm);
|
|
15
15
|
}
|
|
16
|
-
`;function p(a){Y("start-over",l);let{message:
|
|
16
|
+
`;function p(a){Y("start-over",l);let{message:r}=a,i=u((m)=>{let s=m.rooms[r.room];return s?.messages.at(-1)?.id===r.id&&s.pending.length===0&&s.live.length===0});return n(g,{children:[n("li",{className:"line start-over","data-enter":a.enter||void 0,children:[e(o,{name:"reset",size:14}),e("span",{children:t("Conversation started over")}),e("button",{type:"button",className:"link-button",onClick:()=>sa(r.room,r.id),children:t("View the archived conversation")})]}),i?e("li",{className:"line start-over-empty",children:e("span",{children:t("No messages yet. Say hello.")})}):null]})}export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R,a,r,t,B,g,e,n,o,S,X,Qe,Le,u,st,Jt,_n,et,Ae,zt,qe,en}from"./chunk-index-s356ybxk.js";import{me}from"./chunk-index-qq86fxda.js";import{_i}from"./chunk-index-p98tt12y.js";import"./chunk-index-50w6yq2d.js";import{mn,ir}from"./chunk-index-y1xv3dxs.js";import{wi}from"./chunk-index-dpgn7kzp.js";import{ki}from"./chunk-index-0qzqzp6t.js";import{Yt}from"./chunk-index-ddssgba9.js";import{ba}from"./chunk-index-6ycrvwzs.js";mn();var L=(s)=>s==="pinned"||s==="rest"?Ae(s):s==="waiting"||s==="home"?void 0:s;function K(){let s=u((f)=>JSON.stringify(ba(f,(l)=>Le(f,l),(l)=>Qe(f,l)>0,!0).map((l)=>({id:l.id,...l.title===void 0?{}:{title:l.title},entries:l.keys.map((w)=>({key:w,name:f.rooms[w]?.view?.displayName??w,waiting:Qe(f,w)>0}))})))),d=_i(),p=a(s);if(!d)p.current=s;let h=p.current;return R(()=>JSON.parse(h),[h])}function C(s){let{key:d,name:p}=s.entry,h=u((c)=>c.rooms[d]),f=u((c)=>Qe(c,d)),l=h?.view,w=et(l?.character),b=Yt(()=>Jt(d,s.onLeave),s.liftable&&!l?.home?wi(d):void 0);if(!l)return null;return e("li",{...s.liftable&&!l.home?{"data-drop-item":"","data-key":d}:{},children:n("a",{className:"switcher-row",...b,href:S("room",d),"aria-current":d===s.current?"page":void 0,style:w,onClick:(c)=>{if(c.button!==0||c.metaKey||c.ctrlKey||c.shiftKey||c.altKey)return;c.preventDefault(),s.onPick(d)},children:[n("span",{className:"switcher-picture",children:[e(qe,{view:l,size:40}),f?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:p}),h?.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(en,{room:d}),f?e("span",{className:"badge badge-warn",children:B(f,"{count} card waiting","{count} cards waiting")}):null,l.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(o,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,h?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(o,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,h?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(o,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function _(s){let[d,p]=r(""),h=K(),f=zt(),l=me((i)=>i.unread),w=h.map((i)=>({...i,entries:i.entries.filter((m)=>ki(d,m.name)!==void 0)})).filter((i)=>i.entries.length>0||d===""),b=w.filter((i)=>i.entries.length>0).length>1,c=w.map((i)=>{let m=L(i.id),y=b&&d===""&&m!==void 0&&i.entries.length>0&&f.has(m);return{...i,fold:m,folded:y,total:i.entries.length,entries:y?i.entries.filter((N)=>N.key===s.current||N.waiting||(l[N.key]??0)>0):i.entries}}),k=(i)=>s.close(i===s.current?void 0:()=>X("room",i)),z=h.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),v=(i)=>i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?z:i.title??t("Rooms");return n(g,{children:[n("div",{className:"switcher-search",children:[e(o,{name:"search",size:16}),e("input",{type:"search",value:d,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>p(i.target.value),onKeyDown:(i)=>{let m=c.flatMap((y)=>y.entries)[0];if(i.key==="Enter"&&m&&!st(i.nativeEvent))k(m.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>_n(i.currentTarget,s.close),children:e(o,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:c.map((i)=>{let m=i.id==="waiting",y=i.id==="pinned"?"pinned":i.id==="rest"?"rest":m||i.id==="home"?void 0:"folder";return n("section",{"aria-label":m?t("Waiting for you"):v(i),...i.total===0?{"data-empty":""}:{},...y?{"data-drop-zone":y,"data-zone-id":i.id,...y==="folder"?{"data-folder":i.id}:{}}:{},children:[m?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):b||i.total===0?e("h2",{className:"switcher-heading",children:i.fold&&i.total>0?e(ir,{id:i.fold,name:v(i),open:!i.folded,controls:`switcher-body-${i.id}`,count:i.folded?i.total:void 0}):v(i)}):null,e("ul",{className:"switcher-list",id:`switcher-body-${i.id}`,children:i.entries.map((N)=>e(C,{entry:N,current:s.current,onPick:k,onLeave:s.close,liftable:!m&&i.id!=="home"},N.key))})]},i.id)})})]})}export{_ as SwitcherList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O,
|
|
1
|
+
import{O,Rs,Jn}from"./chunk-index-s356ybxk.js";import{Eo,Ao}from"./chunk-index-qq86fxda.js";import{Ji,rs}from"./chunk-index-6nja2vd8.js";import"./chunk-index-edjyj761.js";var c=64;async function m(s){let a=new Image;a.src=s,await a.decode();let r=document.createElement("canvas");r.width=r.height=c;let t=r.getContext("2d");if(!t)throw Error("the page has no 2d canvas");t.drawImage(a,0,0,c,c);let i=c*0.175,o=c-i-2,e=i+2;return t.fillStyle="#ffffff",t.beginPath(),t.arc(o,e,i+2.5,0,Math.PI*2),t.fill(),t.fillStyle="#ef4444",t.beginPath(),t.arc(o,e,i,0,Math.PI*2),t.fill(),r.toDataURL("image/png")}var u=()=>[...document.head.querySelectorAll('link[rel~="icon"]')];function g(s){let a=new Map,r=!1,t=0,i=(e)=>{if(e.dataset.plainHref===void 0)return;if(e.setAttribute("href",e.dataset.plainHref),e.dataset.plainType)e.type=e.dataset.plainType;else e.removeAttribute("type");if(e.dataset.plainSizes)e.setAttribute("sizes",e.dataset.plainSizes);else e.removeAttribute("sizes");delete e.dataset.plainHref,delete e.dataset.plainType,delete e.dataset.plainSizes},o=async()=>{let e=++t,p=s.count()>0;if(p===r)return;if(!p){for(let n of u())i(n);r=!1;return}let l=u(),d=(l.find((n)=>n.dataset.plainHref===void 0&&n.type==="image/png")??l[0])?.href;if(!d)return;let f=a.get(d);if(!f)f=s.render(d),a.set(d,f);let b=await f.catch((n)=>{a.delete(d),console.warn("the tab icon's dot failed to draw",n);return});if(!b||e!==t)return;for(let n of u()){if(n.dataset.plainHref===void 0)n.dataset.plainHref=n.getAttribute("href")??"",n.dataset.plainType=n.type,n.dataset.plainSizes=n.getAttribute("sizes")??"";n.href=b,n.type="image/png",n.removeAttribute("sizes")}r=!0};s.subscribe(()=>void o()),o()}function T(){let s=()=>Ji().badge+Ao(),a=()=>Rs(s());g({count:()=>Jn(O.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};O.subscribe(t),rs(t),Eo(t)},render:m}),a()}export{T as startPageTabDot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Te,s,r,t,e,n,o,X,u,ot}from"./chunk-index-s356ybxk.js";import{Hi,In,gi,is,Oi,yi,Dn,ji,Ki,zr}from"./chunk-index-qdtmetsy.js";import"./chunk-index-tasbd41t.js";import"./chunk-index-5fyqxh0r.js";import"./chunk-index-qq86fxda.js";import"./chunk-index-nncy9wxw.js";import"./chunk-index-e8535c4h.js";import{Us,Di,Vs}from"./chunk-index-g0sdxjxr.js";Hi();function v(){return is((Te(ot)?.kinds??[]).map((a)=>a.kind)),null}function N({focus:a}){let[l,b]=r(),m=Oi(void 0),i=In(),p=i.loaded&&m.length===0;return s(()=>{if(a&&i.loaded)X("table",void 0,{replace:!0})},[a,i.loaded]),n("div",{className:"table-page",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[l?.kind==="webgl"?e("button",{type:"button",className:"icon-button","aria-label":t("Reset view"),title:t("Reset view"),onClick:()=>l.focus(null),children:e(o,{name:"reset"})}):null,e("button",{type:"button",className:"secondary",onClick:()=>X("rooms"),children:t("All rooms")})]})]}),n("div",{className:"table-frame",children:[p?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(Dn,{onHandle:b,onSeat:(d)=>{let c=m.find((f)=>f.name===d);if(c)X("room",c.key)},onFocus:(d)=>{let c=m.find((f)=>f.name===d);if(c)X("room",c.key)}}),e(v,{})]})]})}function C({named:a}){let l=Di(),b=Us(),m=u((y)=>y.listed),i=Vs(l,b,a),p=yi(),{ask:d,sheet:c}=Ki(i),f=a===void 0||l.some(k(a));s(()=>{if(a!==void 0&&m&&!f)X("table",void 0,{replace:!0})},[a,m,f]);let h=e("div",{className:"room-title",children:e("h1",{children:t("Round table")})}),g=n("div",{className:"table-empty-state",children:[e("strong",{children:i?t("The council is empty"):t("No council yet")}),e("p",{className:"meta",children:i?t("Every member of this council is gone. Edit who sits."):t("A council is a group of up to {max} knights who answer in turn.",{max:8})}),p.length>0?e("button",{type:"button",onClick:d,children:i?t("Edit this council"):t("Pick who sits")}):null]});if(i)return n("section",{className:"room council-page",children:[e(zr,{roomKey:i.key,lead:h,empty:g}),c]});return n("div",{className:"table-page",children:[n("header",{className:"page-head",children:[h,p.length>0?e("div",{className:"table-tools",children:e(ji,{council:void 0,onOpen:d})}):null]}),e("div",{className:"table-frame",children:g}),c]})}var k=(a)=>(l)=>l.key===a||l.name===a;function F({focus:a}){return gi()?e(N,{focus:a}):e(C,{named:a})}export{F as TablePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{qn,Ir,Dr,Rt,hn,pn,Si,hs}from"./chunk-index-mzw7nmkc.js";import"./chunk-index-nncy9wxw.js";import{Et,Wt}from"./chunk-index-0xdptr30.js";var ye="http://www.w3.org/2000/svg",t=(d,s={},y)=>{let k=document.createElementNS(ye,d);for(let[S,G]of Object.entries(s))k.setAttribute(S,String(G));return y?.appendChild(k),k},ne=(d)=>{let s=/<svg[^>]*\swidth=/.test(d)?d:d.replace("<svg",'<svg width="256" height="256"');return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(s)}`},xe=0;function we(d,s){let y=s||d<=6?1:2;return{rows:y,perRow:Math.max(1,Math.ceil(d/y))}}function Ee(d,s){let y=`t2d${++xe}`,k=window.matchMedia("(prefers-reduced-motion: reduce)"),S=s.reducedMotion==="auto"||s.reducedMotion===void 0?k.matches:s.reducedMotion,G=s.labels??Wt,{theme:z,scheme:q}=s,v=[],B=new Map,A=new Map,R=new Map,N=new Map,C=s.focus??null,E=document.createElement("div");E.className="t2d";let m=t("svg",{role:"group","aria-label":G.table});if(E.appendChild(m),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(E);function ie(e,r,a){let o=Math.max(1.6,a*0.022),u=o+Math.max(1.2,a*0.014),l=t("filter",{id:`${y}-rim`,x:"-15%",y:"-15%",width:"130%",height:"130%"},e);t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:u,result:"far"},l),t("feFlood",{"flood-color":r.ink,result:"ink"},l),t("feComposite",{in:"ink",in2:"far",operator:"in",result:"line"},l),t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:o,result:"near"},l),t("feFlood",{"flood-color":r.paper,result:"paper"},l),t("feComposite",{in:"paper",in2:"near",operator:"in",result:"rim"},l);let c=t("feMerge",{},l);for(let b of["line","rim","SourceGraphic"])t("feMergeNode",{in:b},c)}function x(){let e=qn(z,q);E.classList.toggle("reduced",S),E.classList.toggle("focus",C!==null),E.classList.toggle("dim",v.some((i)=>R.get(i.id)==="speaking"));let r=s.variant==="compact",a=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,r?60:200);m.setAttribute("viewBox",`0 0 ${a} ${o}`),m.replaceChildren();let u=Math.max(v.length,1),{rows:l,perRow:c}=we(u,r);t("rect",{width:a,height:o,fill:e.css.bg},m);let b=t("defs",{},m),T=a/2,O=r?o*0.82:o*0.62;if(t("ellipse",{cx:T,cy:O,rx:a*0.47,ry:r?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},m),!r)t("ellipse",{cx:T,cy:O,rx:a*0.3,ry:o*0.2,fill:"none",stroke:e.css.ring,"stroke-width":3,opacity:e.night?0.9:0.7},m);let I=a/c,V=r?o*0.95:o/(l+0.6),se=r?(o*0.92-6)/1.54:132,g=Math.max(46,Math.min(I*0.94,132,V*1.05,se)),h=g*0.72,n=g*1.05;ie(b,e,n),v.forEach((i,w)=>{let M=t("radialGradient",{id:`${y}-h${w}`},b);t("stop",{offset:0,"stop-color":i.color,"stop-opacity":0.95},M),t("stop",{offset:1,"stop-color":i.color,"stop-opacity":0},M)});let ae=(i)=>{if(r)return o*0.92;return l===1?o*0.62:o*(0.46+i*0.3)};if(v.forEach((i,w)=>{let M=Math.floor(w/c),le=Math.min(c,u-M*c),ce=w-M*c,de=a/le*(ce+0.5),fe=ae(M),F=R.get(i.id)??"idle",f=t("g",{class:"seat","data-seat":i.id,"data-state":F,...C===i.id?{"data-focus":""}:{},transform:`translate(${de.toFixed(1)} ${fe.toFixed(1)})`,tabindex:s.listBelow?-1:0,role:"button","aria-label":G.seat(i.name,F),color:e.css.text,...s.listBelow?{"aria-hidden":"true"}:{}},m);t("ellipse",{cx:0,cy:3,rx:g*0.55,ry:g*0.1,fill:"#000",opacity:0.35},f),t("ellipse",{class:"halo",cx:0,cy:-h-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${y}-h${w})`},f),t("polygon",{class:"beam",points:`${-n*0.12},${-n*2.1} ${n*0.12},${-n*2.1} ${n*0.5},0 ${-n*0.5},0`,fill:i.color,opacity:0.2},f);let _=t("g",{class:"lift"},f),Z=B.get(i.id);if(Z){let p={x:-n/2,y:-h-n*0.78,width:n,height:n*0.88,filter:`url(#${y}-rim)`};t("image",{href:ne(Z),...p,...i.dim?{opacity:0.55}:{}},_);let oe=A.get(i.id);if(F==="speaking"&&oe&&!S){let he=t("image",{class:"talk",href:ne(oe),...p,opacity:0},_),{frames:ue,seconds:pe}=hs(w);t("animate",{attributeName:"opacity",values:ue.join(";"),dur:`${pe.toFixed(3)}s`,calcMode:"discrete",repeatCount:"indefinite"},he)}}else{t("circle",{cx:0,cy:-h-n*0.3,r:n*0.3,fill:i.color,stroke:e.ink,"stroke-width":2},_);let p=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":Rt},_);p.textContent=Array.from(i.name)[0]?.toUpperCase()??"?"}let J=h*0.22;t("path",{d:`M ${-g*0.5} ${-h} L ${g*0.5} ${-h} L ${g*0.42} 0 L ${-g*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},f),t("rect",{x:-g*0.54,y:-h-J*0.2,width:g*1.08,height:J,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},f);let L=Math.max(11,Math.min(15,g*0.14)),j=Math.min(Math.max(g*0.9,L*5.5+14),Math.max(g*0.9,i.name.length*L*0.62+18),I*0.98),me=L+8;t("rect",{class:"plate",x:-j/2,y:-h*0.78,width:j,height:me,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},f);let ge=t("text",{x:0,y:-h*0.78+L+1.5,"text-anchor":"middle","font-size":L,"font-weight":700,"font-family":Rt,fill:e.plateInk},f),Q=N.get(i.id);ge.textContent=Dr(Q?`${Q} ${i.name}`:i.name,(j-8)/L);let ee=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-h-n*0.78})`},f)),D=F==="done",P=F==="error",U=e.gold;if(D)U=Ir.done;else if(P)U=Ir.error;t("circle",{r:n*0.15,fill:U,stroke:e.ink,"stroke-width":2},ee);let W=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":Rt,fill:D||P?"#fff":e.ink},ee);if(W.textContent="!",D)W.textContent="✓";else if(P)W.textContent="✕";let te=t("g",{class:"orbit"},f);t("circle",{cx:n*0.4,cy:-h-n*0.5,r:n*0.05,fill:i.color},te),t("circle",{cx:-n*0.4,cy:-h-n*0.5,r:n*0.035,fill:i.color,opacity:0.6},te),f.addEventListener("click",(p)=>s.onSeatClick({id:i.id,name:i.name,at:Et(p,f)})),f.addEventListener("keydown",(p)=>{if(p.key==="Enter"||p.key===" ")p.preventDefault(),s.onSeatClick({id:i.id,name:i.name,at:Et({clientX:0,clientY:0,detail:0},f)})})}),!r){let i=Math.min(a*0.34,190),w=o-6;t("rect",{x:T-i/2,y:w-22,width:i,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},m);let M=t("text",{x:T,y:w-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":Rt,fill:e.gold},m);M.textContent=Dr(s.ownerName??"You",12)}}let H=new Set,re=(e,r)=>{if(e.mode==="cut")return;let a=qn(z,q),o=(u,l)=>{let c=setTimeout(()=>{H.delete(c),u()},l);H.add(c)};for(let u of e.joining){let l=[...m.querySelectorAll("g.seat[data-seat]")].find((c)=>c.getAttribute("data-seat")===u);if(!l)continue;l.classList.add("seat-in"),l.prepend(t("ellipse",{class:"seat-ring",rx:44,ry:12,cy:4,stroke:a.css.ring})),o(()=>{l.classList.remove("seat-in"),l.querySelector(".seat-ring")?.remove()},pn)}for(let u of e.leaving){let l=r.get(u);if(!l)continue;let c=l.cloneNode(!0);c.classList.add("seat-out");for(let b of["data-seat","tabindex","role","aria-label"])c.removeAttribute(b);c.setAttribute("aria-hidden","true");for(let[b,[T,O,I]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let V=t("circle",{class:"puff",cx:T,cy:O,r:I,fill:a.paper,stroke:a.ink,"stroke-width":3},c);V.style.animationDelay=`${b*40}ms`}m.appendChild(c),o(()=>c.remove(),hn)}},Y=new ResizeObserver(x);Y.observe(d);let X=()=>{if(s.reducedMotion==="auto"||s.reducedMotion===void 0)K.setReducedMotion(k.matches)};k.addEventListener("change",X);let K={kind:"svg",setTheme(e,r){z=e,q=r,x()},setSeats(e){let r=v.map((o)=>o.id),a=new Map([...m.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));v=e;for(let o of e){if(R.set(o.id,o.state??"idle"),o.avatarSvg)B.set(o.id,o.avatarSvg);if(o.talkSvg)A.set(o.id,o.talkSvg);else A.delete(o.id)}if(x(),r.length>0||a.size>0)re(Si(r,e.map((o)=>o.id),S),a)},setState(e,r){if(R.get(e)===r)return;R.set(e,r),x()},setMark(e,r){if((N.get(e)??null)===r)return;if(r===null)N.delete(e);else N.set(e,r);x()},setAvatar(e,r,a){if(B.set(e,r),a)A.set(e,a);else A.delete(e);return x(),Promise.resolve()},setReducedMotion(e){S=e,x()},resetCamera(){C=null,x(),s.onFocus?.(null)},focus(e){if(e===C)return;C=e,x()},focused:()=>C,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:S,loop:"idle",seats:v.length,renders:0}},dispose(){for(let e of H)clearTimeout(e);H.clear(),Y.disconnect(),k.removeEventListener("change",X),E.remove()}};return K.setSeats(s.seats),K}export{Ee as createTable2D};
|