pi-roundtable-web 0.26.0 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +32 -12
  3. package/dist/chunk-account-nhpd9j90.js +1 -0
  4. package/dist/chunk-action-menu-ec9jqtxq.js +1 -0
  5. package/dist/chunk-agent-d1xfrawq.js +1 -0
  6. package/dist/chunk-arranged-rooms-bga8yk2v.js +1 -0
  7. package/dist/chunk-character-creator-k67f77w5.js +1 -0
  8. package/dist/chunk-codeeditor-jm2sm333.js +2 -0
  9. package/dist/chunk-confirm-wc5xraev.js +1 -0
  10. package/dist/chunk-connectors-mhnw6d79.js +1 -0
  11. package/dist/chunk-conversations-yjyq4g1y.js +1 -0
  12. package/dist/{chunk-drag-v41gx2mc.js → chunk-drag-nyq52ck7.js} +1 -1
  13. package/dist/chunk-entry-red1597w.js +1 -0
  14. package/dist/chunk-folder-list-x56y26yq.js +1 -0
  15. package/dist/chunk-folds-3p7s2nvx.js +1 -0
  16. package/dist/{chunk-gate-8k61stsc.js → chunk-gate-h41bv4y9.js} +1 -1
  17. package/dist/chunk-group-scene-7eb6jyev.js +1 -0
  18. package/dist/chunk-group-table-rca48kt0.js +1 -0
  19. package/dist/chunk-host-icons-x318gjqp.js +1 -0
  20. package/dist/chunk-host-picture-xswcakgy.js +1 -0
  21. package/dist/chunk-host-state-bpahvk54.js +1 -0
  22. package/dist/chunk-host-ui-tsbwwk38.js +1 -0
  23. package/dist/{chunk-index-hby0ap91.js → chunk-index-029209sy.js} +2 -2
  24. package/dist/chunk-index-066vzexw.js +2 -0
  25. package/dist/chunk-index-0h4h76kw.js +2 -0
  26. package/dist/chunk-index-0n6ja7my.js +1 -0
  27. package/dist/chunk-index-0q15ysrb.js +1 -0
  28. package/dist/chunk-index-0xj30mzw.js +13 -0
  29. package/dist/{chunk-index-rhtvcbsq.js → chunk-index-1f0j335v.js} +2 -2
  30. package/dist/chunk-index-2f5nfekb.js +8 -0
  31. package/dist/chunk-index-31ays46f.js +2 -0
  32. package/dist/chunk-index-43k1rjmx.js +2 -0
  33. package/dist/chunk-index-4gk88a0x.js +4 -0
  34. package/dist/chunk-index-4jf4jvfd.css +1 -0
  35. package/dist/chunk-index-4mf29sbx.js +2 -0
  36. package/dist/chunk-index-51n20yhb.js +2 -0
  37. package/dist/{chunk-index-014rjv9k.js → chunk-index-6tpr6r6d.js} +2 -2
  38. package/dist/{chunk-index-e5sd30xy.js → chunk-index-7bbqtdce.js} +2 -2
  39. package/dist/chunk-index-84v7j6vh.js +50 -0
  40. package/dist/chunk-index-8f9jer8r.js +2 -0
  41. package/dist/chunk-index-91z3g774.js +1 -0
  42. package/dist/{chunk-index-dhpt8qr9.js → chunk-index-934zgd18.js} +2 -2
  43. package/dist/{chunk-index-awx6nnta.js → chunk-index-9nents16.js} +2 -2
  44. package/dist/chunk-index-9w0sar6s.js +2 -0
  45. package/dist/chunk-index-a768zmp6.js +2 -0
  46. package/dist/{chunk-index-nqfkwkfp.js → chunk-index-b7jjca66.js} +2 -2
  47. package/dist/chunk-index-c5x70d9g.js +2 -0
  48. package/dist/chunk-index-cmxs5y22.js +42 -0
  49. package/dist/chunk-index-cwc1vvpw.js +2 -0
  50. package/dist/chunk-index-d85x96q0.js +2 -0
  51. package/dist/chunk-index-datrrs6b.js +2 -0
  52. package/dist/chunk-index-dep2e3f3.js +2 -0
  53. package/dist/chunk-index-dtste2ed.js +2 -0
  54. package/dist/chunk-index-ewj52be9.js +2 -0
  55. package/dist/{chunk-index-pcfhpm8v.js → chunk-index-f3b5nch2.js} +142 -18
  56. package/dist/{chunk-index-km40bhsz.js → chunk-index-frwa2fmc.js} +2 -2
  57. package/dist/chunk-index-grkczq2c.js +2 -0
  58. package/dist/chunk-index-gzvkpe3e.js +2 -0
  59. package/dist/chunk-index-kfv996qe.js +920 -0
  60. package/dist/chunk-index-kw85ajap.js +138 -0
  61. package/dist/chunk-index-satam151.js +2 -0
  62. package/dist/{chunk-index-y8rnq8zf.js → chunk-index-smw1n2pt.js} +5 -5
  63. package/dist/chunk-index-th43f690.js +2 -0
  64. package/dist/chunk-index-ths2hxpe.js +1 -0
  65. package/dist/{chunk-index-wnjp6wv0.js → chunk-index-tmx30r1w.js} +2 -2
  66. package/dist/{chunk-index-hssjbr1k.js → chunk-index-y00wke93.js} +2 -2
  67. package/dist/chunk-index-y4sqmenv.js +2 -0
  68. package/dist/{chunk-index-66nskrdj.js → chunk-index-yrhbhmxz.js} +2 -2
  69. package/dist/chunk-index-zd76pr2k.js +2 -0
  70. package/dist/chunk-lang-css-fa7c0zfj.js +1 -0
  71. package/dist/{chunk-lang-dockerfile-hrav55t7.js → chunk-lang-dockerfile-46rk929v.js} +1 -1
  72. package/dist/{chunk-lang-go-x9ahv6e5.js → chunk-lang-go-qb0qdpg7.js} +3 -3
  73. package/dist/chunk-lang-html-47mf2y0v.js +1 -0
  74. package/dist/chunk-lang-javascript-d32qrvxz.js +1 -0
  75. package/dist/{chunk-lang-json-hsemyd0r.js → chunk-lang-json-1q4fp694.js} +1 -1
  76. package/dist/{chunk-lang-markdown-zkwb4c9n.js → chunk-lang-markdown-5w7t28wa.js} +4 -4
  77. package/dist/{chunk-lang-python-tewx7006.js → chunk-lang-python-3dq0p4rf.js} +2 -2
  78. package/dist/{chunk-lang-rust-0ydx84s1.js → chunk-lang-rust-70pa0agr.js} +1 -1
  79. package/dist/{chunk-lang-shell-gq1tmdz4.js → chunk-lang-shell-4pxt7hf4.js} +1 -1
  80. package/dist/{chunk-lang-sql-xt1qyycg.js → chunk-lang-sql-kgcbh2a9.js} +2 -2
  81. package/dist/{chunk-lang-toml-0hamc5fc.js → chunk-lang-toml-99t95pab.js} +1 -1
  82. package/dist/chunk-lang-typescript-4k1d8z7s.js +1 -0
  83. package/dist/{chunk-lang-xml-wf6h5pt2.js → chunk-lang-xml-mnbv9yfa.js} +1 -1
  84. package/dist/{chunk-lang-yaml-7vk521h1.js → chunk-lang-yaml-2by9g1dy.js} +1 -1
  85. package/dist/chunk-layout-actions-cgghzj1w.js +1 -0
  86. package/dist/chunk-menu-items-24cfwawa.js +2 -0
  87. package/dist/chunk-mode-toggle-v4baz3r1.js +1 -0
  88. package/dist/chunk-note-row-72n6cqyk.js +75 -0
  89. package/dist/chunk-notes-83s3tsey.js +1 -0
  90. package/dist/chunk-notice-bell-a4ty5h1p.js +1 -0
  91. package/dist/chunk-notices-evny44be.js +1 -0
  92. package/dist/chunk-onboarding-q1avjbrx.js +1 -0
  93. package/dist/chunk-overview-42h45ehd.js +1 -0
  94. package/dist/chunk-palette-e44qepmh.js +1 -0
  95. package/dist/chunk-placement-items-v466t0sv.js +1 -0
  96. package/dist/chunk-profile-bqcgkgk4.js +1 -0
  97. package/dist/chunk-prompt-history-hgbtcn4b.js +1 -0
  98. package/dist/chunk-prompts-czs8y6r1.js +1 -0
  99. package/dist/chunk-room-confirms-h8cdj3ng.js +1 -0
  100. package/dist/chunk-room-menu-7s0feajw.js +1 -0
  101. package/dist/chunk-rooms-menu-button-gawqvpsr.js +1 -0
  102. package/dist/{chunk-schedules-2ft6xxyw.js → chunk-schedules-zba7krac.js} +1 -1
  103. package/dist/{chunk-seat-menu-d3npdtx1.js → chunk-seat-menu-ca5p4e9q.js} +1 -1
  104. package/dist/chunk-sheet-hosts-ssbz6hf2.js +1 -0
  105. package/dist/chunk-skill-editor-n0y9pd90.js +8 -0
  106. package/dist/chunk-skills-ea4vb2s4.js +1 -0
  107. package/dist/chunk-switcher-list-pj5csqr9.js +1 -0
  108. package/dist/chunk-tab-dot-4tkpxqeh.js +1 -0
  109. package/dist/chunk-table-j8nmtdnn.js +1 -0
  110. package/dist/chunk-table-seats-qeytqe0m.js +1 -0
  111. package/dist/chunk-table2d-18y029k9.js +1 -0
  112. package/dist/chunk-table3d-q2s31ae0.js +4220 -0
  113. package/dist/chunk-thread-actions-w3eadnh7.js +1 -0
  114. package/dist/chunk-thread-cards-fbpky3c9.js +1 -0
  115. package/dist/chunk-thread-list-pghe84be.js +1 -0
  116. package/dist/chunk-transcript-eqzxgqys.js +1 -0
  117. package/dist/chunk-where-ygyr4jdj.js +1 -0
  118. package/dist/chunk-workspace-h0p32ygy.js +578 -0
  119. package/dist/chunk-zh-tw-k6xx1hp2.js +1 -0
  120. package/dist/index.html +1 -2
  121. package/dist/sw.js +1 -1
  122. package/package.json +2 -2
  123. package/src/api-types.ts +63 -3
  124. package/src/app/api-http.ts +1 -1
  125. package/src/app/app.ts +5 -0
  126. package/src/app/room-log.ts +16 -4
  127. package/src/app/rooms.ts +39 -0
  128. package/src/app/routes.ts +96 -2
  129. package/src/app/socket.ts +45 -9
  130. package/src/app/surface-threads.ts +1 -1
  131. package/src/app/surface.ts +2 -1
  132. package/src/app/threads.ts +51 -2
  133. package/src/auth/authenticator.ts +18 -5
  134. package/src/auth/login-page.ts +4 -2
  135. package/src/auth/oidc-pages.ts +2 -0
  136. package/src/auth/oidc.ts +39 -1
  137. package/src/auth/sessions.ts +10 -3
  138. package/src/authz.ts +2 -1
  139. package/src/console-server.ts +32 -6
  140. package/src/host/cards.ts +18 -5
  141. package/src/host/context.ts +72 -25
  142. package/src/host/forms.ts +3 -0
  143. package/src/host/frames.ts +8 -1
  144. package/src/host/host-app.ts +6 -4
  145. package/src/host/host-routes.ts +36 -3
  146. package/src/host/room-views.ts +6 -6
  147. package/src/host/rooms-service.ts +16 -1
  148. package/src/host/views.ts +3 -0
  149. package/src/i18n/zh-tw.ts +103 -79
  150. package/src/index.ts +15 -1
  151. package/src/options.ts +37 -1
  152. package/src/page-presentation.ts +47 -2
  153. package/src/pwa.ts +32 -4
  154. package/src/web-app.ts +47 -3
  155. package/src/web-plugin.ts +32 -10
  156. package/dist/chunk-account-hw49gd0d.js +0 -1
  157. package/dist/chunk-action-menu-rm5cyqkj.js +0 -1
  158. package/dist/chunk-agent-b017vswv.js +0 -1
  159. package/dist/chunk-arranged-rooms-q5v3dm1r.js +0 -1
  160. package/dist/chunk-character-creator-5dxcvd16.js +0 -1
  161. package/dist/chunk-codeeditor-pyt09fwg.js +0 -2
  162. package/dist/chunk-confirm-521yqmta.js +0 -1
  163. package/dist/chunk-connectors-hrm06nx8.js +0 -1
  164. package/dist/chunk-conversations-e26rrf01.js +0 -1
  165. package/dist/chunk-entry-jxxb3ath.js +0 -1
  166. package/dist/chunk-folder-list-b97xk12b.js +0 -1
  167. package/dist/chunk-folds-b8q7eags.js +0 -1
  168. package/dist/chunk-group-scene-dx6wt19m.js +0 -1
  169. package/dist/chunk-group-table-e4jr8r3a.js +0 -1
  170. package/dist/chunk-host-state-g7e7c0k5.js +0 -1
  171. package/dist/chunk-host-ui-x7k6n07v.js +0 -939
  172. package/dist/chunk-index-2d0kg096.js +0 -2
  173. package/dist/chunk-index-2qd81wbx.js +0 -2
  174. package/dist/chunk-index-2stynxw6.css +0 -1
  175. package/dist/chunk-index-459drsft.js +0 -2
  176. package/dist/chunk-index-4mfj596y.js +0 -2
  177. package/dist/chunk-index-bbsytycb.js +0 -2
  178. package/dist/chunk-index-c07p8k0x.js +0 -4
  179. package/dist/chunk-index-cq1e9xdz.js +0 -2
  180. package/dist/chunk-index-d1prgfbp.js +0 -2
  181. package/dist/chunk-index-g351921r.js +0 -1
  182. package/dist/chunk-index-k2qq1gdj.js +0 -2
  183. package/dist/chunk-index-ke9ynm0n.js +0 -2
  184. package/dist/chunk-index-kpscvg85.js +0 -2
  185. package/dist/chunk-index-m0d100mg.js +0 -2
  186. package/dist/chunk-index-mb72snk9.js +0 -2
  187. package/dist/chunk-index-mjqqver5.js +0 -4
  188. package/dist/chunk-index-nwqk447w.js +0 -2
  189. package/dist/chunk-index-q8h8xzbm.js +0 -2
  190. package/dist/chunk-index-r5vszgfs.js +0 -2
  191. package/dist/chunk-index-rjv7vrwd.js +0 -13
  192. package/dist/chunk-index-v23m38p6.js +0 -50
  193. package/dist/chunk-index-va0g7d88.js +0 -1
  194. package/dist/chunk-index-xgkd15n3.js +0 -2
  195. package/dist/chunk-index-z3k18atc.js +0 -2
  196. package/dist/chunk-lang-css-6bepqpnx.js +0 -1
  197. package/dist/chunk-lang-html-8jc72zt4.js +0 -1
  198. package/dist/chunk-lang-javascript-2p2qtbnf.js +0 -1
  199. package/dist/chunk-lang-typescript-82xf7z2e.js +0 -1
  200. package/dist/chunk-layout-actions-zh7bezk7.js +0 -1
  201. package/dist/chunk-menu-items-1n9qargb.js +0 -2
  202. package/dist/chunk-notes-t15bh04m.js +0 -1
  203. package/dist/chunk-notice-bell-w3y0h0sr.js +0 -1
  204. package/dist/chunk-notices-fa3g7qze.js +0 -1
  205. package/dist/chunk-onboarding-34v3nr17.js +0 -1
  206. package/dist/chunk-overview-km5vq375.js +0 -1
  207. package/dist/chunk-palette-a8txdgd0.js +0 -1
  208. package/dist/chunk-placement-items-wgaxsbvs.js +0 -1
  209. package/dist/chunk-profile-ypxdbsk1.js +0 -1
  210. package/dist/chunk-prompt-history-wm9dsy6s.js +0 -1
  211. package/dist/chunk-prompts-7mhhq7zs.js +0 -1
  212. package/dist/chunk-room-confirms-t11a1gsw.js +0 -1
  213. package/dist/chunk-room-menu-2tm2xtfx.js +0 -1
  214. package/dist/chunk-rooms-menu-button-wxnsxjwc.js +0 -1
  215. package/dist/chunk-sheet-hosts-vngvp7wv.js +0 -1
  216. package/dist/chunk-skill-editor-65n2hsq4.js +0 -8
  217. package/dist/chunk-skills-shkdwes8.js +0 -1
  218. package/dist/chunk-switcher-list-g6hhmr1t.js +0 -1
  219. package/dist/chunk-table-1b6bsq2y.js +0 -1
  220. package/dist/chunk-table-seats-vy1qhdks.js +0 -1
  221. package/dist/chunk-table2d-n26b7gd0.js +0 -1
  222. package/dist/chunk-table3d-8aysyf56.js +0 -4220
  223. package/dist/chunk-transcript-355faceq.js +0 -1
  224. package/dist/chunk-where-j5qdt8a4.js +0 -1
  225. package/dist/chunk-workspace-vrbs6zx1.js +0 -1
  226. package/dist/chunk-zh-tw-zeg600bk.js +0 -1
@@ -0,0 +1 @@
1
+ import{r,e,n}from"./chunk-index-84v7j6vh.js";import"./chunk-index-934zgd18.js";import"./chunk-index-8f9jer8r.js";import"./chunk-index-dtste2ed.js";import{Bt}from"./chunk-index-2f5nfekb.js";import{Jr,es,ji,Gn}from"./chunk-index-y4sqmenv.js";import"./chunk-index-9nents16.js";function b(i){let{roomKey:o,members:m}=i,{line:s}=ji(o),[l,a]=r(),u=es(Jr(s,m),s?.id,l),t=(f)=>a({lineId:s?.id,member:f});return n("div",{className:"table-frame room-scene","data-focused":"",children:[e(Bt,{members:m,groupRoom:o,variant:"full",focus:u,onFocus:t,onSeat:t}),e(Gn,{roomKey:o,open:!0,streams:!1})]})}export{b as GroupScene};
@@ -0,0 +1 @@
1
+ import{hr,t,g,e,n,s,u,Je}from"./chunk-index-84v7j6vh.js";import"./chunk-index-934zgd18.js";import"./chunk-index-8f9jer8r.js";import"./chunk-index-dtste2ed.js";import{Bt}from"./chunk-index-2f5nfekb.js";var c=(o,a)=>a?hr(o,a):o;function T(o){let a=u((m)=>m.rooms[o.roomKey]?.view),r=Je();if(!a||a.kind!=="group")return null;let l=a.members??[];return n(g,{children:[n("button",{type:"button",className:"icon-button group-table-button","aria-label":t("Table"),"aria-pressed":o.scene,onClick:()=>o.onScene(!o.scene),children:[e(s,{name:"table"}),e("span",{className:"group-table-label",children:t("Table")})]}),r==="camelot"&&!o.scene?c(e("div",{className:"group-strip",children:e(Bt,{members:l,groupRoom:o.roomKey,variant:"compact"})}),o.slot):null]})}export{T as GroupTable};
@@ -0,0 +1 @@
1
+ import"./chunk-index-0n6ja7my.js";
@@ -0,0 +1 @@
1
+ import{it}from"./chunk-index-kfv996qe.js";export{it as HostPicture};
@@ -0,0 +1 @@
1
+ import{Sr,Ee,wr,kr,_r,Di,Ui,Tr,no}from"./chunk-index-dtste2ed.js";export{Tr as keepCards,Ui as keepReads,_r as noCards,kr as noReads,no as onFrame,Di as seedUnread,Sr as subscribeHost,wr as totalUnread,Ee as useHost};
@@ -0,0 +1 @@
1
+ import{J,z,o,A,Fe,N,a,r,t,ne,g,e,n,s,x,ii,b,u,le,d,p,S,m,k,P,Ft,Mn,Rt,_,mr,Pe,Gt,Qi,ln,cn,Ct,te,mn,Me,yr,Re}from"./chunk-index-84v7j6vh.js";import{Pn}from"./chunk-index-934zgd18.js";import{ki,vs,Ue,_i}from"./chunk-index-8f9jer8r.js";import{j}from"./chunk-index-7bbqtdce.js";import{Ee,kr,_r,Di,Ui,Tr}from"./chunk-index-dtste2ed.js";import{nt,it}from"./chunk-index-kfv996qe.js";import{Ki}from"./chunk-index-kw85ajap.js";import"./chunk-index-0n6ja7my.js";import{De}from"./chunk-index-cmxs5y22.js";import{de}from"./chunk-index-grkczq2c.js";import"./chunk-index-9nents16.js";function Ze(l){let i={};for(let c of l)if(c.type==="multiselect")i[c.name]=[...Ae(c.initial)];else i[c.name]=Ae(c.initial)[0]??"";return i}var Ae=(l)=>l===void 0?[]:typeof l==="string"?[l]:[...l];function Qe(l,i){let c={};for(let f of l){let v=i[f.name];if(v===void 0||v===""||v.length===0)continue;c[f.name]=v}return c}function Ye(l){let{field:i,value:c}=l,[f,v]=r(""),H=i.search?i.options.filter((h)=>h.label.toLowerCase().includes(f.trim().toLowerCase())):i.options,w=i.search?e("input",{type:"search",value:f,placeholder:t("Search…"),"aria-label":t("Search {name}",{name:i.label}),onChange:(h)=>v(h.target.value)}):null;if(i.type==="select")return n(g,{children:[w,n(De,{id:l.id,value:String(c),required:i.required===!0,"aria-describedby":l.described,...i.search?{size:6}:{},onChange:(h)=>l.onChange(h.target.value),children:[i.required?null:e("option",{value:"",children:t("None")}),H.map((h)=>e("option",{value:h.value,children:h.label},h.value))]})]});let y=new Set(Array.isArray(c)?c:[]);return n(g,{children:[w,e("fieldset",{"aria-describedby":l.described,children:H.map((h)=>n("label",{children:[e("input",{type:"checkbox",checked:y.has(h.value),onChange:(E)=>{let C=new Set(y);if(E.target.checked)C.add(h.value);else C.delete(h.value);l.onChange(i.options.filter((M)=>C.has(M.value)).map((M)=>M.value))}}),h.label]},h.value))})]})}function Xe(l){let{field:i,value:c}=l,f=A(),v="hint"in i?i.hint:void 0,H=l.error||v?`${f}-note`:void 0,w;if("options"in i)w=e(Ye,{field:i,id:f,value:c,described:H,onChange:l.onChange});else if(i.type==="textarea")w=e("textarea",{id:f,rows:5,value:String(c),maxLength:i.max??8000,required:i.required===!0,"aria-describedby":H,onChange:(y)=>l.onChange(y.target.value)});else w=e("input",{id:f,type:i.type==="url"?"url":"text",value:String(c),maxLength:i.max??500,required:i.required===!0,"aria-describedby":H,onChange:(y)=>l.onChange(y.target.value)});return n("div",{className:"host-field",children:[i.type==="multiselect"?e("span",{className:"field-label",children:i.label}):e("label",{htmlFor:f,children:i.label}),w,l.error||v?e("span",{id:`${f}-note`,className:l.error?"field-error":"hint",role:l.error?"alert":void 0,children:l.error??v}):null]})}function ie(l){let{spec:i}=l,[c,f]=r(()=>Ze(i.fields)),[v,H]=r(!1),[w,y]=r();return n("form",{className:"host-form",onSubmit:async(E)=>{if(E.preventDefault(),v)return;H(!0),y(void 0);try{y(await l.onSubmit(Qe(i.fields,c)))}catch(C){y({error:d(C)})}finally{H(!1)}},children:[i.fields.map((E)=>e(Xe,{field:E,value:c[E.name]??"",error:w?.field===E.name?w.error:void 0,onChange:(C)=>f((M)=>({...M,[E.name]:C}))},E.name)),w&&!i.fields.some((E)=>E.name===w.field)?e(m,{message:w.error}):null,n("div",{className:"actions",children:[l.onCancel?e("button",{type:"button",className:"secondary",disabled:v,onClick:l.onCancel,children:t("Cancel")}):null,e("button",{type:"submit",disabled:v,children:i.submit})]})]})}function Je(l){if(!l.ok)return{error:ki(l.error),...l.field?{field:l.field}:{}};if(l.notice)p(l.notice);if(l.open)_i(l.open);return}function Q(l){let[i,c]=r(),[f,v]=r(!1),H=async(y,h)=>Je(await l.run(y,h)),w=async(y)=>{if(y.form||y.confirm){c(y);return}v(!0);try{let h=await H(y,{});if(h)p(h.error,"danger")}catch(h){p(d(h),"danger")}finally{v(!1)}};if(l.actions.length===0)return null;return n("div",{className:l.className??"host-actions",children:[l.actions.map((y)=>e("button",{type:"button",className:y.style==="danger"?"danger":y.style==="secondary"?"secondary":"",disabled:f,onClick:()=>w(y),children:y.label},y.id)),i?.form?e(de,{open:!0,title:i.form.title,onClose:()=>c(void 0),children:e(ie,{spec:i.form,onCancel:()=>c(void 0),onSubmit:async(y)=>{let h=await H(i,y);if(!h)c(void 0);return h}})}):i?e(j,{open:!0,title:i.label,confirmLabel:i.label,tone:i.style==="danger"?"danger":"primary",onConfirm:async()=>{let y=await H(i,{});if(y)throw Error(y.error)},onClose:()=>c(void 0),children:e("p",{children:i.confirm})}):null]})}var Ce=/^file:([A-Za-z0-9_-]{1,64})$/;function Se(l){let i=URL.parse(l,document.baseURI);return i!==null&&i.origin===window.location.origin}function Ke({id:l,alt:i}){return e("img",{className:"file-image",src:`api/files/${encodeURIComponent(l)}`,alt:i,loading:"lazy",decoding:"async",onError:(c)=>{let f=document.createElement("span");f.textContent=i||t("Image"),c.currentTarget.replaceWith(f)}})}var W=J(function({source:i}){return e("div",{className:"prose",children:e(Ft,{remarkPlugins:[Rt],urlTransform:(c)=>Ce.test(c)?c:Mn(c),components:{a:({href:c,children:f})=>c&&/^https?:\/\//.test(c)&&!Se(c)?e("a",{href:c,target:"_blank",rel:"noreferrer noopener",children:f}):c&&Se(c)?e("a",{href:c,children:f}):e("span",{children:f}),img:({src:c,alt:f})=>{let v=typeof c==="string"?Ce.exec(c):null;return v?.[1]?e(Ke,{id:v[1],alt:f??""}):e("span",{children:f})},pre:mr,table:({children:c})=>e("div",{className:"table-wrap",children:e("table",{children:c})})},children:i})})});function je(l){switch(l??"open"){case"working":return t("Working…");case"done":return t("Done");case"superseded":return t("Replaced");case"expired":return t("Expired");default:return""}}var he=(l)=>(l.state??"open")==="open";function ee(l){let{card:i}=l,c=je(i.state);return n("article",{className:"host-card","data-tone":i.tone??"note","data-state":i.state??"open",children:[n("header",{children:[e("h3",{children:i.title}),c?e(P,{tone:i.state==="working"?"busy":"plain",children:c}):null]}),i.body?e(W,{source:i.body}):null,i.links?.length?e("div",{className:"host-card-links",children:i.links.map((f)=>e("a",{href:f.url,...f.url.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:f.label},`${f.url}`))}):null,he(i)&&i.buttons?.length?e(Q,{actions:i.buttons,run:l.run}):null]})}nt();function et(){let[l,i]=r(()=>Pn().toString());return o(()=>{let c=()=>i(Pn().toString());return window.addEventListener("popstate",c),window.addEventListener("hashchange",c),()=>{window.removeEventListener("popstate",c),window.removeEventListener("hashchange",c)}},[]),l}function tt(l){if(!l.ok)return{error:ki(l.error),...l.field?{field:l.field}:{}};if(l.notice)p(l.notice);if(l.open)_i(l.open);return}function rt(l){let{section:i}=l;switch(i.kind){case"markdown":return e(W,{source:i.text});case"card":return e(ee,{card:i.card,run:l.run});case"form":return n("section",{className:"stack",children:[e("h2",{className:"section-title",children:i.form.title}),e(ie,{spec:i.form,onSubmit:(c)=>l.submit(i.action,c)})]});case"list":return n("section",{className:"stack",children:[i.title?e("h2",{className:"section-title",children:i.title}):null,i.rows.length===0?e(k,{children:t("Nothing here.")}):null,e("ul",{className:"host-list",children:st(i.rows).map(([c,f])=>n("li",{children:[f.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null,n("div",{className:"host-list-main",children:[f.open?e("a",{href:f.open,...f.open.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:f.title}):e("strong",{children:f.title}),f.subtitle?e("span",{children:f.subtitle}):null]}),f.actions?.length?e(Q,{actions:f.actions,run:l.run}):null]},c))})]})}}function ot({routeKey:l}){let i=l??"",c=et(),f=Ee((C)=>C.pages[i]??0),[v,H]=r(0),[w,y]=r({});o(()=>{let C=!0;return Ue.page(i,Object.fromEntries(new URLSearchParams(c))).then((M)=>C&&y({page:M}),(M)=>{if(!C)return;let L=M instanceof le&&M.status===404;y((T)=>({...L||!T.page?{}:{page:T.page},error:d(M),gone:L}))}),()=>{C=!1}},[i,c,f,v]);let h=async(C,M)=>{let L=await Ue.pageAct(i,{action:C,input:M}),T=tt(L);if(!T)H((O)=>O+1);return T},E=async(C,M)=>{let L=await Ue.pageAct(i,{action:C.id,input:M});if(L.ok)H((T)=>T+1);return L};if(w.gone)return e("div",{className:"page",children:e(k,{children:t("This page is not available.")})});if(!w.page)return e("div",{className:"page",children:w.error?e(m,{message:w.error}):e(S,{})});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:w.page.title})}),w.error?e(m,{message:w.error}):null,w.page.sections.map((C,M)=>e(rt,{section:C,run:E,submit:h},M))]})}function st(l){let i=new Map;return l.map((c)=>{let f=i.get(c.title)??0;return i.set(c.title,f+1),[`${c.title}:${f}`,c]})}var at=/https?:\/\/[^\s<>"']+/g,lt=/[.,;:!?)\]}\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff09\u300d\u300f]+$/;function ct(l){let i=l.replace(lt,""),c=URL.parse(i);return c&&(c.protocol==="https:"||c.protocol==="http:")?i:""}function Le({text:l}){let i=[],c=0;for(let f of l.matchAll(at)){let v=ct(f[0]);if(v==="")continue;let H=f.index;if(H>c)i.push(l.slice(c,H));i.push(e("a",{href:v,target:"_blank",rel:"noreferrer noopener",children:v},`${H}`)),c=H+v.length}if(c<l.length)i.push(l.slice(c));return e("span",{className:"plain",children:i})}var Te=J(function(i){let{message:c}=i,f=c.authorKind??"external";if(f==="notice")return n("li",{className:"host-notice","data-mid":c.id,"data-highlight":i.highlighted||void 0,"data-enter":i.enter||void 0,children:[e(s,{name:"bell",size:14}),e(W,{source:c.text}),e("time",{dateTime:c.at,children:Gt(c.at,i.timeZone)})]});let v=f==="member"&&c.principalId!==void 0&&c.principalId===i.me;return n("li",{className:"message","data-mid":c.id,"data-author":f,"data-mine":v||void 0,"data-header":i.header||void 0,"data-enter":i.enter||void 0,"data-highlight":i.highlighted||void 0,children:[v?null:e("span",{className:"message-avatar",children:i.header?e(it,{picture:c.picture,name:c.author}):null}),n("div",{className:"message-main",children:[i.header?n("div",{className:"message-meta",children:[e("strong",{children:c.author}),c.authorLabel?e("span",{className:"label-chip",children:c.authorLabel}):null,e("time",{dateTime:c.at,children:Gt(c.at,i.timeZone)})]}):null,n("div",{className:"bubble",children:[c.text?f==="assistant"?e(W,{source:c.text}):e(Le,{text:c.text}):null,e(Ct,{files:c.files}),c.expiredFiles?e("p",{className:"message-expired",children:ne(c.expiredFiles,"{count} file was removed","{count} files were removed")}):null]}),c.edited?e("span",{className:"message-edited",children:t("edited")}):null]})]})});nt();var dt=3;function ut({marks:l}){let[i,c]=r(!1);return n("li",{className:"seen",children:[n("button",{type:"button",className:"seen-toggle","aria-expanded":i,onClick:()=>c((f)=>!f),children:[l.slice(0,dt).map((f)=>e(it,{picture:{principal:f.principal},name:f.name,size:16},f.principal)),e("span",{children:t("Seen by {count}",{count:l.length})})]}),i?e("span",{className:"seen-names",children:l.map((f)=>f.name).join(t(", "))}):null]})}function mt(l,i){let c=Re(),f=u((v)=>v.connects);o(()=>{let v=i.current;if(!v)return;let H=0,w=0,y,h,E=()=>{if(h=void 0,document.visibilityState!=="visible")return;let L=v.getBoundingClientRect(),T=0;for(let B of v.querySelectorAll("[data-mid]")){let D=B.getBoundingClientRect();if(D.bottom>L.top&&D.top<L.bottom-4)T=Math.max(T,Number(B.dataset.mid))}if(T<=H)return;let O=w+1000-Date.now();if(O>0){clearTimeout(y),y=setTimeout(C,O);return}if(c.send({type:"read",room:l,upTo:T}))H=T,w=Date.now()},C=()=>{if(h===void 0)h=requestAnimationFrame(E)};v.addEventListener("scroll",C,{passive:!0}),document.addEventListener("visibilitychange",C),window.addEventListener("resize",C);let M=new MutationObserver(C);return M.observe(v,{childList:!0,subtree:!0}),C(),()=>{if(v.removeEventListener("scroll",C),document.removeEventListener("visibilitychange",C),window.removeEventListener("resize",C),M.disconnect(),clearTimeout(y),h!==void 0)cancelAnimationFrame(h)}},[c,l,i,f])}function ae(l){let{roomKey:i}=l;mt(i,l.scroller);let c=u((h)=>h.principal?.id),f=u((h)=>h.rooms[i]?.messages),v=Ee((h)=>h.reads[i]??kr),H=Ee((h)=>h.cursor[i]),w=a(void 0);if(w.current===void 0&&H!==void 0)w.current=H;let y=N(()=>{let E=(f??[]).filter((L)=>L.kind!=="system"),C=w.current===void 0?void 0:E.find((L)=>L.id>(w.current??0)&&(L.principalId===void 0||L.principalId!==c))?.id,M=new Map;for(let L of v){if(L.principal===c)continue;let T=E.findLast((O)=>O.id<=L.upTo);if(T)M.set(T.id,[...M.get(T.id)??[],L])}return{before:(L)=>L.id===C?e("li",{className:"new-divider",children:e("span",{children:t("New messages")})}):null,after:(L)=>{let T=M.get(L.id);return T?e(ut,{marks:T}):null},...l.host?{message:(L,T)=>L.kind==="system"&&L.authorKind===void 0?void 0:e(Te,{message:L,header:T.header,enter:T.enter,timeZone:T.timeZone,me:c,highlighted:l.highlight===L.id})}:{}}},[f,v,c,l.host,l.highlight]);return e(mn,{roomKey:i,enterAfter:l.enterAfter,quotable:l.quotable,decor:y})}nt();var ft=20,pt=2600,xe;function gt(l,i,c){let f=u((y)=>y.connects),v=Ee((y)=>y.rooms[l]??0),[H,w]=r({view:void 0,error:void 0,gone:!1});return o(()=>{let y=!0;return Ue.open(i,c).then((h)=>{if(!y)return;b.dispatch({type:"history_loaded",room:l,messages:h.messages,more:h.more,older:!1}),Ui(l,h.reads,h.cursor),Tr(l,h.cards),w({view:h,error:void 0,gone:!1})},(h)=>{if(!y)return;let E=h instanceof le&&h.status===404;w((C)=>({view:E?void 0:C.view,error:d(h),gone:E}))}),()=>{y=!1}},[l,i,c,f,v]),H}function ht(l){let{header:i}=l;return n(g,{children:[i.banner?e("p",{className:"host-banner","data-tone":i.banner.tone,role:"status",children:i.banner.text}):null,i.fields.length?e("dl",{className:"host-head-fields",children:i.fields.map((c)=>n("div",{children:[e("dt",{children:c.label}),e("dd",{children:c.link?e("a",{href:c.link,...c.link.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:c.value}):c.value})]},`${c.label}:${c.value}`))}):null,e(Q,{className:"host-actions bar",actions:i.actions,run:l.run})]})}function bt(l){let i=Ee((E)=>E.cards[l.room]??_r),c=Me("(min-width: 720px) and (min-height: 760px)"),[f,v]=r();if(i.length===0)return null;let H=i.filter((E)=>he(E)||E.state==="working"),w=i.filter((E)=>!H.includes(E)),y=f??(c&&H.length>0),h=H[0];return n("div",{className:"host-cards","data-open":y||void 0,children:[n("button",{type:"button",className:"host-cards-toggle","aria-expanded":y,onClick:()=>v(!y),children:[e(s,{name:"chevron",size:14}),h?n("span",{children:[e("strong",{children:ne(H.length,"{count} card waiting","{count} cards waiting")}),`: ${h.title}`]}):e("span",{children:t("Earlier cards ({count})",{count:w.length})})]}),y?n("div",{className:"host-cards-body",children:[H.map((E)=>e(ee,{card:E,run:l.run(E.id)},E.id)),w.length?n("details",{className:"host-cards-older",children:[e("summary",{children:t("Earlier cards ({count})",{count:w.length})}),w.map((E)=>e(ee,{card:E,run:l.run(E.id)},E.id))]}):null]}):null]})}function yt({roomKey:l}){let i=Re(),c=vs(l),f=c?.kind??"",v=c?.id??"",{view:H,error:w,gone:y}=gt(l,f,v),h=u((R)=>R.rooms[l]),E=u((R)=>R.limits),C=u((R)=>R.connects),M=u((R)=>R.connection==="open"),L=a(null),T=a(null),{away:O,onScroll:B,onGrow:D,toEnd:Z}=yr(L),[re,F]=r(!1),[I,Y]=r(),[ue,Oe]=r(xe),[qe,_e]=r(!1),[ze,ye]=r(),me=a(void 0),X=a(void 0),q=H!==void 0;if(o(()=>{if(!c||y||!q)return;return i.send({type:"subscribe",room:l}),i.focus(l),()=>{i.focus(void 0),i.send({type:"unsubscribe",room:l})}},[i,l,C,y,q]),q&&me.current===void 0)me.current=h?.messages.at(-1)?.id??0;Fe(()=>{if(q)Z(!1)},[q]),Fe(()=>{let R=L.current;if(R&&X.current!==void 0)R.scrollTop+=R.scrollHeight-X.current,X.current=void 0},[h?.messages[0]?.id]),o(()=>{let R=T.current;if(!R||typeof ResizeObserver>"u")return;let V=new ResizeObserver(D);return V.observe(R),()=>V.disconnect()},[D]);let fe=z(async()=>{let R=b.getState().rooms[l]?.messages[0];if(!R)return!1;let V=await Ue.older(f,v,R.id,ii);return b.dispatch({type:"history_loaded",room:l,messages:V.messages,more:V.more,older:!0}),Ui(l,V.reads,void 0),V.more},[l,f,v]),oe=a(void 0);o(()=>{let R=()=>{let V=Number(Pn().get("message"));oe.current=Number.isSafeInteger(V)&&V>0?V:void 0};return R(),window.addEventListener("popstate",R),()=>window.removeEventListener("popstate",R)},[]);let pe=h?.messages[0]?.id,ve=h?.more===!0;o(()=>{let R=oe.current,V=L.current;if(!q||R===void 0||!V)return;let U=V.querySelector(`[data-mid="${R}"]`);if(U){oe.current=void 0,U.scrollIntoView({block:"center"}),ye(R),requestAnimationFrame(()=>V.dispatchEvent(new Event("scroll"))),setTimeout(()=>ye(void 0),pt);return}if(pe!==void 0&&R<pe&&ve){let K=0;(async()=>{if(K+=1,!await fe().catch(()=>!1)||K>=ft)oe.current=void 0})()}},[q,pe,ve,h?.messages.length,fe]);let we=(R,V={},U)=>Ue.act(f,v,{action:R.id,...U===void 0?{}:{card:U},input:V}),$e=(R,V)=>we(R,V),Be=(R)=>(V,U)=>we(V,U,R);if(y||!q&&!w&&!c)return e("section",{className:"room",children:n("div",{className:"page",children:[e(k,{children:t("This room is not available.")}),e("a",{className:"back",href:x("rooms"),children:t("Back to rooms")})]})});let G=H?.access.send??[],ge=G.length>1,ke=ge&&qe,Ne=ue&&G.includes(ue)?ue:G.includes("turn")?"turn":G[0],He=ke||Ne==="turn",Ge=He?H?.wording?.turn?.placeholder??t("Ask AI…"):H?.wording?.note?.placeholder??t("Write an internal note…"),se=H?.header.title??l,We=h?.messages??[];return n("section",{className:"room",onDragOver:(R)=>{if(G.length&&R.dataTransfer.types.includes("Files"))R.preventDefault()},onDrop:(R)=>{if(!G.length||!R.dataTransfer.files.length)return;R.preventDefault(),Y([...R.dataTransfer.files])},children:[n("header",{className:"room-head",children:[e("a",{className:"icon-button room-back",href:x("rooms"),"aria-label":t("Back to rooms"),children:e(s,{name:"back"})}),e(it,{name:se,size:40}),n("div",{className:"room-title",children:[e("h1",{children:se}),e("span",{className:"room-status","data-working":h?.typing||void 0,children:h?.typing?t("Working…"):t("Host room")})]})]}),!M?n("div",{className:"offline-banner",role:"status",children:[e("span",{className:"spinner","aria-hidden":"true"}),t("Reconnecting… messages wait here until it is back.")]}):null,H?e(ht,{header:H.header,run:$e}):null,e("div",{className:"room-scroll",ref:L,onScroll:B,children:n("div",{className:"room-content",ref:T,children:[w?e(m,{message:w}):null,!q&&!w?e(S,{}):null,h?.more?e("button",{type:"button",className:"secondary older",disabled:re,onClick:async()=>{F(!0),X.current=L.current?.scrollHeight;try{await fe()}catch(R){X.current=void 0,p(d(R),"danger")}finally{F(!1)}},children:re?t("Loading…"):t("Load earlier messages")}):null,q&&We.length===0?e(k,{children:t("No messages yet.")}):null,e(ae,{roomKey:l,enterAfter:me.current,quotable:!1,scroller:L,host:!0,highlight:ze}),h?.typing?e(cn,{name:se,progress:h.progress}):null]})}),O?n("button",{type:"button",className:"to-end",onClick:()=>Z(!0),children:[e(s,{name:"send",size:16,style:{transform:"rotate(180deg)"}}),t("Latest")]}):null,H?e(bt,{room:l,run:Be}):null,H&&G.length===0?e("p",{className:"room-note",children:t("You can read this room but not write in it.")}):null,H&&G.length>0?e(g,{children:e(ln,{draftKey:l,name:se,placeholder:Ge,onAddressed:_e,...ge?{above:e(Ki,{on:He,label:H?.wording?.turn?.label??t("@AI"),...ke?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(R)=>{let V=R?"turn":"note";xe=V,Oe(V)}})}:{},limits:E,stoppable:Boolean(h?.stoppable),onSend:(R,V,U)=>{if(ge&&U){let K=Qi(R);i.say(l,K===""&&V.length===0?R:K,V,"turn")}else i.say(l,R,V,Ne);Z(!0)},onStop:()=>i.send({type:"stop",room:l}),...I?{incoming:I,onIncomingTaken:()=>Y(void 0)}:{}},l)}):null]})}nt();function ce({room:l}){let i=Ee((c)=>c.unread[l]??0);if(i<=0)return null;return e("span",{className:"unread-mark",role:"img","aria-label":ne(i,"{count} unread message","{count} unread messages"),children:i>99?"99+":i})}nt();var vt=6,wt=250;function be(l){let{kind:i}=l,{timeZone:c}=_(),{now:f}=te(),v=u((F)=>F.connects),H=Ee((F)=>F.lists[i]??0),[w,y]=r(""),[h,E]=r(""),[C,M]=r(),[L,T]=r(),[O,B]=r(),[D,Z]=r(!1);o(()=>{let F=setTimeout(()=>E(w.trim()),wt);return()=>clearTimeout(F)},[w]),o(()=>{let F=!0;return Ue.list(i,h||void 0).then((I)=>{if(!F)return;Di(Object.fromEntries(I.rooms.map((Y)=>[Y.key,Y.unread??0]))),M(I.rooms),T(I.cursor),B(void 0)},(I)=>F&&B(d(I))),()=>{F=!1}},[i,h,v,H]);let re=async()=>{if(!L||D)return;Z(!0);try{let F=await Ue.list(i,h||void 0,L);Di(Object.fromEntries(F.rooms.map((I)=>[I.key,I.unread??0]))),M((I)=>[...I??[],...F.rooms]),T(F.cursor)}catch(F){B(d(F))}finally{Z(!1)}};return n("section",{className:"stack",children:[n("h2",{className:"section-title",children:[l.icon?e(s,{name:l.icon,size:14,className:"section-icon"}):null,l.label]}),C&&(C.length>=vt||h||w)?e("input",{type:"search",className:"kind-filter",value:w,placeholder:t("Search {name}",{name:l.label}),"aria-label":t("Search {name}",{name:l.label}),onChange:(F)=>y(F.target.value)}):null,O?e(m,{message:O}):null,!C&&!O?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,C&&C.length===0?e(k,{children:h?t("Nothing matches."):t("No rooms yet.")}):null,C&&C.length>0?e("ul",{className:"room-list",children:C.map((F)=>e("li",{children:n("a",{className:"room-row",href:x("room",F.key),"aria-current":F.key===l.active?"page":void 0,children:[n("span",{className:"kind-row-picture",children:[e(it,{picture:F.picture,name:F.title,size:44}),F.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null]}),n("span",{className:"room-row-main",children:[n("span",{className:"room-row-top",children:[e("strong",{children:F.title}),e(ce,{room:F.key}),e("span",{className:"room-row-time",children:F.lastAt?Pe(F.lastAt,f,c):""})]}),e("span",{className:"room-row-preview",children:e("span",{children:F.subtitle??""})})]}),e(s,{name:"chevron",size:16,className:"room-row-chevron"})]})},F.key))}):null,L?e("button",{type:"button",className:"secondary",disabled:D,onClick:re,children:D?t("Loading…"):t("Show more")}):null]})}function Ve(l){return l.kinds.map((i)=>e(be,{kind:i.kind,label:i.label,...i.icon?{icon:i.icon}:{},active:l.active},i.kind))}function Ie(){let l=(_().pages??[]).filter((i)=>i.place==="settings");if(l.length===0)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("More settings")}),l.map((i)=>n("a",{className:"menu-item menu-link",href:x("p",i.id),children:[e("span",{className:"menu-text",children:e("strong",{children:i.label})}),e(s,{name:"chevron",size:16})]},i.id))]})}export{Ve as HostKinds,ot as HostPage,yt as HostRoomPage,Ie as HostSettingsPages,ae as ReadLog,ce as UnreadMark};
@@ -1,2 +1,2 @@
1
- import{U,xe,l,b,Se,Re,Ee,q,re,Ke,Pt,R,g,pt,E,qe}from"./chunk-index-rjv7vrwd.js";class Pi{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=E(this.state).resolveInner(this.pos,-1);while(e&&t.indexOf(e.name)<0)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),o=n.search(D(t,!1));return o<0?null:{from:i+o,to:this.pos,text:n.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,i){if(t=="abort"&&this.abortListeners){if(this.abortListeners.push(e),i&&i.onDocChange)this.abortOnDocChange=!0}}}function v(t){let e=Object.keys(t).join(""),i=/\w/.test(e);if(i)e=e.replace(/\w/g,"");return`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function O(t){let e=Object.create(null),i=Object.create(null);for(let{label:o}of t){e[o[0]]=!0;for(let s=1;s<o.length;s++)i[o[s]]=!0}let n=v(e)+v(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function We(t){let e=t.map((o)=>typeof o=="string"?{label:o}:o),[i,n]=e.every((o)=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:O(e);return(o)=>{let s=o.matchBefore(n);return s||o.explicit?{from:s?s.from:o.pos,options:e,validFor:i}:null}}function Ye(t,e){return(i)=>{for(let n=E(i.state).resolveInner(i.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(i)}}function D(t,e){var i;let{source:n}=t,o=e&&n[0]!="^",s=n[n.length-1]!="$";if(!o&&!s)return t;return new RegExp(`${o?"^":""}(?:${n})${s?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}var P=Ee.define();var le=typeof navigator=="object"&&/Win/.test(navigator.platform);var L=g.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:0.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:0.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class I{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class y{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,xe.TrackDel),i=t.mapPos(this.to,1,xe.TrackDel);return e==null||i==null?null:new y(this.field,e,i)}}class x{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],o=t.doc.lineAt(e),s=/^\s*/.exec(o.text)[0];for(let a of this.lines){if(i.length){let h=s,c=/^\t*/.exec(a)[0].length;for(let r=0;r<c;r++)h+=t.facet(qe);n.push(e+h.length-c),a=h+a.slice(c)}i.push(a),e+=a.length+1}let f=this.fieldPositions.map((a)=>new y(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:f}}static parse(t){let e=[],i=[],n=[],o;for(let s of t.split(/\r\n?|\n/)){while(o=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s)){let f=o[1]?+o[1]:null,a=o[2]||o[3]||"",h=-1;if(f===0)f=1e9;let c=a.replace(/\\[{}]/g,(r)=>r[1]);for(let r=0;r<e.length;r++)if(f!=null?e[r].seq==f:c?e[r].name==c:!1)h=r;if(h<0){let r=0;while(r<e.length&&(f==null||e[r].seq!=null&&e[r].seq<f))r++;e.splice(r,0,{seq:f,name:c}),h=r;for(let u of n)if(u.field>=h)u.field++}for(let r of n)if(r.line==i.length&&r.from>o.index){let u=o[2]?3+(o[1]||"").length:2;r.from-=u,r.to-=u}n.push(new I(h,i.length,o.index,o.index+c.length)),s=s.slice(0,o.index)+a+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(f,a,h)=>{for(let c of n)if(c.line==i.length&&c.from>h)c.from--,c.to--;return a}),i.push(s)}return new x(i,n)}}var k=R.widget({widget:new class extends Pt{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),M=R.mark({class:"cm-snippetField"});class p{constructor(t,e){this.ranges=t,this.active=e,this.deco=R.set(t.map((i)=>(i.from==i.to?k:M).range(i.from,i.to)),!0)}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new p(e,this.active)}selectionInsideField(t){return t.ranges.every((e)=>this.ranges.some((i)=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}var m=q.define({map(t,e){return t&&t.map(e)}}),A=q.define(),d=Se.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(m))return i.value;if(i.is(A)&&t)return new p(t.ranges,i.value)}if(t&&e.docChanged)t=t.map(e.changes);if(t&&e.selection&&!t.selectionInsideField(e.selection))t=null;return t},provide:(t)=>g.decorations.from(t,(e)=>e?e.deco:R.none)});function w(t,e){return l.create(t.filter((i)=>i.field==e).map((i)=>l.range(i.from,i.to)))}function B(t){let e=x.parse(t);return(i,n,o,s)=>{let{text:f,ranges:a}=e.instantiate(i.state,o),{main:h}=i.state.selection,c={changes:{from:o,to:s==h.from?h.to:s,insert:U.of(f)},scrollIntoView:!0,annotations:n?[P.of(n),re.userEvent.of("input.complete")]:void 0};if(a.length)c.selection=w(a,0);if(a.some((r)=>r.field>0)){let r=new p(a,0),u=c.effects=[m.of(r)];if(i.state.field(d,!1)===void 0)u.push(q.appendConfig.of([d,H,V,L]))}i.dispatch(i.state.update(c))}}function S(t){return({state:e,dispatch:i})=>{let n=e.field(d,!1);if(!n||t<0&&n.active==0)return!1;let o=n.active+t,s=t>0&&!n.ranges.some((f)=>f.field==o+t);return i(e.update({selection:w(n.ranges,o),effects:m.of(s?null:new p(n.ranges,o)),scrollIntoView:!0})),!0}}var F=({state:t,dispatch:e})=>{if(!t.field(d,!1))return!1;return e(t.update({effects:m.of(null)})),!0},W=S(1),j=S(-1);var _=[{key:"Tab",run:W,shift:j},{key:"Escape",run:F}],C=b.define({combine(t){return t.length?t[0]:_}}),H=Re.highest(pt.compute([C],(t)=>t.facet(C)));function N(t,e){return{...e,apply:B(t)}}var V=g.domEventHandlers({mousedown(t,e){let i=e.state.field(d,!1),n;if(!i||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let o=i.ranges.find((s)=>s.from<=n&&s.to>=n);if(!o||o.field==i.active)return!1;return e.dispatch({selection:w(i.ranges,o.field),effects:m.of(i.ranges.some((s)=>s.field>o.field)?new p(i.ranges,o.field):null),scrollIntoView:!0}),!0}});var T=new class extends Ke{};T.startSide=1;T.endSide=-1;var ae=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);
2
- export{Pi,We,Ye,N};
1
+ import{U,ke,l,v,_e,Ne,Le,q,se,ct,Xt,E,y,wt,C,je}from"./chunk-index-0xj30mzw.js";class Gi{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=C(this.state).resolveInner(this.pos,-1);while(e&&t.indexOf(e.name)<0)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),o=n.search(P(t,!1));return o<0?null:{from:i+o,to:this.pos,text:n.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,i){if(t=="abort"&&this.abortListeners){if(this.abortListeners.push(e),i&&i.onDocChange)this.abortOnDocChange=!0}}}function w(t){let e=Object.keys(t).join(""),i=/\w/.test(e);if(i)e=e.replace(/\w/g,"");return`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function D(t){let e=Object.create(null),i=Object.create(null);for(let{label:o}of t){e[o[0]]=!0;for(let s=1;s<o.length;s++)i[o[s]]=!0}let n=w(e)+w(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function st(t){let e=t.map((o)=>typeof o=="string"?{label:o}:o),[i,n]=e.every((o)=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:D(e);return(o)=>{let s=o.matchBefore(n);return s||o.explicit?{from:s?s.from:o.pos,options:e,validFor:i}:null}}function ot(t,e){return(i)=>{for(let n=C(i.state).resolveInner(i.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(i)}}function P(t,e){var i;let{source:n}=t,o=e&&n[0]!="^",s=n[n.length-1]!="$";if(!o&&!s)return t;return new RegExp(`${o?"^":""}(?:${n})${s?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}var R=Le.define();var re=typeof navigator=="object"&&/Win/.test(navigator.platform);var k=y.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:0.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:0.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class S{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class g{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,ke.TrackDel),i=t.mapPos(this.to,1,ke.TrackDel);return e==null||i==null?null:new g(this.field,e,i)}}class b{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],o=t.doc.lineAt(e),s=/^\s*/.exec(o.text)[0];for(let a of this.lines){if(i.length){let h=s,c=/^\t*/.exec(a)[0].length;for(let r=0;r<c;r++)h+=t.facet(je);n.push(e+h.length-c),a=h+a.slice(c)}i.push(a),e+=a.length+1}let f=this.fieldPositions.map((a)=>new g(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:f}}static parse(t){let e=[],i=[],n=[],o;for(let s of t.split(/\r\n?|\n/)){while(o=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s)){let f=o[1]?+o[1]:null,a=o[2]||o[3]||"",h=-1;if(f===0)f=1e9;let c=a.replace(/\\[{}]/g,(r)=>r[1]);for(let r=0;r<e.length;r++)if(f!=null?e[r].seq==f:c?e[r].name==c:!1)h=r;if(h<0){let r=0;while(r<e.length&&(f==null||e[r].seq!=null&&e[r].seq<f))r++;e.splice(r,0,{seq:f,name:c}),h=r;for(let u of n)if(u.field>=h)u.field++}for(let r of n)if(r.line==i.length&&r.from>o.index){let u=o[2]?3+(o[1]||"").length:2;r.from-=u,r.to-=u}n.push(new S(h,i.length,o.index,o.index+c.length)),s=s.slice(0,o.index)+a+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(f,a,h)=>{for(let c of n)if(c.line==i.length&&c.from>h)c.from--,c.to--;return a}),i.push(s)}return new b(i,n)}}var M=E.widget({widget:new class extends Xt{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),A=E.mark({class:"cm-snippetField"});class p{constructor(t,e){this.ranges=t,this.active=e,this.deco=E.set(t.map((i)=>(i.from==i.to?M:A).range(i.from,i.to)),!0)}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new p(e,this.active)}selectionInsideField(t){return t.ranges.every((e)=>this.ranges.some((i)=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}var m=q.define({map(t,e){return t&&t.map(e)}}),B=q.define(),d=_e.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(m))return i.value;if(i.is(B)&&t)return new p(t.ranges,i.value)}if(t&&e.docChanged)t=t.map(e.changes);if(t&&e.selection&&!t.selectionInsideField(e.selection))t=null;return t},provide:(t)=>y.decorations.from(t,(e)=>e?e.deco:E.none)});function x(t,e){return l.create(t.filter((i)=>i.field==e).map((i)=>l.range(i.from,i.to)))}function F(t){let e=b.parse(t);return(i,n,o,s)=>{let{text:f,ranges:a}=e.instantiate(i.state,o),{main:h}=i.state.selection,c={changes:{from:o,to:s==h.from?h.to:s,insert:U.of(f)},scrollIntoView:!0,annotations:n?[R.of(n),se.userEvent.of("input.complete")]:void 0};if(a.length)c.selection=x(a,0);if(a.some((r)=>r.field>0)){let r=new p(a,0),u=c.effects=[m.of(r)];if(i.state.field(d,!1)===void 0)u.push(q.appendConfig.of([d,H,V,k]))}i.dispatch(i.state.update(c))}}function T(t){return({state:e,dispatch:i})=>{let n=e.field(d,!1);if(!n||t<0&&n.active==0)return!1;let o=n.active+t,s=t>0&&!n.ranges.some((f)=>f.field==o+t);return i(e.update({selection:x(n.ranges,o),effects:m.of(s?null:new p(n.ranges,o)),scrollIntoView:!0})),!0}}var W=({state:t,dispatch:e})=>{if(!t.field(d,!1))return!1;return e(t.update({effects:m.of(null)})),!0},N=T(1),j=T(-1);var _=[{key:"Tab",run:N,shift:j},{key:"Escape",run:W}],I=v.define({combine(t){return t.length?t[0]:_}}),H=Ne.highest(wt.compute([I],(t)=>t.facet(I)));function L(t,e){return{...e,apply:F(t)}}var V=y.domEventHandlers({mousedown(t,e){let i=e.state.field(d,!1),n;if(!i||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let o=i.ranges.find((s)=>s.from<=n&&s.to>=n);if(!o||o.field==i.active)return!1;return e.dispatch({selection:x(i.ranges,o.field),effects:m.of(i.ranges.some((s)=>s.field>o.field)?new p(i.ranges,o.field):null),scrollIntoView:!0}),!0}});var O=new class extends ct{};O.startSide=1;O.endSide=-1;var ae=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);
2
+ export{Gi,st,ot,L};
@@ -0,0 +1,2 @@
1
+ import{Ce}from"./chunk-index-51n20yhb.js";import{t,fe,$s,ai}from"./chunk-index-84v7j6vh.js";function Fn(e){let n=e.getBoundingClientRect(),o=$s();fe({title:t("Rooms"),items:[{id:"new-folder",label:t("Add a folder"),icon:"plus",run:()=>Ce({kind:"new"})},{id:"arrange",label:o?t("Done"):t("Arrange"),icon:o?"check":"list",run:()=>ai(!o)}],at:{x:n.left,y:n.bottom},via:"key",source:e})}
2
+ export{Fn};
@@ -0,0 +1,2 @@
1
+ import{Ve,b}from"./chunk-index-84v7j6vh.js";import{At}from"./chunk-index-43k1rjmx.js";var Xr=()=>{let{pins:t,folders:o}=b.getState();return{pins:t,folders:o}};function yn(){let t=b.getState();return At(t,(o)=>Ve(t,o))}
2
+ export{Xr,yn};
@@ -0,0 +1 @@
1
+ import{ti}from"./chunk-index-84v7j6vh.js";var M={chat:"M21 12a8 8 0 0 1-11.6 7.1L4 20.5l1.4-4.7A8 8 0 1 1 21 12Z",link:"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3A4 4 0 0 0 11 18.7l1-1",activity:"M3 12h4l3-8 4 16 3-8h4",users:"M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7ZM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 6.5M18 14a6.5 6.5 0 0 1 3.5 6",megaphone:"M4 10v4h3l8 4V6L7 10H4ZM18 9a4 4 0 0 1 0 6M7 14l1 6h3l-1-5",qr:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h2v2h-2zM18 14h2v2M14 18h2M18 18h2v2h-2z"};ti(M);
@@ -0,0 +1 @@
1
+ var r="./account-zk4efb87.css";if(typeof document<"u"&&!document.getElementById("account-styles")){let e=document.createElement("link");e.id="account-styles",e.rel="stylesheet",e.href=new URL(r,import.meta.url).href,document.head.append(e)}