pi-roundtable-web 0.28.0 → 0.29.0
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 +22 -0
- package/README.md +4 -4
- package/dist/chunk-account-9616x405.js +1 -0
- package/dist/{chunk-action-menu-qpp9bdxh.js → chunk-action-menu-q5y7xpry.js} +1 -1
- package/dist/chunk-agent-x74xezyt.js +1 -0
- package/dist/{chunk-arranged-rooms-6rdkk8t1.js → chunk-arranged-rooms-9prq46vh.js} +1 -1
- package/dist/chunk-bulk-actions-5dc4m9ad.js +1 -0
- package/dist/chunk-character-creator-wf02eg0h.js +1 -0
- package/dist/{chunk-codeeditor-jgj32247.js → chunk-codeeditor-239ss6a2.js} +2 -2
- package/dist/chunk-confirm-bhrx9195.js +1 -0
- package/dist/chunk-connectors-k77pd9by.js +37 -0
- package/dist/{chunk-conversations-fb071rez.js → chunk-conversations-ftcpaqw1.js} +1 -1
- package/dist/chunk-council-sheet-a5e6tspr.js +2 -0
- package/dist/chunk-council-view-6593rqbr.js +1 -0
- package/dist/{chunk-drag-04qfef58.js → chunk-drag-7873fvzw.js} +1 -1
- package/dist/{chunk-entry-mws704mc.js → chunk-entry-5zmjxadx.js} +1 -1
- package/dist/chunk-folder-list-h9hmbm8e.js +1 -0
- package/dist/chunk-folds-vxq86t1s.js +1 -0
- package/dist/{chunk-gate-vxetvn8t.js → chunk-gate-fa6za28z.js} +1 -1
- package/dist/chunk-host-icons-y6frbzqt.js +1 -0
- package/dist/chunk-host-picture-fqg55rbr.js +1 -0
- package/dist/chunk-host-state-65tdhkyq.js +1 -0
- package/dist/{chunk-host-ui-pc9r24e3.js → chunk-host-ui-233kz7qp.js} +1 -1
- package/dist/{chunk-index-5hbq6g2e.css → chunk-index-1652v386.css} +1 -1
- package/dist/chunk-index-2c00zf3z.js +2 -0
- package/dist/chunk-index-2dhrqvba.js +2 -0
- package/dist/chunk-index-2s4bkrz3.js +2 -0
- package/dist/{chunk-index-v8mma5np.js → chunk-index-2ypaqwjy.js} +2 -2
- package/dist/{chunk-index-7qd604rq.js → chunk-index-35zqk1zr.js} +2 -2
- package/dist/chunk-index-39qq37j5.js +2 -0
- package/dist/{chunk-index-2hvn2kte.js → chunk-index-3tjmyd1h.js} +2 -2
- package/dist/{chunk-index-2tr41qht.js → chunk-index-4eag6s50.js} +2 -2
- package/dist/{chunk-index-2y8r4s4f.js → chunk-index-4jnn2g09.js} +2 -2
- package/dist/{chunk-index-q5fyrtx4.js → chunk-index-4krm48hm.js} +1 -1
- package/dist/{chunk-index-zj0gjcvr.js → chunk-index-4re5prfp.js} +2 -2
- package/dist/chunk-index-57teqgct.js +2 -0
- package/dist/{chunk-index-e2gy763y.js → chunk-index-5ssncptg.js} +2 -2
- package/dist/{chunk-index-20xgx0k2.js → chunk-index-7c9fn21n.js} +2 -2
- package/dist/{chunk-index-p7jkr7gv.js → chunk-index-7k5895sn.js} +5 -5
- package/dist/chunk-index-93f3e06v.js +2 -0
- package/dist/chunk-index-9m9v1p7s.js +2 -0
- package/dist/{chunk-index-3yy10a5h.js → chunk-index-a8c0ap8g.js} +2 -2
- package/dist/chunk-index-a8nqn3y0.js +3 -0
- package/dist/chunk-index-am7ghh75.js +120 -0
- package/dist/{chunk-index-rgf4rvns.js → chunk-index-amspdq2j.js} +3 -3
- package/dist/{chunk-index-s53bxwkk.js → chunk-index-aycxt14t.js} +2 -2
- package/dist/{chunk-index-jc3r4qam.js → chunk-index-bjeg3e2j.js} +2 -2
- package/dist/chunk-index-cttrqfm8.js +2 -0
- package/dist/chunk-index-dajanzxc.js +1 -0
- package/dist/chunk-index-e2eeckhh.js +2 -0
- package/dist/{chunk-index-rsd8rftk.js → chunk-index-e46652wf.js} +2 -2
- package/dist/chunk-index-ek98d2rn.js +2 -0
- package/dist/{chunk-index-n0cmnwd2.js → chunk-index-en5dm1zv.js} +2 -2
- package/dist/{chunk-index-zcfr8jdv.js → chunk-index-evhaaqzk.js} +12 -12
- package/dist/{chunk-index-2syyyjnq.js → chunk-index-f4gqzfkv.js} +2 -2
- package/dist/{chunk-index-3gfbhmpb.js → chunk-index-gj3n4dh5.js} +2 -2
- package/dist/chunk-index-gp4chnp3.js +2 -0
- package/dist/{chunk-index-v9gbt5tz.js → chunk-index-h2a42p6s.js} +3 -3
- package/dist/{chunk-index-zt19fdmc.js → chunk-index-haac6nbt.js} +2 -2
- package/dist/{chunk-index-gwkhs8s3.js → chunk-index-hef4gwtb.js} +2 -2
- package/dist/chunk-index-mg96sqpk.js +2 -0
- package/dist/chunk-index-nsya88fn.js +1 -0
- package/dist/{chunk-index-6cg8xp1c.js → chunk-index-ntt3em2k.js} +1 -1
- package/dist/chunk-index-pcbkp62w.js +2 -0
- package/dist/{chunk-index-5t2jkecy.js → chunk-index-pfs6rm6w.js} +2 -2
- package/dist/{chunk-index-x60n1me6.js → chunk-index-pgxgq61x.js} +2 -2
- package/dist/{chunk-index-s9p27f9b.js → chunk-index-q33ppq0j.js} +3 -3
- package/dist/{chunk-index-fepsbhr6.js → chunk-index-r0hk9kyd.js} +2 -2
- package/dist/{chunk-index-2822z600.js → chunk-index-rr73h4kc.js} +3 -3
- package/dist/{chunk-index-e35v554x.js → chunk-index-rtz4936v.js} +1 -1
- package/dist/chunk-index-smz90j6p.js +2 -0
- package/dist/{chunk-index-c7dbvkrq.js → chunk-index-teyx2hz7.js} +2 -2
- package/dist/{chunk-index-4t6vnwap.js → chunk-index-v6h43553.js} +2 -2
- package/dist/chunk-index-vzqwn3wp.js +2 -0
- package/dist/chunk-index-wt2asefx.js +50 -0
- package/dist/chunk-index-x4tq9btg.js +2 -0
- package/dist/chunk-index-y6p8j3zv.js +2 -0
- package/dist/chunk-index-yvcdg5hh.js +2 -0
- package/dist/{chunk-index-m81362sc.js → chunk-index-zdzzf3fp.js} +1 -1
- package/dist/chunk-index-zeqfnkty.js +2 -0
- package/dist/chunk-index-zpwb8mkk.js +2 -0
- package/dist/chunk-lang-css-avzhvm72.js +1 -0
- package/dist/{chunk-lang-dockerfile-n4bt8jbt.js → chunk-lang-dockerfile-2p7e3ssz.js} +1 -1
- package/dist/{chunk-lang-go-9k4y107e.js → chunk-lang-go-zxp9k517.js} +3 -3
- package/dist/chunk-lang-html-red02gep.js +1 -0
- package/dist/chunk-lang-javascript-n33kmjcx.js +1 -0
- package/dist/{chunk-lang-json-hr12bzs1.js → chunk-lang-json-zmym50rg.js} +1 -1
- package/dist/{chunk-lang-markdown-ttzcpgkg.js → chunk-lang-markdown-ww2kcs85.js} +4 -4
- package/dist/{chunk-lang-python-ntj8maem.js → chunk-lang-python-ng1zdtd4.js} +2 -2
- package/dist/{chunk-lang-rust-gv8y859d.js → chunk-lang-rust-6ynhxjdd.js} +1 -1
- package/dist/{chunk-lang-shell-5zzs09b7.js → chunk-lang-shell-39t9bz2s.js} +1 -1
- package/dist/{chunk-lang-sql-6vmze4pg.js → chunk-lang-sql-w875ejpg.js} +2 -2
- package/dist/{chunk-lang-toml-tt0d4rw9.js → chunk-lang-toml-b8ckgkg5.js} +1 -1
- package/dist/chunk-lang-typescript-qf8acbb2.js +1 -0
- package/dist/{chunk-lang-xml-r2sbqnjv.js → chunk-lang-xml-bz91cjp1.js} +1 -1
- package/dist/{chunk-lang-yaml-ex31qbph.js → chunk-lang-yaml-g9zy0tdv.js} +1 -1
- package/dist/chunk-layout-actions-fyzzzeyp.js +1 -0
- package/dist/chunk-menu-items-yvnk3vds.js +1 -0
- package/dist/chunk-mode-toggle-ccv271hm.js +1 -0
- package/dist/{chunk-note-row-40ypghn9.js → chunk-note-row-314py1pp.js} +3 -3
- package/dist/{chunk-notes-a8nqffbf.js → chunk-notes-4rnrddzw.js} +1 -1
- package/dist/{chunk-notice-bell-rdnfmtf2.js → chunk-notice-bell-z9wgamnz.js} +1 -1
- package/dist/{chunk-notices-tefx93s6.js → chunk-notices-mtn7pg1z.js} +1 -1
- package/dist/{chunk-onboarding-wvh0s3vg.js → chunk-onboarding-f3hhxgg4.js} +1 -1
- package/dist/{chunk-overview-zrx3bpwf.js → chunk-overview-qmepntrr.js} +1 -1
- package/dist/chunk-palette-edkn1ypq.js +1 -0
- package/dist/chunk-placement-items-trsa5t23.js +1 -0
- package/dist/{chunk-profile-tyb48b79.js → chunk-profile-pwfq0wns.js} +1 -1
- package/dist/chunk-prompt-history-xp9hmeqt.js +1 -0
- package/dist/chunk-prompts-a56qvytg.js +1 -0
- package/dist/chunk-room-confirms-gqpkz4h0.js +1 -0
- package/dist/{chunk-room-menu-ha1evv71.js → chunk-room-menu-1m2c2ekt.js} +1 -1
- package/dist/chunk-rooms-menu-button-tcvda1gq.js +1 -0
- package/dist/{chunk-schedules-a5pewkhd.js → chunk-schedules-kwnw7p8v.js} +1 -1
- package/dist/{chunk-seat-menu-eh3ymmks.js → chunk-seat-menu-m2n9nvv0.js} +1 -1
- package/dist/chunk-sheet-hosts-pr8xktyq.js +29 -0
- package/dist/{chunk-shortcut-help-bh9ntk9s.js → chunk-shortcut-help-sbvrds1m.js} +2 -2
- package/dist/{chunk-shortcuts-6em0atk9.js → chunk-shortcuts-8705p7q3.js} +1 -1
- package/dist/{chunk-skill-editor-e43mwz01.js → chunk-skill-editor-7xy09sq1.js} +2 -2
- package/dist/chunk-skills-cnc25x7q.js +1 -0
- package/dist/{chunk-start-over-line-xd1v2p0g.js → chunk-start-over-line-97zdd9pb.js} +2 -2
- package/dist/{chunk-switcher-list-dtfh87zy.js → chunk-switcher-list-ehsn2wsk.js} +1 -1
- package/dist/{chunk-tab-dot-qd640mjr.js → chunk-tab-dot-gkpe06q8.js} +1 -1
- package/dist/chunk-table-av3kh3tt.js +1 -0
- package/dist/{chunk-table2d-5nrhfwft.js → chunk-table2d-5x3jptp9.js} +1 -1
- package/dist/{chunk-table3d-5cb66d99.js → chunk-table3d-rsvajx7r.js} +172 -172
- package/dist/chunk-thread-actions-7xtkegwm.js +1 -0
- package/dist/{chunk-thread-cards-kgt22sbp.js → chunk-thread-cards-grzszfha.js} +1 -1
- package/dist/{chunk-thread-list-j2v1pqkz.js → chunk-thread-list-9bjjac3j.js} +2 -2
- package/dist/{chunk-transcript-a0p3vwh6.js → chunk-transcript-t5szb8r0.js} +1 -1
- package/dist/{chunk-waiting-chip-58ttx9av.js → chunk-waiting-chip-d8b6a0p8.js} +2 -2
- package/dist/chunk-waiting-ts3kxjvv.js +1 -0
- package/dist/chunk-where-3d3ncsa5.js +1 -0
- package/dist/{chunk-workspace-d34njy4p.js → chunk-workspace-ct6hvn0z.js} +2 -2
- package/dist/chunk-zh-tw-v9v1eerm.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 +39 -0
- package/src/app/rooms.ts +30 -2
- package/src/app/routes.ts +26 -2
- package/src/app/skill-group-routes.ts +126 -0
- package/src/authz.ts +1 -0
- package/src/i18n/zh-tw.ts +31 -2
- package/src/push/channel.ts +1 -0
- package/src/web-plugin.ts +1 -0
- package/dist/chunk-account-678dgbww.js +0 -1
- package/dist/chunk-agent-x0yvvdq2.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-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-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-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-sm7kfb07.js +0 -2
- package/dist/chunk-index-sw9r4aa4.js +0 -2
- package/dist/chunk-index-t5bmsqqd.js +0 -1
- 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-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-skills-vp107wrp.js +0 -1
- package/dist/chunk-table-svb2xhfd.js +0 -1
- package/dist/chunk-thread-actions-926eab0w.js +0 -1
- package/dist/chunk-waiting-cdyz7r1g.js +0 -1
- package/dist/chunk-where-9jp6g029.js +0 -1
- package/dist/chunk-zh-tw-y3jb20wc.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,r,t,e,n,l,v,m,k,T,_,re}from"./chunk-index-wt2asefx.js";import{gt}from"./chunk-index-amspdq2j.js";import{R}from"./chunk-index-zdzzf3fp.js";function U(a){let{open:c,load:y}=a,{timeZone:N}=_(),[i,p]=r(),[d,g]=r(),[h,b]=r();o(()=>{if(!c)return;let s=!0;return p(void 0),g(void 0),b(void 0),y().then((f)=>s&&p(f),(f)=>s&&g(l(f))),()=>{s=!1}},[c]);let u=i?.find((s)=>s.id===h);return e(R,{open:c,title:a.title,size:"wide",onClose:a.onClose,children:n("div",{className:"stack history",children:[d?e(m,{message:d}):null,!i&&!d?e(v,{}):null,i?.length===0?e(k,{children:t("No changes have been kept yet.")}):null,i&&i.length>0?e("ul",{className:"menu",children:i.map((s)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":s.id===h,onClick:()=>b(s.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:s.by}),e("span",{className:"meta",children:re(s.at,N)})]}),s.revert?e(T,{children:t("Back to the file version")}):null]})},s.id))}):null,u?n("section",{className:"stack","aria-label":t("This change"),children:[e(gt,{label:t("This change"),before:u.previous,after:u.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>a.onUse(u.text),children:t("Use this text")})})]}):null]})})}export{U as HistorySheet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,Q,S,E,o,L,r,t,u,g,e,n,s,fe,l,f,v,m,k,T,_,re}from"./chunk-index-wt2asefx.js";import{de}from"./chunk-index-cttrqfm8.js";import{gt}from"./chunk-index-amspdq2j.js";import{R}from"./chunk-index-zdzzf3fp.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.")},C=(c)=>t(M[c]??c);var O=S(()=>(p("xp9hmeqt"),import("./chunk-prompt-history-xp9hmeqt.js")).then((c)=>({default:c.HistorySheet}))),Z=S(()=>(p("bhrx9195"),import("./chunk-confirm-bhrx9195.js")).then((c)=>({default:c.Confirm})));function pe(){let{timeZone:c}=_(),[N,i]=r(),[h,w]=r(),[b,x]=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,!N&&!h?e(v,{}):null,N?.length===0?e(k,{children:t("No prompts to edit.")}):null,N?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:C(d.label)}),d.differs?e(T,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(T,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:C(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:re(d.override.at,c)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>x(d.id),children:t("Edit")})})]},d.id)),b?e(q,{id:b,onClose:()=>{x(void 0),P()}}):null]})}function q({id:c,onClose:N}){let[i,h]=r(),[w,b]=r(""),[x,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?C(i.label):t("Main prompts"),size:"full",onClose:N,children:[x?e(m,{message:x}):null,!i&&!x?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(T,{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(Q,{fallback:null,children:e(O,{open:F,title:t("History of {name}",{name:C(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(Q,{fallback:null,children:e(Z,{open:z,title:t("Revert {name} to the file version?",{name:C(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let 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{vr}from"./chunk-index-2ypaqwjy.js";import"./chunk-index-57teqgct.js";import"./chunk-index-y6p8j3zv.js";import"./chunk-index-zdzzf3fp.js";import"./chunk-index-yvcdg5hh.js";import"./chunk-index-smz90j6p.js";import"./chunk-index-teyx2hz7.js";import"./chunk-index-4krm48hm.js";import"./chunk-index-39qq37j5.js";import"./chunk-index-7c9fn21n.js";export{vr as RoomConfirmHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p,r,t,g,e,n,s,x,
|
|
1
|
+
import{p,r,t,g,e,n,s,x,d,_,Ye,$t,we,kt}from"./chunk-index-wt2asefx.js";import{Xe}from"./chunk-index-smz90j6p.js";import"./chunk-index-4krm48hm.js";import{Qt}from"./chunk-index-3tjmyd1h.js";import{R}from"./chunk-index-zdzzf3fp.js";import{en}from"./chunk-index-pcbkp62w.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 $t(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:x("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(s,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(s,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor: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 en(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),$t(a.room,{yolo:!1}).then(()=>m(!1))},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(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("fyzzzeyp"),import("./chunk-layout-actions-fyzzzeyp.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(),Xe({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(s,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(s,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),we({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{P as RoomMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,e,s,d}from"./chunk-index-wt2asefx.js";import"./chunk-index-4krm48hm.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-smz90j6p.js";import{ui}from"./chunk-index-vzqwn3wp.js";import"./chunk-index-gp4chnp3.js";import"./chunk-index-aycxt14t.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)=>ui(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,t,u,e,n,s,x,y,f,v,m,k,T,_,re}from"./chunk-index-
|
|
1
|
+
import{r,t,u,e,n,s,x,y,f,v,m,k,T,_,re}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import{xe}from"./chunk-index-ek98d2rn.js";import"./chunk-index-zdzzf3fp.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 W(){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(T,{children:a.lastStatus}):null]}),n("p",{className:"meta",children:[w(a.recurrence)," ·"," ",t("next {when}",{when:re(a.nextRun,c)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:x("room",a.room),children:a.label}):a.label," ","· ",t("set by {name}",{name:a.createdBy})]})]}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Cancel {title}",{title:a.title}),onClick:()=>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{W as SchedulesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{yn}from"./chunk-index-wt2asefx.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 yn((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,Q,S,E,o,L,C,a,r,t,u,g,e,n,s,X,d,fe,y,l,f,v,m,k,_,Se,bn,qr,ts,we,_i,rs,he,Ji,J,De,Vn}from"./chunk-index-wt2asefx.js";import{zo}from"./chunk-index-mg96sqpk.js";import{D}from"./chunk-index-y6p8j3zv.js";import{uo,Ls,Xs,fo,Is}from"./chunk-index-e2eeckhh.js";import"./chunk-index-smz90j6p.js";import"./chunk-index-yvcdg5hh.js";import"./chunk-index-4krm48hm.js";import{vr}from"./chunk-index-2ypaqwjy.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-zeqfnkty.js";import"./chunk-index-93f3e06v.js";import{Zn}from"./chunk-index-a8nqn3y0.js";import{_n}from"./chunk-index-r0hk9kyd.js";import{cn,Gi,$r,Zi}from"./chunk-index-zpwb8mkk.js";import{de}from"./chunk-index-cttrqfm8.js";import{gt}from"./chunk-index-amspdq2j.js";import{Bt}from"./chunk-index-en5dm1zv.js";import{Qt}from"./chunk-index-3tjmyd1h.js";import{Te}from"./chunk-index-rtz4936v.js";import"./chunk-index-57teqgct.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-zdzzf3fp.js";import"./chunk-index-x4tq9btg.js";import{en}from"./chunk-index-pcbkp62w.js";import{ie,Ae}from"./chunk-index-teyx2hz7.js";import"./chunk-index-gp4chnp3.js";import"./chunk-index-aycxt14t.js";import"./chunk-index-39qq37j5.js";import"./chunk-index-7c9fn21n.js";var We=S(()=>(p("xp9hmeqt"),import("./chunk-prompt-history-xp9hmeqt.js")).then((i)=>({default:i.HistorySheet}))),_e=S(()=>(p("wf02eg0h"),import("./chunk-character-creator-wf02eg0h.js")).then((i)=>({default:i.CharacterCreator}))),Ke=["default","off","minimal","low","medium","high","xhigh"],Ne={default:u("Default"),off:u("Off"),minimal:u("Minimal"),low:u("Low"),medium:u("Medium"),high:u("High"),xhigh:u("Very high")},U="default",Ce=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),Ue=u("Automatic"),pe=(i)=>i==="auto"?t(Ue):t(Ne[i]??i),ke=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??U,thinking:i.thinking??U});function ye(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??U)?{model:h.model}:{},...h.thinking!==(i.thinking??U)?{thinking:h.thinking}:{}}}function Ee(){let i=ts(),h=a(i);if(i)h.current=i;let c=h.current,w=i!==void 0;if(o(()=>{if(!w)return;let M=window.location.href,b=()=>{if(window.location.href!==M)bn()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[w]),!c)return null;return e(R,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:bn,children:e(qe,{name:c.name,opened:c.id},c.name)})}function qe({name:i,opened:h}){let[c,w]=r(),[M,b]=r([]),[H,B]=r(),[x,V]=r(),[P,W]=r(!1),[N,A]=r(!1),[F,O]=r(!1),[j,q]=r(!1),ae=Vn(c?.room??""),Y=a(null),ee=c!==void 0,Z=d((I)=>c?I.rooms[c.room]?.view?.muted===!0:!1,c?.room??""),[oe,K]=r(!1),re=d((I)=>c?I.rooms[c.room]?.view?.coordinator===!0:!1,c?.room??""),te=L(),ne=L(),G=L();o(()=>{if(!ee||!qr()?.look)return;Y.current?.scrollIntoView({block:"start"}),Y.current?.focus({preventScroll:!0})},[ee,h]);let T=a({});T.current={profile:c,draft:x},o(()=>{let I=!0;return Promise.all([y.agent(i),y.models()]).then(([me,Be])=>{if(!I)return;let{profile:be,draft:ce}=T.current,je=be&&ce&&Object.keys(ye(be,ce)).length>0;w(me),b(Be.models),V(je?ce:ke(me))},(me)=>I&&B(l(me))),()=>{I=!1}},[i,h]);let z=C(()=>c&&x?ye(c,x):{},[c,x]);if(H)return e(m,{message:H});if(!c||!x)return e(v,{});let ge=Object.keys(z).length>0,Oe=Array.from(new Set([U,...M,x.model])),ze=Ce(c),ve=async()=>{W(!0);try{let I=await y.updateAgent(i,z);w(I),V(ke(I)),A(!1),f(t("Saved."))}catch(I){f(l(I),"danger")}finally{W(!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:ae,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:G,children:[e("span",{className:"menu-icon",children:e(s,{name:Z?"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:G,checked:!Z,label:t("Notifications"),busy:oe,onChange:async(I)=>{K(!0),await en(c.room,!I),K(!1)}})]})})}),N?e(Je,{profile:c,draft:x,saving:P,onBack:()=>A(!1),onSave:ve}):n("form",{className:"stack form",onSubmit:(I)=>{if(I.preventDefault(),!ge)return;if(z.prompt!==void 0)A(!0);else ve()},children:[n("label",{htmlFor:ne,children:[t("Name"),e("input",{id:ne,value:x.displayName,onChange:(I)=>V({...x,displayName:I.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:te,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>q(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>O(!0),children:[e(Ye,{}),t("Full screen")]})]})]}),e("textarea",{id:te,rows:8,value:x.prompt,onChange:(I)=>V({...x,prompt:I.target.value})})]}),e(Bt,{label:t("Model"),value:x.model,onChange:(I)=>V({...x,model:I}),options:Oe.map((I)=>({value:I,label:I===U?ze:I}))}),e(Bt,{label:t("Thinking level"),value:x.thinking,onChange:(I)=>V({...x,thinking:I}),options:Ke.map((I)=>({value:I,label:t(Ne[I])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ge||P,children:P?t("Saving…"):z.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(Ze,{name:i,opened:h}),n("section",{className:"card stack",ref:Y,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(Q,{fallback:e(v,{}),children:e(_e,{name:c.name,displayName:c.displayName,prompt:c.prompt,character:c.character,onSaved:(I)=>w(I)})})]}),re?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:()=>{bn(),we({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive {name}",{name:c.displayName})})})]}),j?e(Q,{fallback:null,children:e(We,{open:j,title:t("History of the prompt"),load:async()=>(await de.agentPromptHistory(i)).versions.map((I)=>({id:I.id,text:I.text,previous:I.previous,by:I.by,at:I.at})),onUse:(I)=>{V({...x,prompt:I}),q(!1)},onClose:()=>q(!1)})}):null,e(R,{open:F,title:t("Prompt"),size:"full",onClose:()=>O(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:x.prompt,onChange:(I)=>V({...x,prompt:I.target.value})})})]})}function Ze({name:i,opened:h}){let[c,w]=r(),[M,b]=r(),[H,B]=r(),x=L(),V=a(null),P=c!==void 0;if(o(()=>{if(!P||!qr()?.skills)return;V.current?.scrollIntoView({block:"start"}),V.current?.focus({preventScroll:!0})},[P,h]),o(()=>{let A=!0;return ie.skills(i).then((F)=>A&&w(F),(F)=>{if(A&&!(F instanceof fe&&F.status===404))B(l(F))}),()=>{A=!1}},[i,h]),H)return e(m,{message:H});if(!c)return null;let W=()=>ie.skills(i).then(w,(A)=>{f(l(A),"danger")}),N=async(A,F)=>{b(A);try{w(await ie.setSkills(i,F?{add:[A]}:{remove:[A]}))}catch(O){f(l(O),"danger")}finally{b(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),ref:V,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,F)=>{let O=`${x}-${F}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:O,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:O,checked:A.carried,label:A.name,busy:M===A.name,disabled:A.builtin,onChange:(j)=>N(A.name,j)})]})},A.name)})}),e(Xe,{name:i,view:c,onApplied:W})]})}function Xe({name:i,view:h,onApplied:c}){let[w,M]=r(),[b,H]=r(),B=L();if(o(()=>{let N=!0;return de.skillGroups().then((A)=>N&&M(A.groups),()=>{return}),()=>{N=!1}},[]),!w?.length)return null;let x=new Set(h.skills.filter((N)=>N.carried).map((N)=>N.name)),V=new Set(h.skills.filter((N)=>N.builtin).map((N)=>N.name)),P=(N)=>N.skills.filter((A)=>!x.has(A)),W=(N)=>N.skills.filter((A)=>x.has(A)&&!V.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:w.map((N,A)=>{let F=P(N),O=F.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:N.name}),e("span",{className:"meta",children:O?t("Carries all of it."):t("Lacks {count}: {skills}",{count:F.length,skills:F.join(", ")})})]}),e(Qt,{id:`${B}-group-${A}`,checked:O,label:t("Skill group {name}",{name:N.name}),disabled:O&&W(N).length===0,onChange:(j)=>H({group:N,on:j})})]})},N.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:()=>H(void 0),onConfirm:async()=>{if(!b)return;let{added:N,removed:A}=await de.applySkillGroup(b.group.name,i,b.on);f(N.length?t("Switched on: {skills}",{skills:N.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:P(b.group).join(", ")}):t("{agent} will no longer carry: {skills}.",{agent:i,skills:W(b.group).join(", ")}):null})})]})}var Ye=()=>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 Je(i){let{profile:h,draft:c}=i,w=a(null);o(()=>w.current?.focus(),[]);let M=[];if(c.displayName!==h.displayName)M.push({label:t("Name"),before:h.displayName,after:c.displayName});let b=(H)=>H===U?Ce(h):H;if(c.model!==(h.model??U))M.push({label:t("Model"),before:b(h.model??U),after:b(c.model)});if(c.thinking!==(h.thinking??U))M.push({label:t("Thinking level"),before:pe(h.thinking??U),after:pe(c.thinking)});return n("section",{ref:w,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),M.length?e("ul",{className:"review-fields",children:M.map((H)=>n("li",{children:[e("strong",{children:H.label}),e("span",{className:"review-before",children:H.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:H.after})]},H.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 Qe=300000;function Me(){let i=Xs(),[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:Ls,children:e(et,{room:h.room,until:h.until},`${h.room}:${h.until}`)})}function et(i){se("archived-log",".archived-log .messages { padding: 0; }");let{timeZone:h}=_(),c=De(),[w,M]=r(),[b,H]=r(!1),[B,x]=r(),[V,P]=r(!1),{room:W,until:N}=i;o(()=>{let F=!0;return uo.page(W,N).then((O)=>{if(!F)return;M(O.messages),H(O.more)},(O)=>{if(F)x(l(O))}),()=>{F=!1}},[W,N]);let A=async()=>{let F=w?.[0];if(!F||V)return;P(!0);try{let O=await uo.page(W,N,F.id);M((j)=>[...O.messages,...j??[]]),H(O.more)}catch(O){x(l(O))}P(!1)};if(B)return e(m,{message:B});if(!w)return e(v,{});if(w.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:V,onClick:A,children:V?t("Loading…"):t("Load earlier messages")}):null,e("ol",{className:"messages",children:w.map((F,O)=>{let j=w[O-1],q=!j||j.kind!==F.kind||j.author!==F.author||Date.parse(F.at)-Date.parse(j.at)>Qe;return e(Ji,{message:F,character:F.agent?c[F.agent]:void 0,header:q,enter:!1,unread:!1,timeZone:h,quotable:!1},F.id)})})]})}var tt=`
|
|
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 xe(){let i=Is(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return se("select-text",tt),n(R,{open:i!==void 0,title:t("Select text"),size:"full",onClose:fo,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:fo,children:t("Close")}),e("button",{type:"button",onClick:()=>Zn(h.text),children:t("Copy all")})]})]})}function nt(i){let h=i.filter((M)=>M.parent!==void 0),c=i.filter((M)=>M.parent===void 0),w=new Set(c.map((M)=>M.name));return[...c.flatMap((M)=>[M,...h.filter((b)=>b.parent===M.name)]),...h.filter((M)=>!w.has(M.parent??""))]}function Le(){let[i,h]=r(),[c,w]=r(),[M,b]=r(),[H,B]=r(),x=E(async()=>{try{h((await ie.archive()).entries),w(void 0)}catch(P){w(l(P))}},[]);o(()=>{x()},[x]);let V=async(P)=>{b(P.name);try{if(P.kind==="agent")await ie.restoreAgent(P.name);else await ie.restoreGroup(P.name);await Ae(),f(t("Restored {name}.",{name:P.displayName})),await x()}catch(W){f(l(W),"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:nt(i).map((P)=>n("li",{className:"menu-item","data-helper":P.parent??void 0,style:P.parent?{paddingLeft:"var(--space-6)"}:void 0,children:[e("span",{className:"menu-icon",children:e(s,{name:P.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:P.displayName}),n("span",{className:"meta",children:[P.parent?t("Temp knight of {name}",{name:P.parent}):P.kind==="agent"?t("Knight"):t("Group")," ","· ",P.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:M===P.name,onClick:()=>V(P),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:M===P.name,onClick:()=>B(P),children:t("Delete")})]},`${P.kind}:${P.name}`))}),e(D,{open:H!==void 0,title:t("Delete {name}?",{name:H?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>B(void 0),onConfirm:async()=>{if(!H)return;if(H.kind==="agent")await ie.deleteAgent(H.name);else await ie.deleteGroup(H.name);await Ae(),f(t("Deleted {name}.",{name:H.displayName})),await x()},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:H?.displayName??""})})})]})}var Ie=/^[a-z0-9-]{1,32}$/,He=2,Pe=8,le="\x00";function at(){let i=d((h)=>h.order.flatMap((c)=>{let w=h.rooms[c]?.view;return w?.kind==="agent"&&!w.helper?[`${w.name}${le}${w.displayName}`]:[]}).join(`${le}${le}`));return C(()=>i===""?[]:i.split(`${le}${le}`).map((h)=>{let[c="",w=""]=h.split(le);return{name:c,displayName:w}}),[i])}function Re(i){let h=at(),[c,w]=r(),[M,b]=r(),[H,B]=r(""),[x,V]=r(""),[P,W]=r(!1),[N,A]=r([]),[F,O]=r(""),[j,q]=r(!1),[ae,Y]=r(i.name===void 0),ee=L(),Z=L();o(()=>{let G=i.name;if(G===void 0)return;let T=!0;return ie.group(G).then((z)=>{if(!T)return;w(z),B(z.displayName),A(z.members),O(z.host),Y(!0)},(z)=>T&&b(l(z))),()=>{T=!1}},[i.name]);let oe=(G)=>h.find((T)=>T.name===G)?.displayName??G,K=N.includes(F)?F:N[0]??"",re=c===void 0?!0:H.trim()!==c.displayName||N.join(",")!==c.members.join(",")||K!==c.host,te=H.trim()!==""&&N.length>=He&&N.length<=Pe&&(c!==void 0||Ie.test(x));if(M&&!ae)return e(m,{message:M});if(!ae)return e(v,{});let ne=async()=>{q(!0),b(void 0);try{if(c){await ie.updateGroup(c.name,{...H.trim()!==c.displayName?{displayName:H.trim()}:{},...N.join(",")!==c.members.join(",")?{members:N}:{},...K!==c.host?{host:K}:{}}),await Ae(),f(t("Saved.")),i.onDone();return}let G=await ie.createGroup({name:x,displayName:H.trim(),members:N,host:K});await Ae(),f(t("Made {name}.",{name:G.displayName})),i.onDone(),X("room",G.room)}catch(G){b(l(G))}finally{q(!1)}};return n("form",{className:"stack form",onSubmit:(G)=>{if(G.preventDefault(),te&&re&&!j)ne()},children:[n("label",{htmlFor:ee,children:[t("Name"),e("input",{id:ee,value:H,autoComplete:"off",onChange:(G)=>{if(B(G.target.value),!c&&!P)V(G.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),c?null:n("label",{htmlFor:Z,children:[t("Permanent name"),e("input",{id:Z,value:x,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":x!==""&&!Ie.test(x),onChange:(G)=>{W(!0),V(G.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((G)=>{let T=N.includes(G.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:T,disabled:!T&&N.length>=Pe,onChange:()=>A(T?N.filter((z)=>z!==G.name):[...N,G.name])}),e("span",{className:"menu-text",children:e("strong",{children:G.displayName})})]})},G.name)})})]}),N.length>=He?e(Bt,{label:t("Host"),value:K,onChange:O,options:N.map((G)=>({value:G,label:oe(G)}))}):null,M?e(m,{message:M}):null,n("div",{className:"actions",children:[c?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),we({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!te||!re||j,children:j?t("Saving…"):c?t("Save"):t("Make group")})]})]})}var ot=S(()=>(p("wf02eg0h"),import("./chunk-character-creator-wf02eg0h.js")).then((i)=>({default:i.CharacterCreator}))),$e=/^[a-z0-9-]{1,32}$/,ue="default";function st(i){let h=[];for(let c of i){let w=c.indexOf("/"),M=w>0?c.slice(0,w):"",b=h.find((H)=>H.provider===M&&M!=="");if(b)b.models.push(c);else h.push({provider:M,models:[c]})}return h}var rt=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Fe({onDone:i}){let[h,c]=r(""),[w,M]=r(""),[b,H]=r(!1),[B,x]=r(""),[V,P]=r(ue),[W,N]=r(""),[A,F]=r(),[O,j]=r(!1),[q,ae]=r([]),[Y,ee]=r(),[Z,oe]=r(!1),K=[L(),L(),L(),L(),L()];o(()=>{let T=!0;return y.models().then((z)=>T&&ae(z.models),()=>{return}),()=>{T=!1}},[]);let re=C(()=>_n({name:w,displayName:h,prompt:B}),[w,h,B]),te=A?.spec??re,ne=$e.test(w)&&h.trim()!==""&&B.trim()!=="";if(O)return e(Q,{fallback:e(v,{}),children:e(ot,{name:w||"new",displayName:h,prompt:B,character:te,onPick:(T,z)=>{F({input:T,spec:z}),j(!1)},onCancel:()=>j(!1)})});let G=async()=>{oe(!0),ee(void 0);try{let T={name:w,displayName:h.trim(),prompt:B,...V!==ue?{model:V}:{},...W.trim()?{task:W.trim()}:{},...A?{character:A.input}:{}},z=await ie.createAgent(T);await Ae(),f(t("Made {name}.",{name:z.displayName})),i(),X("room",z.room)}catch(T){ee(T instanceof fe&&T.field?`${T.field}: ${l(T)}`:l(T))}finally{oe(!1)}};return n("form",{className:"stack form",onSubmit:(T)=>{if(T.preventDefault(),ne&&!Z)G()},children:[n("label",{htmlFor:K[0],children:[t("Name"),e("input",{id:K[0],value:h,autoComplete:"off",onChange:(T)=>{if(c(T.target.value),!b)M(rt(T.target.value))}})]}),n("label",{htmlFor:K[1],children:[t("Permanent name"),e("input",{id:K[1],value:w,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":w!==""&&!$e.test(w),onChange:(T)=>{H(!0),M(T.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:K[2],children:[t("Prompt"),e("textarea",{id:K[2],rows:6,value:B,onChange:(T)=>x(T.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:K[4],children:[t("Model"),n(Te,{id:K[4],value:V,onChange:(T)=>P(T.target.value),children:[e("option",{value:ue,children:t("Default model")}),st(q).map((T)=>T.provider===""?T.models.map((z)=>e("option",{value:z,children:z},z)):e("optgroup",{label:T.provider,children:T.models.map((z)=>e("option",{value:z,children:z},z))},T.provider))]})]}),n("label",{htmlFor:K[3],children:[t("Opening task"),e("textarea",{id:K[3],rows:3,value:W,onChange:(T)=>N(T.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:te,name:w||"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:()=>j(!0),children:t("Choose a look")})]})]}),Y?e(m,{message:Y}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ne||Z,children:Z?t("Making…"):t("Make knight")})})]})}var it=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Ge(){let i=rs(),h=a(i);if(i)h.current=i;let c=h.current,w=i!==void 0;if(o(()=>{if(!w)return;let M=window.location.href,b=()=>{if(window.location.href!==M)_i()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[w]),!c)return null;return e(R,{open:i!==void 0,title:it(c),size:"wide",onClose:_i,children:e("div",{className:"stack agent-sheet",children:c.kind==="new-agent"?e(Fe,{onDone:_i}):c.kind==="archive"?e(Le,{}):e(Re,{...c.name===void 0?{}:{name:c.name},onDone:_i})},c.id)})}function Ve(){let i=$r(),h=a(!1);if(i)h.current=!0;return h.current?e(lt,{open:i}):null}function lt({open:i}){let h=_(),{now:c}=J(),w=d((b)=>cn(b).map(({id:H,card:B})=>{let x=b.rooms[B.room]?.view,V=x?.parent?b.rooms[x.parent]?.view:void 0;return{id:H,room:V?`${V.displayName} › ${x?.displayName??""}`:x?.displayName??B.room,title:B.frame.title,at:B.frame.at}})),M=w.length===0;return o(()=>{if(i&&M)Gi()},[i,M]),e(R,{open:i&&!M,title:t("Cards waiting"),onClose:Gi,children:e("ul",{className:"waiting-list",children:w.map((b)=>e("li",{children:n("button",{type:"button",onClick:()=>Zi(b.id),children:[e("strong",{children:b.title}),n("span",{className:"meta",children:[b.room,b.at?` · ${Se(b.at,c,h.timeZone)}`:""]})]})},b.id))})})}var mt=S(()=>(p("sbvrds1m"),import("./chunk-shortcut-help-sbvrds1m.js")));function ct(){let i=zo(),h=a(!1);if(i)h.current=!0;if(!h.current)return null;return e(Q,{fallback:null,children:e(mt,{open:i})})}function ha(){return n(g,{children:[e(vr,{}),e(Ee,{}),e(Ge,{}),e(Me,{}),e(xe,{}),e(Ve,{}),e(ct,{})]})}export{ha as SheetHosts};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t,e,n}from"./chunk-index-
|
|
1
|
+
import{t,e,n}from"./chunk-index-wt2asefx.js";import{si,Do}from"./chunk-index-mg96sqpk.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-zdzzf3fp.js";var l=`
|
|
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-cn49mawx.js";import{ii,zo}from"./chunk-index-5va
|
|
|
23
23
|
text-align: center;
|
|
24
24
|
font-size: var(--text-sm);
|
|
25
25
|
}
|
|
26
|
-
`;function r(){let o=
|
|
26
|
+
`;function r(){let o=Do(),s=o?"⌥":"Alt",a=o?"⌘":"Ctrl";return[{keys:[s,"↑"],label:t("Previous room")},{keys:[s,"↓"],label:t("Next room")},{keys:[s,"Shift","↑"],label:t("Previous room with unread messages")},{keys:[s,"Shift","↓"],label:t("Next room with unread messages")},{keys:[a,"K"],label:t("Find a room")},{keys:["Esc"],label:t("Close the open menu or sheet, or leave the message box")},{keys:["?"],label:t("Show these shortcuts")}]}function i({open:o}){return se("shortcut-help",l),e(R,{open:o,title:t("Keyboard shortcuts"),onClose:si,children:n("div",{className:"stack",children:[e("dl",{className:"shortcut-list",children:r().map((s)=>n("div",{style:{display:"contents"},children:[e("dt",{children:s.keys.map((a)=>e("kbd",{children:a},a))}),e("dd",{children:s.label})]},s.label))}),e("p",{className:"meta",children:t("In a message box the arrow shortcuts switch rooms only when it is empty or the caret is at its very start (up) or very end (down).")})]})})}export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bi,x,X,Re,O,ot,wt}from"./chunk-index-wt2asefx.js";import{wr}from"./chunk-index-nsya88fn.js";import{go}from"./chunk-index-hef4gwtb.js";import{Xo,si,Io}from"./chunk-index-mg96sqpk.js";import{st}from"./chunk-index-7c9fn21n.js";function m(e,t){let{collapsed:o,expanded:r,current:s}=t,n=st(e,t.at),a=[],c=(i,d)=>{a.push({key:i,shown:d});let f=n.threads[i];if(!f)return;for(let l of f.open)a.push({key:l,shown:d});for(let l of f.closed)a.push({key:l,shown:d&&(r.has(l)||l===s)})};for(let i of n.home)c(i,!0);for(let i of n.pinned)c(i,!0);for(let i of n.folders){let d=!o.has(i.id)||s!==void 0&&i.rooms.includes(s);for(let f of i.rooms)c(f,d)}let u=n.folders.length>0?n.rest:[...n.restAgents,...n.restGroups];for(let i of u)c(i,!0);let{orphans:p}=n;for(let i of p.open)a.push({key:i,shown:!0});for(let i of p.closed)a.push({key:i,shown:r.has(i)||i===s});return a}function y(e,t,o,r){let s=o===1?-1:e.length;if(t!==void 0){if(s=e.findIndex((n)=>n.key===t),s<0)return}for(let n=s+o;n>=0&&n<e.length;n+=o){let a=e[n];if(a&&r(a))return a.key}return}var g=new Set(["","text","search","url","tel","email","password","number","date","datetime-local","month","time","week"]);function h(e){if(!(e instanceof HTMLElement))return;if(e instanceof HTMLTextAreaElement)return e;if(e instanceof HTMLSelectElement)return e;if(e instanceof HTMLInputElement)return g.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function E(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:n,selectionEnd:a}=e;if(n===null||a===null||n!==a)return!1;return t?n===0:n===e.value.length}if((e.textContent??"")==="")return!0;let o=window.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;let r=o.getRangeAt(0),s=document.createRange();if(s.selectNodeContents(e),t)s.setEnd(r.startContainer,r.startOffset);else s.setStart(r.endContainer,r.endOffset);return s.toString()===""}function b(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 o=t==="ArrowUp",r=h(e.target);if(r&&!E(r,o))return;if(e.shiftKey)return o?"previous-unread":"next-unread";return o?"previous":"next"}if(t==="?"&&!e.ctrlKey&&!e.metaKey&&!e.repeat)return h(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 S=()=>document.querySelector('dialog[open], .action-popover, .switcher:not([data-state="closed"])')!==null;function w(e,t=12){let o=x("room",e),r=[...document.querySelectorAll('.room-row[aria-current="page"], .thread-link[aria-current="page"]')].find((s)=>s.getAttribute("href")===o);if(r)r.scrollIntoView?.({block:"nearest"});else if(t>0)requestAnimationFrame(()=>w(e,t-1))}function T(e,t){let o=O.getState(),r=bi(),s=r.pane==="room"?r.key:void 0,n=m(o,{at:(u)=>Re(o,u),collapsed:wr(),expanded:k(),current:s});if(r.pane==="room"&&!n.some((u)=>u.key===s))return;let c=y(n,s,e,t?(u)=>go(u.key)>0:(u)=>u.shown);if(c===void 0)return;X("room",c),w(c)}function v(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&&g.has(t.type))e.preventDefault(),t.blur()}function H(e,t){switch(e){case"escape":v(t);break;case"help":if(t.preventDefault(),Io())si();else if(!S())Xo();break;default:if(S())break;t.preventDefault(),T(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function U(){let e=(t)=>{let o=b(t);if(o)H(o,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{U as startShortcuts};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{p,Q,S,o,
|
|
1
|
+
import{p,Q,S,o,L,r,t,g,e,n,s,fe,l,f,v,m}from"./chunk-index-wt2asefx.js";import{de}from"./chunk-index-cttrqfm8.js";import{gt}from"./chunk-index-amspdq2j.js";import{R}from"./chunk-index-zdzzf3fp.js";var M=S(()=>(p("xp9hmeqt"),import("./chunk-prompt-history-xp9hmeqt.js")).then((d)=>({default:d.HistorySheet}))),B=`---
|
|
2
2
|
name: my-skill
|
|
3
3
|
description: "Use when "
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# My skill
|
|
7
7
|
|
|
8
|
-
`;function _(
|
|
8
|
+
`;function _(d){let{name:u}=d,[i,w]=r(),[h,b]=r(u?"":B),[y,I]=r(),[z,k]=r(!1),[C,x]=r(!1),[A,D]=r(!1),[H,N]=r(!1),T=L();o(()=>{if(!u)return;let a=!0;return de.skillDocument(u).then((c)=>{if(!a)return;w(c),b(c.text)},(c)=>a&&I(l(c))),()=>{a=!1}},[u]);let E=i?.text??"",U=h!==E,F=u!==void 0&&!i&&!y,V=async()=>{x(!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{x(!1)}};return n(R,{open:!0,title:u??t("New skill"),size:"full",onClose:d.onClose,children:[y?e(m,{message:y}):null,F?e(v,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!F&&!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")}),A?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:E,after:h}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>k(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:C,onClick:V,children:C?t("Saving…"):i?t("Save"):t("Create skill")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:T,children:"SKILL.md"}),i?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>N(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:T,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:!U||!h.trim(),onClick:()=>k(!0),children:t("Review changes")})})]}),H&&i?e(Q,{fallback:null,children:e(M,{open:H,title:t("History of {name}",{name:i.name}),load:async()=>{let{versions:a}=await de.skillHistory(i.name);return a.map((c,K)=>({id:c.id,text:c.text,previous:a[K+1]?.text??"",by:c.by,at:c.at}))},onUse:(a)=>{b(a),k(!1),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,Xr,Q,S,o,r,t,g,e,n,s,y,l,f,v,m,k,T,Zt,Et}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import{on}from"./chunk-index-2dhrqvba.js";import{xe}from"./chunk-index-ek98d2rn.js";import{de}from"./chunk-index-cttrqfm8.js";import{ne}from"./chunk-index-57teqgct.js";import"./chunk-index-zdzzf3fp.js";function x({source:a}){return e("div",{className:"prose document",children:e(Zt,{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}=on(()=>de.skillGroups()),[w,u]=r(),[N,V]=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:()=>V(b),children:t("Delete")})]}),e("p",{children:b.description}),n("p",{className:"hint",children:[t("Skills"),": ",b.skills.join(", ")||t("None")]})]},b.name)),e(ne,{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:()=>V(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??[]),[V,h]=r(),[b,G]=r(!1);return n("form",{className:"stack",onSubmit:async(E)=>{E.preventDefault(),G(!0),h(void 0);try{let L=a.group?.name;await de.saveSkillGroup(i.trim(),{description:c,skills:[...a.catalog.map((F)=>F.name).filter((F)=>u.includes(F)),...u.filter((F)=>!a.catalog.some((z)=>z.name===F))],...L?{from:L}:{}}),f(t("Saved {name}.",{name:i.trim()})),a.onDone()}catch(L){h(l(L))}finally{G(!1)}},autoComplete:"off",children:[n("label",{children:[t("Name"),e("input",{value:i,maxLength:64,placeholder:"coding",required:!0,onChange:(E)=>d(E.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:(E)=>w(E.target.value)})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Skills")}),e("ul",{className:"menu",children:a.catalog.map((E)=>{let L=u.includes(E.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:L,onChange:()=>N(L?u.filter((F)=>F!==E.name):[...u,E.name])}),n("span",{className:"menu-text",children:[e("strong",{children:E.name}),E.description?e("span",{className:"meta",children:E.description}):null]})]})},E.name)})})]}),V?e(m,{message:V}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:b,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:b,children:t("Save group")})]})]})}var I=S(()=>(p("7xy09sq1"),import("./chunk-skill-editor-7xy09sq1.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,V]=r(),[h,b]=r();o(()=>{y.session().then(u,()=>{return})},[]);let G=w?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),G?n("button",{type:"button",className:"secondary",onClick:()=>V({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:G?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((C)=>e(R,{skill:C,onEdit:G&&C.source.kind==="written"?()=>V({name:C.name}):void 0,onDelete:G&&C.source.kind==="written"?()=>b(C):void 0},`${C.name}:${a}`)),G?e(B,{catalog:d??[],onChanged:()=>i((C)=>C+1)}):null,N?e(Q,{fallback:null,children:e(I,{name:N.name,onSaved:()=>i((C)=>C+1),onClose:()=>V(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((C)=>C+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(),[V,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(T,{children:b}),a.missing?e(T,{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((G)=>h(l(G)))},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(ne,{open:c,title:a.name,size:"wide",onClose:()=>w(!1),children:V?e(m,{message:V}):!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(Xr,{children:[e("dt",{children:c.key}),e("dd",{children:c.value})]},c.key))}):null,e(x,{source:i.body})]})}export{ye as SkillsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t,g,e,n,s,
|
|
1
|
+
import{t,g,e,n,s,d}from"./chunk-index-wt2asefx.js";import{Ns}from"./chunk-index-e2eeckhh.js";import{se}from"./chunk-index-amxa2bn3.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,l}from"./chunk-index-cn49mawx.js";import{Ls}from"./chunk-index-
|
|
|
13
13
|
margin-top: var(--space-6);
|
|
14
14
|
font-size: var(--text-sm);
|
|
15
15
|
}
|
|
16
|
-
`;function
|
|
16
|
+
`;function p(a){se("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:()=>Ns(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,K,g,e,n,s,x,
|
|
1
|
+
import{C,a,r,t,K,g,e,n,s,x,X,Ke,Re,d,ot,Yt,vn,Je,Ue,Ht}from"./chunk-index-wt2asefx.js";import{pi}from"./chunk-index-2s4bkrz3.js";import{di,fi}from"./chunk-index-q33ppq0j.js";import{hi}from"./chunk-index-gj3n4dh5.js";import{Ft}from"./chunk-index-4eag6s50.js";import{Ws}from"./chunk-index-7c9fn21n.js";di();function v(){let l=d((c)=>JSON.stringify(Ws(c,(o)=>Re(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=pi(),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=Ft(()=>Yt(m,l.onLeave),l.liftable&&!o?.home?fi(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:x("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(Ht,{room:m}),c?e("span",{className:"badge badge-warn",children:K(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 U(l){let[m,p]=r(""),f=v(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>hi(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)=>vn(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{U as SwitcherList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O,
|
|
1
|
+
import{O,as,qn}from"./chunk-index-wt2asefx.js";import{mo,Oo}from"./chunk-index-hef4gwtb.js";import{Yi,Yo}from"./chunk-index-35zqk1zr.js";import"./chunk-index-e46652wf.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=()=>Yi().badge+Oo(),a=()=>as(s());g({count:()=>qn(O.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};O.subscribe(t),Yo(t),mo(t)},render:m}),a()}export{T as startPageTabDot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ke,o,r,t,e,n,s,X,d,rt}from"./chunk-index-wt2asefx.js";import{Ii,An,ai,Uo,li,ci,$n,Di,Ui,xr}from"./chunk-index-am7ghh75.js";import"./chunk-index-haac6nbt.js";import"./chunk-index-4jnn2g09.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-zeqfnkty.js";import"./chunk-index-zdzzf3fp.js";import{gs,Mi,Os}from"./chunk-index-x4tq9btg.js";Ii();function v(){return Uo((ke(rt)?.kinds??[]).map((a)=>a.kind)),null}function N({focus:a}){let[l,b]=r(),u=li(void 0),i=An(),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($n,{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=Mi(),b=gs(),u=d((y)=>y.listed),i=Os(l,b,a),p=ci(),{ask:m,sheet:c}=Ui(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(xr,{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(Di,{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 ai()?e(N,{focus:a}):e(C,{named:a})}export{F as TablePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn,Mr,Rr,Mt,an,ln,mi,Zo}from"./chunk-index-4re5prfp.js";import"./chunk-index-zeqfnkty.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=Nn(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}=Zo(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=Nn(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()},ln)}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(),an)}},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(mi(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};
|