pi-roundtable-web 0.26.3 → 0.27.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 +29 -0
- package/README.md +18 -11
- package/dist/chunk-account-1ecx5kt7.js +1 -0
- package/dist/chunk-action-menu-zh2n0ahf.js +1 -0
- package/dist/chunk-agent-ynm2tcbx.js +1 -0
- package/dist/chunk-arranged-rooms-qnz8vese.js +1 -0
- package/dist/chunk-bulk-actions-pr0mw0kc.js +1 -0
- package/dist/chunk-character-creator-caj4pmg4.js +1 -0
- package/dist/{chunk-codeeditor-6xavqntt.js → chunk-codeeditor-dga6s78p.js} +2 -2
- package/dist/chunk-confirm-g76v5d9r.js +1 -0
- package/dist/{chunk-connectors-7xqsg5q5.js → chunk-connectors-j79ze3j1.js} +1 -1
- package/dist/{chunk-conversations-zc4mv6vj.js → chunk-conversations-2farn72g.js} +1 -1
- package/dist/chunk-council-sheet-s9sz1bzf.js +2 -0
- package/dist/{chunk-drag-0mefcvp3.js → chunk-drag-45e8222r.js} +1 -1
- package/dist/chunk-entry-q11n47h9.js +1 -0
- package/dist/chunk-folder-list-4gcj7g7h.js +1 -0
- package/dist/chunk-folds-ten4ykfw.js +1 -0
- package/dist/{chunk-gate-86r8a2vf.js → chunk-gate-kcv1a4t0.js} +1 -1
- package/dist/chunk-group-scene-12ghcvzd.js +1 -0
- package/dist/chunk-group-table-t458kdgn.js +1 -0
- package/dist/chunk-host-icons-h1k9k96a.js +1 -0
- package/dist/chunk-host-picture-3p0wzn3v.js +1 -0
- package/dist/chunk-host-state-7mdve7cb.js +1 -0
- package/dist/chunk-host-ui-bdgwa6sf.js +1 -0
- package/dist/chunk-index-02vfshtt.js +2 -0
- package/dist/chunk-index-0a81da8z.js +2 -0
- package/dist/{chunk-index-8eexybcx.js → chunk-index-0w4bfjb5.js} +2 -2
- package/dist/{chunk-index-1fn8q4ps.js → chunk-index-12zyshae.js} +2 -2
- package/dist/chunk-index-18pgxxw3.js +2 -0
- package/dist/chunk-index-2e4am3hw.js +50 -0
- package/dist/{chunk-index-agrvqf5b.js → chunk-index-2fdns8tn.js} +2 -2
- package/dist/{chunk-index-84wbc80d.js → chunk-index-2t30xwed.js} +2 -2
- package/dist/{chunk-index-jq970hsd.js → chunk-index-31x6krbs.js} +3 -3
- package/dist/{chunk-index-eh0wb6g0.js → chunk-index-3d8s3565.js} +2 -2
- package/dist/chunk-index-5bfqek1d.js +2 -0
- package/dist/chunk-index-64rsz6pf.js +2 -0
- package/dist/chunk-index-6bkcq9ka.js +2 -0
- package/dist/{chunk-index-47yspxa4.js → chunk-index-8d81qy69.js} +1 -1
- package/dist/chunk-index-92zgb7my.js +2 -0
- package/dist/chunk-index-aamhjg5n.js +2 -0
- package/dist/{chunk-index-r1v895tj.js → chunk-index-ac1ktr56.js} +2 -2
- package/dist/{chunk-index-hc0dgmrs.js → chunk-index-ak6ecqy3.js} +2 -2
- package/dist/{chunk-index-eyc2rkq5.js → chunk-index-b73y2gc0.js} +2 -2
- package/dist/chunk-index-b8cpvr7y.js +2 -0
- package/dist/{chunk-index-3aa5czxj.js → chunk-index-bhqczxr3.js} +2 -2
- package/dist/{chunk-index-6c8mewwy.js → chunk-index-cbqhzf40.js} +12 -12
- package/dist/chunk-index-cdctnw71.js +2 -0
- package/dist/chunk-index-dj0tbfyb.js +2 -0
- package/dist/chunk-index-dnjftvtq.js +2 -0
- package/dist/chunk-index-e2dqjde8.js +1 -0
- package/dist/{chunk-index-tsxsy4qs.js → chunk-index-ebg48jgy.js} +2 -2
- package/dist/{chunk-index-rcxz5w5d.js → chunk-index-ek5mek4j.js} +3 -3
- package/dist/chunk-index-f6q0stqx.js +2 -0
- package/dist/{chunk-index-67p2sc14.js → chunk-index-ffbrm6tr.js} +3 -3
- package/dist/chunk-index-g1awv7rk.js +2 -0
- package/dist/chunk-index-g3wrs02w.js +1 -0
- package/dist/chunk-index-j0m16cj1.js +2 -0
- package/dist/chunk-index-j4kk1m59.js +2 -0
- package/dist/chunk-index-j4x9dq30.css +1 -0
- package/dist/{chunk-index-3wbyq10m.js → chunk-index-jgzygbt8.js} +1 -1
- package/dist/chunk-index-kb3w11mn.js +7 -0
- package/dist/{chunk-index-raf772z6.js → chunk-index-kbrg32sx.js} +2 -2
- package/dist/chunk-index-msqhgvfx.js +2 -0
- package/dist/chunk-index-pefwfm26.js +2 -0
- package/dist/chunk-index-pyfx77cj.js +2 -0
- package/dist/{chunk-index-30vw4nhh.js → chunk-index-q7g62sgm.js} +3 -3
- package/dist/chunk-index-qfgkfq86.js +2 -0
- package/dist/chunk-index-rh0x9rzf.js +2 -0
- package/dist/{chunk-index-m65cv329.js → chunk-index-sm7m4fej.js} +2 -2
- package/dist/chunk-index-sv9qpmhv.js +1 -0
- package/dist/chunk-index-t998yg8y.js +2 -0
- package/dist/{chunk-index-e90kztkx.js → chunk-index-tk4se135.js} +3 -3
- package/dist/chunk-index-v6smgw77.js +2 -0
- package/dist/chunk-index-w42rcbx1.js +2 -0
- package/dist/chunk-index-x4enmj72.js +2 -0
- package/dist/chunk-index-xq84gg8w.js +2 -0
- package/dist/{chunk-index-gt42wjby.js → chunk-index-xxeb2xp0.js} +3 -3
- package/dist/{chunk-index-hczrjnky.js → chunk-index-zyvwhxga.js} +1 -1
- package/dist/chunk-lang-css-y9133ktr.js +1 -0
- package/dist/{chunk-lang-dockerfile-tjxsnhr9.js → chunk-lang-dockerfile-cnwqn660.js} +1 -1
- package/dist/{chunk-lang-go-drmfa25k.js → chunk-lang-go-yy6kgsxv.js} +2 -2
- package/dist/chunk-lang-html-r2xmryek.js +1 -0
- package/dist/chunk-lang-javascript-1r6wd177.js +1 -0
- package/dist/{chunk-lang-json-790swysy.js → chunk-lang-json-dx56g11y.js} +1 -1
- package/dist/{chunk-lang-markdown-483dkxcq.js → chunk-lang-markdown-fpcf2dfq.js} +5 -5
- package/dist/{chunk-lang-python-v9s40bzj.js → chunk-lang-python-zzp95955.js} +2 -2
- package/dist/{chunk-lang-rust-z4gry1bf.js → chunk-lang-rust-214fh7sp.js} +1 -1
- package/dist/{chunk-lang-shell-egsvk8rj.js → chunk-lang-shell-1rpgtepw.js} +1 -1
- package/dist/{chunk-lang-sql-75j3denr.js → chunk-lang-sql-vvp46hpj.js} +2 -2
- package/dist/{chunk-lang-toml-7dbjvhex.js → chunk-lang-toml-tbj7467c.js} +1 -1
- package/dist/chunk-lang-typescript-y5w4tt4g.js +1 -0
- package/dist/{chunk-lang-xml-jg1sv4h2.js → chunk-lang-xml-tbcqmedk.js} +1 -1
- package/dist/{chunk-lang-yaml-g3v7s5je.js → chunk-lang-yaml-jh56t3sv.js} +1 -1
- package/dist/chunk-layout-actions-y73mpsh1.js +1 -0
- package/dist/chunk-menu-items-bza16bw6.js +2 -0
- package/dist/chunk-mode-toggle-nj9gnt3b.js +1 -0
- package/dist/chunk-note-row-6fmhrdng.js +75 -0
- package/dist/chunk-notes-wv0e6ssf.js +1 -0
- package/dist/{chunk-notice-bell-jehad6sx.js → chunk-notice-bell-9z27epd2.js} +1 -1
- package/dist/{chunk-notices-prqkv7ge.js → chunk-notices-fte9f196.js} +1 -1
- package/dist/chunk-onboarding-c5twahc3.js +1 -0
- package/dist/{chunk-overview-2j1s6kqg.js → chunk-overview-k4ccprax.js} +1 -1
- package/dist/{chunk-palette-4qt6ewem.js → chunk-palette-9rbp2fab.js} +1 -1
- package/dist/chunk-placement-items-me598wsb.js +1 -0
- package/dist/{chunk-profile-pfzyc04p.js → chunk-profile-s7r7fcvz.js} +1 -1
- package/dist/{chunk-prompt-history-2bcp2rky.js → chunk-prompt-history-hf296e7v.js} +1 -1
- package/dist/chunk-prompts-c8s0nhkm.js +1 -0
- package/dist/chunk-room-confirms-ga2sbvhc.js +1 -0
- package/dist/chunk-room-menu-7h4jym2b.js +1 -0
- package/dist/chunk-rooms-menu-button-pgtaanb6.js +1 -0
- package/dist/{chunk-schedules-64h9gfwn.js → chunk-schedules-mbnwcxpc.js} +1 -1
- package/dist/{chunk-seat-menu-vrpc40v9.js → chunk-seat-menu-r0k0eawr.js} +1 -1
- package/dist/chunk-sheet-hosts-a5dfevy9.js +1 -0
- package/dist/{chunk-shortcut-help-bdbkdcs9.js → chunk-shortcut-help-a6pkjcq7.js} +2 -2
- package/dist/{chunk-shortcuts-qft33r8t.js → chunk-shortcuts-cgt87jkz.js} +1 -1
- package/dist/chunk-skill-editor-67yk4x7t.js +8 -0
- package/dist/chunk-skills-rewemey4.js +1 -0
- package/dist/chunk-switcher-list-t8rbay2y.js +1 -0
- package/dist/{chunk-tab-dot-1p68ybf8.js → chunk-tab-dot-vr11dfrw.js} +1 -1
- package/dist/chunk-table-52nh0azk.js +1 -0
- package/dist/chunk-table2d-g57vr6h0.js +1 -0
- package/dist/chunk-table3d-rp0w6kt4.js +4220 -0
- package/dist/chunk-thread-actions-qcxt1y1g.js +1 -0
- package/dist/{chunk-thread-cards-t794fp4d.js → chunk-thread-cards-c2mrp2gj.js} +1 -1
- package/dist/chunk-thread-list-0071q455.js +217 -0
- package/dist/{chunk-transcript-km4e3aey.js → chunk-transcript-789yqysq.js} +1 -1
- package/dist/chunk-where-hmwmme9e.js +1 -0
- package/dist/{chunk-workspace-d064v56e.js → chunk-workspace-wr1qrtsh.js} +2 -2
- package/dist/chunk-zh-tw-z5p5mpph.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 +38 -4
- package/src/app/helper-routes.ts +106 -0
- package/src/app/rooms.ts +18 -3
- package/src/app/routes.ts +20 -0
- package/src/app/surface.ts +18 -1
- package/src/app/team-routes.ts +21 -1
- package/src/i18n/zh-tw.ts +46 -9
- package/dist/chunk-account-hck7mhf8.js +0 -1
- package/dist/chunk-action-menu-beqh40k6.js +0 -1
- package/dist/chunk-agent-znnth24t.js +0 -1
- package/dist/chunk-arranged-rooms-wfakrddk.js +0 -1
- package/dist/chunk-bulk-actions-c4tkvk9g.js +0 -1
- package/dist/chunk-character-creator-qwcsdytw.js +0 -1
- package/dist/chunk-confirm-z95j9jt3.js +0 -1
- package/dist/chunk-entry-hrt97qed.js +0 -1
- package/dist/chunk-folder-list-nemtqbnc.js +0 -1
- package/dist/chunk-folds-xpg9qcwf.js +0 -1
- package/dist/chunk-group-scene-g24kxz6f.js +0 -1
- package/dist/chunk-group-table-851jm8ef.js +0 -1
- package/dist/chunk-host-icons-23zhqpmc.js +0 -1
- package/dist/chunk-host-picture-8tnh2wam.js +0 -1
- package/dist/chunk-host-state-j41sp065.js +0 -1
- package/dist/chunk-host-ui-cje7a9t9.js +0 -1
- package/dist/chunk-index-3k7sdph2.js +0 -1
- package/dist/chunk-index-4jf4jvfd.css +0 -1
- package/dist/chunk-index-4s1qj9we.js +0 -2
- package/dist/chunk-index-5fz5e1ct.js +0 -2
- package/dist/chunk-index-azrnzgev.js +0 -2
- package/dist/chunk-index-c2ag3qw2.js +0 -2
- package/dist/chunk-index-efgm0066.js +0 -2
- package/dist/chunk-index-fe0m5mht.js +0 -2
- package/dist/chunk-index-hrtyanda.js +0 -2
- package/dist/chunk-index-j479p62w.js +0 -2
- package/dist/chunk-index-kankja6p.js +0 -50
- package/dist/chunk-index-kb44jp50.js +0 -2
- package/dist/chunk-index-mnwdbb4n.js +0 -2
- package/dist/chunk-index-n6zrc05a.js +0 -2
- package/dist/chunk-index-n93wqszt.js +0 -8
- package/dist/chunk-index-nrexxkar.js +0 -2
- package/dist/chunk-index-pgxgq61x.js +0 -2
- package/dist/chunk-index-q5vzjqr5.js +0 -2
- package/dist/chunk-index-qqwk157d.js +0 -2
- package/dist/chunk-index-r3tqhew8.js +0 -2
- package/dist/chunk-index-rg9vh59e.js +0 -1
- package/dist/chunk-index-sxq69p1f.js +0 -2
- package/dist/chunk-index-taq2psr6.js +0 -2
- package/dist/chunk-index-wc83vb0a.js +0 -2
- package/dist/chunk-index-xbs8q4kn.js +0 -2
- package/dist/chunk-index-xxbveevc.js +0 -2
- package/dist/chunk-index-zx6yka30.js +0 -2
- package/dist/chunk-lang-css-yrc25qk9.js +0 -1
- package/dist/chunk-lang-html-rwe8epvf.js +0 -1
- package/dist/chunk-lang-javascript-d6x6qjtg.js +0 -1
- package/dist/chunk-lang-typescript-1rv9vdcz.js +0 -1
- package/dist/chunk-layout-actions-6assr93n.js +0 -1
- package/dist/chunk-menu-items-9szcza00.js +0 -2
- package/dist/chunk-mode-toggle-bzbq7ycq.js +0 -1
- package/dist/chunk-note-row-g20h11pm.js +0 -75
- package/dist/chunk-notes-gc8bssxn.js +0 -1
- package/dist/chunk-onboarding-mdtc2mb7.js +0 -1
- package/dist/chunk-placement-items-2eect825.js +0 -1
- package/dist/chunk-prompts-052mb05y.js +0 -1
- package/dist/chunk-room-confirms-asvmjh5s.js +0 -1
- package/dist/chunk-room-menu-dm2r2hk6.js +0 -1
- package/dist/chunk-rooms-menu-button-32hemzxc.js +0 -1
- package/dist/chunk-sheet-hosts-jaqx490x.js +0 -1
- package/dist/chunk-skill-editor-z3dx2895.js +0 -8
- package/dist/chunk-skills-4jfcv39n.js +0 -1
- package/dist/chunk-switcher-list-xysjd4tw.js +0 -1
- package/dist/chunk-table-0v4q4dx3.js +0 -1
- package/dist/chunk-table-seats-f683hx8k.js +0 -1
- package/dist/chunk-table2d-1a6atjhj.js +0 -1
- package/dist/chunk-table3d-k0ffeffj.js +0 -4220
- package/dist/chunk-thread-actions-4rpfg4fq.js +0 -1
- package/dist/chunk-thread-list-1pcygpka.js +0 -1
- package/dist/chunk-where-phjwqggy.js +0 -1
- package/dist/chunk-zh-tw-qf18hcxc.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{y,f,u,p}from"./chunk-index-kankja6p.js";import{jo}from"./chunk-index-4s1qj9we.js";import{Zr,vn}from"./chunk-index-hrtyanda.js";import{Ye,rs,os,ss,as,ls}from"./chunk-index-mnwdbb4n.js";import{Lt}from"./chunk-index-nrexxkar.js";var n={createFolder:(e)=>f("folders",{method:"POST",body:JSON.stringify({name:e})}),changeFolder:(e,t)=>f(`folders/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),deleteFolder:(e)=>f(`folders/${encodeURIComponent(e)}`,{method:"DELETE"}),muteFolder:(e,t)=>f(`folders/${encodeURIComponent(e)}/mute`,{method:"PUT",body:JSON.stringify({muted:t})}),placeRoom:(e,t,o)=>f(`rooms/${encodeURIComponent(e)}/folder`,{method:"PUT",body:JSON.stringify({folder:t,before:o})}),pinRoom:(e,t,o)=>f(`rooms/${encodeURIComponent(e)}/pin`,{method:"PUT",body:JSON.stringify({pinned:t,before:o})})};var l=(e)=>p(e,"danger"),d=(e)=>y.dispatch({type:"layout_loaded",pins:e.pins,folders:e.folders});async function i(e,t,o=l){let r=Zr();try{d(e(r))}catch{}try{let s=await t();return d(s),s}catch(s){d(r),y.dispatch({type:"changed"}),o(u(s));return}}var Yo=(e,t,o=null)=>i((r)=>ls(r,e,t,o),()=>n.pinRoom(e,t,o)),Kt=(e,t,o=null)=>i((r)=>as(r,e,t,o),()=>n.placeRoom(e,t,o));function Gi(e,t){let o=Lt(vn(),e);if(o.kind==="rest")return;let r=Ye(o.siblings,e,t);if(!r)return;return o.kind==="pinned"?Yo(e,!0,r.before):Kt(e,o.folder,r.before)}async function Ar(e,t=l){try{let o=await n.createFolder(e);return d(o),o.folders.at(-1)?.id}catch(o){t(u(o));return}}var $r=(e,t,o)=>i((r)=>rs(r,e,t),()=>n.changeFolder(e,{name:t}),o),ms=(e,t)=>i((o)=>os(o,e,t),()=>n.changeFolder(e,{before:t}));function gs(e,t){let o=Ye(Zr().folders.map((r)=>r.id),e,t);return o?ms(e,o.before):void 0}var Nr=(e,t)=>i((o)=>ss(o,e),()=>n.deleteFolder(e),t);async function Os(e,t){try{let o=await n.muteFolder(e,t);for(let r of o.rooms)y.dispatch({type:"room_muted",room:r,muted:o.muted});return!0}catch(o){return l(u(o)),!1}}function ys(e,t){let o=jo(Lt(vn(),e),e,t);if(!o)return;if(o.kind==="pin")return Yo(e,!0,o.before);if(o.kind==="folder")return Kt(e,o.folder,o.before);return Kt(e,null)}
|
|
2
|
-
export{Yo,Kt,Gi,Ar,$r,ms,gs,Nr,Os,ys};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var is=40;class l extends Error{code;constructor(e){super(e);this.code=e;this.name="LayoutError"}}function zn(e,n,r){if(r===n&&e.includes(n))return[...e];let t=e.filter((o)=>o!==n),i=r===null||r===void 0?-1:t.indexOf(r);if(i<0)return[...t,n];return[...t.slice(0,i),n,...t.slice(i)]}function Ye(e,n,r){let t=e.indexOf(n);if(t<0)return;if(r==="up")return t===0?void 0:{before:e[t-1]??null};return t===e.length-1?void 0:{before:e[t+2]??null}}function Wr(e){let n=e.trim(),r=Array.from(n).length;if(r<1||r>40||/\p{Cc}/u.test(n))throw new l("bad-name");return n}var c=(e,n)=>e.toLocaleLowerCase()===n.toLocaleLowerCase();function u(e,n){let r=e.folders.findIndex((t)=>t.id===n);if(r<0)throw new l("no-folder");return r}var f=(e,n)=>({pins:e.pins,folders:n});function rs(e,n,r){let t=u(e,n),i=Wr(r);if(e.folders.some((o)=>o.id!==n&&c(o.name,i)))throw new l("duplicate");return f(e,e.folders.map((o,s)=>s===t?{...o,name:i}:o))}function os(e,n,r){let t=u(e,n),i=e.folders[t],o=zn(e.folders.map((s)=>s.id),n,r);return f(e,o.map((s)=>s===n?i:e.folders.find((a)=>a.id===s)))}function ss(e,n){return u(e,n),f(e,e.folders.filter((r)=>r.id!==n))}var d=(e,n)=>({pins:e.pins.filter((r)=>r!==n),folders:e.folders.map((r)=>r.rooms.includes(n)?{...r,rooms:r.rooms.filter((t)=>t!==n)}:r)});function as(e,n,r,t){if(r!==null)u(e,r);let i=d(e,n);if(r===null)return i;return f(i,i.folders.map((o)=>o.id===r?{...o,rooms:zn(o.rooms,n,t)}:o))}function ls(e,n,r,t){let i=d(e,n);if(!r)return i;return{pins:zn(e.pins.filter((o)=>o!==n),n,t),folders:i.folders}}
|
|
2
|
-
export{is,zn,Ye,Wr,rs,os,ss,as,ls};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{h,be,s,N,a,r,t,c,e,Se,F,d,U,cn,Rn,Ge,et,Cn,gn,yt,Fo,Me,qe,Re}from"./chunk-index-kankja6p.js";import{Ve}from"./chunk-index-zx6yka30.js";import{Ce}from"./chunk-index-raf772z6.js";var we=12,Ee={views:[],attention:{},loaded:!1},de=Ee,{emit:xe,use:Te}=U(),kn=()=>Te(()=>de);function _n(){let n=be(Ge)?.tier;return n!==void 0&&n!=="owner"}function wi(){let n=be(Ge);return _n()||(n?.kinds?.length??0)>0}function ke(n,l){return{key:n.key,kind:"agent",name:`${l}.${n.id}`,displayName:n.title,home:!1,readOnly:!1,mode:{yolo:!1,longRunning:!1},typing:!1,stoppable:!1}}var He=(n)=>n.attention===!0,Ae=(n,l)=>(l.lastAt??"").localeCompare(n.lastAt??"");async function Le(n){let l=await Promise.allSettled(n.map((o)=>Ve.list(o))),u=[];l.forEach((o,m)=>{let i=n[m];if(o.status!=="fulfilled"||i===void 0)return;for(let S of o.value.rooms)u.push({room:S,kind:i})}),u.sort((o,m)=>Ae(o.room,m.room));let f={};for(let{room:o}of u)if(He(o))f[o.key]=!0;return{views:u.map(({room:o,kind:m})=>ke(o,m)),attention:f,loaded:!0}}function go(n){let l=Re(),u=d((y)=>y.connects),f=Ce((y)=>y.lists),o=a(0),m=a(0),i=n.join(`
|
|
2
|
-
`),{views:S}=kn();s(()=>{o.current+=1;let y=o.current,R=!0;return Le(i===""?[]:i.split(`
|
|
3
|
-
`)).then((v)=>{if(!R||y<m.current)return;m.current=y,de=v,xe()}),()=>{R=!1}},[i,u,f]);let g=S.slice(0,we).map((y)=>y.key).join(`
|
|
4
|
-
`);s(()=>{let y=g===""?[]:g.split(`
|
|
5
|
-
`);for(let R of y)l.send({type:"subscribe",room:R});return()=>{for(let R of y)l.send({type:"unsubscribe",room:R})}},[l,g,u])}var Ne=380,Oe="cubic-bezier(0.7, 0, 0.84, 0)",$e=2.4,le=0.35,_e=260,De="cubic-bezier(0.2, 0.8, 0.2, 1)",Ie=1.06,Pe=700,x;function fe(n){if(x?.host===n&&x.phase==="diving")x.abort()}var Be=(n)=>{if(!n||typeof n.animate!=="function")return;n.animate([{transform:`scale(${Ie})`,opacity:le},{transform:"scale(1)",opacity:1}],{duration:_e,easing:De})};function me(n,l,u,f){if(x)return;let o=n.closest("main.route")??n;if(Se()||typeof o.animate!=="function"){u();return}f?.();let m=o.getBoundingClientRect(),i=`${l.x-m.left}px ${l.y-m.top}px`,S={overflow:o.style.overflow,events:o.style.pointerEvents};o.style.overflow="hidden",o.style.pointerEvents="none";let g=o.animate([{transformOrigin:i,transform:"scale(1)",opacity:1},{transformOrigin:i,transform:`scale(${$e})`,opacity:le}],{duration:Ne,easing:Oe,fill:"forwards"}),y=document.documentElement,R,v,T=()=>{o.style.overflow=S.overflow,o.style.pointerEvents=S.events,g.cancel()},D=()=>{window.removeEventListener("popstate",H),window.removeEventListener("hashchange",H)},k={host:n,phase:"diving",abort:H};function H(){if(x!==k||k.phase!=="diving")return;D(),T(),x=void 0}let A=(O)=>{if(x!==k)return;if(v?.disconnect(),clearTimeout(R),y.removeAttribute("data-dive"),T(),x=void 0,O)Be(document.querySelector("main.route"))};x=k,window.addEventListener("popstate",H),window.addEventListener("hashchange",H),g.finished.then(()=>{if(x!==k||k.phase!=="diving")return;if(k.phase="committing",D(),y.setAttribute("data-dive",""),u(),!n.isConnected){A(!0);return}v=new MutationObserver(()=>{if(!n.isConnected)A(!0)}),v.observe(o.parentElement??document.body,{childList:!0,subtree:!0}),R=setTimeout(()=>A(!n.isConnected),Pe)},()=>{return})}var pe=(n)=>n.filter((l)=>l.muted!==!0),Fe=(n)=>n==="sleepy"?"idle":n;function ge(n,l){let u={};for(let[f,o]of Object.entries(n))u[f]=Fe(o);for(let f of l){let o=f.agent;if(!f.typing||o===void 0||!(o in u))continue;let m=u[o];if(m==="waiting"||m==="error")continue;u[o]="speaking"}return u}function Z(n,l){if(n==="speaking")return"happy";return(l?.STATE_EXPRESSION??je)[n]}var je={idle:"neutral",thinking:"thinking",working:"determined",waiting:"curious",done:"proud",error:"apologetic",sleepy:"sleepy"};function ee(n,l){return`s${n}${l.toLowerCase().replace(/[^a-z0-9]/g,"")}`.slice(0,16)}var ze={x:-7,y:-3,w:114,h:100},P=256;function te(n,l,u,f,o,m){let i=n.composeSvg(l,{bare:!0,look:u,expr:Z(f,n),state:"idle",still:!0,size:P,uid:o,skins:m}),{x:S,y:g,w:y,h:R}=ze;return i.replace('viewBox="0 0 100 100"',`viewBox="${S} ${g} ${y} ${R}"`).replace(`width="${P}" height="${P}"`,`width="${P}" height="${Math.round(P*R/y)}"`)}function ye(n){let l=n.delayMs??300,u=n.timers??{set:(i,S)=>setTimeout(i,S),clear:(i)=>clearTimeout(i)},f=new Map,o=new Map,m=(i)=>{let S=o.get(i);if(S===void 0)return;u.clear(S),o.delete(i)};return{seed(i,S){m(i),f.set(i,Z(S))},update(i,S){let g=Z(S);if(!f.has(i)){f.set(i,g);return}if(m(i),f.get(i)===g)return;o.set(i,u.set(()=>{o.delete(i),f.set(i,g),n.setAvatar(i,S)},l))},forget(i){m(i),f.delete(i)},dispose(){for(let i of[...o.keys()])m(i);f.clear()}}}var Ke={idle:c("idle"),thinking:c("thinking"),working:c("working"),waiting:c("waiting"),speaking:c("speaking"),done:c("done"),error:c("error")},Xe=()=>({table:t("Round table"),seat:(n,l)=>t("{name} ({state})",{name:n,state:t(Ke[l])})}),Ue=()=>{qe().catch(()=>{return})},We=10;function ki(n,l={}){let u=l.all===!0,f=_n(),{views:o}=kn(),m=wi(),i=d((S)=>{let g=S.order.map((v)=>S.rooms[v]?.view).filter((v)=>v!==void 0&&v.kind==="agent"),y=n?n.map((v)=>g.find((T)=>T.name===v)).filter((v)=>v!==void 0):g;return[...n||u?y:pe(y)].sort((v,T)=>Number(T.home)-Number(v.home))},`${u}
|
|
6
|
-
${n?.join(`
|
|
7
|
-
`)??""}`);if(f)return o;return m&&!n&&!u?[...i,...o]:i}var Hn=()=>ki(void 0,{all:!0});function Ye(n){return d((l)=>Object.values(l.rooms).filter((u)=>n?u.key===n:u.view?.kind==="group").map((u)=>({typing:u.typing,...u.agent===void 0?{}:{agent:u.agent}})),n??"")}function Vt(n){let{variant:l="full",onHandle:u}=n,f=Rn(),o=et(),m=Cn(),i=gn(),S=yt(),g=ki(n.members),y=Fo(g.map((p)=>p.key)),R=Ye(n.groupRoom),v=kn().attention,T=_n(),D=a(T);D.current=T;let k=Me("(orientation: portrait)"),H=l==="full"&&(n.list===!0||k&&g.length>We),A=N(()=>ge(Object.fromEntries(g.map((p)=>{let w=y[p.key]??"idle";return[p.name,v[p.key]&&(w==="idle"||w==="sleepy")?"waiting":w]})),R),[g,y,R,v]),O=a(A);O.current=A;let L=N(()=>{if(!f)return[];return g.map((p,w)=>{let b=S[p.name]??p.character??cn(f,p);return{id:p.name,name:p.displayName,color:f.accentOf(b,m.look),avatarSvg:te(f,b,m.look,O.current[p.name]??"idle",ee(w,p.name),i)}})},[f,g,S,m.look,i]),K=a(L);K.current=L;let X=a(g);X.current=g;let G=a({look:o,scheme:m.scheme});G.current={look:o,scheme:m.scheme};let W=a(null),V=a(void 0),[B,ve]=r(0),j=a(void 0),ne=a(()=>{return});ne.current=(p)=>{let w=g.find((b)=>b.name===p);if(!f||!w)return;return S[p]??w.character??cn(f,w)};let oe=a(m);oe.current=m;let re=a(i);re.current=i;let se=a(f);se.current=f;let Y=a(u);Y.current=u;let M=a(n);M.current=n;let ie=f!==void 0&&L.length>0;s(()=>{let p=W.current;if(!ie||!p)return;let w=!0,b,Q=ye({setAvatar:(_,q)=>{let C=ne.current(_),E=se.current,I=X.current.findIndex((z)=>z.name===_);if(!C||!E||I<0)return;b?.setAvatar(_,te(E,C,oe.current.look,q,ee(I,_),re.current))}});return j.current=Q,(async()=>{let{mountRoundTable:_}=await (h("hrt97qed"),import("./chunk-entry-hrt97qed.js")),q=K.current.map((E)=>({...E,state:O.current[E.id]??"idle"})),C=await _(p,{theme:G.current.look,scheme:G.current.scheme,seats:q,onSeatClick:({id:E,at:I})=>{let z=M.current.onSeat;if(z){z(E);return}let ae=X.current.find((he)=>he.name===E);if(!ae)return;let ce=()=>F("room",ae.key),ue=W.current;if(I&&ue)me(ue,I,ce,D.current?Ue:void 0);else ce()},...M.current.onSeatMenu?{onSeatMenu:(E)=>M.current.onSeatMenu?.(E)}:{},ownerName:M.current.ownerName??t("You"),focus:M.current.focus??null,onFocus:(E)=>M.current.onFocus?.(E),onMore:()=>M.current.onMore?.(),reducedMotion:"auto",lowPower:"auto",variant:l,listBelow:H,labels:Xe()});if(!w){C.dispose();return}b=C,V.current=C;for(let E of q)Q.seed(E.id,E.state??"idle");Y.current?.(C),ve((E)=>E+1)})(),()=>{w=!1,fe(p),Q.dispose(),j.current=void 0,V.current=void 0,Y.current?.(void 0),b?.dispose()}},[ie,l,H]);let J=n.focus??null;if(s(()=>{let p=V.current;if(p&&p.focused()!==J)p.focus(J)},[J,B]),s(()=>{let p=V.current;if(!p||L.length===0)return;let w=O.current;p.setSeats(L.map((b)=>({...b,state:w[b.id]??"idle"})));for(let b of L)j.current?.seed(b.id,w[b.id]??"idle")},[L,B]),s(()=>{let p=V.current;if(p)p.setTheme(o,m.scheme)},[o,m.scheme,B]),s(()=>{let p=V.current;if(!p)return;for(let w of K.current){let b=A[w.id]??"idle";p.setState(w.id,b),j.current?.update(w.id,b)}},[A,B]),g.length===0)return e("p",{className:"table-empty",children:t("No knights are seated yet.")});return e("section",{className:"table-host",ref:W,"aria-label":t("Round table")})}
|
|
8
|
-
export{kn,_n,wi,go,ki,Hn,Vt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function it(r,o){let s=new Map;for(let e of r.order){let n=r.rooms[e]?.view;if(n)s.set(e,n)}let p=(e)=>{let n=s.get(e);return n!==void 0&&n.kind!=="thread"&&!n.home},i=new Set,g=(e)=>e.filter((n)=>{if(!p(n)||i.has(n))return!1;return i.add(n),!0}),u=g(r.pins),m=r.folders.map((e)=>({id:e.id,name:e.name,rooms:g(e.rooms)})),l=[],h={},t={open:[],closed:[]},d=new Set([...s].filter(([,e])=>e.kind!=="thread").map(([e])=>e)),a=[],f=0;for(let[e,n]of s)if(f+=1,n.kind==="thread"){let y=t;if(n.parent&&d.has(n.parent))y=h[n.parent]??{open:[],closed:[]},h[n.parent]=y;(n.closed?y.closed:y.open).push(e)}else if(n.home)l.push(e);else if(!i.has(e))a.push({key:e,index:f,at:o(e)});a.sort((e,n)=>e.at===n.at?e.index-n.index:n.at-e.at);let c=a.map((e)=>e.key),k=(e)=>s.get(e)?.kind;return{home:l,pinned:u,folders:m,rest:c,restAgents:c.filter((e)=>k(e)==="agent"),restGroups:c.filter((e)=>k(e)==="group"),threads:h,orphans:t}}function cs(r,o,s,p=!1){let i=it(r,o),g=new Map(r.order.map((t,d)=>[t,d])),u=(t)=>[...t].sort((d,a)=>{let f=o(d),c=o(a);return f===c?(g.get(d)??0)-(g.get(a)??0):c-f}),m=u([...i.home,...i.pinned,...i.folders.flatMap((t)=>t.rooms),...i.rest].filter(s)),l=(t)=>t.filter((d)=>!m.includes(d));return[{id:"waiting",keys:m},{id:"home",keys:l(i.home)},{id:"pinned",keys:l(i.pinned)},...i.folders.map((t)=>({id:t.id,title:t.name,keys:l(t.rooms)})),{id:"rest",keys:l(u(i.rest))}].filter((t)=>t.keys.length>0||p&&t.id!=="waiting"&&t.id!=="home")}function Lt(r,o){if(r.pinned.includes(o))return{kind:"pinned",siblings:r.pinned};let s=r.folders.find((p)=>p.rooms.includes(o));return s?{kind:"folder",folder:s.id,siblings:s.rooms}:{kind:"rest"}}function yi(r,o){let s=r.filter(o).length;if(s===0)return"none";return s===r.length?"all":"some"}
|
|
2
|
-
export{it,cs,Lt,yi};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ri,U}from"./chunk-index-kankja6p.js";var i={pin:"M9 4h6l-1 6 3 3H7l3-3-1-6ZM12 13v7",folder:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z",up:"M6 15l6-6 6 6",down:"M6 9l6 6 6-6",edit:"M4 20h4L19 9l-4-4L4 16v4ZM13.5 6.5l4 4"};ri(i);var o,{emit:e,use:r}=U();function Ee(n){o=n,e()}function mi(){if(!o)return;o=void 0,e()}var ts=()=>r(()=>o);
|
|
2
|
-
export{Ee,mi,ts};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ee}from"./chunk-index-qqwk157d.js";import{t,fe,Wo,di}from"./chunk-index-kankja6p.js";import{gi}from"./chunk-index-sxq69p1f.js";function Wn(e){let r=e.getBoundingClientRect(),o=Wo();fe({title:t("Rooms"),items:[...gi(),{id:"new-folder",label:t("Add a folder"),icon:"plus",run:()=>Ee({kind:"new"})},{id:"arrange",label:o?t("Done"):t("Arrange"),icon:o?"check":"list",run:()=>di(!o)}],at:{x:r.left,y:r.bottom},via:"key",source:e})}
|
|
2
|
-
export{Wn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U}from"./chunk-index-kankja6p.js";var a="roundtable-console:folders-collapsed";function i(){try{let e=localStorage.getItem(a),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter((o)=>typeof o==="string"):[])}catch{return new Set}}var l,{emit:d,use:c}=U(),n=()=>(l??=i(),l);function s(e){l=e;try{localStorage.setItem(a,JSON.stringify([...e]))}catch{}d()}var ir=()=>c(n),rr=()=>n();function or(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function sr(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function ar(e){let t=new Set(e),o=n();if([...o].every((r)=>t.has(r)))return;s(new Set([...o].filter((r)=>t.has(r))))}export{ir,rr,or,sr,ar};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h,t}from"./chunk-index-kankja6p.js";import{qr}from"./chunk-index-raf772z6.js";import{Oi,ns}from"./chunk-index-xxbveevc.js";function Ir(e){let n=qr();if(!e)return n;let r=new Set([...e,...ns(e)]);return Object.fromEntries(Object.entries(n).filter(([a])=>r.has(a)))}var i=()=>(h("c4tkvk9g"),import("./chunk-bulk-actions-c4tkvk9g.js"));function gi(e){let n=[];if(Object.keys(Ir(e)).length>0)n.push({id:"read-all",label:t("Mark all as read"),icon:"check",run:()=>{i().then((r)=>r.markAllRead(e))}});if(Oi(e).size>0)n.push({id:"clear-finished",label:t("Clear all finished threads"),icon:"trash",tone:"danger",run:()=>{i().then((r)=>r.clearAllFinished(e))}});return n}
|
|
2
|
-
export{Ir,gi};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h,t,y}from"./chunk-index-kankja6p.js";import{Ee}from"./chunk-index-qqwk157d.js";import{gi}from"./chunk-index-sxq69p1f.js";import{vn}from"./chunk-index-hrtyanda.js";import{Ye}from"./chunk-index-mnwdbb4n.js";import{Lt,yi}from"./chunk-index-nrexxkar.js";var s=(e)=>e(),m=()=>(h("6assr93n"),import("./chunk-layout-actions-6assr93n.js"));function zr(e,l=s){let o=Lt(vn(),e),d=o.kind==="pinned",i=[{id:"pin",label:d?t("Unpin"):t("Pin"),icon:"pin",run:()=>{m().then((r)=>r.pinRoom(e,!d))}},{id:"move",label:t("Move to folder…"),icon:"folder",run:()=>l(()=>Ee({kind:"move",room:e}))}];if(o.kind==="rest")return i;if(Ye(o.siblings,e,"up"))i.push({id:"up",label:t("Move up"),icon:"up",run:()=>{m().then((r)=>r.nudgeRoom(e,"up"))}});if(Ye(o.siblings,e,"down"))i.push({id:"down",label:t("Move down"),icon:"down",run:()=>{m().then((r)=>r.nudgeRoom(e,"down"))}});return i}function bs(e){let l=y.getState(),o=l.folders.find((n)=>n.id===e);if(!o)return;let d=vn().folders.find((n)=>n.id===e)?.rooms??[],i=yi(d,(n)=>l.rooms[n]?.view?.muted===!0)==="all",r=l.folders.map((n)=>n.id),u=[{id:"rename",label:t("Rename"),icon:"edit",run:()=>Ee({kind:"rename",id:e,name:o.name})}];if(d.length>0)u.push({id:"mute",label:i?t("Unmute the whole folder"):t("Mute the whole folder"),icon:i?"bell":"bell-off",run:()=>{m().then((n)=>n.muteFolder(e,!i))}});if(u.push(...gi(d)),Ye(r,e,"up"))u.push({id:"up",label:t("Move up"),icon:"up",run:()=>{m().then((n)=>n.nudgeFolder(e,"up"))}});if(Ye(r,e,"down"))u.push({id:"down",label:t("Move down"),icon:"down",run:()=>{m().then((n)=>n.nudgeFolder(e,"down"))}});return u.push({id:"delete",label:t("Delete folder"),icon:"trash",tone:"danger",run:()=>Ee({kind:"delete",id:e,name:o.name})}),{title:o.name,items:u}}
|
|
2
|
-
export{zr,bs};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{s,r,u,ne}from"./chunk-index-kankja6p.js";function ye(f,e){let{version:o}=ne(),[t,a]=r({data:void 0,error:void 0,subject:e});return s(()=>{let n=!0;return f().then((d)=>{if(n)a({data:d,error:void 0,subject:e})},(d)=>{if(n)a((i)=>({data:i.subject===e?i.data:void 0,error:u(d),subject:e}))}),()=>{n=!1}},[e,o]),t.subject===e?{data:t.data,error:t.error}:{data:void 0,error:void 0}}
|
|
2
|
-
export{ye};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,te,y,f,O,u,p}from"./chunk-index-kankja6p.js";import{Oi}from"./chunk-index-xxbveevc.js";var pi={dismissAllFinished:(e)=>f("rooms/dismiss-finished-threads",{method:"POST",body:JSON.stringify({rooms:e})}),readAll:(e)=>f("rooms/read-all",{method:"POST",body:JSON.stringify({rooms:e})}),unreadAll:(e)=>f("rooms/read-all",{method:"POST",body:JSON.stringify({restore:e})})};var d=()=>y.dispatch({type:"changed"});async function c(e){try{await e()}catch(s){p(u(s),"danger")}d()}async function h(e,s,i,n){try{await s()}catch(r){return p(u(r),"danger"),d(),!1}return y.dispatch({type:"threads_dismissed",rooms:[...e]}),p(i,"info",{label:t("Undo"),run:()=>void c(n)}),!0}function Rr(e){let s=y.getState().rooms[e]?.view?.displayName??e;return h([e],()=>O.dismissThread(e),t("Cleared “{name}”",{name:s}),()=>O.undismissThread(e))}function A(e,s){return h(s,()=>e?O.dismissThreads(e):Promise.all(s.map((i)=>O.dismissThread(i))),te(s.length,"Cleared {count} finished thread","Cleared {count} finished threads"),()=>e?O.undismissThreads(e,s):Promise.all(s.map((i)=>O.undismissThread(i))))}var T=(e)=>Promise.all(Object.entries(e).flatMap(([s,i])=>Array.from({length:Math.ceil(i.length/o)},(n,r)=>O.undismissThreads(s,i.slice(r*o,(r+1)*o))))),o=100,m=500;async function P(e){let s={},i=0;try{for(let r=0;r<e.length;r+=m){let a=await pi.dismissAllFinished(e.slice(r,r+m));i+=a.dismissed;for(let[l,g]of Object.entries(a.threads))s[l]=[...s[l]??[],...g]}}catch(r){p(u(r),"danger")}let n=Object.values(s).flat();if(n.length===0)return d(),i>0;return y.dispatch({type:"threads_dismissed",rooms:n}),p(te(n.length,"Cleared {count} finished thread","Cleared {count} finished threads"),"info",{label:t("Undo"),run:()=>void c(()=>T(s))}),!0}async function Er(e){let s=Oi(e);if(s.size===0)return;await P([...s.keys()])}async function Cr(e,s){if(s.length===0)return;await A(e,s)}
|
|
2
|
-
export{pi,Rr,Er,Cr};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{y}from"./chunk-index-kankja6p.js";function a(t,n){let o=y.getState(),r=new Map;for(let i of o.order){let e=o.rooms[i]?.view;if(e?.kind!=="thread"||!e.parent)continue;if(t&&!t.has(e.parent))continue;let s=o.rooms[e.parent]?.view;if(!s||s.kind==="thread")continue;if(!n(e.closed===!0))continue;r.set(e.parent,[...r.get(e.parent)??[],i])}return r}var Oi=(t)=>a(t&&new Set(t),(n)=>n),ns=(t)=>[...a(new Set(t),()=>!0).values()].flat();
|
|
2
|
-
export{Oi,ns};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,c,v,f}from"./chunk-index-kankja6p.js";import{tr}from"./chunk-index-84wbc80d.js";var n=encodeURIComponent,a=new Set([c("This action takes no form."),c("The form has no such field."),c("This field is required."),c("Choose from the list."),c("This field takes one value."),c("This field is too long."),c("Give a web address."),c("The action could not be done.")]),_i=(e)=>a.has(e)?t(e):e;function Oo(e){let s=e.indexOf(":"),o=e.lastIndexOf(".");if(s<0||o<s+2||o===e.length-1)return;return{kind:e.slice(s+1,o),id:e.slice(o+1)}}var Ve={list:(e,s,o)=>{let i=new URLSearchParams;if(s)i.set("filter",s);if(o)i.set("cursor",o);let r=i.toString();return f(`host/${n(e)}${r?`?${r}`:""}`)},open:(e,s)=>f(`host/${n(e)}/${n(s)}`),older:(e,s,o,i)=>f(`host/${n(e)}/${n(s)}/messages?before=${o}&limit=${i}`),act:(e,s,o)=>f(`host/${n(e)}/${n(s)}/act`,{method:"POST",body:JSON.stringify(o)}),page:(e,s)=>{let o=new URLSearchParams(s).toString();return f(`pages/${n(e)}${o?`?${o}`:""}`)},pageAct:(e,s)=>f(`pages/${n(e)}/act`,{method:"POST",body:JSON.stringify(s)})};function g(e){if("room"in e){let o=e.message===void 0?"":`?message=${e.message}`;return`${v("room",e.room)}${o}`}let s=new URLSearchParams(e.query??{}).toString();return`${v("p",e.page)}${s?`?${s}`:""}`}function Ti(e){tr(new URL(g(e),document.baseURI))}
|
|
2
|
-
export{_i,Oo,Ve,Ti};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-6c8mewwy.js";import"./chunk-index-eh0wb6g0.js";import{Un}from"./chunk-index-tsxsy4qs.js";var r=()=>Un();export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-6c8mewwy.js";import"./chunk-index-eh0wb6g0.js";import{In}from"./chunk-index-3aa5czxj.js";import"./chunk-index-tsxsy4qs.js";import"./chunk-index-rcxz5w5d.js";import"./chunk-index-m65cv329.js";var t=()=>In();export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-6c8mewwy.js";import"./chunk-index-eh0wb6g0.js";import{Xt}from"./chunk-index-rcxz5w5d.js";import"./chunk-index-m65cv329.js";var t=()=>Xt({jsx:!0});export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-6c8mewwy.js";import"./chunk-index-eh0wb6g0.js";import{Xt}from"./chunk-index-rcxz5w5d.js";import"./chunk-index-m65cv329.js";var r=()=>Xt({typescript:!0,jsx:!0});export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Yo,Kt,Gi,Ar,$r,ms,gs,Nr,Os,ys}from"./chunk-index-kb44jp50.js";import"./chunk-index-hrtyanda.js";export{Ar as createFolder,Nr as deleteFolder,ys as dropRoom,Kt as moveRoom,Os as muteFolder,gs as nudgeFolder,Gi as nudgeRoom,Yo as pinRoom,ms as placeFolderBefore,$r as renameFolderTo};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,ln,y,p,Lo,fe,tt,$t,Ne,_t}from"./chunk-index-kankja6p.js";import"./chunk-index-raf772z6.js";import"./chunk-index-qqwk157d.js";import{zr}from"./chunk-index-taq2psr6.js";import{nt}from"./chunk-index-q5vzjqr5.js";import"./chunk-index-sxq69p1f.js";import"./chunk-index-xxbveevc.js";import"./chunk-index-hrtyanda.js";var m=(e)=>e();async function s(e){try{await navigator.clipboard.writeText(e),p(t("Copied"))}catch{p(t("Could not copy."),"danger")}}async function c(e){try{await navigator.share(e)}catch(n){if(n instanceof DOMException&&n.name==="AbortError")return;p(t("Could not share."),"danger")}}var f=()=>typeof navigator.share==="function";function I(e,n=m){let i=y.getState().rooms[e],o=i?.view;if(!o||o.kind==="thread")return;let l=i.mode,a=o.home?[]:zr(e,n);if(o.kind==="agent"){let r=o.name;a.push({id:"edit",label:t("Edit knight"),icon:"profile",run:()=>n(()=>tt(r))},{id:"look",label:t("Change look"),icon:"sparkle",run:()=>n(()=>tt(r,{look:!0}))})}if(o.kind==="group"){let r=o.name;a.push({id:"edit-group",label:t("Edit group"),icon:"profile",run:()=>n(()=>_t({kind:"group",name:r}))})}if(a.push({id:"notifications",label:t("Notifications"),icon:o.muted?"bell-off":"bell",checked:!o.muted,run:async()=>{let r=o.muted!==!0;if(!await nt(e,r))return;p(r?t("Notifications are off for {name}",{name:o.displayName}):t("Notifications are on for {name}",{name:o.displayName}))}}),!o.readOnly)a.push({id:"yolo",label:t("Yolo mode"),icon:"bolt",tone:"yolo",checked:l.yolo,run:()=>{if(l.yolo)return $t(e,{yolo:!1});Ne({kind:"yolo",room:e,name:o.displayName})}},{id:"long",label:t("Long-running mode"),icon:"timer",tone:"long",checked:l.longRunning,run:()=>$t(e,{longRunning:!l.longRunning})},{id:"start-over",label:t("Start over"),icon:"reset",tone:"danger",run:()=>Ne({kind:"start-over",room:e,name:o.displayName})});if(!o.readOnly&&!o.coordinator)a.push({id:"archive",label:o.kind==="group"?t("Archive group"):t("Archive knight"),icon:"archive",tone:"danger",run:()=>Ne({kind:"archive",room:e,name:o.displayName})});return{title:o.displayName,items:a}}function h(e=m){return{title:t("Add"),items:[{id:"new-agent",label:t("New knight"),icon:"profile",run:()=>e(()=>_t({kind:"new-agent"}))},{id:"new-group",label:t("New group"),icon:"rooms",run:()=>e(()=>_t({kind:"group"}))},{id:"archive-list",label:t("Archived"),icon:"archive",run:()=>e(()=>_t({kind:"archive"}))}]}}function P(e,n){let i=e.getBoundingClientRect();fe({...h(n),at:{x:i.left,y:i.bottom},via:"key",source:e})}function O(e){let n=y.getState().rooms[e]?.view;if(n?.kind!=="agent")return;return{title:n.displayName,items:[{id:"leave",label:t("Leave the table"),icon:"bell-off",run:async()=>{if(!await nt(e,!0))return;p(t("{name} left the table",{name:n.displayName}))}}]}}function u(e,n){let i=e.querySelector(".bubble > .prose");if(!i)return n;return(i.innerText||i.textContent||n).trim()}function g(e){if(!e)return;let n=window.getSelection();if(!n)return;let i=document.createRange();i.selectNodeContents(e),n.removeAllRanges(),n.addRange(i)}function b(e){let n=window.getSelection();if(!n||n.isCollapsed)return"";return(n.anchorNode&&e.contains(n.anchorNode)?n.toString():"").trim()}function H(e,n,i){let o=[{id:"copy",label:t("Copy"),icon:"copy",run:()=>s(b(n)||u(n,e.text))},{id:"copy-markdown",label:t("Copy as Markdown"),icon:"notes",run:()=>s(e.text)}];if(i)o.push({id:"quote",label:t("Quote reply"),icon:"conversations",run:()=>Lo(e.room,e.text)});if(o.push({id:"select",label:t("Select text"),icon:"list",run:()=>g(n.querySelector(".bubble"))}),f())o.push({id:"share",label:t("Share"),icon:"send",run:()=>c({text:u(n,e.text)})});return{title:e.author,items:o}}function D(e,n){return{title:n,items:[{id:"profile",label:t("Knight profile"),icon:"profile",run:()=>tt(e)}]}}var d=(e)=>[e.header?`${e.header}: ${e.question}`:e.question,...e.options.map((n)=>n.description?`- ${n.label}: ${n.description}`:`- ${n.label}`)];function v(e){let n=[e.title];switch(e.kind){case"approval":{n.push("",e.message);let{approval:i}=e;if(i){if(n.push("",`${t("Tool")}: ${i.tool}`,`${t("Action")}: ${i.action}`),Object.keys(i.input).length)n.push(JSON.stringify(i.input,null,2));for(let o of i.files??[])n.push(o.path)}break}case"ask":n.push("",...d({question:e.question,options:e.options,multi:e.multi,allowOther:e.allowOther}));break;case"questionnaire":for(let i of e.questions)n.push("",...d(i));break}return n.join(`
|
|
2
|
-
`)}function Q(e){return{title:e.title,items:[{id:"copy-details",label:t("Copy details"),icon:"copy",run:()=>s(v(e))}]}}function w(e){let n=document.createElement("a");n.href=ln(e),n.download=e.name,n.hidden=!0,document.body.append(n),n.click(),n.remove()}async function M(e){let n=new URL(ln(e),window.location.href).href;if(typeof navigator.canShare==="function")try{let i=await fetch(n);if(i.ok){let o=new File([await i.blob()],e.name,{type:e.type});if(navigator.canShare({files:[o]})){await c({files:[o],title:e.name});return}}}catch{}await c({title:e.name,url:n})}function j(e){let n=[{id:"download",label:t("Download"),icon:"download",run:()=>w(e)}];if(f())n.push({id:"share",label:t("Share"),icon:"send",run:()=>M(e)});return{title:e.name,items:n}}export{h as addMenu,D as avatarMenu,v as cardDetails,Q as cardMenu,s as copyText,j as fileMenu,H as messageMenu,P as openAddMenu,I as roomMenu,O as seatMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{nr}from"./chunk-index-67p2sc14.js";export{nr as ModeToggle};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import{J,t,e,n,d,Ke,Wt,Nt}from"./chunk-index-kankja6p.js";import{ot}from"./chunk-index-30vw4nhh.js";var i=!1;function m(){if(i||typeof document>"u")return;if(i=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let o=new CSSStyleSheet;o.replaceSync(`
|
|
2
|
-
/* A note is the room's people talking among themselves: a plain, dashed card, never the accent bubble of a message to the agent. */
|
|
3
|
-
.message[data-note] .bubble,
|
|
4
|
-
.message[data-note][data-mine] .bubble {
|
|
5
|
-
border: 1px dashed var(--control-border);
|
|
6
|
-
background: var(--surface-3);
|
|
7
|
-
color: var(--text);
|
|
8
|
-
box-shadow: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.message[data-note][data-mine] .bubble a,
|
|
12
|
-
.message[data-note][data-mine] .bubble code {
|
|
13
|
-
color: var(--accent);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.message[data-note][data-mine] .prose code,
|
|
17
|
-
.message[data-note][data-mine] .prose blockquote {
|
|
18
|
-
background: var(--surface);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.message[data-note][data-mine] .code-block pre {
|
|
22
|
-
background: var(--surface);
|
|
23
|
-
border-color: var(--border);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.message[data-note][data-mine] .file-chip {
|
|
27
|
-
color: var(--text);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.note-chip {
|
|
31
|
-
padding: 0 var(--space-2);
|
|
32
|
-
border-radius: var(--radius-full);
|
|
33
|
-
background: var(--surface-3);
|
|
34
|
-
color: var(--muted);
|
|
35
|
-
font-size: var(--text-xs);
|
|
36
|
-
font-weight: var(--weight-medium);
|
|
37
|
-
}
|
|
38
|
-
`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o];return}catch{}let s=document.createElement("style");s.textContent=`
|
|
39
|
-
/* A note is the room's people talking among themselves: a plain, dashed card, never the accent bubble of a message to the agent. */
|
|
40
|
-
.message[data-note] .bubble,
|
|
41
|
-
.message[data-note][data-mine] .bubble {
|
|
42
|
-
border: 1px dashed var(--control-border);
|
|
43
|
-
background: var(--surface-3);
|
|
44
|
-
color: var(--text);
|
|
45
|
-
box-shadow: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.message[data-note][data-mine] .bubble a,
|
|
49
|
-
.message[data-note][data-mine] .bubble code {
|
|
50
|
-
color: var(--accent);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.message[data-note][data-mine] .prose code,
|
|
54
|
-
.message[data-note][data-mine] .prose blockquote {
|
|
55
|
-
background: var(--surface);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.message[data-note][data-mine] .code-block pre {
|
|
59
|
-
background: var(--surface);
|
|
60
|
-
border-color: var(--border);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.message[data-note][data-mine] .file-chip {
|
|
64
|
-
color: var(--text);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.note-chip {
|
|
68
|
-
padding: 0 var(--space-2);
|
|
69
|
-
border-radius: var(--radius-full);
|
|
70
|
-
background: var(--surface-3);
|
|
71
|
-
color: var(--muted);
|
|
72
|
-
font-size: var(--text-xs);
|
|
73
|
-
font-weight: var(--weight-medium);
|
|
74
|
-
}
|
|
75
|
-
`,document.head.append(s)}m();var p=J(function(o){let{message:a}=o,l=d((c)=>c.principal?.id),r=a.principalId!==void 0&&a.principalId===l;return n("li",{className:"message","data-mid":a.id,"data-note":!0,"data-mine":r||void 0,"data-header":!0,"data-enter":o.enter||void 0,children:[r?null:e("span",{className:"message-avatar",children:e(ot,{picture:a.principalId===void 0?void 0:{principal:a.principalId},name:a.author})}),n("div",{className:"message-main",children:[n("div",{className:"message-meta",children:[e("strong",{children:a.author}),e("span",{className:"note-chip",children:t("Internal note")}),e("time",{dateTime:a.at,children:Wt(a.at,o.timeZone)})]}),n("div",{className:"bubble",children:[a.text?e(Ke,{source:a.text}):null,e(Nt,{files:a.files})]})]})]})}),k=p;export{k as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X,s,A,a,r,t,c,e,n,O,u,w,m,k,P,_,Xo,ne}from"./chunk-index-kankja6p.js";import{ye}from"./chunk-index-wc83vb0a.js";import{Ue}from"./chunk-index-jq970hsd.js";import{de}from"./chunk-index-j479p62w.js";import"./chunk-index-47yspxa4.js";var F=[{kind:"core",label:c("Core"),hint:c("Carried into every turn.")},{kind:"note",label:c("Note"),hint:c("Searched when a knight needs them.")},{kind:"event",label:c("Events"),hint:c("Carried into every turn until their date.")}],q=300;function ae(){let{timeZone:v}=_(),{version:o}=ne(),[d,l]=r("core"),[p,N]=r(""),[b,E]=r(),[f,L]=r(),[h,D]=r(),[C,S]=r(),[y,T]=r(),K=ye(()=>O.principals(),"principals").data,V=a(0),x=X(async(i)=>{let g=++V.current;try{let I=await O.notes(i.trim(),y);if(g!==V.current)return;E(I),L(void 0)}catch(I){if(g===V.current)L(u(I))}},[y]);s(()=>{let i=setTimeout(()=>void x(p),q);return()=>clearTimeout(i)},[p,x,o]);let R=(b??[]).filter((i)=>i.kind===d).sort((i,g)=>d==="event"?(i.eventDate??"").localeCompare(g.eventDate??""):i.id-g.id),W=Xo(v);return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Notes")}),e("p",{className:"hint",children:t("What a knight remembers. A change applies from the next turn.")})]}),e("button",{type:"button",onClick:()=>D({draft:{kind:d,fact:"",eventDate:""}}),children:t("Add")})]}),K&&K.principals.length>1?e(B,{people:K,shown:y,choose:(i)=>{E(void 0),T(i)}}):null,n("div",{className:"toolbar",children:[e("div",{className:"tabs",role:"tablist",children:F.map((i)=>n("button",{type:"button",role:"tab","aria-selected":d===i.kind,onClick:()=>l(i.kind),children:[t(i.label),b?` ${b.filter((g)=>g.kind===i.kind).length}`:""]},i.kind))}),e("input",{type:"search",placeholder:t("Search (words separated by spaces)"),"aria-label":t("Search notes"),value:p,onChange:(i)=>N(i.target.value)})]}),e("p",{className:"hint",children:t(F.find((i)=>i.kind===d)?.hint??"")}),f?e(m,{message:f}):null,!b?e(w,{}):R.length===0?e(k,{children:p?t("No matching notes."):t("Nothing of this kind yet.")}):R.map((i)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[n("div",{children:[i.eventDate?n("p",{className:"meta",children:[i.eventDate," ",i.eventDate<W?e(P,{children:t("past")}):null]}):null,e("p",{className:"text",children:i.fact})]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>D({note:i,draft:{kind:i.kind,fact:i.fact,eventDate:i.eventDate??""}}),children:t("Edit")}),e("button",{type:"button",className:"danger",onClick:()=>S(i),children:t("Delete")})]})]})},i.id)),e(de,{open:h!==void 0,title:h?.note?t("Edit note"):t("Add note"),onClose:()=>D(void 0),children:h?e(H,{initial:h.draft,save:async(i)=>{if(h.note)await O.updateNote(h.note.id,i,y);else await O.addNote(i,y);D((g)=>g===h?void 0:g),await x(p)},cancel:()=>D(void 0)}):null}),e(de,{open:C!==void 0,title:t("Delete this note?"),onClose:()=>S(void 0),children:C?e(M,{text:C.fact,run:async()=>{await O.deleteNote(C.id,y),S((i)=>i===C?void 0:i),await x(p)},cancel:()=>S(void 0)}):null})]})}function B(v){let{people:o}=v,d=A();return n("label",{className:"inline",htmlFor:d,children:[t("Whose notes")," ",e(Ue,{id:d,value:v.shown??o.self,onChange:(l)=>v.choose(l.target.value===o.self?void 0:l.target.value),children:o.principals.map((l)=>e("option",{value:l.id,children:l.id===o.self?t("{name} (you)",{name:l.name}):l.disabled?t("{name} (disabled)",{name:l.name}):l.name},l.id))})]})}function H(v){let[o,d]=r(v.initial),[l,p]=r(!1),[N,b]=r(),E=async()=>{p(!0),b(void 0);try{await v.save({kind:o.kind,fact:o.fact,...o.kind==="event"&&o.eventDate?{eventDate:o.eventDate}:{}})}catch(f){b(u(f)),p(!1)}};return n("form",{className:"stack",onSubmit:(f)=>{f.preventDefault(),E()},children:[n("fieldset",{children:[e("legend",{children:t("Kind")}),e("div",{className:"tabs",children:F.map((f)=>e("button",{type:"button","aria-pressed":o.kind===f.kind,onClick:()=>d({...o,kind:f.kind}),children:t(f.label)},f.kind))})]}),o.kind==="event"?n("label",{children:[t("Date"),e("input",{type:"date",value:o.eventDate,onChange:(f)=>d({...o,eventDate:f.target.value})})]}):null,n("label",{children:[t("Text"),e("textarea",{rows:4,value:o.fact,onChange:(f)=>d({...o,fact:f.target.value})})]}),N?e(m,{message:N}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:v.cancel,children:t("Cancel")}),e("button",{type:"submit",disabled:l,children:l?t("Saving…"):t("Save")})]})]})}function M(v){let[o,d]=r(!1),[l,p]=r();return n("div",{className:"stack",children:[e("p",{className:"text",children:v.text}),l?e(m,{message:l}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:v.cancel,children:t("Cancel")}),e("button",{type:"button",className:"danger",disabled:o,onClick:()=>{d(!0),v.run().catch((N)=>{p(u(N)),d(!1)})},children:o?t("Deleting…"):t("Delete")})]})]})}export{ae as NotesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X,s,a,r,t,g,e,n,o,v,u,w,m,Nn,Vi}from"./chunk-index-kankja6p.js";import{K}from"./chunk-index-3wbyq10m.js";import"./chunk-index-0q15ysrb.js";import{Pn,nn}from"./chunk-index-8eexybcx.js";import"./chunk-index-47yspxa4.js";import{ce}from"./chunk-index-c2ag3qw2.js";var _=90000,C=2000,V=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),F=()=>/iPhone|iPad/.test(navigator.userAgent);function z({step:i,view:b,refresh:p}){let[l,c]=r(),[d,h]=r(i.done?"arrived":"idle"),[S,y]=r(),[T,N]=r(!1),[I,O]=r(!1),k=a(void 0);s(()=>(Nn().then(c,()=>c("unsupported")),()=>clearTimeout(k.current)),[]),s(()=>{if(i.done)h("arrived")},[i.done]);let L=X((f)=>{let A=async()=>{if((await p())?.steps.find((M)=>M.id===i.id)?.done){h("arrived");return}if(Date.now()-f>_){h("late");return}k.current=setTimeout(A,C)};k.current=setTimeout(A,C)},[p,i.id]),D=async()=>{N(!0),y(void 0),h("sending");try{await ce.pushTest(),h("waiting"),L(Date.now())}catch(f){h("idle"),y(u(f))}finally{N(!1)}},E=async()=>{N(!0),y(void 0);try{await Vi(),c(await Nn()),await p()}catch(f){y(f instanceof Error&&f.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):u(f)),c(await Nn().catch(()=>"unsupported"))}finally{N(!1)}},P=l==="unsupported"&&F()&&!V();return n("section",{className:"card stack","aria-labelledby":`step-${i.id}`,children:[n("div",{className:"card-head",children:[e("h2",{id:`step-${i.id}`,children:Pn(i)}),i.done?n("span",{className:"meta",children:[e(o,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:nn(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":l==="on"||P===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:P?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):V()?t("This page is installed on this device."):t("On a phone, add it to the home screen from the browser's menu so notifications reach you when it is closed.")})]}),n("li",{"data-done":l==="on"||void 0,children:[e("strong",{children:t("Allow notifications")}),l==="blocked"?e("span",{className:"meta",children:t("Notifications are blocked for this site. Allow them in the browser's site settings.")}):l==="unsupported"?e("span",{className:"meta",children:t("This browser cannot get push notifications.")}):l==="on"?e("span",{className:"meta",children:t("Allowed on this device.")}):e("button",{type:"button",disabled:T||l===void 0,onClick:E,children:t("Allow notifications")})]}),n("li",{"data-done":i.done||void 0,children:[e("strong",{children:t("Send a test")}),d==="arrived"?e("span",{className:"meta",children:t("It arrived. Notifications work on this device.")}):n(g,{children:[e("button",{type:"button",className:"secondary",disabled:T||l!=="on"||d==="waiting",onClick:D,children:d==="waiting"?t("Waiting for it…"):t("Send a test notification")}),d==="late"?e("span",{className:"meta",children:t("It has not arrived. Check that notifications are allowed for this app, then send another.")}):null]})]})]}),S?e(m,{message:S}):null,i.waiver&&!i.done&&!i.waived?n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>O(!0),children:t(i.waiver.label)}),e(K,{open:I,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>O(!1),onConfirm:async()=>{await ce.waive(i.id),await p()},children:e("p",{children:t(i.waiver.confirm)})})]}):null,b.push.devices>0&&!i.done?e("p",{className:"meta",children:t("{count} device(s) will get notifications.",{count:b.push.devices})}):null]})}function j(){let[i,b]=r(),[p,l]=r(),c=X(async()=>{try{let d=await ce.onboarding();return b(d),d}catch(d){l(u(d));return}},[]);if(s(()=>{c()},[c]),p&&!i)return e(m,{message:p});if(!i)return e(w,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),i.steps.map((d)=>d.builtin==="push"?e(z,{step:d,view:i,refresh:c},d.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:Pn(d)}),d.done||d.waived?n("span",{className:"meta",children:[e(o,{name:"check",size:14})," ",d.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:v(d.open.page),children:t("Open")})]}),e("p",{className:"meta",children:nn(d)})]},d.id)),i.steps.length===0?e("p",{className:"empty",children:t("There is nothing left to set up.")}):null]})}export{j as OnboardingPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{zr,bs}from"./chunk-index-taq2psr6.js";import"./chunk-index-qqwk157d.js";import"./chunk-index-sxq69p1f.js";import"./chunk-index-xxbveevc.js";import"./chunk-index-raf772z6.js";import"./chunk-index-hrtyanda.js";export{bs as folderMenu,zr as placementItems};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,Q,S,X,s,A,r,t,c,g,e,n,o,le,u,p,w,m,k,P,_,ie}from"./chunk-index-kankja6p.js";import{$e,ht}from"./chunk-index-e90kztkx.js";import{L}from"./chunk-index-47yspxa4.js";var G={"Shared prompt":c("Shared prompt"),"Guest prompt":c("Guest prompt"),"The base every knight's prompt starts with, the main knight's included.":c("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.":c("Used instead of the shared prompt when the person speaking is not the owner.")},C=(l)=>t(G[l]??l);var M=S(()=>(h("2bcp2rky"),import("./chunk-prompt-history-2bcp2rky.js")).then((l)=>({default:l.HistorySheet}))),O=S(()=>(h("z95j9jt3"),import("./chunk-confirm-z95j9jt3.js")).then((l)=>({default:l.Confirm})));function me(){let{timeZone:l}=_(),[N,i]=r(),[f,y]=r(),[v,x]=r(),R=X(()=>{$e.prompts().then((d)=>i(d.documents),(d)=>y(u(d)))},[]);return s(R,[R]),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.")}),f?e(m,{message:f}):null,!N&&!f?e(w,{}):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(P,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(P,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:C(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:ie(d.override.at,l)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>x(d.id),children:t("Edit")})})]},d.id)),v?e(Z,{id:v,onClose:()=>{x(void 0),R()}}):null]})}function Z({id:l,onClose:N}){let[i,f]=r(),[y,v]=r(""),[x,R]=r(),[d,E]=r(!1),[T,H]=r(!1),[D,B]=r(!1),[V,F]=r(!1),z=A();s(()=>{let a=!0;return $e.prompt(l).then((b)=>{if(!a)return;f(b),v(b.text)},(b)=>a&&R(u(b))),()=>{a=!1}},[l]);let I=async()=>{if(!i)return;H(!0);try{let a=await $e.savePrompt(l,{text:y,base:i.text});f(a),v(a.text),E(!1),p(t("Saved."))}catch(a){if(a instanceof le&&a.status===409){let{current:b}=a.body;f(b),p(a.message,"danger")}else p(u(a),"danger")}finally{H(!1)}},U=i!==void 0&&y!==i.text;return n(L,{open:!0,title:i?C(i.label):t("Main prompts"),size:"full",onClose:N,children:[x?e(m,{message:x}):null,!i&&!x?e(w,{}):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(P,{tone:"warn",children:t("Differs from the file version")})}):null,d?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(ht,{label:t("Prompt"),before:i.text,after:y}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:T,onClick:()=>E(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:T,onClick:I,children:T?t("Saving…"):t("Save")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:z,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>B(!0),children:[e(o,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:z,className:"prompt-full",value:y,maxLength:i.maxChars,onChange:(a)=>v(a.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>F(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!U||!y.trim(),onClick:()=>E(!0),children:t("Review changes")})]})]}),D?e(Q,{fallback:null,children:e(M,{open:D,title:t("History of {name}",{name:C(i.label)}),load:async()=>(await $e.promptHistory(l)).versions.map((a)=>({id:a.id,text:a.text,previous:a.previous,by:a.by,at:a.at,revert:a.action==="revert"})),onUse:(a)=>{v(a),E(!1),B(!1)},onClose:()=>B(!1)})}):null,V?e(Q,{fallback:null,children:e(O,{open:V,title:t("Revert {name} to the file version?",{name:C(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let a=await $e.revertPrompt(l,{base:i.text});f(a),v(a.text),E(!1),p(t("Back to the file version."))}catch(a){if(!(a instanceof le&&a.status===409))throw a;let{current:b}=a.body;f(b),p(a.message,"danger")}},onClose:()=>F(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{me as PromptsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ji}from"./chunk-index-efgm0066.js";import"./chunk-index-j479p62w.js";import"./chunk-index-3wbyq10m.js";import"./chunk-index-47yspxa4.js";import"./chunk-index-kb44jp50.js";import"./chunk-index-qqwk157d.js";import"./chunk-index-hrtyanda.js";export{Ji as RoomConfirmHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,r,t,g,e,n,o,v,d,_,tt,$t,Ne,_t}from"./chunk-index-kankja6p.js";import{Ee}from"./chunk-index-qqwk157d.js";import{pt}from"./chunk-index-agrvqf5b.js";import{L}from"./chunk-index-47yspxa4.js";import{nt}from"./chunk-index-q5vzjqr5.js";var p="room-menu-yolo",N="room-menu-long",f="room-menu-mute";function P(a){let[l,m]=r(!1),i=_().app?.modes!==!1,b=d((s)=>s.rooms[a.room]?.view?.home===!1,a.room),u=d((s)=>s.pins.includes(a.room),a.room),c=a.mode??{yolo:!1,longRunning:!1},y=async(s)=>{m(!0),await $t(a.room,{longRunning:s}),m(!1)};return e(L,{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:v("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(o,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(o,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:f,children:[e("span",{className:"menu-icon",children:e(o,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(pt,{id:f,checked:!a.muted,label:t("Notifications"),onChange:async(s)=>{m(!0),await nt(a.room,!s),m(!1)},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:p,children:[e("span",{className:"menu-icon","data-tone":"yolo",children:e(o,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(pt,{id:p,checked:c.yolo,label:t("Yolo mode"),onChange:(s)=>{if(s)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(o,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(pt,{id:N,checked:c.longRunning,label:t("Long-running mode"),onChange:y,busy:l})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),tt(a.agent)},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit knight")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(o,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),_t({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(o,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(o,{name:"chevron",size:16})]})}):null,a.readOnly||!b?null:n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(h("6assr93n"),import("./chunk-layout-actions-6assr93n.js")).then((s)=>s.pinRoom(a.room,!u))},children:[e("span",{className:"menu-icon",children:e(o,{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(),Ee({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(o,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(o,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),Ne({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(o,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{P as RoomMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,e,o,d}from"./chunk-index-kankja6p.js";import"./chunk-index-qqwk157d.js";import"./chunk-index-raf772z6.js";import{Wn}from"./chunk-index-r3tqhew8.js";import"./chunk-index-sxq69p1f.js";import"./chunk-index-xxbveevc.js";function n(){if(!d((r)=>r.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(r)=>Wn(r.currentTarget),children:e(o,{name:"more",size:18})})}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,Q,S,X,s,A,N,a,r,t,c,g,e,n,o,F,d,le,O,u,p,w,m,k,pn,Io,Do,Ne,ui,qo,he,An}from"./chunk-index-kankja6p.js";import{co}from"./chunk-index-n6zrc05a.js";import{K}from"./chunk-index-3wbyq10m.js";import"./chunk-index-qqwk157d.js";import"./chunk-index-kb44jp50.js";import{xe,wt,Ji}from"./chunk-index-efgm0066.js";import{bn}from"./chunk-index-eyc2rkq5.js";import{$e,ht}from"./chunk-index-e90kztkx.js";import{pt}from"./chunk-index-agrvqf5b.js";import{Ue}from"./chunk-index-jq970hsd.js";import"./chunk-index-j479p62w.js";import{L}from"./chunk-index-47yspxa4.js";import{nt}from"./chunk-index-q5vzjqr5.js";import"./chunk-index-hrtyanda.js";function se(i){return n("fieldset",{className:"field",children:[e("legend",{children:i.label}),e("div",{className:"option-chips",children:i.options.map((f)=>e("button",{type:"button","aria-pressed":f.value===i.value,className:"option-chip",onClick:()=>i.onChange(f.value),children:f.label},f.value))})]})}var Re=S(()=>(h("2bcp2rky"),import("./chunk-prompt-history-2bcp2rky.js")).then((i)=>({default:i.HistorySheet}))),Te=S(()=>(h("qwcsdytw"),import("./chunk-character-creator-qwcsdytw.js")).then((i)=>({default:i.CharacterCreator}))),Fe=["default","off","minimal","low","medium","high","xhigh"],ve={default:c("Default"),off:c("Off"),minimal:c("Minimal"),low:c("Low"),medium:c("Medium"),high:c("High"),xhigh:c("Very high")},B="default",be=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),Oe=c("Automatic"),me=(i)=>i==="auto"?t(Oe):t(ve[i]??i),fe=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??B,thinking:i.thinking??B});function ge(i,f){return{...f.displayName!==i.displayName?{displayName:f.displayName}:{},...f.prompt!==i.prompt?{prompt:f.prompt}:{},...f.model!==(i.model??B)?{model:f.model}:{},...f.thinking!==(i.thinking??B)?{thinking:f.thinking}:{}}}function ye(){let i=Do(),f=a(i);if(i)f.current=i;let l=f.current,C=i!==void 0;if(s(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)pn()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(L,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:pn,children:e(Ve,{name:l.name,opened:l.id},l.name)})}function Ve({name:i,opened:f}){let[l,C]=r(),[P,I]=r([]),[E,z]=r(),[M,x]=r(),[v,T]=r(!1),[R,G]=r(!1),[ee,J]=r(!1),[U,j]=r(!1),te=An(l?.room??""),q=a(null),W=l!==void 0,_=d((y)=>l?y.rooms[l.room]?.view?.muted===!0:!1,l?.room??""),[ae,V]=r(!1),ne=d((y)=>l?y.rooms[l.room]?.view?.coordinator===!0:!1,l?.room??""),Y=A(),Z=A(),D=A();s(()=>{if(!W||!Io()?.look)return;q.current?.scrollIntoView({block:"start"}),q.current?.focus({preventScroll:!0})},[W,f]);let b=a({});b.current={profile:l,draft:M},s(()=>{let y=!0;return Promise.all([O.agent(i),O.models()]).then(([ie,Pe])=>{if(!y)return;let{profile:ue,draft:re}=b.current,He=ue&&re&&Object.keys(ge(ue,re)).length>0;C(ie),I(Pe.models),x(He?re:fe(ie))},(ie)=>y&&z(u(ie))),()=>{y=!1}},[i,f]);let H=N(()=>l&&M?ge(l,M):{},[l,M]);if(E)return e(m,{message:E});if(!l||!M)return e(w,{});let de=Object.keys(H).length>0,Le=Array.from(new Set([B,...P,M.model])),Ie=be(l),pe=async()=>{T(!0);try{let y=await O.updateAgent(i,H);C(y),x(fe(y)),G(!1),p(t("Saved."))}catch(y){p(u(y),"danger")}finally{T(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(he,{spec:l.character,name:l.name,size:72,state:te,label:l.displayName}),n("div",{children:[e("h3",{children:l.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:l.effective.model,thinking:me(l.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:D,children:[e("span",{className:"menu-icon",children:e(o,{name:_?"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(pt,{id:D,checked:!_,label:t("Notifications"),busy:ae,onChange:async(y)=>{V(!0),await nt(l.room,!y),V(!1)}})]})})}),R?e(Be,{profile:l,draft:M,saving:v,onBack:()=>G(!1),onSave:pe}):n("form",{className:"stack form",onSubmit:(y)=>{if(y.preventDefault(),!de)return;if(H.prompt!==void 0)G(!0);else pe()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:M.displayName,onChange:(y)=>x({...M,displayName:y.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:Y,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>j(!0),children:[e(o,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>J(!0),children:[e(Ge,{}),t("Full screen")]})]})]}),e("textarea",{id:Y,rows:8,value:M.prompt,onChange:(y)=>x({...M,prompt:y.target.value})})]}),e(se,{label:t("Model"),value:M.model,onChange:(y)=>x({...M,model:y}),options:Le.map((y)=>({value:y,label:y===B?Ie:y}))}),e(se,{label:t("Thinking level"),value:M.thinking,onChange:(y)=>x({...M,thinking:y}),options:Fe.map((y)=>({value:y,label:t(ve[y])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!de||v,children:v?t("Saving…"):H.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(ze,{name:i,opened:f}),n("section",{className:"card stack",ref:q,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(w,{}),children:e(Te,{name:l.name,displayName:l.displayName,prompt:l.prompt,character:l.character,onSaved:(y)=>C(y)})})]}),ne?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:()=>{pn(),Ne({kind:"archive",room:l.room,name:l.displayName})},children:t("Archive {name}",{name:l.displayName})})})]}),U?e(Q,{fallback:null,children:e(Re,{open:U,title:t("History of the prompt"),load:async()=>(await $e.agentPromptHistory(i)).versions.map((y)=>({id:y.id,text:y.text,previous:y.previous,by:y.by,at:y.at})),onUse:(y)=>{x({...M,prompt:y}),j(!1)},onClose:()=>j(!1)})}):null,e(L,{open:ee,title:t("Prompt"),size:"full",onClose:()=>J(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:M.prompt,onChange:(y)=>x({...M,prompt:y.target.value})})})]})}function ze({name:i,opened:f}){let[l,C]=r(),[P,I]=r(),[E,z]=r(),M=A();if(s(()=>{let v=!0;return xe.skills(i).then((T)=>v&&C(T),(T)=>{if(v&&!(T instanceof le&&T.status===404))z(u(T))}),()=>{v=!1}},[i,f]),E)return e(m,{message:E});if(!l)return null;let x=async(v,T)=>{I(v);try{C(await xe.setSkills(i,T?{add:[v]}:{remove:[v]}))}catch(R){p(u(R),"danger")}finally{I(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),children:[e("h3",{children:t("Skills")}),e("p",{className:"meta",children:t("What the knight can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:l.skills.map((v,T)=>{let R=`${M}-${T}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:R,children:[n("span",{className:"menu-text",children:[e("strong",{children:v.name}),e("span",{className:"meta",children:v.missing?t("Its file cannot be read."):v.builtin?t("Built in: every knight carries it."):v.description??""})]}),e(pt,{id:R,checked:v.carried,label:v.name,busy:P===v.name,disabled:v.builtin,onChange:(G)=>x(v.name,G)})]})},v.name)})})]})}var Ge=()=>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 Be(i){let{profile:f,draft:l}=i,C=a(null);s(()=>C.current?.focus(),[]);let P=[];if(l.displayName!==f.displayName)P.push({label:t("Name"),before:f.displayName,after:l.displayName});let I=(E)=>E===B?be(f):E;if(l.model!==(f.model??B))P.push({label:t("Model"),before:I(f.model??B),after:I(l.model)});if(l.thinking!==(f.thinking??B))P.push({label:t("Thinking level"),before:me(f.thinking??B),after:me(l.thinking)});return n("section",{ref:C,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),P.length?e("ul",{className:"review-fields",children:P.map((E)=>n("li",{children:[e("strong",{children:E.label}),e("span",{className:"review-before",children:E.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:E.after})]},E.label))}):null,e(ht,{label:t("Prompt"),before:f.prompt,after:l.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")})]})]})}function ke(){let[i,f]=r(),[l,C]=r(),[P,I]=r(),[E,z]=r(),M=X(async()=>{try{f((await xe.archive()).entries),C(void 0)}catch(v){C(u(v))}},[]);s(()=>{M()},[M]);let x=async(v)=>{I(v.name);try{if(v.kind==="agent")await xe.restoreAgent(v.name);else await xe.restoreGroup(v.name);await wt(),p(t("Restored {name}.",{name:v.displayName})),await M()}catch(T){p(u(T),"danger")}finally{I(void 0)}};if(l&&!i)return e(m,{message:l});if(!i)return e(w,{});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:i.map((v)=>n("li",{className:"menu-item",children:[e("span",{className:"menu-icon",children:e(o,{name:v.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:v.displayName}),n("span",{className:"meta",children:[v.kind==="agent"?t("Knight"):t("Group")," ·"," ",v.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:P===v.name,onClick:()=>x(v),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:P===v.name,onClick:()=>z(v),children:t("Delete")})]},`${v.kind}:${v.name}`))}),e(K,{open:E!==void 0,title:t("Delete {name}?",{name:E?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>z(void 0),onConfirm:async()=>{if(!E)return;if(E.kind==="agent")await xe.deleteAgent(E.name);else await xe.deleteGroup(E.name);await wt(),p(t("Deleted {name}.",{name:E.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:E?.displayName??""})})})]})}var we=/^[a-z0-9-]{1,32}$/,Ce=2,Se=6,oe="\x00";function Ke(){let i=d((f)=>f.order.flatMap((l)=>{let C=f.rooms[l]?.view;return C?.kind==="agent"?[`${C.name}${oe}${C.displayName}`]:[]}).join(`${oe}${oe}`));return N(()=>i===""?[]:i.split(`${oe}${oe}`).map((f)=>{let[l="",C=""]=f.split(oe);return{name:l,displayName:C}}),[i])}function Ae(i){let f=Ke(),[l,C]=r(),[P,I]=r(),[E,z]=r(""),[M,x]=r(""),[v,T]=r(!1),[R,G]=r([]),[ee,J]=r(""),[U,j]=r(!1),[te,q]=r(i.name===void 0),W=A(),_=A();s(()=>{let D=i.name;if(D===void 0)return;let b=!0;return xe.group(D).then((H)=>{if(!b)return;C(H),z(H.displayName),G(H.members),J(H.host),q(!0)},(H)=>b&&I(u(H))),()=>{b=!1}},[i.name]);let ae=(D)=>f.find((b)=>b.name===D)?.displayName??D,V=R.includes(ee)?ee:R[0]??"",ne=l===void 0?!0:E.trim()!==l.displayName||R.join(",")!==l.members.join(",")||V!==l.host,Y=E.trim()!==""&&R.length>=Ce&&R.length<=Se&&(l!==void 0||we.test(M));if(P&&!te)return e(m,{message:P});if(!te)return e(w,{});let Z=async()=>{j(!0),I(void 0);try{if(l){await xe.updateGroup(l.name,{...E.trim()!==l.displayName?{displayName:E.trim()}:{},...R.join(",")!==l.members.join(",")?{members:R}:{},...V!==l.host?{host:V}:{}}),await wt(),p(t("Saved.")),i.onDone();return}let D=await xe.createGroup({name:M,displayName:E.trim(),members:R,host:V});await wt(),p(t("Made {name}.",{name:D.displayName})),i.onDone(),F("room",D.room)}catch(D){I(u(D))}finally{j(!1)}};return n("form",{className:"stack form",onSubmit:(D)=>{if(D.preventDefault(),Y&&ne&&!U)Z()},children:[n("label",{htmlFor:W,children:[t("Name"),e("input",{id:W,value:E,autoComplete:"off",onChange:(D)=>{if(z(D.target.value),!l&&!v)x(D.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),l?null:n("label",{htmlFor:_,children:[t("Permanent name"),e("input",{id:_,value:M,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":M!==""&&!we.test(M),onChange:(D)=>{T(!0),x(D.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Members")}),e("span",{className:"meta",children:t("Pick 2 to 6 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:f.map((D)=>{let b=R.includes(D.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:b,disabled:!b&&R.length>=Se,onChange:()=>G(b?R.filter((H)=>H!==D.name):[...R,D.name])}),e("span",{className:"menu-text",children:e("strong",{children:D.displayName})})]})},D.name)})})]}),R.length>=Ce?e(se,{label:t("Host"),value:V,onChange:J,options:R.map((D)=>({value:D,label:ae(D)}))}):null,P?e(m,{message:P}):null,n("div",{className:"actions",children:[l?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),Ne({kind:"archive",room:l.room,name:l.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!Y||!ne||U,children:U?t("Saving…"):l?t("Save"):t("Make group")})]})]})}var _e=S(()=>(h("qwcsdytw"),import("./chunk-character-creator-qwcsdytw.js")).then((i)=>({default:i.CharacterCreator}))),Ee=/^[a-z0-9-]{1,32}$/,ce="default";function je(i){let f=[];for(let l of i){let C=l.indexOf("/"),P=C>0?l.slice(0,C):"",I=f.find((E)=>E.provider===P&&P!=="");if(I)I.models.push(l);else f.push({provider:P,models:[l]})}return f}var qe=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Me({onDone:i}){let[f,l]=r(""),[C,P]=r(""),[I,E]=r(!1),[z,M]=r(""),[x,v]=r(ce),[T,R]=r(""),[G,ee]=r(),[J,U]=r(!1),[j,te]=r([]),[q,W]=r(),[_,ae]=r(!1),V=[A(),A(),A(),A(),A()];s(()=>{let b=!0;return O.models().then((H)=>b&&te(H.models),()=>{return}),()=>{b=!1}},[]);let ne=N(()=>bn({name:C,displayName:f,prompt:z}),[C,f,z]),Y=G?.spec??ne,Z=Ee.test(C)&&f.trim()!==""&&z.trim()!=="";if(J)return e(Q,{fallback:e(w,{}),children:e(_e,{name:C||"new",displayName:f,prompt:z,character:Y,onPick:(b,H)=>{ee({input:b,spec:H}),U(!1)},onCancel:()=>U(!1)})});let D=async()=>{ae(!0),W(void 0);try{let b={name:C,displayName:f.trim(),prompt:z,...x!==ce?{model:x}:{},...T.trim()?{task:T.trim()}:{},...G?{character:G.input}:{}},H=await xe.createAgent(b);await wt(),p(t("Made {name}.",{name:H.displayName})),i(),F("room",H.room)}catch(b){W(b instanceof le&&b.field?`${b.field}: ${u(b)}`:u(b))}finally{ae(!1)}};return n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),Z&&!_)D()},children:[n("label",{htmlFor:V[0],children:[t("Name"),e("input",{id:V[0],value:f,autoComplete:"off",onChange:(b)=>{if(l(b.target.value),!I)P(qe(b.target.value))}})]}),n("label",{htmlFor:V[1],children:[t("Permanent name"),e("input",{id:V[1],value:C,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":C!==""&&!Ee.test(C),onChange:(b)=>{E(!0),P(b.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:V[2],children:[t("Prompt"),e("textarea",{id:V[2],rows:6,value:z,onChange:(b)=>M(b.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:V[4],children:[t("Model"),n(Ue,{id:V[4],value:x,onChange:(b)=>v(b.target.value),children:[e("option",{value:ce,children:t("Default model")}),je(j).map((b)=>b.provider===""?b.models.map((H)=>e("option",{value:H,children:H},H)):e("optgroup",{label:b.provider,children:b.models.map((H)=>e("option",{value:H,children:H},H))},b.provider))]})]}),n("label",{htmlFor:V[3],children:[t("Opening task"),e("textarea",{id:V[3],rows:3,value:T,onChange:(b)=>R(b.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:Y,name:C||"new",size:72,label:f}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:G?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>U(!0),children:t("Choose a look")})]})]}),q?e(m,{message:q}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!Z||_,children:_?t("Making…"):t("Make knight")})})]})}var We=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function De(){let i=qo(),f=a(i);if(i)f.current=i;let l=f.current,C=i!==void 0;if(s(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)ui()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(L,{open:i!==void 0,title:We(l),size:"wide",onClose:ui,children:e("div",{className:"stack agent-sheet",children:l.kind==="new-agent"?e(Me,{onDone:ui}):l.kind==="archive"?e(ke,{}):e(Ae,{...l.name===void 0?{}:{name:l.name},onDone:ui})},l.id)})}var Xe=S(()=>(h("bdbkdcs9"),import("./chunk-shortcut-help-bdbkdcs9.js")));function Ye(){let i=co(),f=a(!1);if(i)f.current=!0;if(!f.current)return null;return e(Q,{fallback:null,children:e(Xe,{open:i})})}function va(){return n(g,{children:[e(Ji,{}),e(ye,{}),e(De,{}),e(Ye,{})]})}export{va as SheetHosts};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{h,Q,S,s,A,r,t,g,e,n,o,le,u,p,w,m}from"./chunk-index-kankja6p.js";import{$e,ht}from"./chunk-index-e90kztkx.js";import{L}from"./chunk-index-47yspxa4.js";var M=S(()=>(h("2bcp2rky"),import("./chunk-prompt-history-2bcp2rky.js")).then((c)=>({default:c.HistorySheet}))),B=`---
|
|
2
|
-
name: my-skill
|
|
3
|
-
description: "Use when "
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# My skill
|
|
7
|
-
|
|
8
|
-
`;function _(c){let{name:d}=c,[i,k]=r(),[f,v]=r(d?"":B),[b,I]=r(),[R,y]=r(!1),[C,x]=r(!1),[z,D]=r(!1),[H,N]=r(!1),T=A();s(()=>{if(!d)return;let a=!0;return $e.skillDocument(d).then((l)=>{if(!a)return;k(l),v(l.text)},(l)=>a&&I(u(l))),()=>{a=!1}},[d]);let E=i?.text??"",U=f!==E,F=d!==void 0&&!i&&!b,V=async()=>{x(!0);try{if(i){let a=await $e.saveSkillDocument(i.name,{text:f,baseHash:i.hash});k(a),v(a.text),y(!1),D(!1),p(t("Saved.")),c.onSaved()}else await $e.createSkillDocument({text:f}),p(t("Skill created.")),c.onSaved(),c.onClose()}catch(a){if(a instanceof le&&a.status===409){let{current:l}=a.body;k(l),D(!0)}else p(u(a),"danger")}finally{x(!1)}};return n(L,{open:!0,title:d??t("New skill"),size:"full",onClose:c.onClose,children:[b?e(m,{message:b}):null,F?e(w,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!F&&!b&&(!i||i.writable)?n("div",{className:"stack",children:[R?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),z?e(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(ht,{label:"SKILL.md",before:E,after:f}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>y(!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(o,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:T,className:"prompt-full",spellCheck:!1,value:f,onChange:(a)=>v(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||!f.trim(),onClick:()=>y(!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 $e.skillHistory(i.name);return a.map((l,K)=>({id:l.id,text:l.text,previous:a[K+1]?.text??"",by:l.by,at:l.at}))},onUse:(a)=>{v(a),y(!1),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,mr,Q,S,s,r,t,g,e,n,o,O,u,w,m,k,P,Zt,At}from"./chunk-index-kankja6p.js";import{ye}from"./chunk-index-wc83vb0a.js";import{de}from"./chunk-index-j479p62w.js";import"./chunk-index-47yspxa4.js";function v({source:i}){return e("div",{className:"prose document",children:e(Zt,{remarkPlugins:[At],components:{a:({href:a,children:d})=>a&&/^https?:\/\//.test(a)?e("a",{href:a,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:a})=>e("span",{children:a}),pre:({children:a})=>e("div",{className:"code-block",children:e("pre",{children:a})}),table:({children:a})=>e("div",{className:"table-wrap",children:e("table",{children:a})})},children:i})})}var E=S(()=>(h("z3dx2895"),import("./chunk-skill-editor-z3dx2895.js")).then((i)=>({default:i.SkillEditor})));function j(){let[i,a]=r(0),{data:d,error:l}=ye(()=>O.skills(),`skills:${i}`),[b,N]=r(),[p,f]=r();s(()=>{O.session().then(N,()=>{return})},[]);let y=b?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),y?n("button",{type:"button",className:"secondary",onClick:()=>f({name:void 0}),children:[e(o,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:y?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.")}),l?e(m,{message:l}):null,!d&&!l?e(w,{}):null,d?.length===0?e(k,{children:t("No skills.")}):null,d?.map((c)=>e(V,{skill:c,onEdit:y&&c.source.kind==="written"?()=>f({name:c.name}):void 0},`${c.name}:${i}`)),p?e(Q,{fallback:null,children:e(E,{name:p.name,onSaved:()=>a((c)=>c+1),onClose:()=>f(void 0)},p.name??"")}):null]})}function D(i){switch(i.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:i.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${i.repo}:${i.path}`});default:return}}function V({skill:i,onEdit:a}){let[d,l]=r(!1),[b,N]=r(),[p,f]=r(),y=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Knight-written"):i.source.kind==="package"?i.source.package:`${i.source.repo}:${i.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(P,{children:y}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(g,{children:[a?e("button",{type:"button",className:"secondary",onClick:a,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!b)f(void 0),O.skill(i.name).then(N).catch((c)=>f(u(c)))},children:"SKILL.md"})]})]}),e("p",{children:i.missing??i.description}),i.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(o,{name:"lock",size:14}),e("span",{children:D(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All knights"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(de,{open:d,title:i.name,size:"wide",onClose:()=>l(!1),children:p?e(m,{message:p}):!b?e(w,{}):e(C,{title:i.name,detail:b})})]})}function C({title:i,detail:a}){let d=a.metadata.filter((l)=>!(l.key==="name"&&l.value===i));return n("div",{className:"skill-document",children:[d.length?e("dl",{className:"skill-meta",children:d.map((l)=>n(mr,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(v,{source:a.body})]})}export{j as SkillsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N,a,r,t,te,g,e,n,o,v,F,Ot,_e,d,Je,Yt,mn,Ze,We,yn}from"./chunk-index-kankja6p.js";import{ti}from"./chunk-index-azrnzgev.js";import{Kn}from"./chunk-index-hc0dgmrs.js";import{Jn,ei}from"./chunk-index-gt42wjby.js";import{qt}from"./chunk-index-1fn8q4ps.js";import{cs}from"./chunk-index-nrexxkar.js";Jn();function k(){let l=d((c)=>JSON.stringify(cs(c,(s)=>_e(c,s),(s)=>Ot(c,s)>0,!0).map((s)=>({id:s.id,...s.title===void 0?{}:{title:s.title},entries:s.keys.map((u)=>({key:u,name:c.rooms[u]?.view?.displayName??u,waiting:Ot(c,u)>0}))})))),m=ti(),p=a(l);if(!m)p.current=l;let f=p.current;return N(()=>JSON.parse(f),[f])}function z(l){let{key:m,name:p}=l.entry,f=d((i)=>i.rooms[m]),c=d((i)=>Ot(i,m)),s=f?.view,u=Ze(s?.character),w=qt(()=>Yt(m,l.onLeave),l.liftable&&!s?.home?ei(m):void 0);if(!s)return null;return e("li",{...l.liftable&&!s.home?{"data-drop-item":"","data-key":m}:{},children:n("a",{className:"switcher-row",...w,href:v("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(We,{view:s,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(yn,{room:m}),c?e("span",{className:"badge badge-warn",children:te(c,"{count} card waiting","{count} cards waiting")}):null,s.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(o,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,f?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(o,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,f?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(o,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[m,p]=r(""),f=k(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>Kn(m,h.name)!==void 0)})).filter((i)=>i.entries.length>0||m===""),s=(i)=>l.close(i===l.current?void 0:()=>F("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(o,{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&&!Je(i.nativeEvent))s(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>mn(i.currentTarget,l.close),children:e(o,{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((b)=>e(z,{entry:b,current:l.current,onPick:s,onLeave:l.close,liftable:!h&&i.id!=="home"},b.key))})]},i.id)})})]})}export{Y as SwitcherList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,Q,S,be,s,r,t,e,n,Se,F,d,Ge,fe,Bo}from"./chunk-index-kankja6p.js";import"./chunk-index-84wbc80d.js";import"./chunk-index-zx6yka30.js";import"./chunk-index-raf772z6.js";import{kn,_n,wi,go,ki,Hn,Vt}from"./chunk-index-n93wqszt.js";import{ho,Yn}from"./chunk-index-5fz5e1ct.js";import"./chunk-index-47yspxa4.js";var W=S(()=>(h("f683hx8k"),import("./chunk-table-seats-f683hx8k.js")).then((a)=>({default:a.TableSeatsSheet}))),z=300;function D(a){let[p,c]=r(!1);return s(()=>{if(!a){c(!1);return}if(Se()){c(!0);return}let l=setTimeout(()=>c(!0),z);return()=>clearTimeout(l)},[a]),p}function N(a,p,c,l){Bo(a).then((b)=>{if(b)fe({...b,at:p,via:c,source:l})},()=>{return})}function I(){return go((be(Ge)?.kinds??[]).map((a)=>a.kind)),null}function te({focus:a}){let[p,c]=r(),l=ki(void 0),b=Hn(),[w,R]=r(!1),[x,A]=r(!1),m=_n(),T=wi(),y=kn(),E=d((o)=>o.listed),M=m?y.loaded:E&&(!T||y.loaded),C=new Set(y.views.map((o)=>o.key)),v=m?l:l.filter((o)=>!C.has(o.key)),i=m?null:ho(a,v),g=v.find((o)=>o.name===i);s(()=>{if(a&&M&&i===null)F("table",void 0,{replace:!0})},[a,M,i]);let B=D(i!==null),k=(o)=>{if(m){let f=l.find((L)=>L.name===o);if(f)F("room",f.key);return}let u=l.find((f)=>f.name===o);if(u&&C.has(u.key)){F("room",u.key);return}if(o===i)return;F("table",o??void 0,{replace:i!==null})},H=()=>{A(!0),R(!0)},V=!m&&l.length===0&&b.length>0,K=m&&y.loaded&&l.length===0;return n("div",{className:"table-page","data-focused":i!==null||void 0,children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[p?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>k(null),children:t("Reset view")}):null,!m&&b.length>0?e("button",{type:"button",className:"secondary","aria-haspopup":"dialog",onClick:H,children:t("Who's at the table")}):null]})]}),n("div",{className:"table-frame","data-focused":i!==null||void 0,children:[V?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("Every knight has left the table. Choose who sits down.")}),e("button",{type:"button",onClick:H,children:t("Who's at the table")})]}):K?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(Vt,{onHandle:c,focus:i,onFocus:k,...m?{onMore:()=>F("rooms")}:{onSeat:k,onSeatMenu:(o)=>{let u=v.find((f)=>f.name===o.id);if(u)N(u.key,o.at,o.via,o.source)}}}),T?e(I,{}):null,g?e(Yn,{roomKey:g.key,open:B,onBack:()=>k(null),onMenu:(o)=>{let u=o.getBoundingClientRect();N(g.key,{x:u.left,y:u.bottom},"key",o)}},g.key):null]}),x?e(Q,{fallback:null,children:e(W,{open:w,onClose:()=>R(!1)})}):null]})}export{te as TablePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A,r,t,e,n,We}from"./chunk-index-kankja6p.js";import"./chunk-index-84wbc80d.js";import"./chunk-index-zx6yka30.js";import"./chunk-index-raf772z6.js";import{Hn}from"./chunk-index-n93wqszt.js";import{pt}from"./chunk-index-agrvqf5b.js";import{L}from"./chunk-index-47yspxa4.js";import{nt}from"./chunk-index-q5vzjqr5.js";function u({view:s}){let o=A(),[a,m]=r(!1),l=s.muted===!0;return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",htmlFor:o,children:[e(We,{view:s,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:s.displayName}),l?e("span",{className:"meta",children:t("Off the table")}):null]}),e(pt,{id:o,checked:!l,label:s.displayName,busy:a,onChange:async(i)=>{m(!0),await nt(s.key,!i),m(!1)}})]})})}function g(s){let o=Hn();return e(L,{open:s.open,title:t("Who's at the table"),onClose:s.onClose,children:n("div",{className:"stack table-seats",children:[e("p",{className:"meta",children:t("A knight who leaves the table is muted: its room stops pushing to you. A card that waits for you is always pushed.")}),e("ul",{className:"menu",children:o.map((a)=>e(u,{view:a},a.key))})]})})}export{g as TableSeatsSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Qn,ur,dr,Mt,on,sn,ni}from"./chunk-index-fe0m5mht.js";import{Ct,Gt}from"./chunk-index-pgxgq61x.js";var le="http://www.w3.org/2000/svg",t=(d,i={},p)=>{let y=document.createElementNS(le,d);for(let[E,R]of Object.entries(i))y.setAttribute(E,String(R));return p?.appendChild(y),y},ce=(d)=>{let i=/<svg[^>]*\swidth=/.test(d)?d:d.replace("<svg",'<svg width="256" height="256"');return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`},de=0;function fe(d,i){let p=i||d<=6?1:2;return{rows:p,perRow:Math.max(1,Math.ceil(d/p))}}function ye(d,i){let p=`t2d${++de}`,y=window.matchMedia("(prefers-reduced-motion: reduce)"),E=i.reducedMotion==="auto"||i.reducedMotion===void 0?y.matches:i.reducedMotion,R=i.labels??Gt,{theme:O,scheme:I}=i,M=[],_=new Map,A=new Map,T=i.focus??null,S=document.createElement("div");S.className="t2d";let m=t("svg",{role:"group","aria-label":R.table});if(S.appendChild(m),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(S);function Q(e,s,c){let o=Math.max(1.6,c*0.022),g=o+Math.max(1.2,c*0.014),a=t("filter",{id:`${p}-rim`,x:"-15%",y:"-15%",width:"130%",height:"130%"},e);t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:g,result:"far"},a),t("feFlood",{"flood-color":s.ink,result:"ink"},a),t("feComposite",{in:"ink",in2:"far",operator:"in",result:"line"},a),t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:o,result:"near"},a),t("feFlood",{"flood-color":s.paper,result:"paper"},a),t("feComposite",{in:"paper",in2:"near",operator:"in",result:"rim"},a);let l=t("feMerge",{},a);for(let w of["line","rim","SourceGraphic"])t("feMergeNode",{in:w},l)}function x(){let e=Qn(O,I);S.classList.toggle("reduced",E),S.classList.toggle("focus",T!==null),S.classList.toggle("dim",M.some((r)=>A.get(r.id)==="speaking"));let s=i.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,s?60:200);m.setAttribute("viewBox",`0 0 ${c} ${o}`),m.replaceChildren();let g=Math.max(M.length,1),{rows:a,perRow:l}=fe(g,s);t("rect",{width:c,height:o,fill:e.css.bg},m);let w=t("defs",{},m),C=c/2,N=s?o*0.82:o*0.62;if(t("ellipse",{cx:C,cy:N,rx:c*0.47,ry:s?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},m),!s)t("ellipse",{cx:C,cy:N,rx:c*0.3,ry:o*0.2,fill:"none",stroke:e.css.ring,"stroke-width":3,opacity:e.night?0.9:0.7},m);let F=c/l,q=s?o*0.95:o/(a+0.6),h=Math.max(46,Math.min(F*0.94,132,q*1.05)),u=h*0.72,n=h*1.05;Q(w,e,n),M.forEach((r,b)=>{let k=t("radialGradient",{id:`${p}-h${b}`},w);t("stop",{offset:0,"stop-color":r.color,"stop-opacity":0.95},k),t("stop",{offset:1,"stop-color":r.color,"stop-opacity":0},k)});let te=(r)=>{if(s)return o*0.92;return a===1?o*0.62:o*(0.46+r*0.3)};if(M.forEach((r,b)=>{let k=Math.floor(b/l),oe=Math.min(l,g-k*l),ne=b-k*l,re=c/oe*(ne+0.5),ie=te(k),H=A.get(r.id)??"idle",f=t("g",{class:"seat","data-seat":r.id,"data-state":H,...T===r.id?{"data-focus":""}:{},transform:`translate(${re.toFixed(1)} ${ie.toFixed(1)})`,tabindex:i.listBelow?-1:0,role:"button","aria-label":R.seat(r.name,H),color:e.css.text,...i.listBelow?{"aria-hidden":"true"}:{}},m);t("ellipse",{cx:0,cy:3,rx:h*0.55,ry:h*0.1,fill:"#000",opacity:0.35},f),t("ellipse",{class:"halo",cx:0,cy:-u-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${p}-h${b})`},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:r.color,opacity:0.2},f);let B=t("g",{class:"lift"},f),j=_.get(r.id);if(j)t("image",{href:ce(j),x:-n/2,y:-u-n*0.78,width:n,height:n*0.88,filter:`url(#${p}-rim)`,...r.dim?{opacity:0.55}:{}},B);else{t("circle",{cx:0,cy:-u-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},B);let v=t("text",{x:0,y:-u-n*0.3+n*0.1,"text-anchor":"middle","font-size":n*0.3,"font-weight":700,fill:"#fff","font-family":Mt},B);v.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let X=u*0.22;t("path",{d:`M ${-h*0.5} ${-u} L ${h*0.5} ${-u} L ${h*0.42} 0 L ${-h*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},f),t("rect",{x:-h*0.54,y:-u-X*0.2,width:h*1.08,height:X,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},f);let L=Math.max(11,Math.min(15,h*0.14)),K=Math.min(Math.max(h*0.9,L*5.5+14),Math.max(h*0.9,r.name.length*L*0.62+18),F*0.98),se=L+8;t("rect",{class:"plate",x:-K/2,y:-u*0.78,width:K,height:se,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},f);let ae=t("text",{x:0,y:-u*0.78+L+1.5,"text-anchor":"middle","font-size":L,"font-weight":700,"font-family":Mt,fill:e.plateInk},f);ae.textContent=dr(r.name,(K-8)/L);let Z=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-u-n*0.78})`},f)),V=H==="done",D=H==="error",P=e.gold;if(V)P=ur.done;else if(D)P=ur.error;t("circle",{r:n*0.15,fill:P,stroke:e.ink,"stroke-width":2},Z);let U=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":Mt,fill:V||D?"#fff":e.ink},Z);if(U.textContent="!",V)U.textContent="✓";else if(D)U.textContent="✕";let J=t("g",{class:"orbit"},f);t("circle",{cx:n*0.4,cy:-u-n*0.5,r:n*0.05,fill:r.color},J),t("circle",{cx:-n*0.4,cy:-u-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},J),f.addEventListener("click",(v)=>i.onSeatClick({id:r.id,name:r.name,at:Ct(v,f)})),f.addEventListener("keydown",(v)=>{if(v.key==="Enter"||v.key===" ")v.preventDefault(),i.onSeatClick({id:r.id,name:r.name,at:Ct({clientX:0,clientY:0,detail:0},f)})})}),!s){let r=Math.min(c*0.34,190),b=o-6;t("rect",{x:C-r/2,y:b-22,width:r,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},m);let k=t("text",{x:C,y:b-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":Mt,fill:e.gold},m);k.textContent=dr(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=Qn(O,I),o=(g,a)=>{let l=setTimeout(()=>{G.delete(l),g()},a);G.add(l)};for(let g of e.joining){let a=[...m.querySelectorAll("g.seat[data-seat]")].find((l)=>l.getAttribute("data-seat")===g);if(!a)continue;a.classList.add("seat-in"),a.prepend(t("ellipse",{class:"seat-ring",rx:44,ry:12,cy:4,stroke:c.css.ring})),o(()=>{a.classList.remove("seat-in"),a.querySelector(".seat-ring")?.remove()},sn)}for(let g of e.leaving){let a=s.get(g);if(!a)continue;let l=a.cloneNode(!0);l.classList.add("seat-out");for(let w of["data-seat","tabindex","role","aria-label"])l.removeAttribute(w);l.setAttribute("aria-hidden","true");for(let[w,[C,N,F]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let q=t("circle",{class:"puff",cx:C,cy:N,r:F,fill:c.paper,stroke:c.ink,"stroke-width":3},l);q.style.animationDelay=`${w*40}ms`}m.appendChild(l),o(()=>l.remove(),on)}},W=new ResizeObserver(x);W.observe(d);let Y=()=>{if(i.reducedMotion==="auto"||i.reducedMotion===void 0)z.setReducedMotion(y.matches)};y.addEventListener("change",Y);let z={kind:"svg",setTheme(e,s){O=e,I=s,x()},setSeats(e){let s=M.map((o)=>o.id),c=new Map([...m.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));M=e;for(let o of e)if(A.set(o.id,o.state??"idle"),o.avatarSvg)_.set(o.id,o.avatarSvg);if(x(),s.length>0||c.size>0)ee(ni(s,e.map((o)=>o.id),E),c)},setState(e,s){if(A.get(e)===s)return;A.set(e,s),x()},setAvatar(e,s){return _.set(e,s),x(),Promise.resolve()},setReducedMotion(e){E=e,x()},resetCamera(){T=null,x(),i.onFocus?.(null)},focus(e){if(e===T)return;T=e,x()},focused:()=>T,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:E,loop:"idle",seats:M.length,renders:0}},dispose(){for(let e of G)clearTimeout(e);G.clear(),W.disconnect(),y.removeEventListener("change",Y),S.remove()}};return z.setSeats(i.seats),z}export{ye as createTable2D};
|