pi-roundtable-web 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/chunk-account-83crfbn4.js +1 -0
- package/dist/{chunk-action-menu-zh2n0ahf.js → chunk-action-menu-qw7h03x0.js} +1 -1
- package/dist/{chunk-agent-ynm2tcbx.js → chunk-agent-t1632ktv.js} +1 -1
- package/dist/{chunk-arranged-rooms-qnz8vese.js → chunk-arranged-rooms-sb6tbsxw.js} +1 -1
- package/dist/{chunk-bulk-actions-pr0mw0kc.js → chunk-bulk-actions-v1g2bzk7.js} +1 -1
- package/dist/{chunk-character-creator-caj4pmg4.js → chunk-character-creator-ye69w0kx.js} +1 -1
- package/dist/{chunk-codeeditor-dga6s78p.js → chunk-codeeditor-5j6abj8k.js} +1 -1
- package/dist/chunk-confirm-x8w877bz.js +1 -0
- package/dist/{chunk-connectors-j79ze3j1.js → chunk-connectors-t7qbc6nk.js} +1 -1
- package/dist/{chunk-conversations-2farn72g.js → chunk-conversations-kmt6qzym.js} +1 -1
- package/dist/{chunk-council-sheet-s9sz1bzf.js → chunk-council-sheet-bxvn7vza.js} +1 -1
- package/dist/{chunk-drag-45e8222r.js → chunk-drag-03zgvd66.js} +1 -1
- package/dist/{chunk-entry-q11n47h9.js → chunk-entry-y5vwp5e5.js} +1 -1
- package/dist/{chunk-folder-list-4gcj7g7h.js → chunk-folder-list-h3vnjzpb.js} +1 -1
- package/dist/{chunk-folds-ten4ykfw.js → chunk-folds-a3e22m7x.js} +1 -1
- package/dist/{chunk-gate-kcv1a4t0.js → chunk-gate-qzephvdv.js} +1 -1
- package/dist/chunk-group-scene-w1ycabrm.js +1 -0
- package/dist/{chunk-group-table-t458kdgn.js → chunk-group-table-9nvmja8w.js} +1 -1
- package/dist/chunk-host-icons-fccg3b2d.js +1 -0
- package/dist/chunk-host-picture-jaqz127q.js +1 -0
- package/dist/{chunk-host-state-7mdve7cb.js → chunk-host-state-r01v1ywg.js} +1 -1
- package/dist/{chunk-host-ui-bdgwa6sf.js → chunk-host-ui-n54mh5af.js} +1 -1
- package/dist/{chunk-index-ffbrm6tr.js → chunk-index-0ye10vk3.js} +1 -1
- package/dist/{chunk-index-b8cpvr7y.js → chunk-index-1kwp3spy.js} +1 -1
- package/dist/{chunk-index-kbrg32sx.js → chunk-index-3pnvpppa.js} +1 -1
- package/dist/{chunk-index-f6q0stqx.js → chunk-index-47vq85ye.js} +1 -1
- package/dist/{chunk-index-2t30xwed.js → chunk-index-4z4chg7v.js} +1 -1
- package/dist/{chunk-index-cdctnw71.js → chunk-index-5zmswz4s.js} +1 -1
- package/dist/{chunk-index-6bkcq9ka.js → chunk-index-6vcs0h0m.js} +1 -1
- package/dist/{chunk-index-j4kk1m59.js → chunk-index-6xqz6mg2.js} +1 -1
- package/dist/{chunk-index-02vfshtt.js → chunk-index-83v0c9x6.js} +1 -1
- package/dist/{chunk-index-aamhjg5n.js → chunk-index-8xd6anam.js} +1 -1
- package/dist/{chunk-index-31x6krbs.js → chunk-index-983dmeaa.js} +1 -1
- package/dist/{chunk-index-xxeb2xp0.js → chunk-index-9z13jw6q.js} +2 -2
- package/dist/{chunk-index-q7g62sgm.js → chunk-index-af4ebmkr.js} +1 -1
- package/dist/{chunk-index-8d81qy69.js → chunk-index-afrhnrxj.js} +1 -1
- package/dist/{chunk-index-zyvwhxga.js → chunk-index-ben4gv45.js} +1 -1
- package/dist/{chunk-index-t998yg8y.js → chunk-index-c44p8q87.js} +1 -1
- package/dist/{chunk-index-92zgb7my.js → chunk-index-db8zh8e6.js} +1 -1
- package/dist/{chunk-index-dnjftvtq.js → chunk-index-dvfkb699.js} +1 -1
- package/dist/{chunk-index-g3wrs02w.js → chunk-index-e02ddp46.js} +1 -1
- package/dist/{chunk-index-pefwfm26.js → chunk-index-em7vndrb.js} +1 -1
- package/dist/{chunk-index-tk4se135.js → chunk-index-eq161yvp.js} +1 -1
- package/dist/{chunk-index-xq84gg8w.js → chunk-index-f500nw4w.js} +1 -1
- package/dist/{chunk-index-12zyshae.js → chunk-index-f5x2srr0.js} +1 -1
- package/dist/{chunk-index-2e4am3hw.js → chunk-index-fg42egv9.js} +4 -4
- package/dist/{chunk-index-msqhgvfx.js → chunk-index-h3v1d3nt.js} +1 -1
- package/dist/{chunk-index-2fdns8tn.js → chunk-index-j7pgphx3.js} +1 -1
- package/dist/{chunk-index-ac1ktr56.js → chunk-index-k0z507h3.js} +1 -1
- package/dist/chunk-index-kbgykazq.js +2 -0
- package/dist/{chunk-index-0w4bfjb5.js → chunk-index-n05yw5wd.js} +1 -1
- package/dist/{chunk-index-18pgxxw3.js → chunk-index-n8ghdvxb.js} +1 -1
- package/dist/{chunk-index-rh0x9rzf.js → chunk-index-nsvwbjfe.js} +1 -1
- package/dist/{chunk-index-jgzygbt8.js → chunk-index-p5jcwjx8.js} +1 -1
- package/dist/{chunk-index-kb3w11mn.js → chunk-index-rcwdqn50.js} +2 -2
- package/dist/chunk-index-s72hmse6.js +2 -0
- package/dist/{chunk-index-5bfqek1d.js → chunk-index-xevnf9ew.js} +1 -1
- package/dist/{chunk-index-pyfx77cj.js → chunk-index-xx8jq73q.js} +1 -1
- package/dist/{chunk-index-e2dqjde8.js → chunk-index-y60x5jbh.js} +1 -1
- package/dist/{chunk-index-dj0tbfyb.js → chunk-index-ypkgw7gq.js} +1 -1
- package/dist/{chunk-index-g1awv7rk.js → chunk-index-yrmqcay4.js} +1 -1
- package/dist/chunk-layout-actions-8dzvysym.js +1 -0
- package/dist/{chunk-menu-items-bza16bw6.js → chunk-menu-items-3jhya205.js} +1 -1
- package/dist/chunk-mode-toggle-js49gvpd.js +1 -0
- package/dist/{chunk-note-row-6fmhrdng.js → chunk-note-row-kv061030.js} +2 -2
- package/dist/{chunk-notes-wv0e6ssf.js → chunk-notes-sdkqz5hr.js} +1 -1
- package/dist/{chunk-notice-bell-9z27epd2.js → chunk-notice-bell-r012f2zy.js} +1 -1
- package/dist/{chunk-notices-fte9f196.js → chunk-notices-h4rk1zxc.js} +1 -1
- package/dist/{chunk-onboarding-c5twahc3.js → chunk-onboarding-a18cvkph.js} +1 -1
- package/dist/{chunk-overview-k4ccprax.js → chunk-overview-ynaqn4fp.js} +1 -1
- package/dist/{chunk-palette-9rbp2fab.js → chunk-palette-jm79gb5q.js} +1 -1
- package/dist/chunk-placement-items-mwm9q1zn.js +1 -0
- package/dist/{chunk-profile-s7r7fcvz.js → chunk-profile-ajw6pp4r.js} +1 -1
- package/dist/{chunk-prompt-history-hf296e7v.js → chunk-prompt-history-zcfvr3r8.js} +1 -1
- package/dist/{chunk-prompts-c8s0nhkm.js → chunk-prompts-m5rzdk24.js} +1 -1
- package/dist/chunk-room-confirms-ftsj15ja.js +1 -0
- package/dist/{chunk-room-menu-7h4jym2b.js → chunk-room-menu-b9ktw9pw.js} +1 -1
- package/dist/{chunk-rooms-menu-button-pgtaanb6.js → chunk-rooms-menu-button-qe62t6nx.js} +1 -1
- package/dist/{chunk-schedules-mbnwcxpc.js → chunk-schedules-t8yxnf8q.js} +1 -1
- package/dist/{chunk-seat-menu-r0k0eawr.js → chunk-seat-menu-kwtjnpjj.js} +1 -1
- package/dist/{chunk-sheet-hosts-a5dfevy9.js → chunk-sheet-hosts-yj5wszgj.js} +1 -1
- package/dist/{chunk-shortcut-help-a6pkjcq7.js → chunk-shortcut-help-g5cpqjjj.js} +1 -1
- package/dist/{chunk-shortcuts-cgt87jkz.js → chunk-shortcuts-9ft5sqdw.js} +1 -1
- package/dist/{chunk-skill-editor-67yk4x7t.js → chunk-skill-editor-xdfq2708.js} +1 -1
- package/dist/{chunk-skills-rewemey4.js → chunk-skills-9wa4mwdc.js} +1 -1
- package/dist/{chunk-switcher-list-t8rbay2y.js → chunk-switcher-list-vpg6wvtw.js} +1 -1
- package/dist/{chunk-tab-dot-vr11dfrw.js → chunk-tab-dot-yse6wcfp.js} +1 -1
- package/dist/{chunk-table-52nh0azk.js → chunk-table-1y76m54h.js} +1 -1
- package/dist/{chunk-table3d-rp0w6kt4.js → chunk-table3d-cv6069hy.js} +1 -1
- package/dist/chunk-thread-actions-xjhpdjk7.js +1 -0
- package/dist/{chunk-thread-cards-c2mrp2gj.js → chunk-thread-cards-36rckyg7.js} +1 -1
- package/dist/{chunk-thread-list-0071q455.js → chunk-thread-list-fd6agz77.js} +2 -2
- package/dist/{chunk-transcript-789yqysq.js → chunk-transcript-5nfn3r35.js} +1 -1
- package/dist/chunk-where-ha8pc3cg.js +1 -0
- package/dist/{chunk-workspace-wr1qrtsh.js → chunk-workspace-e85twv32.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-account-1ecx5kt7.js +0 -1
- package/dist/chunk-confirm-g76v5d9r.js +0 -1
- package/dist/chunk-group-scene-12ghcvzd.js +0 -1
- package/dist/chunk-host-icons-h1k9k96a.js +0 -1
- package/dist/chunk-host-picture-3p0wzn3v.js +0 -1
- package/dist/chunk-index-j0m16cj1.js +0 -2
- package/dist/chunk-index-v6smgw77.js +0 -2
- package/dist/chunk-layout-actions-y73mpsh1.js +0 -1
- package/dist/chunk-mode-toggle-nj9gnt3b.js +0 -1
- package/dist/chunk-placement-items-me598wsb.js +0 -1
- package/dist/chunk-room-confirms-ga2sbvhc.js +0 -1
- package/dist/chunk-thread-actions-qcxt1y1g.js +0 -1
- package/dist/chunk-where-hmwmme9e.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Nr,Lr,Xr}from"./chunk-index-6vcs0h0m.js";import"./chunk-index-nsvwbjfe.js";export{Lr as clearAcross,Xr as clearFinished,Nr as dismissThread};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,Le,pe,mn,Fo,Xn,Wi}from"./chunk-index-
|
|
1
|
+
import{t,Le,pe,mn,Fo,Xn,Wi}from"./chunk-index-fg42egv9.js";import{Nr,Xr}from"./chunk-index-6vcs0h0m.js";import{gr}from"./chunk-index-f5x2srr0.js";import"./chunk-index-nsvwbjfe.js";var E=12,R=24,y=180,L=150,C=100,w=".thread-card",h=".thread-group",g=(e)=>e instanceof Element?e.closest(w):null,B=(e)=>e.closest("li"),m=(e)=>e.dataset.closed==="",I=(e)=>new Promise((i)=>setTimeout(i,e));function X(e){return[...e.closest(h)?.querySelectorAll(`${w}[data-closed]`)??[]].flatMap((n)=>n.dataset.thread?[n.dataset.thread]:[])}function q(e){let i=B(e);if(delete e.dataset.armed,e.style.transition="",e.style.transform="",e.style.opacity="",i)i.style.transition="",i.style.height="",i.style.marginBottom="",i.style.opacity=""}async function F(e){let i=B(e);if(!i||Le())return;e.dataset.leaving="",e.style.transition=`transform ${y}ms var(--ease-out), opacity ${y}ms var(--ease-out)`,e.style.transform="translate3d(110%, 0, 0)",e.style.opacity="0",await I(y),i.style.height=`${i.offsetHeight}px`,i.getBoundingClientRect(),i.style.transition=`height ${L}ms var(--ease-out), margin-bottom ${L}ms var(--ease-out)`,i.style.height="0px",i.style.marginBottom="calc(var(--space-1) * -1)",await I(L)}function _(e){let i=[...e.closest(h)?.querySelectorAll(`${w} .thread-link`)??[]],n=e.querySelector(".thread-link"),o=n?i.indexOf(n):-1;if(document.activeElement&&!e.contains(document.activeElement))return;(i[o+1]??i[o-1]??e.closest(h)?.querySelector("summary"))?.closest("a, summary")?.focus()}async function T(e){let i=e.dataset.thread;if(!i||!m(e)||e.dataset.leaving!==void 0)return;if(_(e),await F(e),!await Nr(i))q(e);delete e.dataset.leaving}function M(e,i,n){let o=[];if(m(e))o.push({id:"clear",label:t("Clear this thread"),icon:"trash",tone:"danger",run:()=>T(e)});let l=X(e),f=e.closest(h)?.dataset.parent||void 0;if(l.length>0)o.push({id:"clear-all",label:t("Clear all finished"),icon:"trash",tone:"danger",run:()=>Xr(f,l)});pe({title:e.querySelector(".thread-title")?.textContent??"",items:o,at:i,via:n,source:e.querySelector(".thread-link")??e})}var O=(e)=>{if(e.cancelable)e.preventDefault()};function W(e,i){let n=e.at(-1);if(!n||i-n.t>C)return 0;let o=e.find((l)=>n.t-l.t<=C);if(!o||n.t<=o.t)return 0;return(n.x-o.x)/(n.t-o.t)}function z(e){let i=gr(),n,o=!1,l=()=>{n?.press.cancel(),window.removeEventListener("touchmove",O),n=void 0},f=(s)=>{if(o=!1,s.pointerType==="mouse"||!s.isPrimary)return;let r=g(s.target);if(!r||s.target.closest(".thread-more"))return;l();let a={x:s.clientX,y:s.clientY},c=new mn((d)=>{if(o=!0,typeof navigator.vibrate==="function")navigator.vibrate(10);if(n)n.state="reject";v(r),M(r,d,"hold")});c.begin(a.x,a.y),n={id:s.pointerId,card:r,origin:a,press:c,swipes:!Xn(a.x,window.innerWidth),state:"wait",offset:0,samples:[{x:a.x,t:s.timeStamp}]}},v=(s)=>{if(s.dataset.leaving!==void 0)return;delete s.dataset.armed,s.style.transition=`transform ${Le()?0:y}ms var(--ease-out)`,s.style.transform=""},x=(s)=>{if(!n||n.id!==s.pointerId)return;let{card:r}=n,a=s.clientX-n.origin.x,c=s.clientY-n.origin.y;if(n.state==="wait"){n.press.move(s.clientX,s.clientY);let p=Math.abs(a);if(!n.swipes)return;if(p>=E&&p>Fo*Math.abs(c)){if(n.state=a>0?"drag":"reject",n.state==="drag")n.press.cancel(),r.style.transition="none",window.addEventListener("touchmove",O,{passive:!1})}else if(Math.abs(c)>=E)n.state="reject";if(n.state!=="drag")return}if(n.state!=="drag")return;let d=Math.max(0,a-E),u=r.offsetWidth||1;if(n.offset=m(r)?Math.min(d,u):Math.min(R,d*0.3),n.samples.push({x:s.clientX,t:s.timeStamp}),r.style.transform=`translate3d(${n.offset}px, 0, 0)`,m(r))if(Wi(n.offset/u,0))r.dataset.armed="";else delete r.dataset.armed},H=(s)=>{if(!n||n.id!==s.pointerId)return;let{card:r,state:a,offset:c,samples:d}=n,u=n.press.end();if(l(),u)o=!0;if(a!=="drag")return;o=!0;let p=r.offsetWidth||1,A=W(d,s.timeStamp);if(m(r)&&c>E&&Wi(c/p,A))T(r);else v(r)},b=(s)=>{if(!n||n.id!==s.pointerId)return;let{card:r,state:a}=n;if(l(),a==="drag")v(r)},S=(s)=>{let r=g(s.target);if(!r)return;if(s.preventDefault(),o)return;n?.press.cancel(),M(r,{x:s.clientX,y:s.clientY},"contextmenu")},P=(s)=>{o=!1;let r=g(s.target);if(!r)return;if(s.key==="Delete"&&m(r))s.preventDefault(),T(r);else if(s.key==="ContextMenu"||s.key==="F10"&&s.shiftKey){s.preventDefault();let a=r.getBoundingClientRect();M(r,{x:a.left+Math.min(a.width/2,48),y:a.top+24},"key")}},k=(s)=>{if(!o)return;o=!1,s.preventDefault(),s.stopPropagation()},D=(s)=>{if(g(s.target))s.preventDefault()};return e.addEventListener("pointerdown",f),e.addEventListener("pointermove",x),e.addEventListener("pointerup",H),e.addEventListener("pointercancel",b),e.addEventListener("contextmenu",S),e.addEventListener("keydown",P),e.addEventListener("click",k,!0),e.addEventListener("dragstart",D),()=>{l(),i(),e.removeEventListener("pointerdown",f),e.removeEventListener("pointermove",x),e.removeEventListener("pointerup",H),e.removeEventListener("pointercancel",b),e.removeEventListener("contextmenu",S),e.removeEventListener("keydown",P),e.removeEventListener("click",k,!0),e.removeEventListener("dragstart",D)}}export{z as attachThreadCards,M as openCardMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h,J,s,a,t,te,m,e,n,o,v,u,V,k,_e,ne,Bi,Xe,Yt,In,vn,At}from"./chunk-index-
|
|
1
|
+
import{h,J,s,a,t,te,m,e,n,o,v,u,V,k,_e,ne,Bi,Xe,Yt,In,vn,At}from"./chunk-index-fg42egv9.js";var H="roundtable-console:helpers-folded";function z(){try{let i=localStorage.getItem(H),r=i?JSON.parse(i):{};if(typeof r!=="object"||r===null||Array.isArray(r))return{};return Object.fromEntries(Object.entries(r).filter((l)=>typeof l[1]==="boolean"))}catch{return{}}}var S,{emit:O,use:P}=V(),E=()=>(S??=z(),S);function L(i,r){return P(E)[i]??!r}function T(i,r){S={...E(),[i]:r};try{localStorage.setItem(H,JSON.stringify(S))}catch{}O()}var D=!1;function F(){if(D||typeof document>"u")return;if(D=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let r=new CSSStyleSheet;r.replaceSync(`
|
|
2
2
|
.helper-group {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -214,4 +214,4 @@ import{h,J,s,a,t,te,m,e,n,o,v,u,V,k,_e,ne,Bi,Xe,Yt,In,vn,At}from"./chunk-index-2
|
|
|
214
214
|
animation: none;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
`,document.head.append(i)}F();var _=J(function(r){let{view:l}=r,c=l.helper?.finished===!0;return e("li",{children:n("a",{className:"helper-link",href:v("room",l.key),"data-helper":l.name,"data-finished":c?"":void 0,"aria-current":r.active?"page":void 0,children:[e(Xe,{view:l,size:20}),e("strong",{children:l.displayName}),e(Yt,{room:l.key}),n("span",{className:"helper-state",children:[r.waiting?e(vn,{count:r.waiting}):null,!c&&!r.waiting?e("span",{className:"helper-dot",role:"img","aria-label":t("Working")}):null,c?e("span",{children:t("Ended")}):null,c&&r.at?e("span",{className:"room-row-time",children:_e(r.at,r.now,r.timeZone)}):null]})]})})});function Z(i){let{now:r}=ne(),{timeZone:l}=k(),c=At(i.keys),b=c.some((f)=>f.view.helper?.finished!==!0),p=i.parent??"",y=!L(p,b)||c.some((f)=>f.key===i.active)?c:[];if(c.length===0)return null;return n("div",{className:"helper-group","data-parent":i.parent,children:[e("button",{type:"button",className:"helper-head","aria-expanded":y.length>0,onClick:()=>T(p,y.length>0),children:te(c.length,"{count} temp knight","{count} temp knights")}),y.length>0?e("ul",{className:"helper-list",children:y.map(({key:f,...w})=>e(_,{...w,active:f===i.active,now:r,timeZone:l},f))}):null]})}var I=J(function(r){let{view:l,parent:c}=r,b=Bi(l.key),p=Boolean(l.closed);return n("li",{className:"thread-item",children:[p?n("span",{className:"thread-reveal","aria-hidden":"true",children:[e(o,{name:"trash",size:18}),t("Clear")]}):null,n("div",{className:"thread-card","data-hold":"row","data-thread":l.key,"data-closed":p?"":void 0,style:b,children:[n("a",{className:"thread-link",href:v("room",l.key),"aria-current":r.active?"page":void 0,children:[c?e(Xe,{view:c,size:36}):e(o,{name:"conversations",size:20,className:"thread-row-icon"}),n("span",{className:"thread-card-main",children:[n("span",{className:"thread-card-top",children:[e("strong",{className:"thread-title",children:l.displayName}),e(Yt,{room:l.key})]}),n("span",{className:"thread-card-meta",children:[r.typing?e(In,{}):null,e("span",{className:p?"badge":"badge badge-accent",children:p?t("Finished"):t("In progress")}),r.waiting?e(vn,{count:r.waiting}):null,e("span",{className:"room-row-time",children:r.at?_e(r.at,r.now,r.timeZone):""})]})]})]}),p?e("button",{type:"button",className:"thread-more","aria-haspopup":"menu","aria-label":t("More actions for {name}",{name:l.displayName}),onClick:(g)=>{let y=g.currentTarget,f=y.closest(".thread-card"),w=y.getBoundingClientRect();if(f)(h("
|
|
217
|
+
`,document.head.append(i)}F();var _=J(function(r){let{view:l}=r,c=l.helper?.finished===!0;return e("li",{children:n("a",{className:"helper-link",href:v("room",l.key),"data-helper":l.name,"data-finished":c?"":void 0,"aria-current":r.active?"page":void 0,children:[e(Xe,{view:l,size:20}),e("strong",{children:l.displayName}),e(Yt,{room:l.key}),n("span",{className:"helper-state",children:[r.waiting?e(vn,{count:r.waiting}):null,!c&&!r.waiting?e("span",{className:"helper-dot",role:"img","aria-label":t("Working")}):null,c?e("span",{children:t("Ended")}):null,c&&r.at?e("span",{className:"room-row-time",children:_e(r.at,r.now,r.timeZone)}):null]})]})})});function Z(i){let{now:r}=ne(),{timeZone:l}=k(),c=At(i.keys),b=c.some((f)=>f.view.helper?.finished!==!0),p=i.parent??"",y=!L(p,b)||c.some((f)=>f.key===i.active)?c:[];if(c.length===0)return null;return n("div",{className:"helper-group","data-parent":i.parent,children:[e("button",{type:"button",className:"helper-head","aria-expanded":y.length>0,onClick:()=>T(p,y.length>0),children:te(c.length,"{count} temp knight","{count} temp knights")}),y.length>0?e("ul",{className:"helper-list",children:y.map(({key:f,...w})=>e(_,{...w,active:f===i.active,now:r,timeZone:l},f))}):null]})}var I=J(function(r){let{view:l,parent:c}=r,b=Bi(l.key),p=Boolean(l.closed);return n("li",{className:"thread-item",children:[p?n("span",{className:"thread-reveal","aria-hidden":"true",children:[e(o,{name:"trash",size:18}),t("Clear")]}):null,n("div",{className:"thread-card","data-hold":"row","data-thread":l.key,"data-closed":p?"":void 0,style:b,children:[n("a",{className:"thread-link",href:v("room",l.key),"aria-current":r.active?"page":void 0,children:[c?e(Xe,{view:c,size:36}):e(o,{name:"conversations",size:20,className:"thread-row-icon"}),n("span",{className:"thread-card-main",children:[n("span",{className:"thread-card-top",children:[e("strong",{className:"thread-title",children:l.displayName}),e(Yt,{room:l.key})]}),n("span",{className:"thread-card-meta",children:[r.typing?e(In,{}):null,e("span",{className:p?"badge":"badge badge-accent",children:p?t("Finished"):t("In progress")}),r.waiting?e(vn,{count:r.waiting}):null,e("span",{className:"room-row-time",children:r.at?_e(r.at,r.now,r.timeZone):""})]})]})]}),p?e("button",{type:"button",className:"thread-more","aria-haspopup":"menu","aria-label":t("More actions for {name}",{name:l.displayName}),onClick:(g)=>{let y=g.currentTarget,f=y.closest(".thread-card"),w=y.getBoundingClientRect();if(f)(h("36rckyg7"),import("./chunk-thread-cards-36rckyg7.js")).then((N)=>N.openCardMenu(f,{x:w.right,y:w.bottom},"key"))},children:e(o,{name:"more",size:18})}):null]})]})});function M(i){let{now:r}=ne(),{timeZone:l}=k(),c=At(i.open),b=c.filter((d)=>d.view.helper).map((d)=>d.key),p=c.filter((d)=>!d.view.helper),g=At(i.closed),y=u((d)=>i.parent?d.rooms[i.parent]?.view:void 0,i.parent??""),f=a(null),w=p.length+g.length>0;if(s(()=>{let d=f.current;if(!w||!d)return;let x=!1,R;return (h("36rckyg7"),import("./chunk-thread-cards-36rckyg7.js")).then((C)=>{if(!x)R=C.attachThreadCards(d)}),()=>{x=!0,R?.()}},[w]),!w&&b.length===0)return null;let N=({key:d,...x})=>e(I,{...x,active:d===i.active,now:r,timeZone:l,parent:y},d);if(!w)return e(Z,{keys:b,parent:i.parent,active:i.active});return n(m,{children:[b.length?e(Z,{keys:b,parent:i.parent,active:i.active}):null,n("div",{className:"thread-group",ref:f,"data-parent":i.parent,children:[p.length?e("ul",{className:"thread-list","aria-label":t("Dispatch threads"),children:p.map(N)}):null,g.length?n("div",{className:"thread-finished",children:[n("details",{className:"thread-closed",...g.some((d)=>d.key===i.active)?{open:!0}:{},children:[e("summary",{children:te(g.length,"{count} finished thread","{count} finished threads")}),e("ul",{className:"thread-list",children:g.map(N)})]}),e("button",{type:"button",className:"thread-clear",onClick:()=>(h("xjhpdjk7"),import("./chunk-thread-actions-xjhpdjk7.js")).then((d)=>d.clearFinished(i.parent,g.map((x)=>x.key))),children:t("Clear finished")})]}):null]})]})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s,N,a,r,t,c,m,e,n,v,O,w,g,_,P,k,re,mi}from"./chunk-index-
|
|
1
|
+
import{s,N,a,r,t,c,m,e,n,v,O,w,g,_,P,k,re,mi}from"./chunk-index-fg42egv9.js";import{be}from"./chunk-index-xevnf9ew.js";import{qe}from"./chunk-index-983dmeaa.js";function U({conversationKey:o}){let[p,y]=r(),u=N(),d=a(!1),{data:i,error:h}=be(()=>O.transcript(o,p),`${o}|${p??""}`);s(()=>{if(i&&!d.current)d.current=!0,window.scrollTo(0,document.body.scrollHeight)},[i]);let T=n("a",{className:"back",href:v("conversations"),children:["← ",t("Conversations")]});if(!i)return n(m,{children:[T,h?e(g,{message:h}):e(w,{})]});let{conversation:f}=i,E=f.kind==="outside"?t("Outside AI client · {id}",{id:f.id.slice(0,8)}):mi(f);return n(m,{children:[T,n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:E}),f.busy>0?e(P,{tone:"busy",children:t("running")}):null]}),i.archives.length>0?n("label",{className:"inline",htmlFor:u,children:[t("Showing")," ",n(qe,{id:u,value:p??"",onChange:(l)=>{d.current=!1,y(l.target.value||void 0)},children:[e("option",{value:"",children:t("Current conversation")}),i.archives.map((l)=>e("option",{value:l,children:t("Archived {name}",{name:l})},l))]})]}):null,h?e(g,{message:h}):null,i.truncated?e("p",{className:"hint",children:t("This conversation is longer than the console reads; the oldest entries are not shown.")}):null,i.entries.length===0?e(_,{children:t("Nothing to show.")}):null,e("ol",{className:"transcript",children:i.entries.map((l,b)=>e(S,{entry:l},b))})]})]})}function S({entry:o}){let{timeZone:p}=k(),y=o.at?re(o.at,p):"";if(o.role==="tool")return e("li",{className:"entry entry-tool",children:n("details",{children:[n("summary",{children:[o.failed?t("Tool failed"):t("Tool result"),o.tool?` · ${o.tool}`:""]}),e("pre",{children:o.text||t("(empty)")})]})});return n("li",{className:`entry entry-${o.role}`,children:[n("div",{className:"entry-head",children:[e("span",{className:"role",children:t(x[o.role])}),e("span",{className:"meta",children:y})]}),o.text?e("p",{className:"text",children:o.text}):null,o.calls?.map((u,d)=>n("code",{className:"call",children:[u.name," ",u.preview]},d))]})}var x={user:c("User"),assistant:c("Knight"),tool:c("Tool"),compaction:c("Summary of earlier conversation")};export{U as TranscriptPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rn,cr}from"./chunk-index-4z4chg7v.js";export{Rn as currentQuery,cr as followUrl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h,cn,X,ve,s,N,Qe,M,a,r,t,c,m,e,n,o,v,di,D,Di,ce,p,d,f,w,g,_,P,k,re,Me,He}from"./chunk-index-
|
|
1
|
+
import{h,cn,X,ve,s,N,Qe,M,a,r,t,c,m,e,n,o,v,di,D,Di,ce,p,d,f,w,g,_,P,k,re,Me,He}from"./chunk-index-fg42egv9.js";import{K}from"./chunk-index-p5jcwjx8.js";import{on,qe}from"./chunk-index-983dmeaa.js";import{he}from"./chunk-index-s72hmse6.js";import{L}from"./chunk-index-afrhnrxj.js";function st(i,l,u){let[y,b]=r();s(()=>{if(!i)return;let E=(x)=>x.preventDefault(),O=(x)=>{if(x.button!==0||x.metaKey||x.ctrlKey||x.shiftKey||x.altKey)return;let T=x.target instanceof Element?x.target.closest("a"):null;if(!T||T.target||T.hasAttribute("download"))return;if(l.current?.contains(T))return;x.preventDefault(),x.stopPropagation(),b({kind:"link",anchor:T})},R=di((x)=>b({kind:"navigate",proceed:x}));return window.addEventListener("beforeunload",E),document.addEventListener("click",O,!0),()=>{R(),window.removeEventListener("beforeunload",E),document.removeEventListener("click",O,!0)}},[i,l]);let C=X(()=>b(void 0),[]),S=X(()=>{let E=y;if(u(),b(void 0),E?.kind==="link")setTimeout(()=>E.anchor.click(),0);else if(E?.kind==="navigate")E.proceed()},[y,u]);return{leaving:y,stay:C,leave:S}}var ie=(i)=>`workspace/${encodeURIComponent(i)}`,xe=(i)=>`path=${encodeURIComponent(i)}`,Xe=(i)=>({body:JSON.stringify(i)});function Ve(i){if(!(i instanceof ce)||i.status!==409)return;let l=i.body;return l?.conflict==="changed"||l?.conflict==="gone"||l?.conflict==="exists"?l:void 0}var j={roots:()=>p("workspace"),list:(i,l)=>p(`${ie(i)}/list?${xe(l)}`),file:(i,l)=>p(`${ie(i)}/file?${xe(l)}`),save:(i,l,u,y)=>p(`${ie(i)}/file?${xe(l)}`,{method:"PUT",...Xe({text:u,baseHash:y})}),create:(i,l,u,y)=>p(`${ie(i)}/new?${xe(l)}`,{method:"POST",...Xe({kind:u,...y===void 0?{}:{text:y}})}),rename:(i,l,u)=>p(`${ie(i)}/rename`,{method:"POST",...Xe({from:l,to:u})}),remove:(i,l)=>p(`${ie(i)}/entry?${xe(l)}`,{method:"DELETE"}),trash:(i)=>p(`${ie(i)}/trash`),restore:(i,l)=>p(`${ie(i)}/trash/${encodeURIComponent(l)}/restore`,{method:"POST"}),purge:(i,l)=>p(`${ie(i)}/trash/${encodeURIComponent(l)}`,{method:"DELETE"})},ge=(i,l,u=!1)=>`api/${ie(i)}/raw?${xe(l)}${u?"&download=1":""}`;var Re=(i)=>i.split("/").filter(Boolean),we=(i)=>Re(i).slice(0,-1).join("/"),Ne=(i,l)=>i?`${i}/${l}`:l,Te=(i)=>`${i.root}:${i.path}${i.dir&&i.path?"/":""}`;function dt(i){if(!i)return;let l=i.indexOf(":");if(l<1)return;let u=i.slice(l+1);return{root:i.slice(0,l),path:u.replace(/\/+$/,""),dir:u===""||u.endsWith("/")}}var lt=`/*
|
|
2
2
|
* The files pane: roots, a tree, breadcrumbs, a folder's rows, and a file in the editor. Colors
|
|
3
3
|
* are the page's tokens and the --code-* set (tokens.css, styles/camelot.css), so a look or a
|
|
4
4
|
* light/dark switch recolors it with nothing rebuilt. Only transform and opacity ever move.
|
|
@@ -575,4 +575,4 @@ a.ws-row-link:hover {
|
|
|
575
575
|
transition: none;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
`;var ct={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","folder-plus":"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-2V7ZM12 10v6M9 13h6","file-plus":"M6 3h9l4 4v14H6zM14 3v5h5M12 12v6M9 15h6"},Nt=(i)=>(i in ct);function be(i){let{name:l,size:u=20,className:y}=i;if(!Nt(l))return e(o,{name:l,size:u,...y?{className:y}:{}});return e("svg",{viewBox:"0 0 24 24",width:u,height:u,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...y?{className:y}:{},children:e("path",{d:ct[l]})})}function Ye(i){return n("div",{className:"ws-media-actions",children:[i.open?e("a",{className:"button-link",href:ge(i.root,i.path),target:"_blank",rel:"noopener",children:t("Open")}):null,n("a",{className:"button-link",href:ge(i.root,i.path,!0),download:i.name,children:[e(o,{name:"download",size:18}),t("Download")]})]})}function _e(i){let l=i.name.lastIndexOf("."),u=l>0?i.name.slice(l+1).toUpperCase():"";return n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(o,{name:"file",size:32})}),e("strong",{children:i.name}),e("span",{className:"meta",children:[u,Me(i.bytes)].filter(Boolean).join(" · ")}),e("p",{children:i.message}),e(Ye,{root:i.root,path:i.path,name:i.name})]})}var Ct=(i)=>!i&&navigator.pdfViewerEnabled!==!1;function ut(i){let{media:l,root:u,path:y,name:b,bytes:C,phone:S,onFacts:E}=i,[O,R]=r(!1),[x,T]=r(!1);s(()=>(R(!1),T(!1),E(void 0),()=>E(void 0)),[u,y]);let I=ge(u,y);if(O)return e(_e,{root:u,path:y,name:b,bytes:C,message:t("This browser cannot show this file.")});switch(l){case"image":return e("div",{className:"ws-media ws-image","data-actual":x||void 0,children:e("button",{type:"button",className:"ws-image-toggle","aria-label":x?t("Fit to window"):t("Show at full size"),title:x?t("Fit to window"):t("Show at full size"),onClick:()=>T((F)=>!F),children:e("img",{src:I,alt:b,onLoad:(F)=>{let{naturalWidth:Q,naturalHeight:q}=F.currentTarget;E(Q>0?`${Q} × ${q}`:void 0)},onError:()=>R(!0)})})});case"pdf":return Ct(S)?n("div",{className:"ws-media ws-pdf-frame",children:[e("iframe",{className:"ws-pdf",src:I,title:b}),e(Ye,{root:u,path:y,name:b,open:!0})]}):e("div",{className:"ws-media",children:n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(o,{name:"file",size:32})}),e("strong",{children:b}),n("span",{className:"meta",children:["PDF · ",Me(C)]}),e(Ye,{root:u,path:y,name:b,open:!0})]})});case"audio":return e("div",{className:"ws-media ws-sound",children:e("audio",{controls:!0,preload:"metadata",src:I,onError:()=>R(!0)})});case"video":return e("div",{className:"ws-media ws-film",children:e("video",{controls:!0,playsInline:!0,preload:"metadata",src:I,onLoadedMetadata:(F)=>{let{videoWidth:Q,videoHeight:q}=F.currentTarget;E(Q>0?`${Q} × ${q}`:void 0)},onError:()=>R(!0)})})}}var Et={"read-only-root":c("this place is read-only"),"git-dir":c("inside .git"),trash:c("in the trash"),symlink:c("a link"),binary:c("binary file"),"too-large":c("too large"),"not-utf8":c("not UTF-8")};function Ge(i){if(i.id==="agents")return t("Knights' workspace");if(i.id==="scratch")return t("Scratch");return i.label}var pt=new Set([".git","node_modules"]),Ze=(i)=>`roundtable.workspace.open.${i}`,mt="roundtable.workspace.tree",ft="roundtable.workspace.wrap";function Je(i,l){try{let u=localStorage.getItem(i);return u===null?l:JSON.parse(u)}catch{return l}}function Ae(i,l){try{localStorage.setItem(i,JSON.stringify(l))}catch{}}var Le=cn({rev:0,bump:()=>{return}});on("workspace",lt);var Ce=new Map,St=200;function Rt(i,l){Ce.delete(i),Ce.set(i,l);let u=Ce.keys().next().value;if(Ce.size>St&&u!==void 0)Ce.delete(u)}function gt(i,l,u=!0){let{rev:y}=ve(Le),[b,C]=r(0),[S,E]=r({key:"",root:i,path:l}),O=`${i}:${l}`;if(s(()=>{let x=()=>C((T)=>T+1);return window.addEventListener("focus",x),()=>window.removeEventListener("focus",x)},[]),s(()=>{if(!u)return;let x=!0;return j.list(i,l).then((T)=>{if(Rt(O,T),x)E({key:O,root:i,path:l,data:T})},(T)=>x&&E({key:O,root:i,path:l,error:d(T)})),()=>{x=!1}},[i,l,u,y,b]),S.key===O)return{data:S.data,error:S.error,at:S};let R=Ce.get(O);if(R)return{data:R,at:{root:i,path:l}};if(S.data)return{data:S.data,at:S,pending:!0};return{}}var Ee=(i)=>v("workspace",Te(i));function et(i,l,u){let y=Ne(l,u.name);if(u.kind==="dir")return{root:i,path:y,dir:!0};if(u.kind==="file")return{root:i,path:y,dir:!1};if(u.kind==="symlink"&&u.inside)return{root:i,path:y,dir:u.target==="dir"};return}function Tt(i){let l=Re(i.path),u=a(null);return s(()=>{u.current?.scrollIntoView?.({inline:"end",block:"nearest"})},[i.path]),n("nav",{className:"ws-crumbs","aria-label":t("Path"),children:[e("a",{ref:l.length===0?u:void 0,href:Ee({root:i.root.id,path:"",dir:!0}),"aria-current":l.length===0?"page":void 0,children:Ge(i.root)}),l.map((y,b)=>{let C=l.slice(0,b+1).join("/"),S=b===l.length-1;return e("a",{ref:S?u:void 0,href:Ee({root:i.root.id,path:C,dir:!0}),"aria-current":S?"page":void 0,children:y},C)})]})}function ht(i){let{data:l,error:u,pending:y}=gt(i.root,i.path);if(u)return e("p",{className:"ws-tree-note",children:u});if(!l||y)return e("p",{className:"ws-tree-note",children:"…"});if(l.entries.length===0)return e("p",{className:"ws-tree-note",children:t("This folder is empty")});return n("ul",{className:"ws-tree-list","data-depth":i.depth,children:[l.entries.map((b)=>{let C=et(i.root,i.path,b),S=Ne(i.path,b.name),E=C?.dir===!0,O=E&&i.open.has(S),R=i.current?.root===i.root&&i.current.path===S&&i.current.dir===E;return n("li",{children:[n("div",{className:"ws-tree-row","data-selected":R||void 0,"data-quiet":pt.has(b.name)||void 0,style:{paddingLeft:`${0.25+i.depth*0.875}rem`},children:[E?e("button",{type:"button",className:"ws-twist","aria-expanded":O,"aria-label":t("Show or hide {name}",{name:b.name}),onClick:()=>i.toggle(S),children:e(o,{name:"chevron",size:14})}):e("span",{className:"ws-twist"}),C?n("a",{href:Ee(C),title:b.name,children:[e(be,{name:E?"folder":"file",size:15}),e("span",{className:"ws-tree-label",children:b.name})]}):n("span",{className:"ws-tree-off",title:b.inside===!1?t("Outside the workspace"):"",children:[e(o,{name:"file",size:15}),e("span",{className:"ws-tree-label",children:b.name})]})]}),O?e(ht,{root:i.root,path:S,depth:i.depth+1,open:i.open,toggle:i.toggle,current:i.current}):null]},b.name)}),l.truncated?e("li",{className:"ws-tree-note",children:t("Only the first 2,000 items are listed")}):null]})}function Lt(i){let{data:l,error:u,at:y,pending:b}=gt(i.root.id,i.path),{timeZone:C}=k(),S=a(null),E=y?.root??i.root.id,O=y?.path??i.path;if(Qe(()=>{S.current?.closest(".ws-main")?.scrollTo?.(0,0)},[E,O]),u)return e(g,{message:u});if(!l)return e(w,{});if(l.missing)return e(_,{children:t("No files yet")});if(l.entries.length===0)return e(_,{children:t("This folder is empty")});return n("div",{ref:S,className:"ws-listing","data-pending":b||void 0,"aria-busy":b||void 0,inert:b||void 0,children:[e("ul",{className:"ws-rows",children:l.entries.map((R)=>{let x=et(E,O,R),T=n(m,{children:[e(be,{name:x?.dir?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:R.name}),e("span",{className:"meta",children:R.kind==="symlink"&&R.inside===!1?t("Outside the workspace"):R.kind==="other"?t("Not a regular file"):[x?.dir?void 0:Me(R.size),re(new Date(R.mtimeMs).toISOString(),C)].filter(Boolean).join(" · ")})]})]});return n("li",{className:"ws-row","data-quiet":pt.has(R.name)||void 0,children:[x?e("a",{className:"ws-row-link",href:Ee(x),children:T}):e("span",{className:"ws-row-link","data-off":!0,children:T}),i.root.writable||x?e("button",{type:"button",className:"icon-button","aria-label":t("Actions for {name}",{name:R.name}),onClick:()=>i.onMenu(R),children:e(o,{name:"menu"})}):null]},R.name)})}),l.truncated?e("p",{className:"meta",children:t("Only the first 2,000 items are listed")}):null]})}function Wt(i){let{timeZone:l}=k(),{bump:u}=ve(Le),{root:y,path:b}=i,[C,S]=r(),[E,O]=r(),[R,x]=r("read"),[T,I]=r(!1),[F,Q]=r(!1),[q,Ke]=r(()=>Je(ft,i.phone)),[We,ee]=r(!1),[Se,ke]=r(),[V,A]=r(!1),[Y,le]=r(!1),[ze,Ue]=r(!1),[ue,se]=r(),[U,me]=r(),[ye,De]=r(),fe=a(null),H=a(void 0),z=a(null),ae=a(C);ae.current=C;let Z=a(R);Z.current=R;let G=Re(b).at(-1)??b,$e=C?.text!==void 0,Oe=$e&&(C?.media===void 0||V),tt=X(async()=>{let W=await j.file(y.id,b);return S(W),W},[y.id,b]);s(()=>{let W=!0;return j.file(y.id,b).then((B)=>W&&S(B),(B)=>W&&O(d(B))),()=>{W=!1}},[y.id,b]);let Be=st(T,z,()=>{let W=ae.current;if(W?.text!==void 0)H.current?.replace(W.text,W.eol);I(!1),x("read")});s(()=>{if(!T)return;let W=document.title;return document.title=`• ${W}`,()=>{document.title=W}},[T]);let Pe=X(async(W,B)=>{let de=ae.current,J=H.current;if(!de||!J||F)return;let te=B===void 0?J.snapshot():void 0,Fe=B??J.text();Q(!0);try{let ne=await j.save(y.id,b,Fe,W??de.hash);J.markSaved(te),I(J.dirty()),se(void 0),S({...de,hash:ne.hash,size:ne.size,mtimeMs:ne.mtimeMs,text:Fe}),f(t("Saved")),u()}catch(ne){let oe=Ve(ne);if(oe)me({kind:oe.conflict==="gone"?"gone":"changed",...oe.current?{hash:oe.current.hash}:{},text:Fe});else f(d(ne),"danger")}finally{Q(!1)}},[y.id,b,F,u]),nt=a(Pe);nt.current=Pe;let pe=X(async()=>{try{let W=await tt();if(W.text!==void 0)H.current?.replace(W.text,W.eol);I(!1),se(void 0),me(void 0)}catch(W){f(d(W),"danger")}},[tt]),wt=a(pe);wt.current=pe;let je=X(()=>{if(H.current?.dirty()){at(!0);return}x("read")},[]),[vt,at]=r(!1),rt=a(je);rt.current=je,s(()=>{if(!Oe||!fe.current)return;let W=ae.current;if(!W||W.text===void 0)return;let B=!1,de;return (h("dga6s78p"),import("./chunk-codeeditor-dga6s78p.js")).then(async({createEditor:J})=>{if(B||!fe.current)return;let te=await J({parent:fe.current,text:W.text??"",eol:W.eol,language:W.language,editable:!1,wrap:q,phrases:{Find:t("Find"),Replace:t("Replace"),next:t("next"),previous:t("previous"),all:t("all"),"match case":t("match case"),regexp:t("regexp"),"by word":t("by word"),replace:t("replace"),"replace all":t("replace all"),close:t("close")},onChange:()=>I(te.dirty()),onSave:()=>{if(Z.current==="edit"&&te.dirty())nt.current()},onEscape:()=>{if(Z.current==="edit")rt.current()}});if(B){te.destroy();return}de=te,H.current=te,le(!0)}).catch((J)=>{if(console.warn("the editor failed to load",J),!B)Ue(!0)}),()=>{B=!0,de?.destroy(),H.current=void 0,le(!1)}},[Oe,y.id,b]),s(()=>{if(!Y)return;let W=R==="edit"&&C?.editable===!0;if(H.current?.setEditable(W),W)H.current?.focus()},[R,Y,C?.editable]),s(()=>{if(!Y)return;H.current?.setWrap(q),Ae(ft,q)},[q,Y]);let ot=C!==void 0;if(s(()=>{if(!ot)return;let W=!1,B=async()=>{if(W||document.visibilityState==="hidden")return;let te=ae.current;if(!te)return;W=!0;try{let ne=(await j.list(y.id,we(b))).entries.find((yt)=>yt.name===G);if(!ne){se("gone");return}if(ne.kind==="symlink")return;if(ne.size===te.size&&ne.mtimeMs===te.mtimeMs)return;if(Z.current==="edit"&&H.current?.dirty()){se("changed");return}let oe=await j.file(y.id,b);if(oe.hash!==te.hash){if(S(oe),oe.text!==void 0)H.current?.replace(oe.text,oe.eol)}se(void 0)}catch{}finally{W=!1}},de=setInterval(()=>void B(),5000),J=()=>void B();return window.addEventListener("focus",J),document.addEventListener("visibilitychange",J),()=>{clearInterval(de),window.removeEventListener("focus",J),document.removeEventListener("visibilitychange",J)}},[ot,y.id,b,G]),E)return e("div",{className:"ws-file",children:e(g,{message:E})});if(!C)return e("div",{className:"ws-file",children:e(w,{})});let it=C.reason,bt=!C.editable?e(P,{tone:"warn",children:t("Read only: {reason}",{reason:it?t(Et[it]):""})}):null,Ie=R==="edit",kt=n("div",{className:"ws-actions",children:[C.editable&&!Ie?e("button",{type:"button",onClick:()=>{A(!0),x("edit")},children:t("Edit")}):null,Ie?n(m,{children:[e("button",{type:"button",disabled:F||!T,onClick:()=>void Pe(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:je,children:t("Cancel")})]}):null,e("button",{type:"button",className:"icon-button","aria-label":t("File menu"),onClick:()=>ee(!0),children:e(o,{name:"menu"})})]});return n("div",{className:"ws-file",ref:z,children:[n("header",{className:"ws-file-head",children:[n("div",{className:"ws-file-title",children:[n("strong",{children:[T?"• ":"",G]}),n("span",{className:"meta",children:[Me(C.size),Se?` · ${Se}`:""," ·"," ",re(new Date(C.mtimeMs).toISOString(),l)]})]}),bt,kt]}),ue?n("div",{className:"ws-banner",role:"status",children:[e("span",{className:"ws-banner-text",children:ue==="gone"?t("This file is gone"):t("A knight is changing this file")}),ue==="changed"?n(m,{children:[e("button",{type:"button",className:"secondary",onClick:()=>void pe(),children:t("Reload (discard my edits)")}),e("button",{type:"button",className:"secondary",onClick:()=>se(void 0),children:t("Keep editing")})]}):null]}):null,e("div",{className:"ws-view",children:C.media&&!Oe?e(ut,{media:C.media,root:y.id,path:b,name:G,bytes:C.size,phone:i.phone,onFacts:ke}):Oe?e("div",{ref:fe,className:"ws-editor","data-editing":Ie||void 0,children:!Y?e("pre",{className:"ws-plain","aria-busy":!ze,children:C.text}):null}):e(_e,{root:y.id,path:b,name:G,bytes:C.size,message:C.tooLarge?t("This file is too large to show here."):t("This file is not text, so it cannot be shown here.")})}),i.phone&&Ie?n("div",{className:"ws-editbar",role:"toolbar","aria-label":t("Editing"),children:[e("button",{type:"button",disabled:F||!T,onClick:()=>void Pe(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.undo(),children:t("Undo")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.redo(),children:t("Redo")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.find(),children:t("Find")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.tab(),children:t("Tab")})]}):null,e(L,{open:We,title:G,onClose:()=>ee(!1),children:e("div",{className:"stack",children:n("ul",{className:"more-list",children:[$e?e("li",{children:e("button",{type:"button",className:"menu-item",onClick:()=>{Ke((W)=>!W),ee(!1)},children:e("span",{className:"menu-text",children:e("strong",{children:q?t("Do not wrap lines"):t("Wrap lines")})})})}):null,e("li",{children:n("a",{className:"menu-item menu-link",href:ge(y.id,b,!0),download:G,onClick:()=>ee(!1),children:[e("span",{className:"menu-icon",children:e(o,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{ee(!1),pe()},children:[e("span",{className:"menu-icon",children:e(o,{name:"refresh"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Reload")})})]})})]})})}),e(he,{open:U!==void 0,title:U?.kind==="gone"?t("This file is gone"):t("This file changed while you were editing"),onClose:()=>me(void 0),children:n("div",{className:"stack",children:[e("p",{children:U?.kind==="gone"?t("Someone deleted it. Your text has not been saved."):t("Your text has not been saved. What should happen to it?")}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>{navigator.clipboard?.writeText(U?.text??"").then(()=>f(t("Copied")))},children:t("Copy my text")}),U?.kind==="changed"?e("button",{type:"button",className:"secondary",onClick:()=>void pe(),children:t("Reload (discard my edits)")}):null,e("button",{type:"button",className:"danger",onClick:()=>{if(!U)return;if(U.kind==="gone"){let W=U.text;me(void 0),j.create(y.id,b,"file",W).then(async()=>{await pe(),u()}).catch((B)=>f(d(B),"danger"));return}De({hash:U.hash??"",text:U.text}),me(void 0)},children:U?.kind==="gone"?t("Save mine as a new file"):t("Save mine anyway")})]})]})}),e(K,{open:ye!==void 0,title:t("Replace the knight's changes?"),confirmLabel:t("Save mine anyway"),tone:"danger",onClose:()=>De(void 0),onConfirm:async()=>{if(!ye)return;await j.save(y.id,b,ye.text,ye.hash),await pe(),f(t("Saved")),u()},children:e("p",{children:t("The file has been changed since you opened it. Saving yours writes over those changes.")})}),e(K,{open:vt,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>at(!1),onConfirm:async()=>{if(C.text!==void 0)H.current?.replace(C.text,C.eol);I(!1),x("read")},children:e("p",{children:t("Your edits to {name} have not been saved.",{name:G})})}),e(K,{open:Be.leaving!==void 0,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:Be.stay,onConfirm:async()=>Be.leave(),children:e("p",{children:t("Your edits to {name} have not been saved.",{name:G})})})]})}function zt(i){let{ask:l}=i,[u,y]=r(""),[b,C]=r(),[S,E]=r(!1),O=N();s(()=>{y(l?.kind==="rename"?l.name:""),C(void 0)},[l]);let R=l?.kind==="rename"?t("Rename"):l?.kind==="dir"?t("New folder"):t("New file"),x=async(T)=>{if(T.preventDefault(),!l)return;let I=u.trim();if(!I||I.includes("/")){C(t("Use a name without slashes."));return}E(!0),C(void 0);try{if(l.kind==="rename"){let F=Ne(we(l.path),I);await j.rename(i.root.id,l.path,F),f(t("Renamed")),i.onDone()}else{let F=Ne(l.dir,I);await j.create(i.root.id,F,l.kind),f(t("Created")),i.onDone({root:i.root.id,path:F,dir:l.kind==="dir"})}}catch(F){let Q=Ve(F);C(Q?.conflict==="exists"?t("Something with that name is already there."):d(F))}finally{E(!1)}};return e(he,{open:l!==void 0,title:R,onClose:i.onClose,children:n("form",{className:"stack",onSubmit:x,children:[e("label",{htmlFor:O,children:t("Name")}),e("input",{id:O,value:u,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,onChange:(T)=>y(T.target.value)}),b?e(g,{message:b}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:S||!u.trim(),children:l?.kind==="rename"?t("Rename"):t("Create")})]})]})})}function Mt(i){let{bump:l,rev:u}=ve(Le),[y,b]=r(),[C,S]=r(),[E,O]=r(),{timeZone:R}=k();return s(()=>{if(!i.open)return;let x=!0;return j.trash(i.root.id).then((T)=>x&&b(T.items),(T)=>x&&S(d(T))),()=>{x=!1}},[i.open,i.root.id,u]),n(he,{open:i.open,title:t("Trash"),onClose:i.onClose,children:[n("div",{className:"stack",children:[C?e(g,{message:C}):null,!y&&!C?e(w,{}):null,y?.length===0?e(_,{children:t("The trash is empty")}):null,e("ul",{className:"ws-rows",children:y?.map((x)=>n("li",{className:"ws-row",children:[n("span",{className:"ws-row-link","data-off":!0,children:[e(be,{name:x.kind==="dir"?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:x.path}),e("span",{className:"meta",children:re(x.deletedAt,R)})]})]}),e("button",{type:"button",className:"secondary",onClick:async()=>{try{await j.restore(i.root.id,x.id),f(t("Restored")),l()}catch(T){let I=Ve(T);f(I?I.conflict==="exists"?t("Something with that name is already there."):t("The folder it was in is gone."):d(T),"danger")}},children:t("Restore")}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Delete {name} for good",{name:x.name}),onClick:()=>O(x),children:e(o,{name:"trash"})})]},x.id))})]}),e(K,{open:E!==void 0,title:t("Delete for good?"),confirmLabel:t("Delete for good"),tone:"danger",onClose:()=>O(void 0),onConfirm:async()=>{if(!E)return;await j.purge(i.root.id,E.id),l()},children:e("p",{children:t("“{name}” will be removed and cannot be brought back.",{name:E?.path??""})})})]})}function yn(){let i=Di(),l=!He("(min-width: 720px)"),[u,y]=r(0),b=X(()=>y((z)=>z+1),[]),C=M(()=>({rev:u,bump:b}),[u,b]),[S,E]=r(),[O,R]=r();s(()=>{j.roots().then((z)=>E(z.roots),(z)=>R(d(z)))},[]);let[x,T]=r(()=>Je(mt,280)),[I,F]=r(),[Q,q]=r(),[Ke,We]=r(!1),[ee,Se]=r(),ke=dt(i.key),V=S?.find((z)=>z.id===ke?.root)??(l?void 0:S?.[0]),A=V?ke&&ke.root===V.id?ke:{root:V.id,path:"",dir:!0}:void 0,Y=V?.id,le=A?.path,ze=A?.dir,[Ue,ue]=r(new Set);s(()=>{if(!Y)return;ue(new Set(Je(Ze(Y),[])))},[Y]);let se=X((z)=>{if(!Y)return;ue((ae)=>{let Z=new Set(ae);if(Z.has(z))Z.delete(z);else Z.add(z);return Ae(Ze(Y),[...Z]),Z})},[Y]);if(s(()=>{if(!Y||le===void 0||l)return;let z=Re(ze?le:we(le)),ae=z.map((Z,G)=>z.slice(0,G+1).join("/"));ue((Z)=>{if(ae.every(($e)=>Z.has($e)))return Z;let G=new Set([...Z,...ae]);return Ae(Ze(Y),[...G]),G})},[Y,le,ze,l]),O)return e(g,{message:O});if(!S)return e(w,{});if(S.length===0)return e(_,{children:t("No files yet")});if(!V||!A)return e(Le.Provider,{value:C,children:n("div",{className:"page ws-page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Files")})}),e("ul",{className:"more-list",children:S.map((z)=>e("li",{children:n("a",{className:"menu-item menu-link",href:Ee({root:z.id,path:"",dir:!0}),children:[e("span",{className:"menu-icon",children:e(be,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:Ge(z)}),z.writable?null:e("span",{className:"meta",children:t("Read only")})]}),e(o,{name:"chevron",size:16})]})},z.id))})]})});let U=A.dir?A.path:we(A.path),me=A.path===""?{root:V.id,path:"",dir:!0}:{root:V.id,path:we(A.path),dir:!0},ye=n("header",{className:"ws-head",children:[l?e("a",{className:"icon-button","aria-label":t("Back"),href:A.path===""?v("workspace"):Ee(me),children:e(o,{name:"back"})}):e(qe,{chip:!0,className:"ws-root-picker","aria-label":t("Place"),value:V.id,onChange:(z)=>D("workspace",Te({root:z.target.value,path:"",dir:!0})),children:S.map((z)=>e("option",{value:z.id,children:Ge(z)},z.id))}),e(Tt,{root:V,path:A.path}),V.writable?n("div",{className:"ws-head-actions",children:[e("button",{type:"button",className:"icon-button","aria-label":t("New file"),title:t("New file"),onClick:()=>q({kind:"file",dir:U}),children:e(be,{name:"file-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("New folder"),title:t("New folder"),onClick:()=>q({kind:"dir",dir:U}),children:e(be,{name:"folder-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("Trash"),title:t("Trash"),onClick:()=>We(!0),children:e(o,{name:"trash"})})]}):null]}),De=A.dir?e("div",{className:"ws-dir",children:e(Lt,{root:V,path:A.path,onMenu:(z)=>F(z)})}):e(Wt,{root:V,path:A.path,phone:l},`${V.id}:${A.path}`),fe=I?et(V.id,U,I):void 0,H=I?Ne(U,I.name):"";return n(Le.Provider,{value:C,children:[n("div",{className:"ws-page ws","data-wide":!l||void 0,style:{"--ws-tree":`${x}px`},children:[ye,n("div",{className:"ws-body",children:[!l?n(m,{children:[e("aside",{className:"ws-tree","aria-label":t("Folders"),children:e(ht,{root:V.id,path:"",depth:0,open:Ue,toggle:se,current:A})}),e(Dt,{width:x,onChange:(z)=>{T(z),Ae(mt,z)}})]}):null,e("section",{className:"ws-main",children:De})]})]}),e(L,{open:I!==void 0,title:I?.name??"",onClose:()=>F(void 0),children:n("ul",{className:"more-list",children:[fe&&!fe.dir?e("li",{children:n("a",{className:"menu-item menu-link",href:ge(V.id,H,!0),download:I?.name,onClick:()=>F(void 0),children:[e("span",{className:"menu-icon",children:e(o,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}):null,V.writable&&I?n(m,{children:[e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{q({kind:"rename",path:H,name:I.name}),F(void 0)},children:[e("span",{className:"menu-icon",children:e(o,{name:"notes"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Rename")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{Se({path:H,name:I.name}),F(void 0)},children:[e("span",{className:"menu-icon",children:e(o,{name:"trash"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Delete")})})]})})]}):null]})}),e(zt,{root:V,ask:Q,onClose:()=>q(void 0),onDone:(z)=>{if(q(void 0),b(),z)D("workspace",Te(z))}}),e(Mt,{root:V,open:Ke,onClose:()=>We(!1)}),e(K,{open:ee!==void 0,title:t("Move to the trash?"),confirmLabel:t("Delete"),tone:"danger",onClose:()=>Se(void 0),onConfirm:async()=>{if(!ee)return;if(await j.remove(V.id,ee.path),f(t("Moved to the trash")),b(),!A.dir&&(A.path===ee.path||A.path.startsWith(`${ee.path}/`)))D("workspace",Te({root:V.id,path:we(A.path),dir:!0}))},children:e("p",{children:t("“{name}” goes to the trash, where you can bring it back.",{name:ee?.name??""})})})]})}function Dt(i){let y=(b)=>Math.min(560,Math.max(180,b));return e("div",{className:"ws-resizer",role:"separator","aria-orientation":"vertical","aria-valuenow":i.width,"aria-valuemin":180,"aria-valuemax":560,"aria-label":t("Resize the folder list"),tabIndex:0,onKeyDown:(b)=>{if(b.key==="ArrowLeft")i.onChange(y(i.width-16));if(b.key==="ArrowRight")i.onChange(y(i.width+16))},onPointerDown:(b)=>{let C=b.clientX,S=i.width,E=b.currentTarget;E.setPointerCapture(b.pointerId);let O=(x)=>i.onChange(y(S+x.clientX-C)),R=()=>{E.removeEventListener("pointermove",O),E.removeEventListener("pointerup",R)};E.addEventListener("pointermove",O),E.addEventListener("pointerup",R)}})}export{yn as WorkspacePage};
|
|
578
|
+
`;var ct={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","folder-plus":"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-2V7ZM12 10v6M9 13h6","file-plus":"M6 3h9l4 4v14H6zM14 3v5h5M12 12v6M9 15h6"},Nt=(i)=>(i in ct);function be(i){let{name:l,size:u=20,className:y}=i;if(!Nt(l))return e(o,{name:l,size:u,...y?{className:y}:{}});return e("svg",{viewBox:"0 0 24 24",width:u,height:u,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...y?{className:y}:{},children:e("path",{d:ct[l]})})}function Ye(i){return n("div",{className:"ws-media-actions",children:[i.open?e("a",{className:"button-link",href:ge(i.root,i.path),target:"_blank",rel:"noopener",children:t("Open")}):null,n("a",{className:"button-link",href:ge(i.root,i.path,!0),download:i.name,children:[e(o,{name:"download",size:18}),t("Download")]})]})}function _e(i){let l=i.name.lastIndexOf("."),u=l>0?i.name.slice(l+1).toUpperCase():"";return n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(o,{name:"file",size:32})}),e("strong",{children:i.name}),e("span",{className:"meta",children:[u,Me(i.bytes)].filter(Boolean).join(" · ")}),e("p",{children:i.message}),e(Ye,{root:i.root,path:i.path,name:i.name})]})}var Ct=(i)=>!i&&navigator.pdfViewerEnabled!==!1;function ut(i){let{media:l,root:u,path:y,name:b,bytes:C,phone:S,onFacts:E}=i,[O,R]=r(!1),[x,T]=r(!1);s(()=>(R(!1),T(!1),E(void 0),()=>E(void 0)),[u,y]);let I=ge(u,y);if(O)return e(_e,{root:u,path:y,name:b,bytes:C,message:t("This browser cannot show this file.")});switch(l){case"image":return e("div",{className:"ws-media ws-image","data-actual":x||void 0,children:e("button",{type:"button",className:"ws-image-toggle","aria-label":x?t("Fit to window"):t("Show at full size"),title:x?t("Fit to window"):t("Show at full size"),onClick:()=>T((F)=>!F),children:e("img",{src:I,alt:b,onLoad:(F)=>{let{naturalWidth:Q,naturalHeight:q}=F.currentTarget;E(Q>0?`${Q} × ${q}`:void 0)},onError:()=>R(!0)})})});case"pdf":return Ct(S)?n("div",{className:"ws-media ws-pdf-frame",children:[e("iframe",{className:"ws-pdf",src:I,title:b}),e(Ye,{root:u,path:y,name:b,open:!0})]}):e("div",{className:"ws-media",children:n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(o,{name:"file",size:32})}),e("strong",{children:b}),n("span",{className:"meta",children:["PDF · ",Me(C)]}),e(Ye,{root:u,path:y,name:b,open:!0})]})});case"audio":return e("div",{className:"ws-media ws-sound",children:e("audio",{controls:!0,preload:"metadata",src:I,onError:()=>R(!0)})});case"video":return e("div",{className:"ws-media ws-film",children:e("video",{controls:!0,playsInline:!0,preload:"metadata",src:I,onLoadedMetadata:(F)=>{let{videoWidth:Q,videoHeight:q}=F.currentTarget;E(Q>0?`${Q} × ${q}`:void 0)},onError:()=>R(!0)})})}}var Et={"read-only-root":c("this place is read-only"),"git-dir":c("inside .git"),trash:c("in the trash"),symlink:c("a link"),binary:c("binary file"),"too-large":c("too large"),"not-utf8":c("not UTF-8")};function Ge(i){if(i.id==="agents")return t("Knights' workspace");if(i.id==="scratch")return t("Scratch");return i.label}var pt=new Set([".git","node_modules"]),Ze=(i)=>`roundtable.workspace.open.${i}`,mt="roundtable.workspace.tree",ft="roundtable.workspace.wrap";function Je(i,l){try{let u=localStorage.getItem(i);return u===null?l:JSON.parse(u)}catch{return l}}function Ae(i,l){try{localStorage.setItem(i,JSON.stringify(l))}catch{}}var Le=cn({rev:0,bump:()=>{return}});on("workspace",lt);var Ce=new Map,St=200;function Rt(i,l){Ce.delete(i),Ce.set(i,l);let u=Ce.keys().next().value;if(Ce.size>St&&u!==void 0)Ce.delete(u)}function gt(i,l,u=!0){let{rev:y}=ve(Le),[b,C]=r(0),[S,E]=r({key:"",root:i,path:l}),O=`${i}:${l}`;if(s(()=>{let x=()=>C((T)=>T+1);return window.addEventListener("focus",x),()=>window.removeEventListener("focus",x)},[]),s(()=>{if(!u)return;let x=!0;return j.list(i,l).then((T)=>{if(Rt(O,T),x)E({key:O,root:i,path:l,data:T})},(T)=>x&&E({key:O,root:i,path:l,error:d(T)})),()=>{x=!1}},[i,l,u,y,b]),S.key===O)return{data:S.data,error:S.error,at:S};let R=Ce.get(O);if(R)return{data:R,at:{root:i,path:l}};if(S.data)return{data:S.data,at:S,pending:!0};return{}}var Ee=(i)=>v("workspace",Te(i));function et(i,l,u){let y=Ne(l,u.name);if(u.kind==="dir")return{root:i,path:y,dir:!0};if(u.kind==="file")return{root:i,path:y,dir:!1};if(u.kind==="symlink"&&u.inside)return{root:i,path:y,dir:u.target==="dir"};return}function Tt(i){let l=Re(i.path),u=a(null);return s(()=>{u.current?.scrollIntoView?.({inline:"end",block:"nearest"})},[i.path]),n("nav",{className:"ws-crumbs","aria-label":t("Path"),children:[e("a",{ref:l.length===0?u:void 0,href:Ee({root:i.root.id,path:"",dir:!0}),"aria-current":l.length===0?"page":void 0,children:Ge(i.root)}),l.map((y,b)=>{let C=l.slice(0,b+1).join("/"),S=b===l.length-1;return e("a",{ref:S?u:void 0,href:Ee({root:i.root.id,path:C,dir:!0}),"aria-current":S?"page":void 0,children:y},C)})]})}function ht(i){let{data:l,error:u,pending:y}=gt(i.root,i.path);if(u)return e("p",{className:"ws-tree-note",children:u});if(!l||y)return e("p",{className:"ws-tree-note",children:"…"});if(l.entries.length===0)return e("p",{className:"ws-tree-note",children:t("This folder is empty")});return n("ul",{className:"ws-tree-list","data-depth":i.depth,children:[l.entries.map((b)=>{let C=et(i.root,i.path,b),S=Ne(i.path,b.name),E=C?.dir===!0,O=E&&i.open.has(S),R=i.current?.root===i.root&&i.current.path===S&&i.current.dir===E;return n("li",{children:[n("div",{className:"ws-tree-row","data-selected":R||void 0,"data-quiet":pt.has(b.name)||void 0,style:{paddingLeft:`${0.25+i.depth*0.875}rem`},children:[E?e("button",{type:"button",className:"ws-twist","aria-expanded":O,"aria-label":t("Show or hide {name}",{name:b.name}),onClick:()=>i.toggle(S),children:e(o,{name:"chevron",size:14})}):e("span",{className:"ws-twist"}),C?n("a",{href:Ee(C),title:b.name,children:[e(be,{name:E?"folder":"file",size:15}),e("span",{className:"ws-tree-label",children:b.name})]}):n("span",{className:"ws-tree-off",title:b.inside===!1?t("Outside the workspace"):"",children:[e(o,{name:"file",size:15}),e("span",{className:"ws-tree-label",children:b.name})]})]}),O?e(ht,{root:i.root,path:S,depth:i.depth+1,open:i.open,toggle:i.toggle,current:i.current}):null]},b.name)}),l.truncated?e("li",{className:"ws-tree-note",children:t("Only the first 2,000 items are listed")}):null]})}function Lt(i){let{data:l,error:u,at:y,pending:b}=gt(i.root.id,i.path),{timeZone:C}=k(),S=a(null),E=y?.root??i.root.id,O=y?.path??i.path;if(Qe(()=>{S.current?.closest(".ws-main")?.scrollTo?.(0,0)},[E,O]),u)return e(g,{message:u});if(!l)return e(w,{});if(l.missing)return e(_,{children:t("No files yet")});if(l.entries.length===0)return e(_,{children:t("This folder is empty")});return n("div",{ref:S,className:"ws-listing","data-pending":b||void 0,"aria-busy":b||void 0,inert:b||void 0,children:[e("ul",{className:"ws-rows",children:l.entries.map((R)=>{let x=et(E,O,R),T=n(m,{children:[e(be,{name:x?.dir?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:R.name}),e("span",{className:"meta",children:R.kind==="symlink"&&R.inside===!1?t("Outside the workspace"):R.kind==="other"?t("Not a regular file"):[x?.dir?void 0:Me(R.size),re(new Date(R.mtimeMs).toISOString(),C)].filter(Boolean).join(" · ")})]})]});return n("li",{className:"ws-row","data-quiet":pt.has(R.name)||void 0,children:[x?e("a",{className:"ws-row-link",href:Ee(x),children:T}):e("span",{className:"ws-row-link","data-off":!0,children:T}),i.root.writable||x?e("button",{type:"button",className:"icon-button","aria-label":t("Actions for {name}",{name:R.name}),onClick:()=>i.onMenu(R),children:e(o,{name:"menu"})}):null]},R.name)})}),l.truncated?e("p",{className:"meta",children:t("Only the first 2,000 items are listed")}):null]})}function Wt(i){let{timeZone:l}=k(),{bump:u}=ve(Le),{root:y,path:b}=i,[C,S]=r(),[E,O]=r(),[R,x]=r("read"),[T,I]=r(!1),[F,Q]=r(!1),[q,Ke]=r(()=>Je(ft,i.phone)),[We,ee]=r(!1),[Se,ke]=r(),[V,A]=r(!1),[Y,le]=r(!1),[ze,Ue]=r(!1),[ue,se]=r(),[U,me]=r(),[ye,De]=r(),fe=a(null),H=a(void 0),z=a(null),ae=a(C);ae.current=C;let Z=a(R);Z.current=R;let G=Re(b).at(-1)??b,$e=C?.text!==void 0,Oe=$e&&(C?.media===void 0||V),tt=X(async()=>{let W=await j.file(y.id,b);return S(W),W},[y.id,b]);s(()=>{let W=!0;return j.file(y.id,b).then((B)=>W&&S(B),(B)=>W&&O(d(B))),()=>{W=!1}},[y.id,b]);let Be=st(T,z,()=>{let W=ae.current;if(W?.text!==void 0)H.current?.replace(W.text,W.eol);I(!1),x("read")});s(()=>{if(!T)return;let W=document.title;return document.title=`• ${W}`,()=>{document.title=W}},[T]);let Pe=X(async(W,B)=>{let de=ae.current,J=H.current;if(!de||!J||F)return;let te=B===void 0?J.snapshot():void 0,Fe=B??J.text();Q(!0);try{let ne=await j.save(y.id,b,Fe,W??de.hash);J.markSaved(te),I(J.dirty()),se(void 0),S({...de,hash:ne.hash,size:ne.size,mtimeMs:ne.mtimeMs,text:Fe}),f(t("Saved")),u()}catch(ne){let oe=Ve(ne);if(oe)me({kind:oe.conflict==="gone"?"gone":"changed",...oe.current?{hash:oe.current.hash}:{},text:Fe});else f(d(ne),"danger")}finally{Q(!1)}},[y.id,b,F,u]),nt=a(Pe);nt.current=Pe;let pe=X(async()=>{try{let W=await tt();if(W.text!==void 0)H.current?.replace(W.text,W.eol);I(!1),se(void 0),me(void 0)}catch(W){f(d(W),"danger")}},[tt]),wt=a(pe);wt.current=pe;let je=X(()=>{if(H.current?.dirty()){at(!0);return}x("read")},[]),[vt,at]=r(!1),rt=a(je);rt.current=je,s(()=>{if(!Oe||!fe.current)return;let W=ae.current;if(!W||W.text===void 0)return;let B=!1,de;return (h("5j6abj8k"),import("./chunk-codeeditor-5j6abj8k.js")).then(async({createEditor:J})=>{if(B||!fe.current)return;let te=await J({parent:fe.current,text:W.text??"",eol:W.eol,language:W.language,editable:!1,wrap:q,phrases:{Find:t("Find"),Replace:t("Replace"),next:t("next"),previous:t("previous"),all:t("all"),"match case":t("match case"),regexp:t("regexp"),"by word":t("by word"),replace:t("replace"),"replace all":t("replace all"),close:t("close")},onChange:()=>I(te.dirty()),onSave:()=>{if(Z.current==="edit"&&te.dirty())nt.current()},onEscape:()=>{if(Z.current==="edit")rt.current()}});if(B){te.destroy();return}de=te,H.current=te,le(!0)}).catch((J)=>{if(console.warn("the editor failed to load",J),!B)Ue(!0)}),()=>{B=!0,de?.destroy(),H.current=void 0,le(!1)}},[Oe,y.id,b]),s(()=>{if(!Y)return;let W=R==="edit"&&C?.editable===!0;if(H.current?.setEditable(W),W)H.current?.focus()},[R,Y,C?.editable]),s(()=>{if(!Y)return;H.current?.setWrap(q),Ae(ft,q)},[q,Y]);let ot=C!==void 0;if(s(()=>{if(!ot)return;let W=!1,B=async()=>{if(W||document.visibilityState==="hidden")return;let te=ae.current;if(!te)return;W=!0;try{let ne=(await j.list(y.id,we(b))).entries.find((yt)=>yt.name===G);if(!ne){se("gone");return}if(ne.kind==="symlink")return;if(ne.size===te.size&&ne.mtimeMs===te.mtimeMs)return;if(Z.current==="edit"&&H.current?.dirty()){se("changed");return}let oe=await j.file(y.id,b);if(oe.hash!==te.hash){if(S(oe),oe.text!==void 0)H.current?.replace(oe.text,oe.eol)}se(void 0)}catch{}finally{W=!1}},de=setInterval(()=>void B(),5000),J=()=>void B();return window.addEventListener("focus",J),document.addEventListener("visibilitychange",J),()=>{clearInterval(de),window.removeEventListener("focus",J),document.removeEventListener("visibilitychange",J)}},[ot,y.id,b,G]),E)return e("div",{className:"ws-file",children:e(g,{message:E})});if(!C)return e("div",{className:"ws-file",children:e(w,{})});let it=C.reason,bt=!C.editable?e(P,{tone:"warn",children:t("Read only: {reason}",{reason:it?t(Et[it]):""})}):null,Ie=R==="edit",kt=n("div",{className:"ws-actions",children:[C.editable&&!Ie?e("button",{type:"button",onClick:()=>{A(!0),x("edit")},children:t("Edit")}):null,Ie?n(m,{children:[e("button",{type:"button",disabled:F||!T,onClick:()=>void Pe(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:je,children:t("Cancel")})]}):null,e("button",{type:"button",className:"icon-button","aria-label":t("File menu"),onClick:()=>ee(!0),children:e(o,{name:"menu"})})]});return n("div",{className:"ws-file",ref:z,children:[n("header",{className:"ws-file-head",children:[n("div",{className:"ws-file-title",children:[n("strong",{children:[T?"• ":"",G]}),n("span",{className:"meta",children:[Me(C.size),Se?` · ${Se}`:""," ·"," ",re(new Date(C.mtimeMs).toISOString(),l)]})]}),bt,kt]}),ue?n("div",{className:"ws-banner",role:"status",children:[e("span",{className:"ws-banner-text",children:ue==="gone"?t("This file is gone"):t("A knight is changing this file")}),ue==="changed"?n(m,{children:[e("button",{type:"button",className:"secondary",onClick:()=>void pe(),children:t("Reload (discard my edits)")}),e("button",{type:"button",className:"secondary",onClick:()=>se(void 0),children:t("Keep editing")})]}):null]}):null,e("div",{className:"ws-view",children:C.media&&!Oe?e(ut,{media:C.media,root:y.id,path:b,name:G,bytes:C.size,phone:i.phone,onFacts:ke}):Oe?e("div",{ref:fe,className:"ws-editor","data-editing":Ie||void 0,children:!Y?e("pre",{className:"ws-plain","aria-busy":!ze,children:C.text}):null}):e(_e,{root:y.id,path:b,name:G,bytes:C.size,message:C.tooLarge?t("This file is too large to show here."):t("This file is not text, so it cannot be shown here.")})}),i.phone&&Ie?n("div",{className:"ws-editbar",role:"toolbar","aria-label":t("Editing"),children:[e("button",{type:"button",disabled:F||!T,onClick:()=>void Pe(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.undo(),children:t("Undo")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.redo(),children:t("Redo")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.find(),children:t("Find")}),e("button",{type:"button",className:"secondary",onClick:()=>H.current?.tab(),children:t("Tab")})]}):null,e(L,{open:We,title:G,onClose:()=>ee(!1),children:e("div",{className:"stack",children:n("ul",{className:"more-list",children:[$e?e("li",{children:e("button",{type:"button",className:"menu-item",onClick:()=>{Ke((W)=>!W),ee(!1)},children:e("span",{className:"menu-text",children:e("strong",{children:q?t("Do not wrap lines"):t("Wrap lines")})})})}):null,e("li",{children:n("a",{className:"menu-item menu-link",href:ge(y.id,b,!0),download:G,onClick:()=>ee(!1),children:[e("span",{className:"menu-icon",children:e(o,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{ee(!1),pe()},children:[e("span",{className:"menu-icon",children:e(o,{name:"refresh"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Reload")})})]})})]})})}),e(he,{open:U!==void 0,title:U?.kind==="gone"?t("This file is gone"):t("This file changed while you were editing"),onClose:()=>me(void 0),children:n("div",{className:"stack",children:[e("p",{children:U?.kind==="gone"?t("Someone deleted it. Your text has not been saved."):t("Your text has not been saved. What should happen to it?")}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>{navigator.clipboard?.writeText(U?.text??"").then(()=>f(t("Copied")))},children:t("Copy my text")}),U?.kind==="changed"?e("button",{type:"button",className:"secondary",onClick:()=>void pe(),children:t("Reload (discard my edits)")}):null,e("button",{type:"button",className:"danger",onClick:()=>{if(!U)return;if(U.kind==="gone"){let W=U.text;me(void 0),j.create(y.id,b,"file",W).then(async()=>{await pe(),u()}).catch((B)=>f(d(B),"danger"));return}De({hash:U.hash??"",text:U.text}),me(void 0)},children:U?.kind==="gone"?t("Save mine as a new file"):t("Save mine anyway")})]})]})}),e(K,{open:ye!==void 0,title:t("Replace the knight's changes?"),confirmLabel:t("Save mine anyway"),tone:"danger",onClose:()=>De(void 0),onConfirm:async()=>{if(!ye)return;await j.save(y.id,b,ye.text,ye.hash),await pe(),f(t("Saved")),u()},children:e("p",{children:t("The file has been changed since you opened it. Saving yours writes over those changes.")})}),e(K,{open:vt,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>at(!1),onConfirm:async()=>{if(C.text!==void 0)H.current?.replace(C.text,C.eol);I(!1),x("read")},children:e("p",{children:t("Your edits to {name} have not been saved.",{name:G})})}),e(K,{open:Be.leaving!==void 0,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:Be.stay,onConfirm:async()=>Be.leave(),children:e("p",{children:t("Your edits to {name} have not been saved.",{name:G})})})]})}function zt(i){let{ask:l}=i,[u,y]=r(""),[b,C]=r(),[S,E]=r(!1),O=N();s(()=>{y(l?.kind==="rename"?l.name:""),C(void 0)},[l]);let R=l?.kind==="rename"?t("Rename"):l?.kind==="dir"?t("New folder"):t("New file"),x=async(T)=>{if(T.preventDefault(),!l)return;let I=u.trim();if(!I||I.includes("/")){C(t("Use a name without slashes."));return}E(!0),C(void 0);try{if(l.kind==="rename"){let F=Ne(we(l.path),I);await j.rename(i.root.id,l.path,F),f(t("Renamed")),i.onDone()}else{let F=Ne(l.dir,I);await j.create(i.root.id,F,l.kind),f(t("Created")),i.onDone({root:i.root.id,path:F,dir:l.kind==="dir"})}}catch(F){let Q=Ve(F);C(Q?.conflict==="exists"?t("Something with that name is already there."):d(F))}finally{E(!1)}};return e(he,{open:l!==void 0,title:R,onClose:i.onClose,children:n("form",{className:"stack",onSubmit:x,children:[e("label",{htmlFor:O,children:t("Name")}),e("input",{id:O,value:u,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,onChange:(T)=>y(T.target.value)}),b?e(g,{message:b}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:S||!u.trim(),children:l?.kind==="rename"?t("Rename"):t("Create")})]})]})})}function Mt(i){let{bump:l,rev:u}=ve(Le),[y,b]=r(),[C,S]=r(),[E,O]=r(),{timeZone:R}=k();return s(()=>{if(!i.open)return;let x=!0;return j.trash(i.root.id).then((T)=>x&&b(T.items),(T)=>x&&S(d(T))),()=>{x=!1}},[i.open,i.root.id,u]),n(he,{open:i.open,title:t("Trash"),onClose:i.onClose,children:[n("div",{className:"stack",children:[C?e(g,{message:C}):null,!y&&!C?e(w,{}):null,y?.length===0?e(_,{children:t("The trash is empty")}):null,e("ul",{className:"ws-rows",children:y?.map((x)=>n("li",{className:"ws-row",children:[n("span",{className:"ws-row-link","data-off":!0,children:[e(be,{name:x.kind==="dir"?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:x.path}),e("span",{className:"meta",children:re(x.deletedAt,R)})]})]}),e("button",{type:"button",className:"secondary",onClick:async()=>{try{await j.restore(i.root.id,x.id),f(t("Restored")),l()}catch(T){let I=Ve(T);f(I?I.conflict==="exists"?t("Something with that name is already there."):t("The folder it was in is gone."):d(T),"danger")}},children:t("Restore")}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Delete {name} for good",{name:x.name}),onClick:()=>O(x),children:e(o,{name:"trash"})})]},x.id))})]}),e(K,{open:E!==void 0,title:t("Delete for good?"),confirmLabel:t("Delete for good"),tone:"danger",onClose:()=>O(void 0),onConfirm:async()=>{if(!E)return;await j.purge(i.root.id,E.id),l()},children:e("p",{children:t("“{name}” will be removed and cannot be brought back.",{name:E?.path??""})})})]})}function yn(){let i=Di(),l=!He("(min-width: 720px)"),[u,y]=r(0),b=X(()=>y((z)=>z+1),[]),C=M(()=>({rev:u,bump:b}),[u,b]),[S,E]=r(),[O,R]=r();s(()=>{j.roots().then((z)=>E(z.roots),(z)=>R(d(z)))},[]);let[x,T]=r(()=>Je(mt,280)),[I,F]=r(),[Q,q]=r(),[Ke,We]=r(!1),[ee,Se]=r(),ke=dt(i.key),V=S?.find((z)=>z.id===ke?.root)??(l?void 0:S?.[0]),A=V?ke&&ke.root===V.id?ke:{root:V.id,path:"",dir:!0}:void 0,Y=V?.id,le=A?.path,ze=A?.dir,[Ue,ue]=r(new Set);s(()=>{if(!Y)return;ue(new Set(Je(Ze(Y),[])))},[Y]);let se=X((z)=>{if(!Y)return;ue((ae)=>{let Z=new Set(ae);if(Z.has(z))Z.delete(z);else Z.add(z);return Ae(Ze(Y),[...Z]),Z})},[Y]);if(s(()=>{if(!Y||le===void 0||l)return;let z=Re(ze?le:we(le)),ae=z.map((Z,G)=>z.slice(0,G+1).join("/"));ue((Z)=>{if(ae.every(($e)=>Z.has($e)))return Z;let G=new Set([...Z,...ae]);return Ae(Ze(Y),[...G]),G})},[Y,le,ze,l]),O)return e(g,{message:O});if(!S)return e(w,{});if(S.length===0)return e(_,{children:t("No files yet")});if(!V||!A)return e(Le.Provider,{value:C,children:n("div",{className:"page ws-page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Files")})}),e("ul",{className:"more-list",children:S.map((z)=>e("li",{children:n("a",{className:"menu-item menu-link",href:Ee({root:z.id,path:"",dir:!0}),children:[e("span",{className:"menu-icon",children:e(be,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:Ge(z)}),z.writable?null:e("span",{className:"meta",children:t("Read only")})]}),e(o,{name:"chevron",size:16})]})},z.id))})]})});let U=A.dir?A.path:we(A.path),me=A.path===""?{root:V.id,path:"",dir:!0}:{root:V.id,path:we(A.path),dir:!0},ye=n("header",{className:"ws-head",children:[l?e("a",{className:"icon-button","aria-label":t("Back"),href:A.path===""?v("workspace"):Ee(me),children:e(o,{name:"back"})}):e(qe,{chip:!0,className:"ws-root-picker","aria-label":t("Place"),value:V.id,onChange:(z)=>D("workspace",Te({root:z.target.value,path:"",dir:!0})),children:S.map((z)=>e("option",{value:z.id,children:Ge(z)},z.id))}),e(Tt,{root:V,path:A.path}),V.writable?n("div",{className:"ws-head-actions",children:[e("button",{type:"button",className:"icon-button","aria-label":t("New file"),title:t("New file"),onClick:()=>q({kind:"file",dir:U}),children:e(be,{name:"file-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("New folder"),title:t("New folder"),onClick:()=>q({kind:"dir",dir:U}),children:e(be,{name:"folder-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("Trash"),title:t("Trash"),onClick:()=>We(!0),children:e(o,{name:"trash"})})]}):null]}),De=A.dir?e("div",{className:"ws-dir",children:e(Lt,{root:V,path:A.path,onMenu:(z)=>F(z)})}):e(Wt,{root:V,path:A.path,phone:l},`${V.id}:${A.path}`),fe=I?et(V.id,U,I):void 0,H=I?Ne(U,I.name):"";return n(Le.Provider,{value:C,children:[n("div",{className:"ws-page ws","data-wide":!l||void 0,style:{"--ws-tree":`${x}px`},children:[ye,n("div",{className:"ws-body",children:[!l?n(m,{children:[e("aside",{className:"ws-tree","aria-label":t("Folders"),children:e(ht,{root:V.id,path:"",depth:0,open:Ue,toggle:se,current:A})}),e(Dt,{width:x,onChange:(z)=>{T(z),Ae(mt,z)}})]}):null,e("section",{className:"ws-main",children:De})]})]}),e(L,{open:I!==void 0,title:I?.name??"",onClose:()=>F(void 0),children:n("ul",{className:"more-list",children:[fe&&!fe.dir?e("li",{children:n("a",{className:"menu-item menu-link",href:ge(V.id,H,!0),download:I?.name,onClick:()=>F(void 0),children:[e("span",{className:"menu-icon",children:e(o,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}):null,V.writable&&I?n(m,{children:[e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{q({kind:"rename",path:H,name:I.name}),F(void 0)},children:[e("span",{className:"menu-icon",children:e(o,{name:"notes"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Rename")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{Se({path:H,name:I.name}),F(void 0)},children:[e("span",{className:"menu-icon",children:e(o,{name:"trash"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Delete")})})]})})]}):null]})}),e(zt,{root:V,ask:Q,onClose:()=>q(void 0),onDone:(z)=>{if(q(void 0),b(),z)D("workspace",Te(z))}}),e(Mt,{root:V,open:Ke,onClose:()=>We(!1)}),e(K,{open:ee!==void 0,title:t("Move to the trash?"),confirmLabel:t("Delete"),tone:"danger",onClose:()=>Se(void 0),onConfirm:async()=>{if(!ee)return;if(await j.remove(V.id,ee.path),f(t("Moved to the trash")),b(),!A.dir&&(A.path===ee.path||A.path.startsWith(`${ee.path}/`)))D("workspace",Te({root:V.id,path:we(A.path),dir:!0}))},children:e("p",{children:t("“{name}” goes to the trash, where you can bring it back.",{name:ee?.name??""})})})]})}function Dt(i){let y=(b)=>Math.min(560,Math.max(180,b));return e("div",{className:"ws-resizer",role:"separator","aria-orientation":"vertical","aria-valuenow":i.width,"aria-valuemin":180,"aria-valuemax":560,"aria-label":t("Resize the folder list"),tabIndex:0,onKeyDown:(b)=>{if(b.key==="ArrowLeft")i.onChange(y(i.width-16));if(b.key==="ArrowRight")i.onChange(y(i.width+16))},onPointerDown:(b)=>{let C=b.clientX,S=i.width,E=b.currentTarget;E.setPointerCapture(b.pointerId);let O=(x)=>i.onChange(y(S+x.clientX-C)),R=()=>{E.removeEventListener("pointermove",O),E.removeEventListener("pointerup",R)};E.addEventListener("pointermove",O),E.addEventListener("pointerup",R)}})}export{yn as WorkspacePage};
|
package/dist/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
<link rel="stylesheet" crossorigin href="./chunk-index-j4x9dq30.css"><script type="module" crossorigin src="./chunk-index-
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./chunk-index-j4x9dq30.css"><script type="module" crossorigin src="./chunk-index-fg42egv9.js"></script></head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
|
15
15
|
|
package/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=self,i=new URL(o.registration.scope);var d=new URL("index.html",i).href,h=new Set(["index.html","account-zk4efb87.css","chunk-account-
|
|
1
|
+
var o=self,i=new URL(o.registration.scope);var d=new URL("index.html",i).href,h=new Set(["index.html","account-zk4efb87.css","chunk-account-83crfbn4.js","chunk-action-menu-qw7h03x0.js","chunk-agent-t1632ktv.js","chunk-arranged-rooms-sb6tbsxw.js","chunk-bulk-actions-v1g2bzk7.js","chunk-character-creator-ye69w0kx.js","chunk-confirm-x8w877bz.js","chunk-connectors-t7qbc6nk.js","chunk-conversations-kmt6qzym.js","chunk-council-sheet-bxvn7vza.js","chunk-drag-03zgvd66.js","chunk-entry-y5vwp5e5.js","chunk-folder-list-h3vnjzpb.js","chunk-folds-a3e22m7x.js","chunk-gate-qzephvdv.js","chunk-group-scene-w1ycabrm.js","chunk-group-table-9nvmja8w.js","chunk-host-icons-fccg3b2d.js","chunk-host-picture-jaqz127q.js","chunk-host-state-r01v1ywg.js","chunk-host-ui-n54mh5af.js","chunk-index-0a81da8z.js","chunk-index-0q15ysrb.js","chunk-index-0ye10vk3.js","chunk-index-1kwp3spy.js","chunk-index-3d8s3565.js","chunk-index-3pnvpppa.js","chunk-index-47vq85ye.js","chunk-index-4z4chg7v.js","chunk-index-5zmswz4s.js","chunk-index-64rsz6pf.js","chunk-index-6vcs0h0m.js","chunk-index-6xqz6mg2.js","chunk-index-83v0c9x6.js","chunk-index-8xd6anam.js","chunk-index-983dmeaa.js","chunk-index-9z13jw6q.js","chunk-index-af4ebmkr.js","chunk-index-afrhnrxj.js","chunk-index-ak6ecqy3.js","chunk-index-b73y2gc0.js","chunk-index-ben4gv45.js","chunk-index-bhqczxr3.js","chunk-index-c44p8q87.js","chunk-index-db8zh8e6.js","chunk-index-dvfkb699.js","chunk-index-e02ddp46.js","chunk-index-ebg48jgy.js","chunk-index-ek5mek4j.js","chunk-index-em7vndrb.js","chunk-index-eq161yvp.js","chunk-index-f500nw4w.js","chunk-index-f5x2srr0.js","chunk-index-fg42egv9.js","chunk-index-h3v1d3nt.js","chunk-index-j4x9dq30.css","chunk-index-j7pgphx3.js","chunk-index-k0z507h3.js","chunk-index-kbgykazq.js","chunk-index-n05yw5wd.js","chunk-index-n8ghdvxb.js","chunk-index-nsvwbjfe.js","chunk-index-p5jcwjx8.js","chunk-index-qfgkfq86.js","chunk-index-rcwdqn50.js","chunk-index-s72hmse6.js","chunk-index-sm7m4fej.js","chunk-index-sv9qpmhv.js","chunk-index-w42rcbx1.js","chunk-index-x4enmj72.js","chunk-index-xevnf9ew.js","chunk-index-xx8jq73q.js","chunk-index-y60x5jbh.js","chunk-index-ypkgw7gq.js","chunk-index-yrmqcay4.js","chunk-layout-actions-8dzvysym.js","chunk-menu-items-3jhya205.js","chunk-mode-toggle-js49gvpd.js","chunk-note-row-kv061030.js","chunk-notes-sdkqz5hr.js","chunk-notice-bell-r012f2zy.js","chunk-notices-h4rk1zxc.js","chunk-onboarding-a18cvkph.js","chunk-overview-ynaqn4fp.js","chunk-palette-jm79gb5q.js","chunk-placement-items-mwm9q1zn.js","chunk-profile-ajw6pp4r.js","chunk-prompt-history-zcfvr3r8.js","chunk-prompts-m5rzdk24.js","chunk-room-confirms-ftsj15ja.js","chunk-room-menu-b9ktw9pw.js","chunk-rooms-menu-button-qe62t6nx.js","chunk-schedules-t8yxnf8q.js","chunk-seat-menu-kwtjnpjj.js","chunk-sheet-hosts-yj5wszgj.js","chunk-shortcut-help-g5cpqjjj.js","chunk-shortcuts-9ft5sqdw.js","chunk-skill-editor-xdfq2708.js","chunk-skills-9wa4mwdc.js","chunk-switcher-list-vpg6wvtw.js","chunk-tab-dot-yse6wcfp.js","chunk-table-1y76m54h.js","chunk-table2d-g57vr6h0.js","chunk-thread-actions-xjhpdjk7.js","chunk-thread-cards-36rckyg7.js","chunk-thread-list-fd6agz77.js","chunk-transcript-5nfn3r35.js","chunk-where-ha8pc3cg.js","chunk-workspace-e85twv32.js","chunk-zh-tw-z5p5mpph.js"].map((e)=>new URL(e,i).href)),w=/\/chunk-table3d-[a-z0-9]+\.js$/,g=/\/chunk-(?:codeeditor|lang-[a-z]+)-[a-z0-9]+\.js$/,k=["api/","auth/","login","files/","avatars/"],m=(e)=>{let n=e.pathname.slice(i.pathname.length);return k.some((t)=>n.startsWith(t))};async function v(e){let n=await caches.open("roundtable-web-59ab434c7bf1");try{let t=await fetch(e);if(t.ok&&new URL(e.url).href===i.href)await n.put(d,t.clone());return t}catch{let t=await n.match(d);if(t)return t;throw Error("offline and the shell is not cached")}}async function W(e){let n=await caches.open("roundtable-web-59ab434c7bf1"),t=await n.match(e);if(t)return t;let a=await fetch(e);if(a.ok)await n.put(e,a.clone());return a}var r=(e,n)=>typeof e==="string"&&e?e.slice(0,n):void 0;function l(e){if(typeof e!=="string")return i.href;let n=URL.parse(e,i);return n&&n.origin===i.origin&&n.pathname.startsWith(i.pathname)?n.href:i.href}var E=new Set(["notice","test"]);async function u(e,n){if(!e?.tag||!e.kind||!E.has(e.kind))return;try{await fetch(new URL("api/push/receipts",i),{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({tag:e.tag,event:n})})}catch{}}async function y(e){if(typeof e!=="number"||!Number.isSafeInteger(e)||e<0)return;try{if(e>0)await o.navigator.setAppBadge?.(e);else await o.navigator.clearAppBadge?.()}catch{}}async function P(e){let n={};try{let s=e.data?.json();if(typeof s==="object"&&s!==null)n=s}catch{}let t=r(n.tag,200),a=r(n.kind,16);if(await y(n.badge),a==="clear"){if(t)for(let s of await o.registration.getNotifications({tag:t}))s.close();return}await o.registration.showNotification(r(n.title,120)??"Roundtable",{body:r(n.body,240),icon:new URL("icons/192.png",i).href,badge:new URL("icons/badge-96.png",i).href,...t?{tag:t,renotify:!0}:{},...n.urgency==="high"?{requireInteraction:!0}:{},data:{url:l(n.url),...t?{tag:t}:{},...a?{kind:a}:{}}}),await u({...t?{tag:t}:{},...a?{kind:a}:{}},"received")}async function b(e){e.notification.close();let n=e.notification.data,t=l(n?.url),a=r(n?.tag,200),s=r(n?.kind,16),f=u({...a?{tag:a}:{},...s?{kind:s}:{}},"opened"),c=(await o.clients.matchAll({type:"window",includeUncontrolled:!0})).find((p)=>p.url.startsWith(i.href));if(c)await c.focus(),c.postMessage({type:"roundtable:open",url:t});else await o.clients.openWindow(t);await f}o.addEventListener("install",(e)=>{e.waitUntil(caches.open("roundtable-web-59ab434c7bf1").then((n)=>n.addAll([...h])).then(()=>o.skipWaiting()))});o.addEventListener("activate",(e)=>{e.waitUntil(caches.keys().then((n)=>Promise.all(n.filter((t)=>t.startsWith("roundtable-web-")&&t!=="roundtable-web-59ab434c7bf1").map((t)=>caches.delete(t)))).then(()=>o.clients.claim()))});o.addEventListener("fetch",(e)=>{let{request:n}=e;if(n.method!=="GET")return;let t=new URL(n.url);if(t.origin!==i.origin||!t.pathname.startsWith(i.pathname))return;if(m(t))return;if(n.mode==="navigate")e.respondWith(v(n));else if(h.has(t.origin+t.pathname)||w.test(t.pathname)||g.test(t.pathname))e.respondWith(W(n))});o.addEventListener("push",(e)=>{e.waitUntil(P(e))});o.addEventListener("notificationclick",(e)=>{e.waitUntil(b(e))});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-roundtable-web",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"description": "A web console for the owners of a pi-roundtable host: conversations, transcripts, and memory notes, with live updates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/react": "19.3.0",
|
|
71
71
|
"@types/react-dom": "19.3.0",
|
|
72
72
|
"@types/three": "0.186.0",
|
|
73
|
-
"pi-roundtable": "0.27.
|
|
73
|
+
"pi-roundtable": "0.27.1",
|
|
74
74
|
"react": "19.3.0",
|
|
75
75
|
"react-dom": "19.3.0",
|
|
76
76
|
"react-markdown": "10.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,Q,S,e,w}from"./chunk-index-2e4am3hw.js";var a={profile:S(()=>(h("s7r7fcvz"),import("./chunk-profile-s7r7fcvz.js")).then((o)=>({default:o.ProfilePage}))),notices:S(()=>(h("fte9f196"),import("./chunk-notices-fte9f196.js")).then((o)=>({default:o.NoticesPage}))),onboarding:S(()=>(h("c5twahc3"),import("./chunk-onboarding-c5twahc3.js")).then((o)=>({default:o.OnboardingPage})))};function n({pane:o}){let t=a[o];return t?e(Q,{fallback:e(w,{}),children:e(t,{})}):null}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K}from"./chunk-index-jgzygbt8.js";import"./chunk-index-8d81qy69.js";export{K as Confirm};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ei,Ci,As}from"./chunk-index-t998yg8y.js";import"./chunk-index-kb3w11mn.js";import"./chunk-index-18pgxxw3.js";import"./chunk-index-2t30xwed.js";import"./chunk-index-8d81qy69.js";import"./chunk-index-64rsz6pf.js";import"./chunk-index-kbrg32sx.js";export{As as GroupScene,Ci as GroupStage,Ei as useGroupFocus};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-zyvwhxga.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at}from"./chunk-index-q7g62sgm.js";export{at as HostPicture};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wo,jt,er,zr,Ir,Cs,$s,Dr,Ns,Ls}from"./chunk-index-pyfx77cj.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";export{zr as createFolder,Dr as deleteFolder,Ls as dropRoom,jt as moveRoom,Ns as muteFolder,$s as nudgeFolder,er as nudgeRoom,Wo as pinRoom,Cs as placeFolderBefore,Ir as renameFolderTo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ur}from"./chunk-index-ffbrm6tr.js";export{ur as ModeToggle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Br,Xs}from"./chunk-index-f6q0stqx.js";import"./chunk-index-j4kk1m59.js";import"./chunk-index-b8cpvr7y.js";import"./chunk-index-rh0x9rzf.js";import"./chunk-index-e2dqjde8.js";import"./chunk-index-kbrg32sx.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";export{Xs as folderMenu,Br as placementItems};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lr}from"./chunk-index-aamhjg5n.js";import"./chunk-index-v6smgw77.js";import"./chunk-index-jgzygbt8.js";import"./chunk-index-8d81qy69.js";import"./chunk-index-pyfx77cj.js";import"./chunk-index-j4kk1m59.js";import"./chunk-index-cdctnw71.js";import"./chunk-index-e2dqjde8.js";import"./chunk-index-j0m16cj1.js";import"./chunk-index-g1awv7rk.js";export{lr as RoomConfirmHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Nr,Lr,Xr}from"./chunk-index-6bkcq9ka.js";import"./chunk-index-rh0x9rzf.js";export{Lr as clearAcross,Xr as clearFinished,Nr as dismissThread};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Rn,cr}from"./chunk-index-2t30xwed.js";export{Rn as currentQuery,cr as followUrl};
|