pi-roundtable-web 0.28.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +4 -4
- package/dist/chunk-account-66e6ezdq.js +1 -0
- package/dist/{chunk-action-menu-qpp9bdxh.js → chunk-action-menu-ap5xn7bf.js} +1 -1
- package/dist/chunk-agent-sapt5qhn.js +1 -0
- package/dist/chunk-arranged-rooms-n6bk696f.js +1 -0
- package/dist/chunk-attachments-p5v9gqyt.js +102 -0
- package/dist/chunk-bulk-actions-aze4ewc4.js +1 -0
- package/dist/chunk-character-creator-m7tw20ef.js +225 -0
- package/dist/{chunk-codeeditor-jgj32247.js → chunk-codeeditor-yy6pq8mv.js} +2 -2
- package/dist/chunk-confirm-0cajsfhk.js +1 -0
- package/dist/chunk-connectors-tw0tbm21.js +37 -0
- package/dist/chunk-conversations-wkm23m5r.js +1 -0
- package/dist/chunk-council-sheet-mz7s23nq.js +2 -0
- package/dist/chunk-council-view-zgvzxtgn.js +1 -0
- package/dist/{chunk-drag-04qfef58.js → chunk-drag-d1bpy8w6.js} +1 -1
- package/dist/{chunk-entry-mws704mc.js → chunk-entry-7zr5b1fp.js} +1 -1
- package/dist/chunk-folder-list-bs4eh3g9.js +1 -0
- package/dist/chunk-folds-eez1q41c.js +1 -0
- package/dist/{chunk-gate-vxetvn8t.js → chunk-gate-dt91egcd.js} +1 -1
- package/dist/chunk-host-icons-nfe2t8tk.js +1 -0
- package/dist/chunk-host-picture-4rtswxwa.js +1 -0
- package/dist/chunk-host-state-1vxzmmq6.js +1 -0
- package/dist/chunk-host-ui-x38bf0et.js +1 -0
- package/dist/{chunk-index-zj0gjcvr.js → chunk-index-0h99xcs3.js} +2 -2
- package/dist/{chunk-index-e2gy763y.js → chunk-index-1kb8tv4v.js} +2 -2
- package/dist/chunk-index-24cggw6k.js +50 -0
- package/dist/chunk-index-2g8xtwqg.js +2 -0
- package/dist/chunk-index-3n38xe7m.js +2 -0
- package/dist/{chunk-index-n0cmnwd2.js → chunk-index-3tksdmx7.js} +2 -2
- package/dist/{chunk-index-2822z600.js → chunk-index-4a1tdadd.js} +3 -3
- package/dist/{chunk-index-2syyyjnq.js → chunk-index-53fwc7sc.js} +2 -2
- package/dist/chunk-index-55ps4x5n.js +2 -0
- package/dist/{chunk-index-q5fyrtx4.js → chunk-index-5j1v2q7w.js} +1 -1
- package/dist/chunk-index-5w6tb7p0.js +2 -0
- package/dist/chunk-index-6btdp13p.js +2 -0
- package/dist/chunk-index-6m7dwsmv.js +1 -0
- package/dist/{chunk-index-20xgx0k2.js → chunk-index-6rdywten.js} +2 -2
- package/dist/{chunk-index-3gfbhmpb.js → chunk-index-6s2pqwna.js} +2 -2
- package/dist/{chunk-index-fepsbhr6.js → chunk-index-7mrkq793.js} +2 -2
- package/dist/chunk-index-7xcbpeqz.js +2 -0
- package/dist/chunk-index-88wh5eyj.js +2 -0
- package/dist/{chunk-index-6cg8xp1c.js → chunk-index-8pbwr3rs.js} +1 -1
- package/dist/{chunk-index-jc3r4qam.js → chunk-index-8wpvj7k5.js} +2 -2
- package/dist/chunk-index-97dcp1vh.js +1 -0
- package/dist/chunk-index-a7e6rhxy.js +2 -0
- package/dist/{chunk-index-2tr41qht.js → chunk-index-bxf8eq1s.js} +2 -2
- package/dist/chunk-index-c8gm1crh.js +120 -0
- package/dist/{chunk-index-2y8r4s4f.js → chunk-index-ce7hsda9.js} +2 -2
- package/dist/chunk-index-cfesmk1f.js +2 -0
- package/dist/{chunk-index-m81362sc.js → chunk-index-cmzvq3nf.js} +1 -1
- package/dist/{chunk-index-7qd604rq.js → chunk-index-d4mx2vvf.js} +1 -1
- package/dist/chunk-index-d74tpnkd.js +2 -0
- package/dist/chunk-index-d941ae7c.js +2 -0
- package/dist/{chunk-index-e35v554x.js → chunk-index-dr0jr7d3.js} +3 -3
- package/dist/chunk-index-en728705.js +2 -0
- package/dist/chunk-index-fb3kzyyp.js +2 -0
- package/dist/{chunk-index-3yy10a5h.js → chunk-index-ffnd0jcj.js} +2 -2
- package/dist/chunk-index-fn6305vn.js +3 -0
- package/dist/{chunk-index-zcfr8jdv.js → chunk-index-gdh7wsd5.js} +12 -12
- package/dist/{chunk-index-2hvn2kte.js → chunk-index-m76gdwnk.js} +2 -2
- package/dist/chunk-index-mr391t49.js +2 -0
- package/dist/chunk-index-n3khm9fq.js +2 -0
- package/dist/{chunk-index-sm7kfb07.js → chunk-index-nn4w6a04.js} +2 -2
- package/dist/{chunk-index-gwkhs8s3.js → chunk-index-nr275sa7.js} +2 -2
- package/dist/{chunk-index-x60n1me6.js → chunk-index-pgxgq61x.js} +2 -2
- package/dist/chunk-index-prq011b6.js +2 -0
- package/dist/{chunk-index-v9gbt5tz.js → chunk-index-q4k9vk04.js} +19 -3
- package/dist/chunk-index-rgdaec7y.js +2 -0
- package/dist/chunk-index-rjs1can6.js +2 -0
- package/dist/chunk-index-s4a8e4qm.js +2 -0
- package/dist/{chunk-index-s9p27f9b.js → chunk-index-sz381vda.js} +3 -3
- package/dist/{chunk-index-5hbq6g2e.css → chunk-index-t7csmbpy.css} +1 -1
- package/dist/{chunk-index-rgf4rvns.js → chunk-index-v9jqyr1f.js} +3 -3
- package/dist/{chunk-index-rsd8rftk.js → chunk-index-vpq2cj14.js} +2 -2
- package/dist/chunk-index-vsaggfns.js +2 -0
- package/dist/{chunk-index-p7jkr7gv.js → chunk-index-w17wgjby.js} +5 -5
- package/dist/{chunk-index-c7dbvkrq.js → chunk-index-wgrx2ybn.js} +2 -2
- package/dist/chunk-index-wsv46y9p.js +2 -0
- package/dist/{chunk-index-4t6vnwap.js → chunk-index-xbj816p0.js} +2 -2
- package/dist/{chunk-index-s53bxwkk.js → chunk-index-yr758n6t.js} +2 -2
- package/dist/{chunk-index-5t2jkecy.js → chunk-index-ysv36nbk.js} +2 -2
- package/dist/{chunk-index-zt19fdmc.js → chunk-index-ze9p4npm.js} +2 -2
- package/dist/chunk-index-zfdvyrjt.js +2 -0
- package/dist/chunk-lang-css-3h22se37.js +1 -0
- package/dist/{chunk-lang-dockerfile-n4bt8jbt.js → chunk-lang-dockerfile-y24eejnh.js} +1 -1
- package/dist/{chunk-lang-go-9k4y107e.js → chunk-lang-go-qzgv1161.js} +3 -3
- package/dist/chunk-lang-html-9rvrmmpg.js +1 -0
- package/dist/chunk-lang-javascript-4kv8s3tk.js +1 -0
- package/dist/{chunk-lang-json-hr12bzs1.js → chunk-lang-json-99v80v88.js} +1 -1
- package/dist/{chunk-lang-markdown-ttzcpgkg.js → chunk-lang-markdown-gn8he877.js} +4 -4
- package/dist/{chunk-lang-python-ntj8maem.js → chunk-lang-python-prsw4p4k.js} +2 -2
- package/dist/{chunk-lang-rust-gv8y859d.js → chunk-lang-rust-g6xqta16.js} +1 -1
- package/dist/{chunk-lang-shell-5zzs09b7.js → chunk-lang-shell-dmpnzc6w.js} +1 -1
- package/dist/{chunk-lang-sql-6vmze4pg.js → chunk-lang-sql-wz7ca27b.js} +2 -2
- package/dist/{chunk-lang-toml-tt0d4rw9.js → chunk-lang-toml-160prtq4.js} +1 -1
- package/dist/chunk-lang-typescript-mp0yw903.js +1 -0
- package/dist/{chunk-lang-xml-r2sbqnjv.js → chunk-lang-xml-9htkz2dd.js} +1 -1
- package/dist/{chunk-lang-yaml-ex31qbph.js → chunk-lang-yaml-08749wd5.js} +1 -1
- package/dist/chunk-layout-actions-tdx896xf.js +1 -0
- package/dist/chunk-menu-items-trhybv1g.js +1 -0
- package/dist/chunk-mode-toggle-4dtfphq4.js +1 -0
- package/dist/{chunk-note-row-40ypghn9.js → chunk-note-row-28e5x7n8.js} +33 -4
- package/dist/chunk-notes-5nkayhw8.js +1 -0
- package/dist/chunk-notice-bell-xz8a04am.js +1 -0
- package/dist/{chunk-notices-tefx93s6.js → chunk-notices-d0cwvk27.js} +1 -1
- package/dist/chunk-onboarding-zs4rtea9.js +1 -0
- package/dist/{chunk-overview-zrx3bpwf.js → chunk-overview-9sb3ywa8.js} +1 -1
- package/dist/chunk-palette-5sfhrv4x.js +1 -0
- package/dist/chunk-placement-items-e2neja55.js +1 -0
- package/dist/{chunk-profile-tyb48b79.js → chunk-profile-jffhtpqf.js} +1 -1
- package/dist/chunk-prompt-history-1jz2gk3v.js +1 -0
- package/dist/chunk-prompts-0t30ttd0.js +1 -0
- package/dist/chunk-room-confirms-6595921h.js +1 -0
- package/dist/{chunk-room-menu-ha1evv71.js → chunk-room-menu-hwkjyxwe.js} +1 -1
- package/dist/chunk-rooms-menu-button-k0eq1tcr.js +1 -0
- package/dist/{chunk-schedules-a5pewkhd.js → chunk-schedules-e12y8fw2.js} +1 -1
- package/dist/{chunk-seat-menu-eh3ymmks.js → chunk-seat-menu-n2bcw0mf.js} +1 -1
- package/dist/chunk-sheet-hosts-myvm2vhd.js +29 -0
- package/dist/chunk-shortcut-help-434sqnxc.js +26 -0
- package/dist/chunk-shortcuts-mjxph0g7.js +1 -0
- package/dist/chunk-skill-editor-98492yrt.js +8 -0
- package/dist/chunk-skills-mfv8ppfh.js +1 -0
- package/dist/chunk-start-over-line-m526193z.js +16 -0
- package/dist/{chunk-switcher-list-dtfh87zy.js → chunk-switcher-list-5ngjar24.js} +1 -1
- package/dist/{chunk-tab-dot-qd640mjr.js → chunk-tab-dot-tzjkahj5.js} +1 -1
- package/dist/chunk-table-xbtbex2z.js +1 -0
- package/dist/{chunk-table2d-5nrhfwft.js → chunk-table2d-61bvrykm.js} +1 -1
- package/dist/{chunk-table3d-5cb66d99.js → chunk-table3d-5a7vbgyj.js} +172 -172
- package/dist/chunk-thread-actions-bf6vf2mt.js +1 -0
- package/dist/{chunk-thread-cards-kgt22sbp.js → chunk-thread-cards-n0n603vf.js} +1 -1
- package/dist/chunk-thread-list-7bkdn51x.js +227 -0
- package/dist/{chunk-transcript-a0p3vwh6.js → chunk-transcript-8ztrkt6g.js} +1 -1
- package/dist/chunk-waiting-chip-y83c90v3.js +32 -0
- package/dist/chunk-waiting-s273kcgz.js +1 -0
- package/dist/chunk-where-jr791gzj.js +1 -0
- package/dist/chunk-workspace-dw71mshw.js +586 -0
- package/dist/chunk-zh-tw-vm5d0w6j.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/api-types.ts +51 -0
- package/src/app/app.ts +7 -0
- package/src/app/card-log.ts +10 -2
- package/src/app/protocol.ts +18 -0
- package/src/app/queued-delivery.ts +107 -0
- package/src/app/queued-frames.ts +115 -0
- package/src/app/room-log.ts +39 -7
- package/src/app/rooms.ts +30 -2
- package/src/app/routes.ts +123 -7
- package/src/app/skill-group-routes.ts +126 -0
- package/src/app/socket.ts +12 -2
- package/src/app/surface.ts +37 -6
- package/src/app/zip.ts +124 -0
- package/src/auth/sessions.ts +9 -1
- package/src/authz.ts +1 -0
- package/src/host/cards.ts +10 -3
- package/src/host/stored-json.ts +23 -0
- package/src/i18n/zh-tw.ts +45 -2
- package/src/notices/mount.ts +1 -0
- package/src/notices/store.ts +9 -1
- package/src/push/channel.ts +1 -0
- package/src/web-plugin.ts +5 -1
- package/dist/chunk-account-678dgbww.js +0 -1
- package/dist/chunk-agent-x0yvvdq2.js +0 -1
- package/dist/chunk-arranged-rooms-6rdkk8t1.js +0 -1
- package/dist/chunk-bulk-actions-zbwdaxtc.js +0 -1
- package/dist/chunk-character-creator-215psy17.js +0 -1
- package/dist/chunk-confirm-2pzrt272.js +0 -1
- package/dist/chunk-connectors-zha2d834.js +0 -37
- package/dist/chunk-conversations-fb071rez.js +0 -1
- package/dist/chunk-council-sheet-k5fycefd.js +0 -2
- package/dist/chunk-folder-list-qxhmczwv.js +0 -1
- package/dist/chunk-folds-b7asegfs.js +0 -1
- package/dist/chunk-group-scene-63yhh1mh.js +0 -1
- package/dist/chunk-group-table-zy4hmgk3.js +0 -1
- package/dist/chunk-host-icons-tyktazzz.js +0 -1
- package/dist/chunk-host-picture-ebhejn2k.js +0 -1
- package/dist/chunk-host-state-wajep0yr.js +0 -1
- package/dist/chunk-host-ui-pc9r24e3.js +0 -1
- package/dist/chunk-index-1af8vsyb.js +0 -2
- package/dist/chunk-index-254701sm.js +0 -3
- package/dist/chunk-index-31m1b2f5.js +0 -2
- package/dist/chunk-index-5vatmakn.js +0 -2
- package/dist/chunk-index-6yra9kdq.js +0 -2
- package/dist/chunk-index-9bdstf8t.js +0 -2
- package/dist/chunk-index-acj4xxgq.js +0 -100
- package/dist/chunk-index-aexy023z.js +0 -2
- package/dist/chunk-index-amxa2bn3.js +0 -2
- package/dist/chunk-index-bef0fc2m.js +0 -2
- package/dist/chunk-index-c6tphrjr.js +0 -1
- package/dist/chunk-index-cn49mawx.js +0 -50
- package/dist/chunk-index-gcmmwh8t.js +0 -2
- package/dist/chunk-index-h2vhv4kh.js +0 -2
- package/dist/chunk-index-h9ccz1r3.js +0 -2
- package/dist/chunk-index-n0ejy0wd.js +0 -2
- package/dist/chunk-index-nkdg1dfz.js +0 -7
- package/dist/chunk-index-qxynr1hf.js +0 -2
- package/dist/chunk-index-r7fdgzy1.js +0 -2
- package/dist/chunk-index-sdcpf5dp.js +0 -2
- package/dist/chunk-index-sw9r4aa4.js +0 -2
- package/dist/chunk-index-t5bmsqqd.js +0 -1
- package/dist/chunk-index-v8mma5np.js +0 -2
- package/dist/chunk-index-vsfsv8hd.js +0 -2
- package/dist/chunk-index-wxft0aqb.js +0 -2
- package/dist/chunk-index-zvvwxkev.js +0 -2
- package/dist/chunk-lang-css-7q1dtpgm.js +0 -1
- package/dist/chunk-lang-html-xgvba8rn.js +0 -1
- package/dist/chunk-lang-javascript-vgxmgd0a.js +0 -1
- package/dist/chunk-lang-typescript-2v652sh5.js +0 -1
- package/dist/chunk-layout-actions-bfqtg71d.js +0 -1
- package/dist/chunk-menu-items-rztgekfj.js +0 -1
- package/dist/chunk-mode-toggle-m5kgb7c7.js +0 -1
- package/dist/chunk-notes-a8nqffbf.js +0 -1
- package/dist/chunk-notice-bell-rdnfmtf2.js +0 -1
- package/dist/chunk-onboarding-wvh0s3vg.js +0 -1
- package/dist/chunk-palette-5xtdvy9a.js +0 -1
- package/dist/chunk-placement-items-rgyrktvy.js +0 -1
- package/dist/chunk-prompt-history-wv0vdsjv.js +0 -1
- package/dist/chunk-prompts-75hgb0t0.js +0 -1
- package/dist/chunk-room-confirms-bcvhpcry.js +0 -1
- package/dist/chunk-rooms-menu-button-ej3a2hyc.js +0 -1
- package/dist/chunk-sheet-hosts-d5zbwbbr.js +0 -29
- package/dist/chunk-shortcut-help-bh9ntk9s.js +0 -26
- package/dist/chunk-shortcuts-6em0atk9.js +0 -1
- package/dist/chunk-skill-editor-e43mwz01.js +0 -8
- package/dist/chunk-skills-vp107wrp.js +0 -1
- package/dist/chunk-start-over-line-xd1v2p0g.js +0 -16
- package/dist/chunk-table-svb2xhfd.js +0 -1
- package/dist/chunk-thread-actions-926eab0w.js +0 -1
- package/dist/chunk-thread-list-j2v1pqkz.js +0 -217
- package/dist/chunk-waiting-cdyz7r1g.js +0 -1
- package/dist/chunk-waiting-chip-58ttx9av.js +0 -28
- package/dist/chunk-where-9jp6g029.js +0 -1
- package/dist/chunk-workspace-d34njy4p.js +0 -578
- package/dist/chunk-zh-tw-y3jb20wc.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,T,x,E,o,L,r,t,u,g,e,n,s,fe,l,f,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{R}from"./chunk-index-cmzvq3nf.js";var M={"Shared prompt":u("Shared prompt"),"Guest prompt":u("Guest prompt"),"The base every knight's prompt starts with, the main knight's included.":u("The base every knight's prompt starts with, the main knight's included."),"Used instead of the shared prompt when the person speaking is not the owner.":u("Used instead of the shared prompt when the person speaking is not the owner.")},N=(c)=>t(M[c]??c);var O=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((c)=>({default:c.HistorySheet}))),Z=x(()=>(p("0cajsfhk"),import("./chunk-confirm-0cajsfhk.js")).then((c)=>({default:c.Confirm})));function pe(){let{timeZone:c}=_(),[S,i]=r(),[h,w]=r(),[b,C]=r(),P=E(()=>{de.prompts().then((d)=>i(d.documents),(d)=>w(l(d)))},[]);return o(P,[P]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Main prompts")})}),e("p",{className:"hint",children:t("The texts the main knight and the other knights start from. A text you save here replaces the one from the file from the next turn on, until you go back to the file's.")}),h?e(m,{message:h}):null,!S&&!h?e(v,{}):null,S?.length===0?e(k,{children:t("No prompts to edit.")}):null,S?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:N(d.label)}),d.differs?e(Q,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(Q,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:N(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:oe(d.override.at,c)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>C(d.id),children:t("Edit")})})]},d.id)),b?e(q,{id:b,onClose:()=>{C(void 0),P()}}):null]})}function q({id:c,onClose:S}){let[i,h]=r(),[w,b]=r(""),[C,P]=r(),[d,B]=r(!1),[H,V]=r(!1),[F,D]=r(!1),[z,A]=r(!1),I=L();o(()=>{let a=!0;return de.prompt(c).then((y)=>{if(!a)return;h(y),b(y.text)},(y)=>a&&P(l(y))),()=>{a=!1}},[c]);let U=async()=>{if(!i)return;V(!0);try{let a=await de.savePrompt(c,{text:w,base:i.text});h(a),b(a.text),B(!1),f(t("Saved."))}catch(a){if(a instanceof fe&&a.status===409){let{current:y}=a.body;h(y),f(a.message,"danger")}else f(l(a),"danger")}finally{V(!1)}},G=i!==void 0&&w!==i.text;return n(R,{open:!0,title:i?N(i.label):t("Main prompts"),size:"full",onClose:S,children:[C?e(m,{message:C}):null,!i&&!C?e(v,{}):null,i?.broken?e(m,{message:t("The file version of this prompt cannot be read, so it cannot be changed here until it can: {reason}",{reason:i.broken})}):null,i&&!i.broken?n("div",{className:"stack",children:[i.differs?e("p",{className:"hint",children:e(Q,{tone:"warn",children:t("Differs from the file version")})}):null,d?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(gt,{label:t("Prompt"),before:i.text,after:w}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:H,onClick:()=>B(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:H,onClick:U,children:H?t("Saving…"):t("Save")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:I,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>D(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:I,className:"prompt-full",value:w,maxLength:i.maxChars,onChange:(a)=>b(a.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>A(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!G||!w.trim(),onClick:()=>B(!0),children:t("Review changes")})]})]}),F?e(T,{fallback:null,children:e(O,{open:F,title:t("History of {name}",{name:N(i.label)}),load:async()=>(await de.promptHistory(c)).versions.map((a)=>({id:a.id,text:a.text,previous:a.previous,by:a.by,at:a.at,revert:a.action==="revert"})),onUse:(a)=>{b(a),B(!1),D(!1)},onClose:()=>D(!1)})}):null,z?e(T,{fallback:null,children:e(Z,{open:z,title:t("Revert {name} to the file version?",{name:N(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let a=await de.revertPrompt(c,{base:i.text});h(a),b(a.text),B(!1),f(t("Back to the file version."))}catch(a){if(!(a instanceof fe&&a.status===409))throw a;let{current:y}=a.body;h(y),f(a.message,"danger")}},onClose:()=>A(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{pe as PromptsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Pr}from"./chunk-index-cfesmk1f.js";import"./chunk-index-s4a8e4qm.js";import"./chunk-index-6btdp13p.js";import"./chunk-index-cmzvq3nf.js";import"./chunk-index-vsaggfns.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-wgrx2ybn.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";export{Pr as RoomConfirmHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p,r,t,g,e,n,s,
|
|
1
|
+
import{p,r,t,g,e,n,s,S,d,_,Ye,Nt,ke,kt}from"./chunk-index-24cggw6k.js";import{ze}from"./chunk-index-3n38xe7m.js";import"./chunk-index-5j1v2q7w.js";import{Qt}from"./chunk-index-m76gdwnk.js";import{R}from"./chunk-index-cmzvq3nf.js";import{nn}from"./chunk-index-en728705.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=d((o)=>o.rooms[a.room]?.view?.home===!1,a.room),u=d((o)=>o.pins.includes(a.room),a.room),c=a.mode??{yolo:!1,longRunning:!1},k=async(o)=>{m(!0),await Nt(a.room,{longRunning:o}),m(!1)};return e(R,{open:a.open,title:t("Room menu"),onClose:a.onClose,children:n("ul",{className:"menu",children:[a.readOnly?e("li",{children:a.parent?n("a",{className:"menu-item menu-link",href:S("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(s,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(s,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:b,children:[e("span",{className:"menu-icon",children:e(s,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(Qt,{id:b,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{m(!0),await nn(a.room,!o),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(s,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(Qt,{id:h,checked:c.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else m(!0),Nt(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(s,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(Qt,{id:N,checked:c.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(),Ye(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit knight")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(s,{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(),Ye(a.agent,{skills:!0})},children:[e("span",{className:"menu-icon",children:e(s,{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(s,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),kt({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(s,{name:"chevron",size:16})]})}):null,a.readOnly||!f?null:n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(p("tdx896xf"),import("./chunk-layout-actions-tdx896xf.js")).then((o)=>o.pinRoom(a.room,!u))},children:[e("span",{className:"menu-icon",children:e(s,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:u?t("Unpin"):t("Pin")}),e("span",{className:"meta",children:t("Keep this room at the top of the list.")})]})]})}),e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),ze({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(s,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(s,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),ke({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{P as RoomMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,e,s,d}from"./chunk-index-24cggw6k.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-3n38xe7m.js";import{ci}from"./chunk-index-fb3kzyyp.js";import"./chunk-index-5w6tb7p0.js";import"./chunk-index-yr758n6t.js";function r(){if(!d((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>ci(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,t,u,e,n,s,
|
|
1
|
+
import{r,t,u,e,n,s,S,y,f,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import{xe}from"./chunk-index-55ps4x5n.js";import"./chunk-index-cmzvq3nf.js";var h={mon:u("Mon"),tue:u("Tue"),wed:u("Wed"),thu:u("Thu"),fri:u("Fri"),sat:u("Sat"),sun:u("Sun")};function w(c){if(typeof c!=="object"||c===null)return"";let o=c,i=typeof o.time==="string"?o.time:"";switch(o.kind){case"once":return t("Once on {date} at {time}",{date:String(o.date??""),time:i});case"every":return Number(o.everyDays)===1?t("Every day at {time}",{time:i}):t("Every {count} days at {time}",{count:Number(o.everyDays),time:i});case"weekly":{let l=Array.isArray(o.weekdays)?o.weekdays.map((d)=>t(h[String(d)]??String(d))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:i})}default:return""}}function V(){let{timeZone:c}=_(),[o,i]=r(0),[l,d]=r(),{data:p,error:g}=xe(()=>y.schedules(),`schedules:${o}`);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(v,{}):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(Q,{children:a.lastStatus}):null]}),n("p",{className:"meta",children:[w(a.recurrence)," ·"," ",t("next {when}",{when:oe(a.nextRun,c)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:S("room",a.room),children:a.label}):a.label," ","· ",t("set by {name}",{name:a.createdBy})]})]}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Cancel {title}",{title:a.title}),onClick:()=>d(a),children:e(s,{name:"trash"})})]},a.id))}),e(D,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>d(void 0),onConfirm:async()=>{if(!l)return;await y.cancelSchedule(l.id),i((a)=>a+1),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{bn}from"./chunk-index-24cggw6k.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 bn((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,29 @@
|
|
|
1
|
+
import{p,T,x,E,o,L,C,a,r,t,u,g,e,n,s,X,d,fe,y,l,f,v,m,k,_,we,vn,Hr,fs,ke,Ti,ms,he,wn,te,De,Fn}from"./chunk-index-24cggw6k.js";import{Zo}from"./chunk-index-7xcbpeqz.js";import{D}from"./chunk-index-6btdp13p.js";import{vo,js,Ks,xo,ea}from"./chunk-index-n3khm9fq.js";import{Ms,po,Rs}from"./chunk-index-mr391t49.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-vsaggfns.js";import"./chunk-index-5j1v2q7w.js";import{Pr}from"./chunk-index-cfesmk1f.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-nn4w6a04.js";import{Yn}from"./chunk-index-fn6305vn.js";import{Pn}from"./chunk-index-7mrkq793.js";import{fn,ji,Ur,Ki}from"./chunk-index-a7e6rhxy.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{Ft}from"./chunk-index-3tksdmx7.js";import{Qt}from"./chunk-index-m76gdwnk.js";import{Re}from"./chunk-index-dr0jr7d3.js";import{H}from"./chunk-index-s4a8e4qm.js";import{R}from"./chunk-index-cmzvq3nf.js";import"./chunk-index-wsv46y9p.js";import{nn}from"./chunk-index-en728705.js";import"./chunk-index-5w6tb7p0.js";import{re,Ne}from"./chunk-index-wgrx2ybn.js";import"./chunk-index-yr758n6t.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";import{Y}from"./chunk-index-d941ae7c.js";var Ke=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((i)=>({default:i.HistorySheet}))),Qe=x(()=>(p("m7tw20ef"),import("./chunk-character-creator-m7tw20ef.js")).then((i)=>({default:i.CharacterCreator}))),Ue=["default","off","minimal","low","medium","high","xhigh"],Ae={default:u("Default"),off:u("Off"),minimal:u("Minimal"),low:u("Low"),medium:u("Medium"),high:u("High"),xhigh:u("Very high")},q="default",Ee=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),qe=u("Automatic"),pe=(i)=>i==="auto"?t(qe):t(Ae[i]??i),Se=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??q,thinking:i.thinking??q});function Ce(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 xe(){let i=fs(),h=a(i);if(i)h.current=i;let c=h.current,N=i!==void 0;if(o(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)vn()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!c)return null;return e(R,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:vn,children:e(Ze,{name:c.name,opened:c.id},c.name)})}function Ze({name:i,opened:h}){let[c,N]=r(),[w,b]=r([]),[I,B]=r(),[M,z]=r(),[G,Q]=r(!1),[S,A]=r(!1),[V,W]=r(!1),[K,Z]=r(!1),se=Fn(c?.room??""),ee=a(null),ne=c!==void 0,J=d((F)=>c?F.rooms[c.room]?.view?.muted===!0:!1,c?.room??""),[ie,U]=r(!1),le=d((F)=>c?F.rooms[c.room]?.view?.coordinator===!0:!1,c?.room??""),oe=L(),ae=L(),O=L();o(()=>{if(!ne||!Hr()?.look)return;ee.current?.scrollIntoView({block:"start"}),ee.current?.focus({preventScroll:!0})},[ne,h]);let P=a({});P.current={profile:c,draft:M},o(()=>{let F=!0;return Promise.all([y.agent(i),y.models()]).then(([ce,_e])=>{if(!F)return;let{profile:ye,draft:ue}=P.current,je=ye&&ue&&Object.keys(Ce(ye,ue)).length>0;N(ce),b(_e.models),z(je?ue:Se(ce))},(ce)=>F&&B(l(ce))),()=>{F=!1}},[i,h]);let j=C(()=>c&&M?Ce(c,M):{},[c,M]);if(I)return e(m,{message:I});if(!c||!M)return e(v,{});let ve=Object.keys(j).length>0,Be=Array.from(new Set([q,...w,M.model])),We=Ee(c),be=async()=>{Q(!0);try{let F=await y.updateAgent(i,j);N(F),z(Se(F)),A(!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:c.character,name:c.name,size:72,state:se,label:c.displayName}),n("div",{children:[e("h3",{children:c.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:c.effective.model,thinking:pe(c.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(s,{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(Qt,{id:O,checked:!J,label:t("Notifications"),busy:ie,onChange:async(F)=>{U(!0),await nn(c.room,!F),U(!1)}})]})})}),S?e(et,{profile:c,draft:M,saving:G,onBack:()=>A(!1),onSave:be}):n("form",{className:"stack form",onSubmit:(F)=>{if(F.preventDefault(),!ve)return;if(j.prompt!==void 0)A(!0);else be()},children:[n("label",{htmlFor:ae,children:[t("Name"),e("input",{id:ae,value:M.displayName,onChange:(F)=>z({...M,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(s,{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:M.prompt,onChange:(F)=>z({...M,prompt:F.target.value})})]}),e(Ft,{label:t("Model"),value:M.model,onChange:(F)=>z({...M,model:F}),options:Be.map((F)=>({value:F,label:F===q?We:F}))}),e(Ft,{label:t("Thinking level"),value:M.thinking,onChange:(F)=>z({...M,thinking:F}),options:Ue.map((F)=>({value:F,label:t(Ae[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(v,{}),children:e(Qe,{name:c.name,displayName:c.displayName,prompt:c.prompt,character:c.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:()=>{vn(),ke({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive {name}",{name:c.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({...M,prompt:F}),Z(!1)},onClose:()=>Z(!1)})}):null,e(R,{open:V,title:t("Prompt"),size:"full",onClose:()=>W(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:M.prompt,onChange:(F)=>z({...M,prompt:F.target.value})})})]})}function Xe({name:i,opened:h}){let[c,N]=r(),[w,b]=r(),[I,B]=r(),M=L(),z=a(null),G=c!==void 0;if(o(()=>{if(!G||!Hr()?.skills)return;z.current?.scrollIntoView({block:"start"}),z.current?.focus({preventScroll:!0})},[G,h]),o(()=>{let A=!0;return re.skills(i).then((V)=>A&&N(V),(V)=>{if(A&&!(V instanceof fe&&V.status===404))B(l(V))}),()=>{A=!1}},[i,h]),I)return e(m,{message:I});if(!c)return null;let Q=()=>re.skills(i).then(N,(A)=>{f(l(A),"danger")}),S=async(A,V)=>{b(A);try{N(await re.setSkills(i,V?{add:[A]}:{remove:[A]}))}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:c.skills.filter((A)=>A.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:c.skills.map((A,V)=>{let W=`${M}-${V}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:W,children:[n("span",{className:"menu-text",children:[e("strong",{children:A.name}),e("span",{className:"meta",children:A.missing?t("Its file cannot be read."):A.builtin?t("Built in: every knight carries it."):A.description??""})]}),e(Qt,{id:W,checked:A.carried,label:A.name,busy:w===A.name,disabled:A.builtin,onChange:(K)=>S(A.name,K)})]})},A.name)})}),e(Ye,{name:i,view:c,onApplied:Q})]})}function Ye({name:i,view:h,onApplied:c}){let[N,w]=r(),[b,I]=r(),B=L();if(o(()=>{let S=!0;return de.skillGroups().then((A)=>S&&w(A.groups),()=>{return}),()=>{S=!1}},[]),!N?.length)return null;let M=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((A)=>!M.has(A)),Q=(S)=>S.skills.filter((A)=>M.has(A)&&!z.has(A));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,A)=>{let V=G(S),W=V.length===0;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:`${B}-group-${A}`,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(Qt,{id:`${B}-group-${A}`,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:A}=await de.applySkillGroup(b.group.name,i,b.on);f(S.length?t("Switched on: {skills}",{skills:S.join(", ")}):A.length?t("Switched off: {skills}",{skills:A.join(", ")}):t("Nothing changed for {name}.",{name:b.group.name})),c()},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:c}=i,N=a(null);o(()=>N.current?.focus(),[]);let w=[];if(c.displayName!==h.displayName)w.push({label:t("Name"),before:h.displayName,after:c.displayName});let b=(I)=>I===q?Ee(h):I;if(c.model!==(h.model??q))w.push({label:t("Model"),before:b(h.model??q),after:b(c.model)});if(c.thinking!==(h.thinking??q))w.push({label:t("Thinking level"),before:pe(h.thinking??q),after:pe(c.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(gt,{label:t("Prompt"),before:h.prompt,after:c.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 Me(){let i=Ks(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return e(R,{open:i!==void 0,title:t("Archived conversation"),size:"wide",onClose:js,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}=_(),c=De(),[N,w]=r(),[b,I]=r(!1),[B,M]=r(),[z,G]=r(!1),{room:Q,until:S}=i;o(()=>{let V=!0;return vo.page(Q,S).then((W)=>{if(!V)return;w(W.messages),I(W.more)},(W)=>{if(V)M(l(W))}),()=>{V=!1}},[Q,S]);let A=async()=>{let V=N?.[0];if(!V||z)return;G(!0);try{let W=await vo.page(Q,S,V.id);w((K)=>[...W.messages,...K??[]]),I(W.more)}catch(W){M(l(W))}G(!1)};if(B)return e(m,{message:B});if(!N)return e(v,{});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:A,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(wn,{message:V,character:V.agent?c[V.agent]:void 0,header:Z,enter:!1,unread:!1,timeZone:h,quotable:!1},V.id)})})]})}function ot(i){let{message:h}=i,[c,N]=r(h.text),w=a(null);o(()=>{w.current?.focus(),w.current?.setSelectionRange(c.length,c.length)},[c.length]);let b=c.trim(),I=b===""&&h.files.length===0;return n("form",{className:"stack",onSubmit:(M)=>{if(M.preventDefault(),I)return;if(b!==h.text)Ms(h,b);i.onClose()},children:[e("div",{className:"field",children:e("textarea",{ref:w,className:"queued-edit-text",rows:6,value:c,"aria-label":t("Edit"),onChange:(M)=>N(M.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 Le(){let i=Rs(),h=a(void 0);if(i)h.current=i;let c=h.current;if(!c)return null;return e(H,{open:i!==void 0,title:t("Edit"),onClose:po,children:e(ot,{message:c,onClose:po},c.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 Te(){let i=ea(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return Y("select-text",at),n(R,{open:i!==void 0,title:t("Select text"),size:"full",onClose:xo,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:xo,children:t("Close")}),e("button",{type:"button",onClick:()=>Yn(h.text),children:t("Copy all")})]})]})}function st(i){let h=i.filter((w)=>w.parent!==void 0),c=i.filter((w)=>w.parent===void 0),N=new Set(c.map((w)=>w.name));return[...c.flatMap((w)=>[w,...h.filter((b)=>b.parent===w.name)]),...h.filter((w)=>!N.has(w.parent??""))]}function He(){let[i,h]=r(),[c,N]=r(),[w,b]=r(),[I,B]=r(),M=E(async()=>{try{h((await re.archive()).entries),N(void 0)}catch(G){N(l(G))}},[]);o(()=>{M()},[M]);let z=async(G)=>{b(G.name);try{if(G.kind==="agent")await re.restoreAgent(G.name);else await re.restoreGroup(G.name);await Ne(),f(t("Restored {name}.",{name:G.displayName})),await M()}catch(Q){f(l(Q),"danger")}finally{b(void 0)}};if(c&&!i)return e(m,{message:c});if(!i)return e(v,{});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(s,{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 Ne(),f(t("Deleted {name}.",{name:I.displayName})),await M()},children:e("p",{children:t("{name} and its messages in this app are deleted for good, and the name can be used again. This cannot be undone.",{name:I?.displayName??""})})})]})}var Ie=/^[a-z0-9-]{1,32}$/,Pe=2,$e=8,me="\x00";function rt(){let i=d((h)=>h.order.flatMap((c)=>{let N=h.rooms[c]?.view;return N?.kind==="agent"&&!N.helper?[`${N.name}${me}${N.displayName}`]:[]}).join(`${me}${me}`));return C(()=>i===""?[]:i.split(`${me}${me}`).map((h)=>{let[c="",N=""]=h.split(me);return{name:c,displayName:N}}),[i])}function Fe(i){let h=rt(),[c,N]=r(),[w,b]=r(),[I,B]=r(""),[M,z]=r(""),[G,Q]=r(!1),[S,A]=r([]),[V,W]=r(""),[K,Z]=r(!1),[se,ee]=r(i.name===void 0),ne=L(),J=L();o(()=>{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),A(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=c===void 0?!0:I.trim()!==c.displayName||S.join(",")!==c.members.join(",")||U!==c.host,oe=I.trim()!==""&&S.length>=Pe&&S.length<=$e&&(c!==void 0||Ie.test(M));if(w&&!se)return e(m,{message:w});if(!se)return e(v,{});let ae=async()=>{Z(!0),b(void 0);try{if(c){await re.updateGroup(c.name,{...I.trim()!==c.displayName?{displayName:I.trim()}:{},...S.join(",")!==c.members.join(",")?{members:S}:{},...U!==c.host?{host:U}:{}}),await Ne(),f(t("Saved.")),i.onDone();return}let O=await re.createGroup({name:M,displayName:I.trim(),members:S,host:U});await Ne(),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),!c&&!G)z(O.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),c?null:n("label",{htmlFor:J,children:[t("Permanent name"),e("input",{id:J,value:M,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":M!==""&&!Ie.test(M),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>=$e,onChange:()=>A(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>=Pe?e(Ft,{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:[c?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),ke({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!oe||!le||K,children:K?t("Saving…"):c?t("Save"):t("Make group")})]})]})}var it=x(()=>(p("m7tw20ef"),import("./chunk-character-creator-m7tw20ef.js")).then((i)=>({default:i.CharacterCreator}))),Ge=/^[a-z0-9-]{1,32}$/,ge="default";function lt(i){let h=[];for(let c of i){let N=c.indexOf("/"),w=N>0?c.slice(0,N):"",b=h.find((I)=>I.provider===w&&w!=="");if(b)b.models.push(c);else h.push({provider:w,models:[c]})}return h}var mt=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Ve({onDone:i}){let[h,c]=r(""),[N,w]=r(""),[b,I]=r(!1),[B,M]=r(""),[z,G]=r(ge),[Q,S]=r(""),[A,V]=r(),[W,K]=r(!1),[Z,se]=r([]),[ee,ne]=r(),[J,ie]=r(!1),U=[L(),L(),L(),L(),L()];o(()=>{let P=!0;return y.models().then((j)=>P&&se(j.models),()=>{return}),()=>{P=!1}},[]);let le=C(()=>Pn({name:N,displayName:h,prompt:B}),[N,h,B]),oe=A?.spec??le,ae=Ge.test(N)&&h.trim()!==""&&B.trim()!=="";if(W)return e(T,{fallback:e(v,{}),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()}:{},...A?{character:A.input}:{}},j=await re.createAgent(P);await Ne(),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(c(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!==""&&!Ge.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)=>M(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(Re,{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:A?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 Oe(){let i=ms(),h=a(i);if(i)h.current=i;let c=h.current,N=i!==void 0;if(o(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)Ti()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!c)return null;return e(R,{open:i!==void 0,title:ct(c),size:"wide",onClose:Ti,children:e("div",{className:"stack agent-sheet",children:c.kind==="new-agent"?e(Ve,{onDone:Ti}):c.kind==="archive"?e(He,{}):e(Fe,{...c.name===void 0?{}:{name:c.name},onDone:Ti})},c.id)})}function ze(){let i=Ur(),h=a(!1);if(i)h.current=!0;return h.current?e(ut,{open:i}):null}function ut({open:i}){let h=_(),{now:c}=te(),N=d((b)=>fn(b).map(({id:I,card:B})=>{let M=b.rooms[B.room]?.view,z=M?.parent?b.rooms[M.parent]?.view:void 0;return{id:I,room:z?`${z.displayName} › ${M?.displayName??""}`:M?.displayName??B.room,title:B.frame.title,at:B.frame.at}})),w=N.length===0;return o(()=>{if(i&&w)ji()},[i,w]),e(R,{open:i&&!w,title:t("Cards waiting"),onClose:ji,children:e("ul",{className:"waiting-list",children:N.map((b)=>e("li",{children:n("button",{type:"button",onClick:()=>Ki(b.id),children:[e("strong",{children:b.title}),n("span",{className:"meta",children:[b.room,b.at?` · ${we(b.at,c,h.timeZone)}`:""]})]})},b.id))})})}var dt=x(()=>(p("434sqnxc"),import("./chunk-shortcut-help-434sqnxc.js")));function pt(){let i=Zo(),h=a(!1);if(i)h.current=!0;if(!h.current)return null;return e(T,{fallback:null,children:e(dt,{open:i})})}function Do(){return n(g,{children:[e(Pr,{}),e(Le,{}),e(xe,{}),e(Oe,{}),e(Me,{}),e(Te,{}),e(ze,{}),e(pt,{})]})}export{Do as SheetHosts};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{t,e,n}from"./chunk-index-24cggw6k.js";import{li,Yo}from"./chunk-index-7xcbpeqz.js";import{R}from"./chunk-index-cmzvq3nf.js";import{Y}from"./chunk-index-d941ae7c.js";var o=`
|
|
2
|
+
.shortcut-list {
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: var(--space-3) var(--space-4);
|
|
7
|
+
margin: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.shortcut-list dt {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
gap: var(--space-1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.shortcut-list dd {
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.shortcut-list kbd {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
min-width: 1.6rem;
|
|
23
|
+
text-align: center;
|
|
24
|
+
font-size: var(--text-sm);
|
|
25
|
+
}
|
|
26
|
+
`;function r(){let a=Yo(),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(R,{open:a,title:t("Keyboard shortcuts"),onClose:li,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{Un,S,X,Ae,O,ot,wt}from"./chunk-index-24cggw6k.js";import{Ar}from"./chunk-index-97dcp1vh.js";import{_o}from"./chunk-index-nr275sa7.js";import{Ci,Ei}from"./chunk-index-mr391t49.js";import{Go,li,Wo}from"./chunk-index-7xcbpeqz.js";import{st}from"./chunk-index-6rdywten.js";function y(e,t){let{collapsed:n,expanded:r,current:s}=t,o=st(e,t.at),a=[],d=(i,c)=>{a.push({key:i,shown:c});let f=o.threads[i];if(!f)return;for(let l of f.open)a.push({key:l,shown:c});for(let l of f.closed)a.push({key:l,shown:c&&(r.has(l)||l===s)})};for(let i of o.home)d(i,!0);for(let i of o.pinned)d(i,!0);for(let i of o.folders){let c=!n.has(i.id)||s!==void 0&&i.rooms.includes(s);for(let f of i.rooms)d(f,c)}let u=o.folders.length>0?o.rest:[...o.restAgents,...o.restGroups];for(let i of u)d(i,!0);let{orphans:m}=o;for(let i of m.open)a.push({key:i,shown:!0});for(let i of m.closed)a.push({key:i,shown:r.has(i)||i===s});return a}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 a=e[o];if(a&&r(a))return a.key}return}var k=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 k.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function w(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:o,selectionEnd:a}=e;if(o===null||a===null||o!==a)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 E(){let e=Un();if(e.pane!=="room"||e.key===void 0)return;return(O.getState().rooms[e.key]?.messages??[]).findLast(Ci)}var x=(e)=>e instanceof HTMLTextAreaElement&&e.closest(".composer")!==null&&e.value===""&&!e.readOnly;function T(e){if(e.defaultPrevented||ot(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&&!w(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)&&E()?"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 b(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(()=>b(e,t-1))}function H(e,t){let n=O.getState(),r=Un(),s=r.pane==="room"?r.key:void 0,o=y(n,{at:(u)=>Ae(n,u),collapsed:Ar(),expanded:K(),current:s});if(r.pane==="room"&&!o.some((u)=>u.key===s))return;let d=h(o,s,e,t?(u)=>_o(u.key)>0:(u)=>u.shown);if(d===void 0)return;X("room",d),b(d)}function L(e){if(document.querySelector(".action-popover")){e.preventDefault(),wt();return}if(document.querySelector("dialog[open]"))return;let t=document.activeElement;if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&k.has(t.type))e.preventDefault(),t.blur()}function A(e,t){switch(e){case"escape":L(t);break;case"help":if(t.preventDefault(),Wo())li();else if(!p())Go();break;case"edit-queued":{if(p())break;let n=E();if(!n)break;t.preventDefault(),Ei(n);break}default:if(p())break;t.preventDefault(),H(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function G(){let e=(t)=>{let n=T(t);if(n)A(n,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{G as startShortcuts};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{p,T,x,o,L,r,t,g,e,n,s,fe,l,f,v,m}from"./chunk-index-24cggw6k.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{R}from"./chunk-index-cmzvq3nf.js";var B=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((d)=>({default:d.HistorySheet}))),O=`---
|
|
2
|
+
name: my-skill
|
|
3
|
+
description: "Use when "
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# My skill
|
|
7
|
+
|
|
8
|
+
`;function _(d){let{name:u}=d,[i,w]=r(),[h,b]=r(u?"":O),[y,z]=r(),[A,k]=r(!1),[S,N]=r(!1),[U,D]=r(!1),[H,C]=r(!1),E=L();o(()=>{if(!u)return;let a=!0;return de.skillDocument(u).then((c)=>{if(!a)return;w(c),b(c.text)},(c)=>a&&z(l(c))),()=>{a=!1}},[u]);let F=i?.text??"",V=h!==F,I=u!==void 0&&!i&&!y,K=async()=>{N(!0);try{if(i){let a=await de.saveSkillDocument(i.name,{text:h,baseHash:i.hash});w(a),b(a.text),k(!1),D(!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),D(!0)}else f(l(a),"danger")}finally{N(!1)}};return n(R,{open:!0,title:u??t("New skill"),size:"full",onClose:d.onClose,children:[y?e(m,{message:y}):null,I?e(v,{}):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:[A?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(gt,{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:()=>C(!0),children:[e(s,{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")})})]}),H&&i?e(T,{fallback:null,children:e(B,{open:H,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),C(!1)},onClose:()=>C(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,Br,T,x,o,r,t,g,e,n,s,y,l,f,v,m,k,Q,Yt,Et}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import{ln}from"./chunk-index-2g8xtwqg.js";import{de}from"./chunk-index-prq011b6.js";import{xe}from"./chunk-index-55ps4x5n.js";import{H}from"./chunk-index-s4a8e4qm.js";import"./chunk-index-cmzvq3nf.js";function F({source:a}){return e("div",{className:"prose document",children:e(Yt,{remarkPlugins:[Et],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}=ln(()=>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(s,{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(v,{}):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=x(()=>(p("98492yrt"),import("./chunk-skill-editor-98492yrt.js")).then((a)=>({default:a.SkillEditor})));function ye(){let[a,i]=r(0),{data:d,error:c}=xe(()=>y.skills(),`skills:${a}`),[w,u]=r(),[N,E]=r(),[h,b]=r();o(()=>{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(s,{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(v,{}):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(Q,{children:b}),a.missing?e(Q,{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(s,{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(v,{}):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(Br,{children:[e("dt",{children:c.key}),e("dd",{children:c.value})]},c.key))}):null,e(F,{source:i.body})]})}export{ye as SkillsPage};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{t,g,e,n,s,d}from"./chunk-index-24cggw6k.js";import{Hs}from"./chunk-index-n3khm9fq.js";import{Y}from"./chunk-index-d941ae7c.js";var l=`
|
|
2
|
+
.line.start-over {
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
margin-top: var(--space-4);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.line.start-over .link-button {
|
|
8
|
+
min-height: 1.75rem;
|
|
9
|
+
font-size: inherit;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.start-over-empty {
|
|
13
|
+
margin-top: var(--space-6);
|
|
14
|
+
font-size: var(--text-sm);
|
|
15
|
+
}
|
|
16
|
+
`;function p(a){Y("start-over",l);let{message:o}=a,i=d((m)=>{let r=m.rooms[o.room];return r?.messages.at(-1)?.id===o.id&&r.pending.length===0&&r.live.length===0});return n(g,{children:[n("li",{className:"line start-over","data-enter":a.enter||void 0,children:[e(s,{name:"reset",size:14}),e("span",{children:t("Conversation started over")}),e("button",{type:"button",className:"link-button",onClick:()=>Hs(o.room,o.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C,a,r,t,
|
|
1
|
+
import{C,a,r,t,G,g,e,n,s,S,X,Ke,Ae,d,ot,jt,xn,Je,Ue,Kt}from"./chunk-index-24cggw6k.js";import{yi}from"./chunk-index-d74tpnkd.js";import{mi,gi}from"./chunk-index-sz381vda.js";import{Oi}from"./chunk-index-6s2pqwna.js";import{Zt}from"./chunk-index-bxf8eq1s.js";import{ca}from"./chunk-index-6rdywten.js";mi();function v(){let l=d((c)=>JSON.stringify(ca(c,(o)=>Ae(c,o),(o)=>Ke(c,o)>0,!0).map((o)=>({id:o.id,...o.title===void 0?{}:{title:o.title},entries:o.keys.map((u)=>({key:u,name:c.rooms[u]?.view?.displayName??u,waiting:Ke(c,u)>0}))})))),m=yi(),p=a(l);if(!m)p.current=l;let f=p.current;return C(()=>JSON.parse(f),[f])}function b(l){let{key:m,name:p}=l.entry,f=d((i)=>i.rooms[m]),c=d((i)=>Ke(i,m)),o=f?.view,u=Je(o?.character),w=Zt(()=>jt(m,l.onLeave),l.liftable&&!o?.home?gi(m):void 0);if(!o)return null;return e("li",{...l.liftable&&!o.home?{"data-drop-item":"","data-key":m}:{},children:n("a",{className:"switcher-row",...w,href:S("room",m),"aria-current":m===l.current?"page":void 0,style:u,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(m)},children:[n("span",{className:"switcher-picture",children:[e(Ue,{view:o,size:40}),c?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:p}),f?.typing?n("span",{className:"switcher-working",children:[n("span",{className:"typing","aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t("Working")]}):null]}),e(Kt,{room:m}),c?e("span",{className:"badge badge-warn",children:G(c,"{count} card waiting","{count} cards waiting")}):null,o.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(s,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,f?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(s,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,f?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(s,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[m,p]=r(""),f=v(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>Oi(m,h.name)!==void 0)})).filter((i)=>i.entries.length>0||m===""),o=(i)=>l.close(i===l.current?void 0:()=>X("room",i)),u=f.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),w=c.filter((i)=>i.entries.length>0).length>1;return n(g,{children:[n("div",{className:"switcher-search",children:[e(s,{name:"search",size:16}),e("input",{type:"search",value:m,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>p(i.target.value),onKeyDown:(i)=>{let h=c.flatMap((y)=>y.entries)[0];if(i.key==="Enter"&&h&&!ot(i.nativeEvent))o(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>xn(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:c.map((i)=>{let h=i.id==="waiting",y=i.id==="pinned"?"pinned":i.id==="rest"?"rest":h||i.id==="home"?void 0:"folder";return n("section",{"aria-label":h?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...y?{"data-drop-zone":y,"data-zone-id":i.id,...y==="folder"?{"data-folder":i.id}:{}}:{},children:[h?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):w||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((N)=>e(b,{entry:N,current:l.current,onPick:o,onLeave:l.close,liftable:!h&&i.id!=="home"},N.key))})]},i.id)})})]})}export{Y as SwitcherList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O,
|
|
1
|
+
import{O,vs,Gn}from"./chunk-index-24cggw6k.js";import{ko,To}from"./chunk-index-nr275sa7.js";import{Gi,jo}from"./chunk-index-d4mx2vvf.js";import"./chunk-index-vpq2cj14.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=()=>Gi().badge+To(),a=()=>vs(s());g({count:()=>Gn(O.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};O.subscribe(t),jo(t),ko(t)},render:m}),a()}export{T as startPageTabDot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_e,o,r,t,e,n,s,X,d,rt}from"./chunk-index-24cggw6k.js";import{qi,Nn,ui,Ho,di,fi,Ln,Bi,Fi,Qr}from"./chunk-index-c8gm1crh.js";import"./chunk-index-ze9p4npm.js";import"./chunk-index-ce7hsda9.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-cmzvq3nf.js";import{Cs,Ai,Es}from"./chunk-index-wsv46y9p.js";qi();function v(){return Ho((_e(rt)?.kinds??[]).map((a)=>a.kind)),null}function N({focus:a}){let[l,b]=r(),u=di(void 0),i=Nn(),p=i.loaded&&u.length===0;return o(()=>{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(s,{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(Ln,{onHandle:b,onSeat:(m)=>{let c=u.find((f)=>f.name===m);if(c)X("room",c.key)},onFocus:(m)=>{let c=u.find((f)=>f.name===m);if(c)X("room",c.key)}}),e(v,{})]})]})}function C({named:a}){let l=Ai(),b=Cs(),u=d((y)=>y.listed),i=Es(l,b,a),p=fi(),{ask:m,sheet:c}=Fi(i),f=a===void 0||l.some(k(a));o(()=>{if(a!==void 0&&u&&!f)X("table",void 0,{replace:!0})},[a,u,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:m,children:i?t("Edit this council"):t("Pick who sits")}):null]});if(i)return n("section",{className:"room council-page",children:[e(Qr,{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(Bi,{council:void 0,onOpen:m})}):null]}),e("div",{className:"table-frame",children:g}),c]})}var k=(a)=>(l)=>l.key===a||l.name===a;function F({focus:a}){return ui()?e(N,{focus:a}):e(C,{named:a})}export{F as TablePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{zn,Mr,Rr,Mt,un,dn,pi,os}from"./chunk-index-0h99xcs3.js";import"./chunk-index-rjs1can6.js";import{Ct,Gt}from"./chunk-index-pgxgq61x.js";var pe="http://www.w3.org/2000/svg",t=(d,s={},y)=>{let k=document.createElementNS(pe,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)}`},ye=0;function xe(d,s){let y=s||d<=6?1:2;return{rows:y,perRow:Math.max(1,Math.ceil(d/y))}}function $e(d,s){let y=`t2d${++ye}`,k=window.matchMedia("(prefers-reduced-motion: reduce)"),S=s.reducedMotion==="auto"||s.reducedMotion===void 0?k.matches:s.reducedMotion,G=s.labels??Gt,{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=zn(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}=xe(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),g=Math.max(46,Math.min(I*0.94,132,V*1.05)),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 se=(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),ae=Math.min(c,u-M*c),le=w-M*c,ce=a/ae*(le+0.5),de=se(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(${ce.toFixed(1)} ${de.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 ge=t("image",{class:"talk",href:ne(oe),...p,opacity:0},_),{frames:he,seconds:ue}=os(w);t("animate",{attributeName:"opacity",values:he.join(";"),dur:`${ue.toFixed(3)}s`,calcMode:"discrete",repeatCount:"indefinite"},ge)}}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":Mt},_);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),fe=L+8;t("rect",{class:"plate",x:-j/2,y:-h*0.78,width:j,height:fe,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},f);let me=t("text",{x:0,y:-h*0.78+L+1.5,"text-anchor":"middle","font-size":L,"font-weight":700,"font-family":Mt,fill:e.plateInk},f),Q=N.get(i.id);me.textContent=Rr(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=Mr.done;else if(P)U=Mr.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":Mt,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:Ct(p,f)})),f.addEventListener("keydown",(p)=>{if(p.key==="Enter"||p.key===" ")p.preventDefault(),s.onSeatClick({id:i.id,name:i.name,at:Ct({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":Mt,fill:e.gold},m);M.textContent=Rr(s.ownerName??"You",12)}}let H=new Set,re=(e,r)=>{if(e.mode==="cut")return;let a=zn(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()},dn)}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(),un)}},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(pi(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{$e as createTable2D};
|