dorkos 0.93.0 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +2614 -836
- package/dist/client/assets/{AboutPage-R35A-Uu-.js → AboutPage-ESdr5ej6.js} +1 -1
- package/dist/client/assets/{AdapterIcon-kPDXiFU1.js → AdapterIcon-C2oG4Wi0.js} +1 -1
- package/dist/client/assets/{AppearancePage-COqDtruX.js → AppearancePage-BkLDttbk.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-CIKvkn5X.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-DrUBXr8b.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-4FX_eaSh.js → BlintzCanvas-BqJDhl-U.js} +1 -1
- package/dist/client/assets/{CanvasCsvContent-Dq2X1kUl.js → CanvasCsvContent-DAsWhu2A.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-CZUc62IR.js → CanvasFileContent-CFpGh9lB.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-D1IN_nl9.js → CanvasModel3dContent-DorTDn1y.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-BeEhMSvL.js → CodeMirrorDiff-ChMTPEBY.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BlNLMvbo.js → CodeMirrorEditor-DtYzxmC5.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-s7RnRr1y.js → ConnectionAccessLists-DnxFiJIp.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BTTdQBdS.js → ConnectionsPage-Exq_5IiP.js} +1 -1
- package/dist/client/assets/{ConventionPage-CI3PeUHm.js → ConventionPage-DXnlTX8j.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-D6OvDT9K.js → FloatingTanStackRouterDevtools-CqogiFob-CEzhHBdz.js} +1 -1
- package/dist/client/assets/HandlePage-C1AzkGxs.js +1 -0
- package/dist/client/assets/{LexicalField-Bqq5KeUW.js → LexicalField-DJfTqKnT.js} +1 -1
- package/dist/client/assets/{ManagesPage-CWdKDvw1.js → ManagesPage-BAYoqzuu.js} +1 -1
- package/dist/client/assets/{Model3dViewer-ClJVGLDb.js → Model3dViewer-DgKQPqJb.js} +1 -1
- package/dist/client/assets/NamePage-BDAAuJFs.js +1 -0
- package/dist/client/assets/{NotificationsPage-C6tE8iuE.js → NotificationsPage-CrGzgL1F.js} +1 -1
- package/dist/client/assets/{PermissionsPage-BqDl7shN.js → PermissionsPage-CRq4hxB-.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-B3q8QYcS.js → PersonalityPopover-CoJNGa7f.js} +1 -1
- package/dist/client/assets/PhotoPage-DFLk5ALL.js +1 -0
- package/dist/client/assets/{RoomsPage-DwYtOhd7.js → RoomsPage-DfJvCi90.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-BDPs-RYB.js → RunsOnPopover-UixmCBm5.js} +1 -1
- package/dist/client/assets/{SessionsPage-Du24E934.js → SessionsPage-D8BzdYL7.js} +1 -1
- package/dist/client/assets/{SkillsPage-DjLUEngt.js → SkillsPage-B6yHwhAp.js} +1 -1
- package/dist/client/assets/{TasksPage-B6i3r76o.js → TasksPage-KFUMW7h0.js} +1 -1
- package/dist/client/assets/{ToolsPage-DNoC2MMz.js → ToolsPage-Dd7DXlpE.js} +1 -1
- package/dist/client/assets/{TopologyGraph-DtBDaHqX.js → TopologyGraph-CJj2myGV.js} +5 -5
- package/dist/client/assets/{agent-browser-da9rKrej.js → agent-browser-C48rts1h.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-DJ5Xz8gv.js → highlighted-body-KPVGNVTW-CvHOdigG.js} +1 -1
- package/dist/client/assets/{index-BzDP7VXZ.js → index-1tkVhrNa.js} +1 -1
- package/dist/client/assets/{index-C9wgMNj5.js → index-3nUBnton.js} +3 -3
- package/dist/client/assets/{index-CtlzkOJ3.js → index-672L_-Ce.js} +1 -1
- package/dist/client/assets/{index-BVpHI-1y.js → index-9lsrtJLf.js} +1 -1
- package/dist/client/assets/{index-BnORUrPC.js → index-B1N7_mWs.js} +1 -1
- package/dist/client/assets/index-B4Z9VBPe.js +1678 -0
- package/dist/client/assets/{index-BC9LsNlJ.js → index-BK5zyBqg.js} +1 -1
- package/dist/client/assets/{index-CObinYlG.js → index-BNO2TT-L.js} +1 -1
- package/dist/client/assets/{index-CotYqF0w.js → index-BSj4LDYi.js} +1 -1
- package/dist/client/assets/{index-D0sn-ct6.js → index-B_0gazbk.js} +1 -1
- package/dist/client/assets/{index-FsBhOkNr.js → index-BgBnbdck.js} +1 -1
- package/dist/client/assets/{index-1o6WO7iZ.js → index-BhxMJfLU.js} +1 -1
- package/dist/client/assets/{index-DdsOOmtz.js → index-BlNzH0bV.js} +1 -1
- package/dist/client/assets/{index-3DE2Q3OD.js → index-BmYSSGWx.js} +1 -1
- package/dist/client/assets/{index-LcH-4hgH.js → index-Brd8Hs2R.js} +1 -1
- package/dist/client/assets/{index-Bp2CiCey.js → index-Bu5-0YcT.js} +1 -1
- package/dist/client/assets/{index-gHd4-GL-.js → index-C0YR9sBs.js} +1 -1
- package/dist/client/assets/{index-CfUAagLY.js → index-CEQe58ON.js} +1 -1
- package/dist/client/assets/{index-Bl2j_xjE.js → index-CEU2IWuT.js} +1 -1
- package/dist/client/assets/{index-Dyeo69l2.js → index-CMKnOlvn.js} +1 -1
- package/dist/client/assets/{index-B5yJddXH.js → index-CMlp38oa.js} +1 -1
- package/dist/client/assets/{index-gIAwAMkn.js → index-CNPnwL--.js} +1 -1
- package/dist/client/assets/{index-Ca5JlBEc.js → index-Clh_1xLD.js} +1 -1
- package/dist/client/assets/{index-DsH33VjO.js → index-CpAbafE9.js} +2 -2
- package/dist/client/assets/{index-DQWAoAN-.js → index-CpFgghxb.js} +1 -1
- package/dist/client/assets/{index-D1kH8Sr2.js → index-Cum2QlPd.js} +2 -2
- package/dist/client/assets/index-D8mgsoST.css +1 -0
- package/dist/client/assets/{index-CJK5Iw50.js → index-DDGf-Mnk.js} +1 -1
- package/dist/client/assets/{index-DJGEk3-H.js → index-DEuOFjz7.js} +1 -1
- package/dist/client/assets/{index-Bu16-jWo.js → index-DSDJttSW.js} +1 -1
- package/dist/client/assets/{index-DwfaFQZo.js → index-DmA6ple3.js} +1 -1
- package/dist/client/assets/{index-CZ0BaV1t.js → index-DrkFww9Q.js} +1 -1
- package/dist/client/assets/{index-CtJTMcuR.js → index-O5pHJ17K.js} +1 -1
- package/dist/client/assets/{index-Cvzimc0W.js → index-PA-V6bdB.js} +1 -1
- package/dist/client/assets/{index-CQXxVt4A.js → index-XMua1laL.js} +1 -1
- package/dist/client/assets/{index-DnN4PJaN.js → index-ZBeb8ExW.js} +1 -1
- package/dist/client/assets/{index-BQ-o6bQ0.js → index-ngTGZK5T.js} +1 -1
- package/dist/client/assets/{room-files-source-DRQNpCWs.js → room-files-source-CWB8LgHN.js} +2 -2
- package/dist/client/assets/{soul-file-DcQD5pcS.js → soul-file-BTDnNMG7.js} +1 -1
- package/dist/client/assets/{use-personality-commit-Dsy9tqWY.js → use-personality-commit-CzT0Fy-T.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/0136_mirror_timeline_order.sql +23 -0
- package/dist/drizzle/meta/0136_snapshot.json +10232 -0
- package/dist/drizzle/meta/_journal.json +8 -1
- package/dist/server/index.js +2375 -986
- package/dist/server/index.js.map +2 -2
- package/package.json +6 -6
- package/dist/client/assets/HandlePage-Dvqztr0N.js +0 -1
- package/dist/client/assets/NamePage-BgVZ-KD1.js +0 -1
- package/dist/client/assets/PhotoPage-lt6ZevHW.js +0 -1
- package/dist/client/assets/index-BCGiD7pg.js +0 -1674
- package/dist/client/assets/index-BG-HtbEP.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as be,E as $,C as he}from"./index-DdsOOmtz.js";import{p as Te,s as Pe,t as b,E as xe,e as K,j as Ve,a as ye,L as we,i as ve,f as Xe,O as $e}from"./index-C9wgMNj5.js";import{cssLanguage as J,css as _e}from"./index-BzDP7VXZ.js";import{typescriptLanguage as qe,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-BC9LsNlJ.js";import"./index-BCGiD7pg.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==X){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/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PPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et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`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pt,mt,ft,ct,ut,Ot,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ie(e,a){let r=Object.create(null);for(let l of e.getChildren(ne)){let t=l.getChild(je),s=l.getChild(A)||l.getChild(se);t&&(r[a.read(t.from,t.to)]=s?s.type.id==A?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function U(e,a){let r=e.getChild(Ie);return r?a.read(r.from,r.to):" "}function q(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=ie(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ue(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return Te((i,u)=>{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=t=i,o=u.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?F(r,t,t.from,l):L(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?L(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?F(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?Tt(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Pt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ht(r,e,t,l):null}function qt(e){return me(y.default,e)}function xt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new y(a,r):y.default;return t=>me(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=we.define({name:"html",parser:St.configure({props:[ve.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),Xe.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),$e.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Ct(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new ye(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,_e().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`</${S}>`;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:Ve.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Ct as html,qt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage};
|
|
1
|
+
import{L as be,E as $,C as he}from"./index-BlNzH0bV.js";import{p as Te,s as Pe,t as b,E as xe,e as K,j as Ve,a as ye,L as we,i as ve,f as Xe,O as $e}from"./index-3nUBnton.js";import{cssLanguage as J,css as _e}from"./index-1tkVhrNa.js";import{typescriptLanguage as qe,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-BK5zyBqg.js";import"./index-B4Z9VBPe.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==X){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1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!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!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]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pt,mt,ft,ct,ut,Ot,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ie(e,a){let r=Object.create(null);for(let l of e.getChildren(ne)){let t=l.getChild(je),s=l.getChild(A)||l.getChild(se);t&&(r[a.read(t.from,t.to)]=s?s.type.id==A?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function U(e,a){let r=e.getChild(Ie);return r?a.read(r.from,r.to):" "}function q(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=ie(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ue(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return Te((i,u)=>{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=t=i,o=u.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?F(r,t,t.from,l):L(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?L(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?F(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?Tt(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Pt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ht(r,e,t,l):null}function qt(e){return me(y.default,e)}function xt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new y(a,r):y.default;return t=>me(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=we.define({name:"html",parser:St.configure({props:[ve.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),Xe.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),$e.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Ct(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new ye(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,_e().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`</${S}>`;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:Ve.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Ct as html,qt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,bl as x,dC as m,di as g,dD as P,dE as p,dF as w,dG as C,cs as S,dH as L,J as R,dI as T,dJ as E,B as v,dK as I,dL as M,dM as O,dN as F}from"./index-
|
|
1
|
+
import{j as s,bl as x,dC as m,di as g,dD as P,dE as p,dF as w,dG as C,cs as S,dH as L,J as R,dI as T,dJ as E,B as v,dK as I,dL as M,dM as O,dN as F}from"./index-B4Z9VBPe.js";import{dO as V}from"./index-B4Z9VBPe.js";function f({label:n,empty:t,allClear:a,action:o,children:l}){return s.jsxs("section",{children:[s.jsxs("div",{className:"mb-2 flex min-h-6 items-center justify-between gap-2",children:[s.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-widest uppercase",children:n}),!t&&o]}),t?s.jsx("p",{className:"text-muted-foreground/70 text-xs",children:a}):l]})}const u=5,_={animate:{transition:{staggerChildren:.04}}};function B(){const n=x(),t=m(),a=g(),{schedules:o,errors:l,activity:d,isLoading:c,total:i}=P(),j=p(c),A=w(),y=C(o),N=t==="/"&&!a,r=y.slice(0,u),h=l.slice(0,u-r.length),b=d.slice(0,u-r.length-h.length);return N?null:s.jsxs(f,{label:"Needs attention",empty:!j&&i===0&&r.length===0,allClear:"All quiet. Nothing needs you.",action:s.jsx(v,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>n({to:"/"}),children:"View all →"}),children:[s.jsx(S,{initial:!1,children:r.map(e=>s.jsx(L,{task:e,className:"mb-2"},e.id))}),s.jsxs(R.div,{variants:_,initial:"initial",animate:"animate",children:[h.map(e=>s.jsx(T,{signal:e},e.id)),b.map(e=>s.jsx(E,{notification:e,onOpen:()=>A(e)},e.id))]})]})}const H=5;function k(){const n=x(),t=m(),a=g(),{groups:o,isLoading:l}=I(),d=p(l);if(t==="/activity"&&!a)return null;const c=o.flatMap(i=>i.items).slice(0,H);return s.jsx(f,{label:"Activity",empty:!d&&c.length===0,allClear:"No recent activity.",action:s.jsx(v,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>n({to:"/activity"}),children:"Open activity →"}),children:s.jsx(M,{children:s.jsx(O,{children:c.map(i=>s.jsx(F,{item:i},i.id))})})})}function D(){return s.jsxs("div",{"data-slot":"pulse",className:"flex h-full flex-col gap-6 overflow-y-auto p-4",children:[s.jsx(B,{}),s.jsx(k,{})]})}export{D as PulsePanel,V as usePulseFreshness};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dT as Se,gi as Me,af as ne,r as a,gj as Ie,gk as Q,gl as G,gm as K,d_ as ie,gn as Ce,cS as J,go as ee,dj as it,gp as lt,bm as ct,gq as dt,aj as oe,gr as ut,gs as ft,eT as ht,gt as pt,ag as Te,gu as mt,j as t,aF as Fe,am as Ke,cW as xt,C as He,gv as gt,dB as be,gw as yt,fR as Ue,fW as vt,al as Oe,gx as qe,gy as Qe,gz as Ct,f3 as bt,f4 as wt,f5 as kt,f6 as Z,f7 as ue,dQ as jt,eh as fe,ei as he,ej as pe,ek as me,el as xe,em as ge,en as ye,eo as ve,B as Y,aG as Et,gA as Ae,g0 as Dt,gB as Rt,ai as ce,gC as Be,gD as We,d4 as Nt,gE as St,gF as Tt,gG as Ft,gH as Ot,e5 as De,gI as Ye,dh as Pt,dU as Mt,cU as At,gJ as _t,gK as Lt,g5 as zt,gL as $t,dW as It,dX as Kt,dY as Ht,dZ as Ut,d$ as qt,e0 as Qt,I as Bt,e1 as Wt}from"./index-
|
|
1
|
+
import{dT as Se,gi as Me,af as ne,r as a,gj as Ie,gk as Q,gl as G,gm as K,d_ as ie,gn as Ce,cS as J,go as ee,dj as it,gp as lt,bm as ct,gq as dt,aj as oe,gr as ut,gs as ft,eT as ht,gt as pt,ag as Te,gu as mt,j as t,aF as Fe,am as Ke,cW as xt,C as He,gv as gt,dB as be,gw as yt,fR as Ue,fW as vt,al as Oe,gx as qe,gy as Qe,gz as Ct,f3 as bt,f4 as wt,f5 as kt,f6 as Z,f7 as ue,dQ as jt,eh as fe,ei as he,ej as pe,ek as me,el as xe,em as ge,en as ye,eo as ve,B as Y,aG as Et,gA as Ae,g0 as Dt,gB as Rt,ai as ce,gC as Be,gD as We,d4 as Nt,gE as St,gF as Tt,gG as Ft,gH as Ot,e5 as De,gI as Ye,dh as Pt,dU as Mt,cU as At,gJ as _t,gK as Lt,g5 as zt,gL as $t,dW as It,dX as Kt,dY as Ht,dZ as Ut,d$ as qt,e0 as Qt,I as Bt,e1 as Wt}from"./index-B4Z9VBPe.js";import{t as ae,g as Yt,C as Gt,n as Ge,r as Ve,a as Vt,p as Xt,F as Zt,w as Jt,c as Xe,b as en}from"./room-files-source-CWB8LgHN.js";import{N as Qn,R as Bn}from"./room-files-source-CWB8LgHN.js";/**
|
|
2
2
|
* @license lucide-react v1.47.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -13,5 +13,5 @@ import{dT as Se,gi as Me,af as ne,r as a,gj as Ie,gk as Q,gl as G,gm as K,d_ as
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const tt={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};tt.node;const nn=Se(tt);function le(e,n,s){return["file-explorer","tree",e.scopeKey,n,e.filtersHidden?s:null]}function ke(e,n,s,m){return{queryKey:le(e,n,s),queryFn:()=>e.list(n,{showHidden:s}),staleTime:Me.FILE_TREE_STALE_TIME_MS,gcTime:Me.FILE_TREE_GC_TIME_MS,placeholderData:p=>p??m.getQueryData(le(e,n,!s))}}const sn=[".git",".dork",".claude",".agents","node_modules"];function an(e){return e.startsWith(".")||sn.includes(e)}const Re=["ROOM.md","README.md"];function Ne(e){return Re.some(n=>n.toLowerCase()===e.toLowerCase())}function nt(e){return e.filter(n=>!an(n.name))}function rn(e){if(e.reduce((p,i)=>i.type==="file"&&Ne(i.name)?p+1:p,0)===0)return e;const s=[],m=[];for(const p of e)p.type==="file"&&Ne(p.name)?s.push(p):m.push(p);return s.sort((p,i)=>Re.findIndex(o=>o.toLowerCase()===p.name.toLowerCase())-Re.findIndex(o=>o.toLowerCase()===i.name.toLowerCase())),[...s,...m]}const on=/ copy(?: \d+)?$/;function Pe({name:e,isDir:n,taken:s}){const m=new Set(s);if(!m.has(e))return e;const p=n?-1:e.lastIndexOf("."),i=p>0,o=i?e.slice(p):"",g=(i?e.slice(0,p):e).replace(on,"");for(let r=1;;r+=1){const d=r===1?`${g} copy${o}`:`${g} copy ${r}${o}`;if(!m.has(d))return d}}function _e(e,n,s){return{name:n,path:e,type:s,size:0,mtime:Date.now(),isSymlink:!1}}function ln(e){const n=ne(),{source:s,showHidden:m,queryClient:p,inFlightRef:i}=e,o=s.cwd??"",[g,r]=a.useState(null),d=a.useCallback(async h=>{i.current+=1;try{return await h()}finally{i.current-=1}},[i]),c=a.useMemo(()=>{const h=x=>le(s,x,m);return{getChildren:x=>{var j;return((j=p.getQueryData(h(x)))==null?void 0:j.entries)??[]},isLoaded:x=>p.getQueryData(h(x))!==void 0,takenNames:async x=>(await n.readFileTree(o,{path:x===Q?void 0:x,showHidden:!0})).entries.map(C=>C.name),snapshot:x=>p.getQueryData(h(x)),setChildren:(x,j)=>{p.setQueryData(h(x),C=>({entries:Ie(j((C==null?void 0:C.entries)??[]))}))},restore:(x,j)=>{p.setQueryData(h(x),j)},invalidate:x=>{p.invalidateQueries({queryKey:h(x),exact:!0})}}},[p,n,o,s,m]),D=a.useCallback((h,x,j)=>d(async()=>{const C=ee(h,x),S=!c.getChildren(h).some(_=>_.path===C),I=c.snapshot(h);S&&c.setChildren(h,_=>[..._,_e(C,x,j)]);try{return await n.createEntry(o,C,j),!0}catch(_){return S&&c.restore(h,I),ae(_,`Couldn’t create ${j==="dir"?"folder":"file"}`),!1}finally{c.invalidate(h)}}),[n,o,c,d]),M=a.useCallback((h,x)=>d(async()=>{if(x===h.name||x.length===0)return!0;const j=G(h.path),C=ee(j,x),S=c.getChildren(j).some(A=>A.path===C),I=c.snapshot(j),_={...h,name:x,path:C};S||c.setChildren(j,A=>A.map(z=>z.path===h.path?_:z));try{return await n.renameEntry(o,h.path,C),K.getState().remapExpandedPaths(h.path,C),!0}catch(A){return S||c.restore(j,I),ae(A,"Couldn’t rename"),!1}finally{c.invalidate(j)}}),[n,o,c,d]),R=a.useCallback(h=>d(async()=>{const x=G(h.path),j=c.snapshot(x);c.setChildren(x,C=>C.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path,{recursive:!0}),K.getState().dropExpandedPaths(h.path)}catch(C){c.restore(x,j),ae(C,"Couldn’t delete")}finally{c.invalidate(x)}}),[n,o,c,d]),q=a.useCallback(h=>d(async()=>{const x=G(h.path);if(h.type==="file"){const j=c.snapshot(x);c.setChildren(x,C=>C.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path),K.getState().dropExpandedPaths(h.path)}catch(C){c.restore(x,j),ae(C,"Couldn’t delete")}finally{c.invalidate(x)}return}try{await n.deleteEntry(o,h.path),c.setChildren(x,j=>j.filter(C=>C.path!==h.path)),K.getState().dropExpandedPaths(h.path),c.invalidate(x)}catch(j){if(Yt(j)==="DIR_NOT_EMPTY"){r(h);return}ae(j,"Couldn’t delete")}}),[n,o,c,d]),b=a.useCallback(async()=>{const h=g;r(null),h&&await R(h)},[g,R]),H=a.useCallback(()=>r(null),[]),$=a.useCallback((h,x)=>d(async()=>{const j=G(h),C=ie(h),S=ee(x,C);if(x===j||S===h||Ce(x,h))return;const I=c.getChildren(j).find(v=>v.path===h);if(!I)return;const _=c.isLoaded(x),A=_&&c.getChildren(x).some(v=>v.path===S),z={...I,name:C,path:S},W=c.snapshot(j),F=_?c.snapshot(x):void 0;c.setChildren(j,v=>v.filter(L=>L.path!==h)),_&&!A&&c.setChildren(x,v=>[...v,z]);try{await n.renameEntry(o,h,S),K.getState().remapExpandedPaths(h,S)}catch(v){c.restore(j,W),_&&!A&&c.restore(x,F),ae(v,"Couldn’t move")}finally{c.invalidate(j),_&&c.invalidate(x)}}),[n,o,c,d]),k=a.useCallback((h,x)=>d(async()=>{if(h.isDir&&Ce(x,h.path)){J.error(Gt);return}let j;try{j=await c.takenNames(x)}catch(A){ae(A,"Couldn’t copy");return}const C=Pe({name:ie(h.path),isDir:h.isDir,taken:j}),S=ee(x,C),I=c.isLoaded(x),_=I?c.snapshot(x):void 0;if(I){const A=c.getChildren(G(h.path)).find(W=>W.path===h.path),z=A?{...A,name:C,path:S}:_e(S,C,h.isDir?"dir":"file");c.setChildren(x,W=>[...W,z])}try{await n.copyEntry(o,h.path,S)}catch(A){I&&c.restore(x,_),ae(A,"Couldn’t copy")}finally{c.invalidate(x)}}),[n,o,c,d]);return{createEntry:D,renameEntry:M,removeEntry:q,moveEntry:$,copyEntry:k,pendingRecursiveDelete:g,confirmRecursiveDelete:b,cancelRecursiveDelete:H}}function cn(e){return e!=null&&e.startsWith("darwin")?"Reveal in Finder":e!=null&&e.startsWith("win32")?"Reveal in File Explorer":"Show in File Manager"}function dn(e,n){const s=e.includes("\\")&&!e.includes("/"),m=e.replace(/[\\/]+$/,""),p=s?n.split("/").join("\\"):n;return`${m}${s?"\\":"/"}${p}`}function un(e){const n=ne(),{data:s}=it(),m=a.useMemo(()=>n.supportsReveal?cn(s==null?void 0:s.platform):null,[n.supportsReveal,s==null?void 0:s.platform]),p=a.useCallback(async d=>{if(e)try{await n.revealEntry(e,d.path)}catch(c){ae(c,"Couldn’t open the file manager")}},[n,e]),{copy:i}=lt(),o=a.useCallback(async(d,c)=>{const D=c==="absolute"&&e?dn(e,d.path):d.path;await i(D)||J.error("Couldn’t copy to the clipboard")},[e,i]),g=a.useCallback(d=>{ct(dt(d.path))||J.error("Open a chat first to add a file to it")},[]),r=a.useCallback(d=>{K.getState().setClipboard({path:d.path,isDir:d.type==="dir"});try{navigator.clipboard.writeText(d.path).catch(()=>{})}catch{}},[]);return{revealLabel:m,reveal:p,copyPath:o,addToChat:g,copyToClipboard:r}}const fn=1e3;function hn(e){const{source:n,showHidden:s,queryClient:m,inFlightRef:p}=e,i=n.changes,[o,g]=a.useState(null),[r,d]=a.useState(null),[c,D]=a.useState(null),[M,R]=a.useState(0),q=a.useCallback(async u=>{p.current+=1,R(f=>f+1);try{return await u()}finally{p.current-=1,R(f=>f-1)}},[p]),b=a.useMemo(()=>{const u=f=>le(n,f,s);return{listing:f=>m.getQueryData(u(f)),isLoaded:f=>m.getQueryData(u(f))!==void 0,entries:f=>{var T;return((T=m.getQueryData(u(f)))==null?void 0:T.entries)??[]},setEntries:(f,T)=>m.setQueryData(u(f),y=>({...y,entries:Ie(T((y==null?void 0:y.entries)??[]))})),restore:(f,T)=>m.setQueryData(u(f),T),fetch:f=>n.list(f,{showHidden:!0}),refreshAll:()=>{m.invalidateQueries({queryKey:["file-explorer","tree",n.scopeKey]}),m.invalidateQueries({queryKey:["file-explorer","preview",n.scopeKey]})}}},[m,n,s]),H=a.useCallback(async u=>{const f=b.listing(u);return(f==null?void 0:f.commit)!==void 0?f.commit:(await b.fetch(u)).commit??null},[b]),$=a.useCallback((u,f,T,y)=>{switch(u.status){case"changed":return!0;case"conflict":return D({kind:f,path:u.path,lastCommit:u.lastCommit,retry:()=>T(u.commit)}),!1;case"exists":return J.error(y===void 0?u.reason:Ge(y)),!1;case"refused":return J.error(u.reason),!1}},[]),k=a.useCallback((u,f)=>{J.error(Ve(u)??f)},[]),h=a.useCallback((u,f,T)=>{const y=O=>q(async()=>{if(i===void 0)return!1;const E=G(u.path),N=G(f),w=ie(f),U=b.isLoaded(N),te=U&&b.entries(N).some(X=>X.path===f),V=b.listing(E),de=N===E?void 0:b.listing(N),l={...u,name:w,path:f};te||(N===E?b.setEntries(E,X=>X.map(se=>se.path===u.path?l:se)):(b.setEntries(E,X=>X.filter(se=>se.path!==u.path)),U&&b.setEntries(N,X=>[...X,l])));const P=()=>{b.restore(E,V),N!==E&&U&&b.restore(N,de)};try{const X=O??await H(E);if(X===null)return P(),J.error("There’s nothing in this room’s files to change yet."),!1;const se=await i.move({from:u.path,to:f,baseCommit:X}),je=$(se,T,async re=>{await y(re)},w);return je?K.getState().remapExpandedPaths(u.path,f):P(),je}catch(X){return P(),k(X,T==="rename"?"Couldn’t rename":"Couldn’t move"),!1}finally{b.refreshAll()}});return y(null)},[i,b,q,H,$,k]),x=a.useCallback(async(u,f)=>f===u.name||f.length===0?!0:h(u,ee(G(u.path),f),"rename"),[h]),j=a.useCallback(async(u,f)=>{const T=G(u),y=ee(f,ie(u));if(f===T||y===u||Ce(f,u))return;const O=b.entries(T).find(E=>E.path===u);O&&await h(O,y,"move")},[b,h]),C=a.useCallback(async u=>{let f=0;const T=[u];for(;T.length>0;){const y=T.shift(),O=await b.fetch(y);for(const E of O.entries)if(E.type==="dir"?T.push(E.path):f+=1,f>=fn)return{count:f,moreThan:!0}}return{count:f,moreThan:!1}},[b]),S=a.useCallback(u=>{if(u.type!=="dir"){g({entry:u,fileCount:1,moreThan:!1});return}g({entry:u,fileCount:null,moreThan:!1}),C(u.path).then(({count:f,moreThan:T})=>g(y=>(y==null?void 0:y.entry.path)===u.path?{entry:u,fileCount:f,moreThan:T}:y),()=>{})},[C]),I=a.useCallback(u=>{const f=T=>q(async()=>{if(i===void 0)return;const y=G(u.path),O=b.listing(y);b.setEntries(y,E=>E.filter(N=>N.path!==u.path));try{const E=T??await H(y);if(E===null){b.restore(y,O);return}const N=await i.remove({path:u.path,baseCommit:E});$(N,"delete",U=>f(U))?K.getState().dropExpandedPaths(u.path):b.restore(y,O)}catch(E){b.restore(y,O),k(E,"Couldn’t delete")}finally{b.refreshAll()}});return f(null)},[i,b,q,H,$,k]),_=a.useCallback(async()=>{const u=o;g(null),u&&await I(u.entry)},[o,I]),A=a.useCallback(()=>g(null),[]),z=a.useCallback((u,f,T,y)=>{const O=E=>q(async()=>{if(i===void 0)return;const N=b.isLoaded(u),w=N?b.listing(u):void 0;if(N){const U=new Set(b.entries(u).map(V=>V.name)),te=f.filter(V=>!U.has(V.name)).map(V=>({name:V.name,path:ee(u,V.name),type:"file",size:V.size}));te.length>0&&b.setEntries(u,V=>[...V,...te])}try{const U=await i.upload({dir:u,baseCommit:E,replace:T,files:f});!$(U,"upload",V=>O(V))&&N&&b.restore(u,w)}catch(U){N&&b.restore(u,w),k(U,"Couldn’t upload")}finally{b.refreshAll()}});return O(y)},[i,b,q,$,k]),W=a.useCallback(async(u,f)=>{if(i===void 0||f.length===0)return;if(f.length>i.maxUploadFiles){J.error(`One upload can carry up to ${i.maxUploadFiles} files, so nothing was uploaded. Try again with fewer.`);return}let T;try{T=await b.fetch(u)}catch(w){k(w,"Couldn’t upload");return}const y=T.entries.map(w=>w.name),O=new Set(y),E=f.map(w=>w.name).filter(w=>O.has(w)),N=T.commit??null;if(E.length===0){await z(u,f,[],N);return}d({dir:u,files:f,names:E,taken:y,baseCommit:N})},[i,b,k,z]),F=a.useCallback(async u=>{const f=r;if(d(null),f===null)return;if(u==="replace"){await z(f.dir,f.files,f.names,f.baseCommit);return}const T=new Set([...f.taken,...f.files.map(E=>E.name)]),y=new Set(f.names),O=f.files.map(E=>{if(!y.has(E.name))return E;const N=Pe({name:E.name,isDir:!1,taken:T});return T.add(N),new File([E],N,{type:E.type,lastModified:E.lastModified})});await z(f.dir,O,[],f.baseCommit)},[r,z]),v=a.useCallback(()=>d(null),[]),L=a.useCallback(()=>D(null),[]),B=a.useMemo(()=>r===null?null:{dir:r.dir,names:r.names},[r]);return{renameEntry:x,moveEntry:j,requestDelete:S,pendingDelete:o,confirmDelete:_,cancelDelete:A,upload:W,pendingClash:B,resolveClash:F,cancelClash:v,conflict:c,dismissConflict:L,busy:M>0}}const Le={scopeKey:"",cwd:null,writable:!1,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list:()=>Promise.resolve({entries:[]})};function pn(e){var u,f,T;const n=ne(),s=oe(),{setTheme:m}=ut(),p=K(y=>y.showHidden),i=K(y=>y.expanded),o=K(y=>y.loadExplorerForCwd),g=K(y=>y.pruneMissing),r=(e==null?void 0:e.scopeKey)??null,d=(e==null?void 0:e.cwd)??null;a.useEffect(()=>{o(r)},[r,o]);const c=a.useMemo(()=>[Q,...ft(i)],[i]),D=ht({queries:e?c.map(y=>ke(e,y,p,s)):[]}),M=(e==null?void 0:e.filtersHidden)??!0,R=a.useMemo(()=>{const y={};return c.forEach((O,E)=>{var U;const N=D[E];let w=((U=N==null?void 0:N.data)==null?void 0:U.entries)??[];!p&&!M&&(w=nt(w)),O===Q&&(w=rn(w)),y[O]={entries:w,loading:(N==null?void 0:N.isLoading)??!1,error:(N==null?void 0:N.isError)??!1}}),y},[c,D,p,M]),q=a.useRef(0),b=a.useRef({});a.useEffect(()=>{q.current>0||c.forEach((y,O)=>{var N,w,U;const E=(w=(N=D[O])==null?void 0:N.data)==null?void 0:w.entries;!E||(U=D[O])!=null&&U.isError||b.current[y]!==E&&(b.current[y]=E,g(y,E.map(te=>te.name)))})},[c,D,g]);const H=a.useMemo(()=>pt(i,R),[i,R]),$=!!e&&!!((u=R[Q])!=null&&u.loading),k=!!e&&!!((f=R[Q])!=null&&f.error),h=(T=D[0])==null?void 0:T.error,x=k&&h?Vt(h):void 0,j=(x==null?void 0:x.message)??null,C=(x==null?void 0:x.command)??null,S=a.useMemo(()=>{var O;const y=new Set;for(const E of c)E!==Q&&((O=R[E])!=null&&O.error)&&y.add(E);return y},[c,R]),I=a.useCallback(y=>{if(y.type!=="dir")return;const O=K.getState();O.setDirExpanded(y.path,!O.expanded[y.path])},[]),_=a.useCallback(y=>{if(y===Q)return;const O=K.getState();O.expanded[y]||O.setDirExpanded(y,!0)},[]),A=(e==null?void 0:e.preview)==="canvas",z=a.useCallback(y=>{if(y.type!=="file"||!A)return;const O={getStore:Te.getState,setTheme:m,supportsTerminal:n.supportsTerminal};mt(O,{action:"open_file",sourcePath:y.path},"user")},[A,m,n]),W=a.useCallback(()=>{r!==null&&s.invalidateQueries({queryKey:["file-explorer","tree",r]})},[s,r]),F=a.useCallback(y=>{e!==null&&s.invalidateQueries({queryKey:le(e,y,p),exact:!0})},[s,e,p]);a.useEffect(()=>{if(e!=null&&e.events)return e.events(W)},[e,W]);const v=ln({source:e??Le,showHidden:p,queryClient:s,inFlightRef:q}),L=hn({source:e??Le,showHidden:p,queryClient:s,inFlightRef:q}),B=un(d);return{rows:H,rootLoading:$,rootError:k,rootErrorMessage:j,rootErrorCommand:C,errorPaths:S,toggleExpand:I,ensureExpanded:_,openFile:z,reload:W,retryDir:F,changes:e!=null&&e.changes?L:null,...v,...B}}function mn(e){const{transport:n,cwd:s}=e;return{scopeKey:s,cwd:s,writable:!0,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list(m,p){return n.readFileTree(s,{path:m===""?void 0:m,showHidden:p.showHidden})}}}function we(e){return Array.from(e).includes("Files")}function st(e){const n=Array.from(e.items??[]);if(!(n.length>0&&n.every(i=>"webkitGetAsEntry"in i)))return{files:Array.from(e.files??[]),folders:0};const m=[];let p=0;for(const i of n){if(i.kind!=="file")continue;const o=i.webkitGetAsEntry();if(o!=null&&o.isDirectory){p+=1;continue}const g=i.getAsFile();g&&m.push(g)}return{files:m,folders:p}}const xn=12;function gn({row:e,selected:n,renaming:s,error:m,onSelect:p,onActivate:i,onRetry:o,onSubmitRename:g,onCancelRename:r,onNewFile:d,onNewFolder:c,onStartRename:D,onDelete:M,onMove:R,onCopyInto:q,onCopy:b,onPaste:H,onDuplicate:$,canPasteInto:k,revealLabel:h,onReveal:x,onAddToChat:j,onCopyPath:C,readOnly:S=!1,provenance:I=!1,copyable:_=!0,onDisk:A=!0,onUpload:z,onPickUpload:W}){const{entry:F,depth:v,expanded:L,loading:B}=e,u=F.type==="dir",f=u?F.path:G(F.path),[T,y]=a.useState(!1),O=!u&&v===0&&Ne(F.name),E=Xt(F.lastCommit),N=t.jsxs("div",{role:"treeitem","aria-label":F.name,"aria-expanded":u?L:void 0,"aria-selected":n,tabIndex:-1,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),p(F),i(F))},draggable:!s&&!S,onDragStart:w=>{S||(w.dataTransfer.setData("text/plain",F.path),w.dataTransfer.setData(Ct,F.path),w.dataTransfer.effectAllowed="copyMove")},onDragOver:w=>{if(w.stopPropagation(),!S&&z&&we(w.dataTransfer.types)){w.preventDefault(),w.dataTransfer.dropEffect="copy",y(!0);return}S||!u||!Qe(w.dataTransfer.types)||(w.preventDefault(),w.dataTransfer.dropEffect=w.altKey&&_?"copy":"move",y(!0))},onDragLeave:()=>y(!1),onDrop:w=>{if(w.stopPropagation(),S)return;if(y(!1),z&&we(w.dataTransfer.types)){w.preventDefault();const{files:te}=st(w.dataTransfer);z(f,te);return}if(!u)return;const U=qe(w.dataTransfer);U!==null&&(w.preventDefault(),w.altKey&&_?q(U,F.path):R(U,F.path))},onClick:()=>{p(F),i(F)},className:Oe("flex w-full cursor-pointer items-center gap-1 py-1 pr-2 text-sm transition-colors",n?"bg-accent text-foreground":"hover:bg-accent/50",T&&"ring-ring/60 bg-accent ring-1"),style:{paddingLeft:v*xn+8},children:[t.jsx("span",{className:"flex size-4 flex-shrink-0 items-center justify-center",children:u&&(B?t.jsx(Fe,{size:"xs",className:"text-muted-foreground"}):m?t.jsx("button",{type:"button","aria-label":"Retry loading",title:"Couldn’t load. Retry",onClick:w=>{w.stopPropagation(),o()},className:"flex items-center justify-center",children:t.jsx(Ke,{className:"text-destructive size-3.5"})}):L?t.jsx(xt,{className:"text-muted-foreground size-3.5"}):t.jsx(He,{className:"text-muted-foreground size-3.5"}))}),u?L?t.jsx(gt,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):F.isSymlink===!0?t.jsx(yt,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}):t.jsx(Ue,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),s?t.jsx(yn,{initialName:F.name,onSubmit:w=>g(F,w),onCancel:r}):t.jsx("span",{className:"min-w-0 flex-1 truncate",children:F.name}),O&&!s&&t.jsx(vt,{"aria-label":"Pinned to the top",className:"text-muted-foreground/60 size-3 flex-shrink-0"}),I&&!s&&t.jsx("span",{className:"text-muted-foreground/70 text-2xs max-w-[45%] flex-shrink-0 truncate tabular-nums",title:E.title??void 0,children:E.label})]});return S?N:t.jsxs(bt,{children:[t.jsx(wt,{asChild:!0,children:N}),t.jsxs(kt,{className:"w-52",children:[t.jsx(Z,{movesFocus:!0,onClick:()=>d(f),children:"New file"}),t.jsx(Z,{movesFocus:!0,onClick:()=>c(f),children:"New folder"}),W&&t.jsx(Z,{onClick:()=>W(f),children:"Upload files…"}),A&&t.jsxs(t.Fragment,{children:[t.jsx(ue,{}),h&&t.jsx(Z,{onClick:()=>x(F),children:h}),t.jsx(Z,{movesFocus:!0,onClick:()=>j(F),children:"Add to chat"})]}),_&&t.jsxs(t.Fragment,{children:[t.jsx(ue,{}),t.jsx(Z,{onClick:()=>b(F),children:"Copy"}),t.jsx(Z,{disabled:!k(f),onClick:()=>H(f),children:"Paste"}),t.jsx(Z,{onClick:()=>$(F),children:"Duplicate"})]}),t.jsx(ue,{}),A?t.jsxs(t.Fragment,{children:[t.jsx(Z,{onClick:()=>C(F,"absolute"),children:"Copy path"}),t.jsx(Z,{onClick:()=>C(F,"relative"),children:"Copy relative path"})]}):t.jsx(Z,{onClick:()=>C(F,"relative"),children:"Copy path"}),t.jsx(ue,{}),t.jsx(Z,{movesFocus:!0,onClick:()=>D(F),children:"Rename"}),t.jsx(Z,{variant:"destructive",onClick:()=>M(F),children:"Delete"})]})]})}function yn({initialName:e,onSubmit:n,onCancel:s}){const m=a.useRef(null),[p,i]=a.useState(e);a.useEffect(()=>{const g=m.current;if(!g)return;g.focus();const r=e.lastIndexOf(".");g.setSelectionRange(0,r>0?r:e.length)},[e]);const o=()=>{const g=p.trim();g&&g!==e?n(g):s()};return t.jsx("input",{ref:m,type:"text",value:p,"aria-label":"New name",onChange:g=>i(g.target.value),onClick:g=>g.stopPropagation(),onBlur:o,onKeyDown:g=>{g.stopPropagation(),g.key==="Enter"?o():g.key==="Escape"&&s()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})}const vn=100,Cn=28,bn=250;function wn(e){const{rows:n,selectedPath:s,renamingPath:m,errorPaths:p,onSelectPath:i,onRetryDir:o}=e,g=a.useRef(null),r=K(v=>v.setScrollTop),d=K(v=>v.scopeKey),c=a.useCallback(v=>v.type==="dir"?e.onToggle(v):e.onOpen(v),[e]),D=jn(e,c),M=n.length>vn,R=jt({count:n.length,getScrollElement:()=>g.current,estimateSize:()=>Cn,overscan:12,enabled:M}),q=a.useRef({scope:void 0,done:!1}),b=a.useRef(null);a.useLayoutEffect(()=>{const v=q.current;if(v.scope!==d&&(v.scope=d,v.done=!1),v.done||n.length===0)return;const L=g.current;if(!L)return;const B=K.getState().scrollTop;if(B<=0){v.done=!0;return}M?R.scrollToOffset(B):L.scrollTop=B,b.current=L.scrollTop,L.scrollTop>=B&&(v.done=!0)},[n.length,d,M,R]);const H=a.useRef(null),$=a.useRef(null),k=a.useCallback(()=>{const v=g.current;v&&v.scrollTop!==b.current&&(q.current.done=!0,H.current=v.scrollTop,$.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,H.current!==null&&r(H.current)},bn))},[r]);a.useEffect(()=>()=>{$.current&&clearTimeout($.current),H.current!==null&&r(H.current)},[r]);const h=a.useRef(void 0);a.useEffect(()=>{var u,f;const v=h.current;if(h.current=s,v===void 0||s===v||s===null)return;const L=n.findIndex(T=>T.entry.path===s);if(L<0)return;const B=g.current;B&&(M?R.scrollToIndex(L,{align:"auto"}):(f=(u=B.querySelector(`[data-row-index="${L}"]`))==null?void 0:u.scrollIntoView)==null||f.call(u,{block:"nearest"}),b.current=B.scrollTop)},[s,n,M,R]);const[x,j]=a.useState(!1),{onCopyInto:C,onMove:S}=e,I=e.readOnly===!0,_=e.copyable!==!1,A=a.useCallback(v=>{I||!Qe(v.dataTransfer.types)||(v.preventDefault(),v.dataTransfer.dropEffect=v.altKey&&_?"copy":"move",j(!0))},[I,_]),z=a.useCallback((v,L)=>{const B=n.find(u=>u.entry.path===v);B&&C({path:v,isDir:B.entry.type==="dir"},L)},[n,C]),W=a.useCallback(v=>{if(j(!1),I)return;const L=qe(v.dataTransfer);L!==null&&(v.preventDefault(),v.altKey&&_?z(L,Q):S(L,Q))},[z,S,I,_]),F=v=>t.jsx(gn,{row:v,selected:v.entry.path===s,renaming:v.entry.path===m,error:v.entry.type==="dir"&&v.expanded&&p.has(v.entry.path),onSelect:L=>i(L.path),onActivate:c,onRetry:()=>o(v.entry.path),onSubmitRename:e.onSubmitRename,onCancelRename:e.onCancelRename,onStartRename:e.onStartRename,onNewFile:e.onNewFile,onNewFolder:e.onNewFolder,onDelete:e.onDelete,onMove:e.onMove,onCopyInto:z,onCopy:e.onCopy,onPaste:e.onPaste,onDuplicate:e.onDuplicate,canPasteInto:e.canPasteInto,revealLabel:e.revealLabel,onReveal:e.onReveal,onAddToChat:e.onAddToChat,onCopyPath:e.onCopyPath,readOnly:e.readOnly,provenance:e.provenance,copyable:e.copyable,onDisk:e.onDisk,onUpload:e.onUpload,onPickUpload:e.onPickUpload});return t.jsx("div",{ref:g,role:"tree","aria-label":"File explorer",tabIndex:0,onKeyDown:D,onScroll:k,onDragOver:A,onDragLeave:()=>j(!1),onDrop:W,className:Oe("focus-visible:ring-ring/40 h-full overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-inset",x&&"ring-ring/60 bg-accent/30 ring-1 ring-inset"),children:M?t.jsx("div",{style:{height:R.getTotalSize()},className:"relative w-full",children:R.getVirtualItems().map(v=>t.jsx("div",{"data-row-index":v.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${v.start}px)`},children:F(n[v.index])},n[v.index].entry.path))}):n.map((v,L)=>t.jsx("div",{"data-row-index":L,children:F(v)},v.entry.path))})}function kn(e){return e?e.type==="dir"?e.path:G(e.path):Q}function jn(e,n){const{rows:s,selectedPath:m,renamingPath:p,onSelectPath:i}=e;return a.useCallback(o=>{var d,c,D,M;if(p!==null)return;const g=s.findIndex(R=>R.entry.path===m),r=g>=0?s[g]:void 0;if(o.metaKey||o.ctrlKey){if(e.readOnly===!0||e.copyable===!1)return;const R=o.key.toLowerCase();if(R==="c"&&r){o.preventDefault(),e.onCopy(r.entry);return}if(R==="v"){o.preventDefault(),e.onPaste(kn(r==null?void 0:r.entry));return}return}switch(o.key){case"ArrowDown":o.preventDefault(),i(((d=s[Math.min(g+1,s.length-1)])==null?void 0:d.entry.path)??((c=s[0])==null?void 0:c.entry.path));break;case"ArrowUp":o.preventDefault(),i(((D=s[Math.max(g-1,0)])==null?void 0:D.entry.path)??((M=s[0])==null?void 0:M.entry.path));break;case"ArrowRight":(r==null?void 0:r.entry.type)==="dir"&&!r.expanded&&(o.preventDefault(),e.onToggle(r.entry));break;case"ArrowLeft":if(!r)break;if(o.preventDefault(),r.entry.type==="dir"&&r.expanded)e.onToggle(r.entry);else{const R=G(r.entry.path);R&&i(R)}break;case"Enter":r&&(o.preventDefault(),n(r.entry));break;case"F2":r&&e.readOnly!==!0&&(o.preventDefault(),e.onStartRename(r.entry));break;case"Delete":case"Backspace":r&&e.readOnly!==!0&&(o.preventDefault(),e.onDelete(r.entry));break}},[s,m,p,i,e,n])}const En={rename:"Rename it anyway",move:"Move it anyway",delete:"Delete it anyway",upload:"Upload mine over it"},Dn={rename:"nothing was renamed",move:"nothing was moved",delete:"nothing was deleted",upload:"nothing was uploaded"};function Rn(e){const{entry:n,fileCount:s,moreThan:m}=e,p="The room’s history keeps a copy, so an agent or git can bring it back if you need it.";if(n.type!=="dir")return`“${n.name}” leaves the room’s files. ${p}`;const i=s===null?"everything in it":m?`the more than ${s.toLocaleString()} files in it`:s===1?"the 1 file in it":`the ${s.toLocaleString()} files in it`;return`“${n.name}” and ${i} leave the room’s files. ${p}`}function Nn({changes:e,onOpenTheirs:n,onReturnFocus:s}){var d;const m=c=>{c.preventDefault();const D=document.activeElement;D!==null&&D!==document.body||s()},{pendingDelete:p,pendingClash:i,conflict:o}=e,g=i===null?"":i.dir===Q?"The top folder":`“${i.dir}”`,r=(i==null?void 0:i.names.length)===1;return t.jsxs(t.Fragment,{children:[t.jsx(fe,{open:p!==null,onOpenChange:c=>!c&&e.cancelDelete(),children:t.jsxs(he,{onCloseAutoFocus:m,children:[t.jsxs(pe,{children:[t.jsx(me,{children:(p==null?void 0:p.entry.type)==="dir"?"Delete this folder?":"Delete this file?"}),t.jsx(xe,{children:p===null?"":Rn(p)})]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:e.cancelDelete,children:"Cancel"}),t.jsx(ve,{onClick:()=>void e.confirmDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:"Delete"})]})]})}),t.jsx(fe,{open:i!==null,onOpenChange:c=>!c&&e.cancelClash(),children:t.jsxs(he,{onCloseAutoFocus:m,children:[t.jsxs(pe,{children:[t.jsx(me,{children:r?`Replace “${i==null?void 0:i.names[0]}”?`:`Replace ${(i==null?void 0:i.names.length)??0} files?`}),t.jsx(xe,{children:r?`${g} already has a file with this name. Replace it with yours, or keep both and add yours under a new name.`:`${g} already has files with these names: ${(i==null?void 0:i.names.join(", "))??""}. Replace them with yours, or keep both and add yours under new names.`})]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:e.cancelClash,children:"Cancel"}),t.jsx(Y,{variant:"outline",onClick:()=>void e.resolveClash("keep-both"),children:"Keep both"}),t.jsx(ve,{onClick:()=>void e.resolveClash("replace"),children:"Replace"})]})]})}),t.jsx(fe,{open:o!==null,onOpenChange:c=>!c&&e.dismissConflict(),children:t.jsxs(he,{onCloseAutoFocus:m,children:[t.jsxs(pe,{children:[t.jsx(me,{children:"Somebody changed this first"}),t.jsx(xe,{children:o===null?"":`${((d=o.lastCommit)==null?void 0:d.author)??"Somebody"} changed “${o.path}” after you opened it, so ${Dn[o.kind]}.`})]}),(o==null?void 0:o.lastCommit)&&t.jsxs("p",{className:"text-muted-foreground text-xs",children:[o.lastCommit.subject," · ",Et(o.lastCommit.at)]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:e.dismissConflict,children:"Cancel"}),t.jsx(Y,{variant:"outline",onClick:()=>{o!==null&&(e.dismissConflict(),n(o.path))},children:"Open their version"}),t.jsx(ve,{onClick:()=>{o!==null&&(e.dismissConflict(),o.retry())},className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:o===null?"":En[o.kind]})]})]})})]})}function ze(e,n){return n.name===e?Ge(e):`There’s already “${n.name}” there, and a name that differs only in capital letters is the same ${n.type==="dir"?"folder":"file"} on some computers. Pick another name.`}const Sn="Folders can’t be uploaded whole. Open the folder and drop the files inside it.";function Tn({source:e,className:n,onCommands:s}={}){var de;const m=ne(),p=Te(l=>l.selectedCwd),i=a.useMemo(()=>p?mn({transport:m,cwd:p}):null,[m,p]),o=e===void 0?i:e,g=o!==null&&!o.writable,r=pn(o),d=r.changes,c=oe(),D=K(l=>l.showHidden),{rows:M,rootLoading:R,rootError:q,rootErrorMessage:b,rootErrorCommand:H,errorPaths:$}=r,k=K(l=>l.setCommands),h=K(l=>l.selectedPath),x=K(l=>l.setSelectedPath),j=K(l=>l.clipboard),[C,S]=a.useState(null),[I,_]=a.useState(null),[A,z]=a.useState(null),W=a.useCallback(l=>z(l===null?null:{path:l,isNew:!1}),[]),F=a.useRef(null),v=a.useRef(Q),[L,B]=a.useState(!1),u=a.useCallback((l,P)=>{if(d!==null){if(P.length===0){J.error(Sn);return}r.ensureExpanded(l),d.upload(l,P)}},[d,r]),f=a.useRef(null),T=a.useCallback(()=>{var l,P;(P=(l=f.current)==null?void 0:l.querySelector('[role="tree"]'))==null||P.focus()},[]),y=a.useCallback(l=>{var P;v.current=l,(P=F.current)==null||P.click()},[]),O=a.useCallback(l=>j!==null&&!(j.isDir&&Ce(l,j.path)),[j]),E=a.useCallback((l,P)=>{r.ensureExpanded(l),Ae.flushSync(()=>{_(null),S({parent:l,type:P})})},[r]),N=a.useCallback(l=>{Ae.flushSync(()=>_(l.path))},[]),w=a.useRef({startCreate:E,reload:r.reload,pickUpload:y});a.useEffect(()=>{w.current={startCreate:E,reload:r.reload,pickUpload:y}});const U=d!==null;a.useEffect(()=>{if(g||s===void 0&&U)return;const l=s??k;return l({newFile:()=>w.current.startCreate(Q,"file"),newFolder:()=>w.current.startCreate(Q,"dir"),refresh:()=>w.current.reload(),...U&&{upload:()=>w.current.pickUpload(Q)}}),()=>l(null)},[k,s,g,U]);const te=a.useCallback(async l=>{var se;if(!C||o===null)return;const P=C;if(S(null),d!==null){const re=(((se=c.getQueryData(le(o,P.parent,D)))==null?void 0:se.entries)??[]).find(ot=>ot.name.toLowerCase()===l.toLowerCase());if(P.type==="dir"){if(re!==void 0&&!(re.type==="dir"&&re.name===l)){J.error(ze(l,re));return}S({parent:ee(P.parent,l),type:"file",firstInFolder:l});return}if(re!==void 0){J.error(ze(l,re));return}const rt=ee(P.parent,l);z({path:rt,isNew:!0});return}await r.createEntry(P.parent,l,P.type)&&x(ee(P.parent,l))},[C,o,d,c,D,r,x]),V=a.useCallback(async(l,P)=>{_(null),(d?await d.renameEntry(l,P):await r.renameEntry(l,P))&&x(ee(G(l.path),P))},[d,r,x]);return o===null?e!==void 0?null:t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-6 text-center text-sm",children:"Select a working directory to browse its files."}):t.jsxs("div",{ref:f,className:Oe("flex h-full flex-col",L&&"ring-ring/60 bg-accent/30 ring-1 ring-inset",n),onDragOver:l=>{d===null||!we(l.dataTransfer.types)||(l.preventDefault(),l.dataTransfer.dropEffect="copy",B(!0))},onDragLeave:l=>{l.currentTarget.contains(l.relatedTarget)||B(!1)},onDrop:l=>{B(!1),!(d===null||!we(l.dataTransfer.types))&&(l.preventDefault(),u(Q,st(l.dataTransfer).files))},children:[d!==null&&t.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,"aria-hidden":!0,tabIndex:-1,"data-testid":"room-files-upload-input",onChange:l=>{const P=Array.from(l.target.files??[]);l.target.value="",u(v.current,P)}}),t.jsxs("div",{className:"min-h-0 flex-1",children:[C&&t.jsx(Fn,{type:C.type,firstInFolder:C.firstInFolder,onSubmit:l=>void te(l),onCancel:()=>S(null)},`${C.parent}:${C.type}:${C.firstInFolder??""}`),R&&M.length===0?t.jsx("div",{className:"flex h-20 items-center justify-center",children:t.jsx(Fe,{size:"md",className:"text-muted-foreground",label:"Loading files"})}):q&&M.length===0?t.jsxs("div",{className:"text-muted-foreground flex min-h-20 flex-col items-center justify-center gap-2 px-4 py-3 text-center text-xs [overflow-wrap:anywhere]",children:[t.jsx("span",{children:b??"Couldn’t load files."}),H!==null&&t.jsx("code",{"aria-label":"Command that removes the settings",className:"bg-muted text-foreground block w-full rounded px-2 py-1.5 text-left font-mono select-all",children:H}),t.jsxs(Y,{variant:"outline",size:"xs",onClick:r.reload,children:[t.jsx(Ke,{}),"Retry"]})]}):M.length===0&&!C?t.jsx("div",{className:"text-muted-foreground/60 flex h-20 items-center justify-center px-4 text-center text-xs",children:d!==null?"No files yet. Drop files here, or use Upload.":"Empty directory"}):t.jsx(wn,{rows:M,selectedPath:h,renamingPath:I,errorPaths:$,onSelectPath:x,onToggle:r.toggleExpand,onOpen:l=>{o.preview==="inline"?W(l.path):r.openFile(l)},onRetryDir:r.retryDir,onSubmitRename:(l,P)=>void V(l,P),onCancelRename:()=>_(null),onStartRename:N,onNewFile:l=>E(l,"file"),onNewFolder:l=>E(l,"dir"),onDelete:l=>d?d.requestDelete(l):void r.removeEntry(l),onMove:(l,P)=>void(d?d.moveEntry(l,P):r.moveEntry(l,P)),onCopyInto:(l,P)=>void r.copyEntry(l,P),onCopy:r.copyToClipboard,onPaste:l=>{j&&r.copyEntry(j,l)},onDuplicate:l=>void r.copyEntry({path:l.path,isDir:l.type==="dir"},G(l.path)),canPasteInto:O,readOnly:g,provenance:o.provenance,copyable:d===null,onDisk:o.cwd!==null,onUpload:d?u:void 0,onPickUpload:d?y:void 0,revealLabel:r.revealLabel,onReveal:l=>void r.reveal(l),onAddToChat:r.addToChat,onCopyPath:(l,P)=>void r.copyPath(l,P)})]}),o.preview==="inline"&&t.jsx(Zt,{source:o,path:(A==null?void 0:A.path)??null,isNew:(A==null?void 0:A.isNew)??!1,onCreated:()=>{A!==null&&(z({path:A.path,isNew:!1}),x(A.path))},onClose:()=>z(null)}),d!==null&&t.jsx(Nn,{changes:d,onOpenTheirs:l=>W(l),onReturnFocus:T}),t.jsx(fe,{open:r.pendingRecursiveDelete!==null,onOpenChange:l=>!l&&r.cancelRecursiveDelete(),children:t.jsxs(he,{children:[t.jsxs(pe,{children:[t.jsx(me,{children:"Delete this folder?"}),t.jsxs(xe,{children:["“",(de=r.pendingRecursiveDelete)==null?void 0:de.name,"” isn’t empty. Deleting it removes everything inside. This can’t be undone."]})]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:r.cancelRecursiveDelete,children:"Cancel"}),t.jsx(ve,{onClick:()=>void r.confirmRecursiveDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:"Delete"})]})]})})]})}function Fn({type:e,firstInFolder:n,onSubmit:s,onCancel:m}){const p=a.useRef(null),[i,o]=a.useState("");a.useEffect(()=>{var d;(d=p.current)==null||d.focus()},[]);const g=()=>{const d=i.trim();d?s(d):m()},r=t.jsxs("div",{className:"flex items-center gap-1",children:[e==="dir"?t.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(Ue,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),t.jsx("input",{ref:p,type:"text",value:i,"aria-label":n!==void 0?`First file in ${n}`:e==="dir"?"New folder name":"New file name",placeholder:e==="dir"?"folder-name":"file-name",onChange:d=>o(d.target.value),onBlur:g,onKeyDown:d=>{d.key==="Enter"?g():d.key==="Escape"&&m()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})]});return n===void 0?t.jsx("div",{className:"px-3 py-1",children:r}):t.jsxs("div",{className:"space-y-1 px-3 py-1",children:[t.jsxs("p",{className:"text-muted-foreground flex min-w-0 items-center gap-1 text-xs",children:[t.jsx(be,{className:"size-(--size-icon-xs) flex-shrink-0 text-sky-500"}),t.jsx("span",{className:"truncate",children:n})]}),r,t.jsx("p",{className:"text-muted-foreground text-2xs",children:"Name its first file. The folder appears when you save it."})]})}function at(){const e=K(m=>m.showHidden),n=K(m=>m.setShowHidden),s=e?"Hide hidden files":"Show hidden files";return t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":s,title:s,onClick:()=>n(!e),children:e?t.jsx(Dt,{className:"text-muted-foreground"}):t.jsx(Rt,{className:"text-muted-foreground"})})}function On({cwd:e}){const n=ne(),{data:s}=ce({queryKey:["file-explorer","workspace",e],queryFn:()=>n.resolveWorkspace(e),staleTime:6e4});return s!=null&&s.branch?t.jsxs("span",{className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",title:`Workspace ${s.key} on ${s.branch}`,children:[t.jsx(Be,{className:"size-3 flex-shrink-0"}),t.jsx("span",{className:"truncate",children:s.branch})]}):null}function In(){const e=Te(s=>s.selectedCwd),n=K(s=>s.commands);return e?t.jsxs(t.Fragment,{children:[t.jsx(On,{cwd:e}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New file",title:"New file",onClick:()=>n==null?void 0:n.newFile(),children:t.jsx(et,{className:"text-muted-foreground"})}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New folder",title:"New folder",onClick:()=>n==null?void 0:n.newFolder(),children:t.jsx(We,{className:"text-muted-foreground"})}),t.jsx(at,{}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"Refresh",title:"Refresh",onClick:()=>n==null?void 0:n.refresh(),children:t.jsx(Nt,{className:"text-muted-foreground"})})]}):null}function Pn({roomId:e}){const n=ne(),s=oe(),m=ce(Ye(n,e));a.useEffect(()=>Jt(s,e,()=>{s.invalidateQueries({queryKey:De.repoStatus(e)})}),[s,e]);const p=a.useMemo(()=>{var r;return((r=m.data)==null?void 0:r.kind)==="ok"?St(m.data.status):[]},[m.data]),i=Tt(p),o=Ft(p);if(!o)return null;const g=p.map((r,d)=>`${i[d]}: ${Ot(r)}`);return t.jsxs("span",{"data-slot":"pending-work-badge",title:g.join(`
|
|
16
|
+
*/const tt={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};tt.node;const nn=Se(tt);function le(e,n,s){return["file-explorer","tree",e.scopeKey,n,e.filtersHidden?s:null]}function ke(e,n,s,m){return{queryKey:le(e,n,s),queryFn:()=>e.list(n,{showHidden:s}),staleTime:Me.FILE_TREE_STALE_TIME_MS,gcTime:Me.FILE_TREE_GC_TIME_MS,placeholderData:p=>p??m.getQueryData(le(e,n,!s))}}const sn=[".git",".dork",".claude",".agents","node_modules"];function an(e){return e.startsWith(".")||sn.includes(e)}const Re=["ROOM.md","README.md"];function Ne(e){return Re.some(n=>n.toLowerCase()===e.toLowerCase())}function nt(e){return e.filter(n=>!an(n.name))}function rn(e){if(e.reduce((p,i)=>i.type==="file"&&Ne(i.name)?p+1:p,0)===0)return e;const s=[],m=[];for(const p of e)p.type==="file"&&Ne(p.name)?s.push(p):m.push(p);return s.sort((p,i)=>Re.findIndex(o=>o.toLowerCase()===p.name.toLowerCase())-Re.findIndex(o=>o.toLowerCase()===i.name.toLowerCase())),[...s,...m]}const on=/ copy(?: \d+)?$/;function Pe({name:e,isDir:n,taken:s}){const m=new Set(s);if(!m.has(e))return e;const p=n?-1:e.lastIndexOf("."),i=p>0,o=i?e.slice(p):"",g=(i?e.slice(0,p):e).replace(on,"");for(let r=1;;r+=1){const d=r===1?`${g} copy${o}`:`${g} copy ${r}${o}`;if(!m.has(d))return d}}function _e(e,n,s){return{name:n,path:e,type:s,size:0,mtime:Date.now(),isSymlink:!1}}function ln(e){const n=ne(),{source:s,showHidden:m,queryClient:p,inFlightRef:i}=e,o=s.cwd??"",[g,r]=a.useState(null),d=a.useCallback(async h=>{i.current+=1;try{return await h()}finally{i.current-=1}},[i]),c=a.useMemo(()=>{const h=x=>le(s,x,m);return{getChildren:x=>{var j;return((j=p.getQueryData(h(x)))==null?void 0:j.entries)??[]},isLoaded:x=>p.getQueryData(h(x))!==void 0,takenNames:async x=>(await n.readFileTree(o,{path:x===Q?void 0:x,showHidden:!0})).entries.map(C=>C.name),snapshot:x=>p.getQueryData(h(x)),setChildren:(x,j)=>{p.setQueryData(h(x),C=>({entries:Ie(j((C==null?void 0:C.entries)??[]))}))},restore:(x,j)=>{p.setQueryData(h(x),j)},invalidate:x=>{p.invalidateQueries({queryKey:h(x),exact:!0})}}},[p,n,o,s,m]),D=a.useCallback((h,x,j)=>d(async()=>{const C=ee(h,x),S=!c.getChildren(h).some(_=>_.path===C),I=c.snapshot(h);S&&c.setChildren(h,_=>[..._,_e(C,x,j)]);try{return await n.createEntry(o,C,j),!0}catch(_){return S&&c.restore(h,I),ae(_,`Couldn’t create ${j==="dir"?"folder":"file"}`),!1}finally{c.invalidate(h)}}),[n,o,c,d]),M=a.useCallback((h,x)=>d(async()=>{if(x===h.name||x.length===0)return!0;const j=G(h.path),C=ee(j,x),S=c.getChildren(j).some(A=>A.path===C),I=c.snapshot(j),_={...h,name:x,path:C};S||c.setChildren(j,A=>A.map(z=>z.path===h.path?_:z));try{return await n.renameEntry(o,h.path,C),K.getState().remapExpandedPaths(h.path,C),!0}catch(A){return S||c.restore(j,I),ae(A,"Couldn’t rename"),!1}finally{c.invalidate(j)}}),[n,o,c,d]),R=a.useCallback(h=>d(async()=>{const x=G(h.path),j=c.snapshot(x);c.setChildren(x,C=>C.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path,{recursive:!0}),K.getState().dropExpandedPaths(h.path)}catch(C){c.restore(x,j),ae(C,"Couldn’t delete")}finally{c.invalidate(x)}}),[n,o,c,d]),q=a.useCallback(h=>d(async()=>{const x=G(h.path);if(h.type==="file"){const j=c.snapshot(x);c.setChildren(x,C=>C.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path),K.getState().dropExpandedPaths(h.path)}catch(C){c.restore(x,j),ae(C,"Couldn’t delete")}finally{c.invalidate(x)}return}try{await n.deleteEntry(o,h.path),c.setChildren(x,j=>j.filter(C=>C.path!==h.path)),K.getState().dropExpandedPaths(h.path),c.invalidate(x)}catch(j){if(Yt(j)==="DIR_NOT_EMPTY"){r(h);return}ae(j,"Couldn’t delete")}}),[n,o,c,d]),b=a.useCallback(async()=>{const h=g;r(null),h&&await R(h)},[g,R]),H=a.useCallback(()=>r(null),[]),$=a.useCallback((h,x)=>d(async()=>{const j=G(h),C=ie(h),S=ee(x,C);if(x===j||S===h||Ce(x,h))return;const I=c.getChildren(j).find(v=>v.path===h);if(!I)return;const _=c.isLoaded(x),A=_&&c.getChildren(x).some(v=>v.path===S),z={...I,name:C,path:S},W=c.snapshot(j),F=_?c.snapshot(x):void 0;c.setChildren(j,v=>v.filter(L=>L.path!==h)),_&&!A&&c.setChildren(x,v=>[...v,z]);try{await n.renameEntry(o,h,S),K.getState().remapExpandedPaths(h,S)}catch(v){c.restore(j,W),_&&!A&&c.restore(x,F),ae(v,"Couldn’t move")}finally{c.invalidate(j),_&&c.invalidate(x)}}),[n,o,c,d]),k=a.useCallback((h,x)=>d(async()=>{if(h.isDir&&Ce(x,h.path)){J.error(Gt);return}let j;try{j=await c.takenNames(x)}catch(A){ae(A,"Couldn’t copy");return}const C=Pe({name:ie(h.path),isDir:h.isDir,taken:j}),S=ee(x,C),I=c.isLoaded(x),_=I?c.snapshot(x):void 0;if(I){const A=c.getChildren(G(h.path)).find(W=>W.path===h.path),z=A?{...A,name:C,path:S}:_e(S,C,h.isDir?"dir":"file");c.setChildren(x,W=>[...W,z])}try{await n.copyEntry(o,h.path,S)}catch(A){I&&c.restore(x,_),ae(A,"Couldn’t copy")}finally{c.invalidate(x)}}),[n,o,c,d]);return{createEntry:D,renameEntry:M,removeEntry:q,moveEntry:$,copyEntry:k,pendingRecursiveDelete:g,confirmRecursiveDelete:b,cancelRecursiveDelete:H}}function cn(e){return e!=null&&e.startsWith("darwin")?"Reveal in Finder":e!=null&&e.startsWith("win32")?"Reveal in File Explorer":"Show in File Manager"}function dn(e,n){const s=e.includes("\\")&&!e.includes("/"),m=e.replace(/[\\/]+$/,""),p=s?n.split("/").join("\\"):n;return`${m}${s?"\\":"/"}${p}`}function un(e){const n=ne(),{data:s}=it(),m=a.useMemo(()=>n.supportsReveal?cn(s==null?void 0:s.platform):null,[n.supportsReveal,s==null?void 0:s.platform]),p=a.useCallback(async d=>{if(e)try{await n.revealEntry(e,d.path)}catch(c){ae(c,"Couldn’t open the file manager")}},[n,e]),{copy:i}=lt(),o=a.useCallback(async(d,c)=>{const D=c==="absolute"&&e?dn(e,d.path):d.path;await i(D)||J.error("Couldn’t copy to the clipboard")},[e,i]),g=a.useCallback(d=>{ct(dt(d.path))||J.error("Open a chat first to add a file to it")},[]),r=a.useCallback(d=>{K.getState().setClipboard({path:d.path,isDir:d.type==="dir"});try{navigator.clipboard.writeText(d.path).catch(()=>{})}catch{}},[]);return{revealLabel:m,reveal:p,copyPath:o,addToChat:g,copyToClipboard:r}}const fn=1e3;function hn(e){const{source:n,showHidden:s,queryClient:m,inFlightRef:p}=e,i=n.changes,[o,g]=a.useState(null),[r,d]=a.useState(null),[c,D]=a.useState(null),[M,R]=a.useState(0),q=a.useCallback(async u=>{p.current+=1,R(f=>f+1);try{return await u()}finally{p.current-=1,R(f=>f-1)}},[p]),b=a.useMemo(()=>{const u=f=>le(n,f,s);return{listing:f=>m.getQueryData(u(f)),isLoaded:f=>m.getQueryData(u(f))!==void 0,entries:f=>{var T;return((T=m.getQueryData(u(f)))==null?void 0:T.entries)??[]},setEntries:(f,T)=>m.setQueryData(u(f),y=>({...y,entries:Ie(T((y==null?void 0:y.entries)??[]))})),restore:(f,T)=>m.setQueryData(u(f),T),fetch:f=>n.list(f,{showHidden:!0}),refreshAll:()=>{m.invalidateQueries({queryKey:["file-explorer","tree",n.scopeKey]}),m.invalidateQueries({queryKey:["file-explorer","preview",n.scopeKey]})}}},[m,n,s]),H=a.useCallback(async u=>{const f=b.listing(u);return(f==null?void 0:f.commit)!==void 0?f.commit:(await b.fetch(u)).commit??null},[b]),$=a.useCallback((u,f,T,y)=>{switch(u.status){case"changed":return!0;case"conflict":return D({kind:f,path:u.path,lastCommit:u.lastCommit,retry:()=>T(u.commit)}),!1;case"exists":return J.error(y===void 0?u.reason:Ge(y)),!1;case"refused":return J.error(u.reason),!1}},[]),k=a.useCallback((u,f)=>{J.error(Ve(u)??f)},[]),h=a.useCallback((u,f,T)=>{const y=O=>q(async()=>{if(i===void 0)return!1;const E=G(u.path),N=G(f),w=ie(f),U=b.isLoaded(N),te=U&&b.entries(N).some(X=>X.path===f),V=b.listing(E),de=N===E?void 0:b.listing(N),l={...u,name:w,path:f};te||(N===E?b.setEntries(E,X=>X.map(se=>se.path===u.path?l:se)):(b.setEntries(E,X=>X.filter(se=>se.path!==u.path)),U&&b.setEntries(N,X=>[...X,l])));const P=()=>{b.restore(E,V),N!==E&&U&&b.restore(N,de)};try{const X=O??await H(E);if(X===null)return P(),J.error("There’s nothing in this room’s files to change yet."),!1;const se=await i.move({from:u.path,to:f,baseCommit:X}),je=$(se,T,async re=>{await y(re)},w);return je?K.getState().remapExpandedPaths(u.path,f):P(),je}catch(X){return P(),k(X,T==="rename"?"Couldn’t rename":"Couldn’t move"),!1}finally{b.refreshAll()}});return y(null)},[i,b,q,H,$,k]),x=a.useCallback(async(u,f)=>f===u.name||f.length===0?!0:h(u,ee(G(u.path),f),"rename"),[h]),j=a.useCallback(async(u,f)=>{const T=G(u),y=ee(f,ie(u));if(f===T||y===u||Ce(f,u))return;const O=b.entries(T).find(E=>E.path===u);O&&await h(O,y,"move")},[b,h]),C=a.useCallback(async u=>{let f=0;const T=[u];for(;T.length>0;){const y=T.shift(),O=await b.fetch(y);for(const E of O.entries)if(E.type==="dir"?T.push(E.path):f+=1,f>=fn)return{count:f,moreThan:!0}}return{count:f,moreThan:!1}},[b]),S=a.useCallback(u=>{if(u.type!=="dir"){g({entry:u,fileCount:1,moreThan:!1});return}g({entry:u,fileCount:null,moreThan:!1}),C(u.path).then(({count:f,moreThan:T})=>g(y=>(y==null?void 0:y.entry.path)===u.path?{entry:u,fileCount:f,moreThan:T}:y),()=>{})},[C]),I=a.useCallback(u=>{const f=T=>q(async()=>{if(i===void 0)return;const y=G(u.path),O=b.listing(y);b.setEntries(y,E=>E.filter(N=>N.path!==u.path));try{const E=T??await H(y);if(E===null){b.restore(y,O);return}const N=await i.remove({path:u.path,baseCommit:E});$(N,"delete",U=>f(U))?K.getState().dropExpandedPaths(u.path):b.restore(y,O)}catch(E){b.restore(y,O),k(E,"Couldn’t delete")}finally{b.refreshAll()}});return f(null)},[i,b,q,H,$,k]),_=a.useCallback(async()=>{const u=o;g(null),u&&await I(u.entry)},[o,I]),A=a.useCallback(()=>g(null),[]),z=a.useCallback((u,f,T,y)=>{const O=E=>q(async()=>{if(i===void 0)return;const N=b.isLoaded(u),w=N?b.listing(u):void 0;if(N){const U=new Set(b.entries(u).map(V=>V.name)),te=f.filter(V=>!U.has(V.name)).map(V=>({name:V.name,path:ee(u,V.name),type:"file",size:V.size}));te.length>0&&b.setEntries(u,V=>[...V,...te])}try{const U=await i.upload({dir:u,baseCommit:E,replace:T,files:f});!$(U,"upload",V=>O(V))&&N&&b.restore(u,w)}catch(U){N&&b.restore(u,w),k(U,"Couldn’t upload")}finally{b.refreshAll()}});return O(y)},[i,b,q,$,k]),W=a.useCallback(async(u,f)=>{if(i===void 0||f.length===0)return;if(f.length>i.maxUploadFiles){J.error(`One upload can carry up to ${i.maxUploadFiles} files, so nothing was uploaded. Try again with fewer.`);return}let T;try{T=await b.fetch(u)}catch(w){k(w,"Couldn’t upload");return}const y=T.entries.map(w=>w.name),O=new Set(y),E=f.map(w=>w.name).filter(w=>O.has(w)),N=T.commit??null;if(E.length===0){await z(u,f,[],N);return}d({dir:u,files:f,names:E,taken:y,baseCommit:N})},[i,b,k,z]),F=a.useCallback(async u=>{const f=r;if(d(null),f===null)return;if(u==="replace"){await z(f.dir,f.files,f.names,f.baseCommit);return}const T=new Set([...f.taken,...f.files.map(E=>E.name)]),y=new Set(f.names),O=f.files.map(E=>{if(!y.has(E.name))return E;const N=Pe({name:E.name,isDir:!1,taken:T});return T.add(N),new File([E],N,{type:E.type,lastModified:E.lastModified})});await z(f.dir,O,[],f.baseCommit)},[r,z]),v=a.useCallback(()=>d(null),[]),L=a.useCallback(()=>D(null),[]),B=a.useMemo(()=>r===null?null:{dir:r.dir,names:r.names},[r]);return{renameEntry:x,moveEntry:j,requestDelete:S,pendingDelete:o,confirmDelete:_,cancelDelete:A,upload:W,pendingClash:B,resolveClash:F,cancelClash:v,conflict:c,dismissConflict:L,busy:M>0}}const Le={scopeKey:"",cwd:null,writable:!1,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list:()=>Promise.resolve({entries:[]})};function pn(e){var u,f,T;const n=ne(),s=oe(),{setTheme:m}=ut(),p=K(y=>y.showHidden),i=K(y=>y.expanded),o=K(y=>y.loadExplorerForCwd),g=K(y=>y.pruneMissing),r=(e==null?void 0:e.scopeKey)??null,d=(e==null?void 0:e.cwd)??null;a.useEffect(()=>{o(r)},[r,o]);const c=a.useMemo(()=>[Q,...ft(i)],[i]),D=ht({queries:e?c.map(y=>ke(e,y,p,s)):[]}),M=(e==null?void 0:e.filtersHidden)??!0,R=a.useMemo(()=>{const y={};return c.forEach((O,E)=>{var U;const N=D[E];let w=((U=N==null?void 0:N.data)==null?void 0:U.entries)??[];!p&&!M&&(w=nt(w)),O===Q&&(w=rn(w)),y[O]={entries:w,loading:(N==null?void 0:N.isLoading)??!1,error:(N==null?void 0:N.isError)??!1}}),y},[c,D,p,M]),q=a.useRef(0),b=a.useRef({});a.useEffect(()=>{q.current>0||c.forEach((y,O)=>{var N,w,U;const E=(w=(N=D[O])==null?void 0:N.data)==null?void 0:w.entries;!E||(U=D[O])!=null&&U.isError||b.current[y]!==E&&(b.current[y]=E,g(y,E.map(te=>te.name)))})},[c,D,g]);const H=a.useMemo(()=>pt(i,R),[i,R]),$=!!e&&!!((u=R[Q])!=null&&u.loading),k=!!e&&!!((f=R[Q])!=null&&f.error),h=(T=D[0])==null?void 0:T.error,x=k&&h?Vt(h):void 0,j=(x==null?void 0:x.message)??null,C=(x==null?void 0:x.command)??null,S=a.useMemo(()=>{var O;const y=new Set;for(const E of c)E!==Q&&((O=R[E])!=null&&O.error)&&y.add(E);return y},[c,R]),I=a.useCallback(y=>{if(y.type!=="dir")return;const O=K.getState();O.setDirExpanded(y.path,!O.expanded[y.path])},[]),_=a.useCallback(y=>{if(y===Q)return;const O=K.getState();O.expanded[y]||O.setDirExpanded(y,!0)},[]),A=(e==null?void 0:e.preview)==="canvas",z=a.useCallback(y=>{if(y.type!=="file"||!A)return;const O={getStore:Te.getState,setTheme:m,supportsTerminal:n.supportsTerminal};mt(O,{action:"open_file",sourcePath:y.path},"user")},[A,m,n]),W=a.useCallback(()=>{r!==null&&s.invalidateQueries({queryKey:["file-explorer","tree",r]})},[s,r]),F=a.useCallback(y=>{e!==null&&s.invalidateQueries({queryKey:le(e,y,p),exact:!0})},[s,e,p]);a.useEffect(()=>{if(e!=null&&e.events)return e.events(W)},[e,W]);const v=ln({source:e??Le,showHidden:p,queryClient:s,inFlightRef:q}),L=hn({source:e??Le,showHidden:p,queryClient:s,inFlightRef:q}),B=un(d);return{rows:H,rootLoading:$,rootError:k,rootErrorMessage:j,rootErrorCommand:C,errorPaths:S,toggleExpand:I,ensureExpanded:_,openFile:z,reload:W,retryDir:F,changes:e!=null&&e.changes?L:null,...v,...B}}function mn(e){const{transport:n,cwd:s}=e;return{scopeKey:s,cwd:s,writable:!0,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list(m,p){return n.readFileTree(s,{path:m===""?void 0:m,showHidden:p.showHidden})}}}function we(e){return Array.from(e).includes("Files")}function st(e){const n=Array.from(e.items??[]);if(!(n.length>0&&n.every(i=>"webkitGetAsEntry"in i)))return{files:Array.from(e.files??[]),folders:0};const m=[];let p=0;for(const i of n){if(i.kind!=="file")continue;const o=i.webkitGetAsEntry();if(o!=null&&o.isDirectory){p+=1;continue}const g=i.getAsFile();g&&m.push(g)}return{files:m,folders:p}}const xn=12;function gn({row:e,selected:n,renaming:s,error:m,onSelect:p,onActivate:i,onRetry:o,onSubmitRename:g,onCancelRename:r,onNewFile:d,onNewFolder:c,onStartRename:D,onDelete:M,onMove:R,onCopyInto:q,onCopy:b,onPaste:H,onDuplicate:$,canPasteInto:k,revealLabel:h,onReveal:x,onAddToChat:j,onCopyPath:C,readOnly:S=!1,provenance:I=!1,copyable:_=!0,onDisk:A=!0,onUpload:z,onPickUpload:W}){const{entry:F,depth:v,expanded:L,loading:B}=e,u=F.type==="dir",f=u?F.path:G(F.path),[T,y]=a.useState(!1),O=!u&&v===0&&Ne(F.name),E=Xt(F.lastCommit),N=t.jsxs("div",{role:"treeitem","aria-label":F.name,"aria-expanded":u?L:void 0,"aria-selected":n,tabIndex:-1,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),p(F),i(F))},draggable:!s&&!S,onDragStart:w=>{S||(w.dataTransfer.setData("text/plain",F.path),w.dataTransfer.setData(Ct,F.path),w.dataTransfer.effectAllowed="copyMove")},onDragOver:w=>{if(w.stopPropagation(),!S&&z&&we(w.dataTransfer.types)){w.preventDefault(),w.dataTransfer.dropEffect="copy",y(!0);return}S||!u||!Qe(w.dataTransfer.types)||(w.preventDefault(),w.dataTransfer.dropEffect=w.altKey&&_?"copy":"move",y(!0))},onDragLeave:()=>y(!1),onDrop:w=>{if(w.stopPropagation(),S)return;if(y(!1),z&&we(w.dataTransfer.types)){w.preventDefault();const{files:te}=st(w.dataTransfer);z(f,te);return}if(!u)return;const U=qe(w.dataTransfer);U!==null&&(w.preventDefault(),w.altKey&&_?q(U,F.path):R(U,F.path))},onClick:()=>{p(F),i(F)},className:Oe("flex w-full cursor-pointer items-center gap-1 py-1 pr-2 text-sm transition-colors",n?"bg-accent text-foreground":"hover:bg-accent/50",T&&"ring-ring/60 bg-accent ring-1"),style:{paddingLeft:v*xn+8},children:[t.jsx("span",{className:"flex size-4 flex-shrink-0 items-center justify-center",children:u&&(B?t.jsx(Fe,{size:"xs",className:"text-muted-foreground"}):m?t.jsx("button",{type:"button","aria-label":"Retry loading",title:"Couldn’t load. Retry",onClick:w=>{w.stopPropagation(),o()},className:"flex items-center justify-center",children:t.jsx(Ke,{className:"text-destructive size-3.5"})}):L?t.jsx(xt,{className:"text-muted-foreground size-3.5"}):t.jsx(He,{className:"text-muted-foreground size-3.5"}))}),u?L?t.jsx(gt,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):F.isSymlink===!0?t.jsx(yt,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}):t.jsx(Ue,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),s?t.jsx(yn,{initialName:F.name,onSubmit:w=>g(F,w),onCancel:r}):t.jsx("span",{className:"min-w-0 flex-1 truncate",children:F.name}),O&&!s&&t.jsx(vt,{"aria-label":"Pinned to the top",className:"text-muted-foreground/60 size-3 flex-shrink-0"}),I&&!s&&t.jsx("span",{className:"text-muted-foreground/70 text-2xs max-w-[45%] flex-shrink-0 truncate tabular-nums",title:E.title??void 0,children:E.label})]});return S?N:t.jsxs(bt,{children:[t.jsx(wt,{asChild:!0,children:N}),t.jsxs(kt,{className:"w-52",children:[t.jsx(Z,{movesFocus:!0,onClick:()=>d(f),children:"New file"}),t.jsx(Z,{movesFocus:!0,onClick:()=>c(f),children:"New folder"}),W&&t.jsx(Z,{onClick:()=>W(f),children:"Upload files…"}),A&&t.jsxs(t.Fragment,{children:[t.jsx(ue,{}),h&&t.jsx(Z,{onClick:()=>x(F),children:h}),t.jsx(Z,{movesFocus:!0,onClick:()=>j(F),children:"Add to chat"})]}),_&&t.jsxs(t.Fragment,{children:[t.jsx(ue,{}),t.jsx(Z,{onClick:()=>b(F),children:"Copy"}),t.jsx(Z,{disabled:!k(f),onClick:()=>H(f),children:"Paste"}),t.jsx(Z,{onClick:()=>$(F),children:"Duplicate"})]}),t.jsx(ue,{}),A?t.jsxs(t.Fragment,{children:[t.jsx(Z,{onClick:()=>C(F,"absolute"),children:"Copy path"}),t.jsx(Z,{onClick:()=>C(F,"relative"),children:"Copy relative path"})]}):t.jsx(Z,{onClick:()=>C(F,"relative"),children:"Copy path"}),t.jsx(ue,{}),t.jsx(Z,{movesFocus:!0,onClick:()=>D(F),children:"Rename"}),t.jsx(Z,{variant:"destructive",onClick:()=>M(F),children:"Delete"})]})]})}function yn({initialName:e,onSubmit:n,onCancel:s}){const m=a.useRef(null),[p,i]=a.useState(e);a.useEffect(()=>{const g=m.current;if(!g)return;g.focus();const r=e.lastIndexOf(".");g.setSelectionRange(0,r>0?r:e.length)},[e]);const o=()=>{const g=p.trim();g&&g!==e?n(g):s()};return t.jsx("input",{ref:m,type:"text",value:p,"aria-label":"New name",onChange:g=>i(g.target.value),onClick:g=>g.stopPropagation(),onBlur:o,onKeyDown:g=>{g.stopPropagation(),g.key==="Enter"?o():g.key==="Escape"&&s()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})}const vn=100,Cn=28,bn=250;function wn(e){const{rows:n,selectedPath:s,renamingPath:m,errorPaths:p,onSelectPath:i,onRetryDir:o}=e,g=a.useRef(null),r=K(v=>v.setScrollTop),d=K(v=>v.scopeKey),c=a.useCallback(v=>v.type==="dir"?e.onToggle(v):e.onOpen(v),[e]),D=jn(e,c),M=n.length>vn,R=jt({count:n.length,getScrollElement:()=>g.current,estimateSize:()=>Cn,overscan:12,enabled:M}),q=a.useRef({scope:void 0,done:!1}),b=a.useRef(null);a.useLayoutEffect(()=>{const v=q.current;if(v.scope!==d&&(v.scope=d,v.done=!1),v.done||n.length===0)return;const L=g.current;if(!L)return;const B=K.getState().scrollTop;if(B<=0){v.done=!0;return}M?R.scrollToOffset(B):L.scrollTop=B,b.current=L.scrollTop,L.scrollTop>=B&&(v.done=!0)},[n.length,d,M,R]);const H=a.useRef(null),$=a.useRef(null),k=a.useCallback(()=>{const v=g.current;v&&v.scrollTop!==b.current&&(q.current.done=!0,H.current=v.scrollTop,$.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,H.current!==null&&r(H.current)},bn))},[r]);a.useEffect(()=>()=>{$.current&&clearTimeout($.current),H.current!==null&&r(H.current)},[r]);const h=a.useRef(void 0);a.useEffect(()=>{var u,f;const v=h.current;if(h.current=s,v===void 0||s===v||s===null)return;const L=n.findIndex(T=>T.entry.path===s);if(L<0)return;const B=g.current;B&&(M?R.scrollToIndex(L,{align:"auto"}):(f=(u=B.querySelector(`[data-row-index="${L}"]`))==null?void 0:u.scrollIntoView)==null||f.call(u,{block:"nearest"}),b.current=B.scrollTop)},[s,n,M,R]);const[x,j]=a.useState(!1),{onCopyInto:C,onMove:S}=e,I=e.readOnly===!0,_=e.copyable!==!1,A=a.useCallback(v=>{I||!Qe(v.dataTransfer.types)||(v.preventDefault(),v.dataTransfer.dropEffect=v.altKey&&_?"copy":"move",j(!0))},[I,_]),z=a.useCallback((v,L)=>{const B=n.find(u=>u.entry.path===v);B&&C({path:v,isDir:B.entry.type==="dir"},L)},[n,C]),W=a.useCallback(v=>{if(j(!1),I)return;const L=qe(v.dataTransfer);L!==null&&(v.preventDefault(),v.altKey&&_?z(L,Q):S(L,Q))},[z,S,I,_]),F=v=>t.jsx(gn,{row:v,selected:v.entry.path===s,renaming:v.entry.path===m,error:v.entry.type==="dir"&&v.expanded&&p.has(v.entry.path),onSelect:L=>i(L.path),onActivate:c,onRetry:()=>o(v.entry.path),onSubmitRename:e.onSubmitRename,onCancelRename:e.onCancelRename,onStartRename:e.onStartRename,onNewFile:e.onNewFile,onNewFolder:e.onNewFolder,onDelete:e.onDelete,onMove:e.onMove,onCopyInto:z,onCopy:e.onCopy,onPaste:e.onPaste,onDuplicate:e.onDuplicate,canPasteInto:e.canPasteInto,revealLabel:e.revealLabel,onReveal:e.onReveal,onAddToChat:e.onAddToChat,onCopyPath:e.onCopyPath,readOnly:e.readOnly,provenance:e.provenance,copyable:e.copyable,onDisk:e.onDisk,onUpload:e.onUpload,onPickUpload:e.onPickUpload});return t.jsx("div",{ref:g,role:"tree","aria-label":"File explorer",tabIndex:0,onKeyDown:D,onScroll:k,onDragOver:A,onDragLeave:()=>j(!1),onDrop:W,className:Oe("focus-visible:ring-ring h-full overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-inset",x&&"ring-ring/60 bg-accent/30 ring-1 ring-inset"),children:M?t.jsx("div",{style:{height:R.getTotalSize()},className:"relative w-full",children:R.getVirtualItems().map(v=>t.jsx("div",{"data-row-index":v.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${v.start}px)`},children:F(n[v.index])},n[v.index].entry.path))}):n.map((v,L)=>t.jsx("div",{"data-row-index":L,children:F(v)},v.entry.path))})}function kn(e){return e?e.type==="dir"?e.path:G(e.path):Q}function jn(e,n){const{rows:s,selectedPath:m,renamingPath:p,onSelectPath:i}=e;return a.useCallback(o=>{var d,c,D,M;if(p!==null)return;const g=s.findIndex(R=>R.entry.path===m),r=g>=0?s[g]:void 0;if(o.metaKey||o.ctrlKey){if(e.readOnly===!0||e.copyable===!1)return;const R=o.key.toLowerCase();if(R==="c"&&r){o.preventDefault(),e.onCopy(r.entry);return}if(R==="v"){o.preventDefault(),e.onPaste(kn(r==null?void 0:r.entry));return}return}switch(o.key){case"ArrowDown":o.preventDefault(),i(((d=s[Math.min(g+1,s.length-1)])==null?void 0:d.entry.path)??((c=s[0])==null?void 0:c.entry.path));break;case"ArrowUp":o.preventDefault(),i(((D=s[Math.max(g-1,0)])==null?void 0:D.entry.path)??((M=s[0])==null?void 0:M.entry.path));break;case"ArrowRight":(r==null?void 0:r.entry.type)==="dir"&&!r.expanded&&(o.preventDefault(),e.onToggle(r.entry));break;case"ArrowLeft":if(!r)break;if(o.preventDefault(),r.entry.type==="dir"&&r.expanded)e.onToggle(r.entry);else{const R=G(r.entry.path);R&&i(R)}break;case"Enter":r&&(o.preventDefault(),n(r.entry));break;case"F2":r&&e.readOnly!==!0&&(o.preventDefault(),e.onStartRename(r.entry));break;case"Delete":case"Backspace":r&&e.readOnly!==!0&&(o.preventDefault(),e.onDelete(r.entry));break}},[s,m,p,i,e,n])}const En={rename:"Rename it anyway",move:"Move it anyway",delete:"Delete it anyway",upload:"Upload mine over it"},Dn={rename:"nothing was renamed",move:"nothing was moved",delete:"nothing was deleted",upload:"nothing was uploaded"};function Rn(e){const{entry:n,fileCount:s,moreThan:m}=e,p="The room’s history keeps a copy, so an agent or git can bring it back if you need it.";if(n.type!=="dir")return`“${n.name}” leaves the room’s files. ${p}`;const i=s===null?"everything in it":m?`the more than ${s.toLocaleString()} files in it`:s===1?"the 1 file in it":`the ${s.toLocaleString()} files in it`;return`“${n.name}” and ${i} leave the room’s files. ${p}`}function Nn({changes:e,onOpenTheirs:n,onReturnFocus:s}){var d;const m=c=>{c.preventDefault();const D=document.activeElement;D!==null&&D!==document.body||s()},{pendingDelete:p,pendingClash:i,conflict:o}=e,g=i===null?"":i.dir===Q?"The top folder":`“${i.dir}”`,r=(i==null?void 0:i.names.length)===1;return t.jsxs(t.Fragment,{children:[t.jsx(fe,{open:p!==null,onOpenChange:c=>!c&&e.cancelDelete(),children:t.jsxs(he,{onCloseAutoFocus:m,children:[t.jsxs(pe,{children:[t.jsx(me,{children:(p==null?void 0:p.entry.type)==="dir"?"Delete this folder?":"Delete this file?"}),t.jsx(xe,{children:p===null?"":Rn(p)})]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:e.cancelDelete,children:"Cancel"}),t.jsx(ve,{onClick:()=>void e.confirmDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:"Delete"})]})]})}),t.jsx(fe,{open:i!==null,onOpenChange:c=>!c&&e.cancelClash(),children:t.jsxs(he,{onCloseAutoFocus:m,children:[t.jsxs(pe,{children:[t.jsx(me,{children:r?`Replace “${i==null?void 0:i.names[0]}”?`:`Replace ${(i==null?void 0:i.names.length)??0} files?`}),t.jsx(xe,{children:r?`${g} already has a file with this name. Replace it with yours, or keep both and add yours under a new name.`:`${g} already has files with these names: ${(i==null?void 0:i.names.join(", "))??""}. Replace them with yours, or keep both and add yours under new names.`})]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:e.cancelClash,children:"Cancel"}),t.jsx(Y,{variant:"outline",onClick:()=>void e.resolveClash("keep-both"),children:"Keep both"}),t.jsx(ve,{onClick:()=>void e.resolveClash("replace"),children:"Replace"})]})]})}),t.jsx(fe,{open:o!==null,onOpenChange:c=>!c&&e.dismissConflict(),children:t.jsxs(he,{onCloseAutoFocus:m,children:[t.jsxs(pe,{children:[t.jsx(me,{children:"Somebody changed this first"}),t.jsx(xe,{children:o===null?"":`${((d=o.lastCommit)==null?void 0:d.author)??"Somebody"} changed “${o.path}” after you opened it, so ${Dn[o.kind]}.`})]}),(o==null?void 0:o.lastCommit)&&t.jsxs("p",{className:"text-muted-foreground text-xs",children:[o.lastCommit.subject," · ",Et(o.lastCommit.at)]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:e.dismissConflict,children:"Cancel"}),t.jsx(Y,{variant:"outline",onClick:()=>{o!==null&&(e.dismissConflict(),n(o.path))},children:"Open their version"}),t.jsx(ve,{onClick:()=>{o!==null&&(e.dismissConflict(),o.retry())},className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:o===null?"":En[o.kind]})]})]})})]})}function ze(e,n){return n.name===e?Ge(e):`There’s already “${n.name}” there, and a name that differs only in capital letters is the same ${n.type==="dir"?"folder":"file"} on some computers. Pick another name.`}const Sn="Folders can’t be uploaded whole. Open the folder and drop the files inside it.";function Tn({source:e,className:n,onCommands:s}={}){var de;const m=ne(),p=Te(l=>l.selectedCwd),i=a.useMemo(()=>p?mn({transport:m,cwd:p}):null,[m,p]),o=e===void 0?i:e,g=o!==null&&!o.writable,r=pn(o),d=r.changes,c=oe(),D=K(l=>l.showHidden),{rows:M,rootLoading:R,rootError:q,rootErrorMessage:b,rootErrorCommand:H,errorPaths:$}=r,k=K(l=>l.setCommands),h=K(l=>l.selectedPath),x=K(l=>l.setSelectedPath),j=K(l=>l.clipboard),[C,S]=a.useState(null),[I,_]=a.useState(null),[A,z]=a.useState(null),W=a.useCallback(l=>z(l===null?null:{path:l,isNew:!1}),[]),F=a.useRef(null),v=a.useRef(Q),[L,B]=a.useState(!1),u=a.useCallback((l,P)=>{if(d!==null){if(P.length===0){J.error(Sn);return}r.ensureExpanded(l),d.upload(l,P)}},[d,r]),f=a.useRef(null),T=a.useCallback(()=>{var l,P;(P=(l=f.current)==null?void 0:l.querySelector('[role="tree"]'))==null||P.focus()},[]),y=a.useCallback(l=>{var P;v.current=l,(P=F.current)==null||P.click()},[]),O=a.useCallback(l=>j!==null&&!(j.isDir&&Ce(l,j.path)),[j]),E=a.useCallback((l,P)=>{r.ensureExpanded(l),Ae.flushSync(()=>{_(null),S({parent:l,type:P})})},[r]),N=a.useCallback(l=>{Ae.flushSync(()=>_(l.path))},[]),w=a.useRef({startCreate:E,reload:r.reload,pickUpload:y});a.useEffect(()=>{w.current={startCreate:E,reload:r.reload,pickUpload:y}});const U=d!==null;a.useEffect(()=>{if(g||s===void 0&&U)return;const l=s??k;return l({newFile:()=>w.current.startCreate(Q,"file"),newFolder:()=>w.current.startCreate(Q,"dir"),refresh:()=>w.current.reload(),...U&&{upload:()=>w.current.pickUpload(Q)}}),()=>l(null)},[k,s,g,U]);const te=a.useCallback(async l=>{var se;if(!C||o===null)return;const P=C;if(S(null),d!==null){const re=(((se=c.getQueryData(le(o,P.parent,D)))==null?void 0:se.entries)??[]).find(ot=>ot.name.toLowerCase()===l.toLowerCase());if(P.type==="dir"){if(re!==void 0&&!(re.type==="dir"&&re.name===l)){J.error(ze(l,re));return}S({parent:ee(P.parent,l),type:"file",firstInFolder:l});return}if(re!==void 0){J.error(ze(l,re));return}const rt=ee(P.parent,l);z({path:rt,isNew:!0});return}await r.createEntry(P.parent,l,P.type)&&x(ee(P.parent,l))},[C,o,d,c,D,r,x]),V=a.useCallback(async(l,P)=>{_(null),(d?await d.renameEntry(l,P):await r.renameEntry(l,P))&&x(ee(G(l.path),P))},[d,r,x]);return o===null?e!==void 0?null:t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-6 text-center text-sm",children:"Select a working directory to browse its files."}):t.jsxs("div",{ref:f,className:Oe("flex h-full flex-col",L&&"ring-ring/60 bg-accent/30 ring-1 ring-inset",n),onDragOver:l=>{d===null||!we(l.dataTransfer.types)||(l.preventDefault(),l.dataTransfer.dropEffect="copy",B(!0))},onDragLeave:l=>{l.currentTarget.contains(l.relatedTarget)||B(!1)},onDrop:l=>{B(!1),!(d===null||!we(l.dataTransfer.types))&&(l.preventDefault(),u(Q,st(l.dataTransfer).files))},children:[d!==null&&t.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,"aria-hidden":!0,tabIndex:-1,"data-testid":"room-files-upload-input",onChange:l=>{const P=Array.from(l.target.files??[]);l.target.value="",u(v.current,P)}}),t.jsxs("div",{className:"min-h-0 flex-1",children:[C&&t.jsx(Fn,{type:C.type,firstInFolder:C.firstInFolder,onSubmit:l=>void te(l),onCancel:()=>S(null)},`${C.parent}:${C.type}:${C.firstInFolder??""}`),R&&M.length===0?t.jsx("div",{className:"flex h-20 items-center justify-center",children:t.jsx(Fe,{size:"md",className:"text-muted-foreground",label:"Loading files"})}):q&&M.length===0?t.jsxs("div",{className:"text-muted-foreground flex min-h-20 flex-col items-center justify-center gap-2 px-4 py-3 text-center text-xs [overflow-wrap:anywhere]",children:[t.jsx("span",{children:b??"Couldn’t load files."}),H!==null&&t.jsx("code",{"aria-label":"Command that removes the settings",className:"bg-muted text-foreground block w-full rounded px-2 py-1.5 text-left font-mono select-all",children:H}),t.jsxs(Y,{variant:"outline",size:"xs",onClick:r.reload,children:[t.jsx(Ke,{}),"Retry"]})]}):M.length===0&&!C?t.jsx("div",{className:"text-muted-foreground/60 flex h-20 items-center justify-center px-4 text-center text-xs",children:d!==null?"No files yet. Drop files here, or use Upload.":"Empty directory"}):t.jsx(wn,{rows:M,selectedPath:h,renamingPath:I,errorPaths:$,onSelectPath:x,onToggle:r.toggleExpand,onOpen:l=>{o.preview==="inline"?W(l.path):r.openFile(l)},onRetryDir:r.retryDir,onSubmitRename:(l,P)=>void V(l,P),onCancelRename:()=>_(null),onStartRename:N,onNewFile:l=>E(l,"file"),onNewFolder:l=>E(l,"dir"),onDelete:l=>d?d.requestDelete(l):void r.removeEntry(l),onMove:(l,P)=>void(d?d.moveEntry(l,P):r.moveEntry(l,P)),onCopyInto:(l,P)=>void r.copyEntry(l,P),onCopy:r.copyToClipboard,onPaste:l=>{j&&r.copyEntry(j,l)},onDuplicate:l=>void r.copyEntry({path:l.path,isDir:l.type==="dir"},G(l.path)),canPasteInto:O,readOnly:g,provenance:o.provenance,copyable:d===null,onDisk:o.cwd!==null,onUpload:d?u:void 0,onPickUpload:d?y:void 0,revealLabel:r.revealLabel,onReveal:l=>void r.reveal(l),onAddToChat:r.addToChat,onCopyPath:(l,P)=>void r.copyPath(l,P)})]}),o.preview==="inline"&&t.jsx(Zt,{source:o,path:(A==null?void 0:A.path)??null,isNew:(A==null?void 0:A.isNew)??!1,onCreated:()=>{A!==null&&(z({path:A.path,isNew:!1}),x(A.path))},onClose:()=>z(null)}),d!==null&&t.jsx(Nn,{changes:d,onOpenTheirs:l=>W(l),onReturnFocus:T}),t.jsx(fe,{open:r.pendingRecursiveDelete!==null,onOpenChange:l=>!l&&r.cancelRecursiveDelete(),children:t.jsxs(he,{children:[t.jsxs(pe,{children:[t.jsx(me,{children:"Delete this folder?"}),t.jsxs(xe,{children:["“",(de=r.pendingRecursiveDelete)==null?void 0:de.name,"” isn’t empty. Deleting it removes everything inside. This can’t be undone."]})]}),t.jsxs(ge,{children:[t.jsx(ye,{onClick:r.cancelRecursiveDelete,children:"Cancel"}),t.jsx(ve,{onClick:()=>void r.confirmRecursiveDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:"Delete"})]})]})})]})}function Fn({type:e,firstInFolder:n,onSubmit:s,onCancel:m}){const p=a.useRef(null),[i,o]=a.useState("");a.useEffect(()=>{var d;(d=p.current)==null||d.focus()},[]);const g=()=>{const d=i.trim();d?s(d):m()},r=t.jsxs("div",{className:"flex items-center gap-1",children:[e==="dir"?t.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(Ue,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),t.jsx("input",{ref:p,type:"text",value:i,"aria-label":n!==void 0?`First file in ${n}`:e==="dir"?"New folder name":"New file name",placeholder:e==="dir"?"folder-name":"file-name",onChange:d=>o(d.target.value),onBlur:g,onKeyDown:d=>{d.key==="Enter"?g():d.key==="Escape"&&m()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})]});return n===void 0?t.jsx("div",{className:"px-3 py-1",children:r}):t.jsxs("div",{className:"space-y-1 px-3 py-1",children:[t.jsxs("p",{className:"text-muted-foreground flex min-w-0 items-center gap-1 text-xs",children:[t.jsx(be,{className:"size-(--size-icon-xs) flex-shrink-0 text-sky-500"}),t.jsx("span",{className:"truncate",children:n})]}),r,t.jsx("p",{className:"text-muted-foreground text-2xs",children:"Name its first file. The folder appears when you save it."})]})}function at(){const e=K(m=>m.showHidden),n=K(m=>m.setShowHidden),s=e?"Hide hidden files":"Show hidden files";return t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":s,title:s,onClick:()=>n(!e),children:e?t.jsx(Dt,{className:"text-muted-foreground"}):t.jsx(Rt,{className:"text-muted-foreground"})})}function On({cwd:e}){const n=ne(),{data:s}=ce({queryKey:["file-explorer","workspace",e],queryFn:()=>n.resolveWorkspace(e),staleTime:6e4});return s!=null&&s.branch?t.jsxs("span",{className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",title:`Workspace ${s.key} on ${s.branch}`,children:[t.jsx(Be,{className:"size-3 flex-shrink-0"}),t.jsx("span",{className:"truncate",children:s.branch})]}):null}function In(){const e=Te(s=>s.selectedCwd),n=K(s=>s.commands);return e?t.jsxs(t.Fragment,{children:[t.jsx(On,{cwd:e}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New file",title:"New file",onClick:()=>n==null?void 0:n.newFile(),children:t.jsx(et,{className:"text-muted-foreground"})}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New folder",title:"New folder",onClick:()=>n==null?void 0:n.newFolder(),children:t.jsx(We,{className:"text-muted-foreground"})}),t.jsx(at,{}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"Refresh",title:"Refresh",onClick:()=>n==null?void 0:n.refresh(),children:t.jsx(Nt,{className:"text-muted-foreground"})})]}):null}function Pn({roomId:e}){const n=ne(),s=oe(),m=ce(Ye(n,e));a.useEffect(()=>Jt(s,e,()=>{s.invalidateQueries({queryKey:De.repoStatus(e)})}),[s,e]);const p=a.useMemo(()=>{var r;return((r=m.data)==null?void 0:r.kind)==="ok"?St(m.data.status):[]},[m.data]),i=Tt(p),o=Ft(p);if(!o)return null;const g=p.map((r,d)=>`${i[d]}: ${Ot(r)}`);return t.jsxs("span",{"data-slot":"pending-work-badge",title:g.join(`
|
|
17
17
|
`),className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",children:[t.jsx(Be,{className:"size-3 flex-shrink-0"}),t.jsxs("span",{className:"sr-only",children:["Not merged into the room yet. ",g.join(". "),"."]}),t.jsx("span",{"aria-hidden":"true",className:"truncate",children:o})]})}const Mn={added:"added",modified:"changed",deleted:"deleted",untracked:"new"},An=new Map([["OPERATOR_ONLY","Only the person who owns this DorkOS can decide what happens to those changes."],["ROOM_FILE_NOT_FOUND","One of those changes is not there any more, so nothing was discarded. The list below has been refreshed."],["MERGE_IN_FLIGHT","Something else is writing to this room’s files right now. Nothing was changed. Try again in a moment."],["MAIN_CHECKOUT_DIRTY","This room’s files are on another branch, which DorkOS will not move for you. Put them back on main yourself."],["ROOM_REPO_GIT_UNAVAILABLE","This computer doesn’t have git installed, and a room’s files are a git repository."],["ROOM_HAS_NO_REPO","This room does not have files of its own any more."],["ROOM_REPOS_DISABLED","Rooms cannot have files of their own on this install right now."]]);function _n({roomId:e}){var H,$;const n=ne(),s=oe(),m=ce(Ye(n,e)),[p,i]=a.useState([]),[o,g]=a.useState(!1),[r,d]=a.useState(null),c=Pt({mutationFn:k=>n.repairRoomMain(e,k),onSuccess:()=>{i([]),g(!1),d(null),s.invalidateQueries({queryKey:De.repoStatus(e)})},onError:k=>{g(!1);const h=An.get(Mt(k)??"");d(h??"That didn’t work. Try again in a moment."),s.invalidateQueries({queryKey:De.repoStatus(e)})}});if(((H=m.data)==null?void 0:H.kind)==="unavailable")return t.jsx("p",{role:"alert","data-slot":"room-main-warning",className:"border-border/60 text-muted-foreground rounded-lg border px-3 py-2.5 text-xs",children:"DorkOS couldn’t check whether this room’s files are in order. If saving here is refused, this is why. Try again in a moment."});const D=(($=m.data)==null?void 0:$.kind)==="ok"?m.data.status.main:void 0;if(D===void 0||!D.dirty)return null;const M=D.branch!=="main",R=p.filter(k=>D.strays.some(h=>h.path===k)),q=o&&R.length>0,b=k=>i(h=>h.includes(k)?h.filter(x=>x!==k):[...h,k]);return t.jsxs("div",{role:"alert","data-slot":"room-main-warning",className:"border-border/60 bg-muted/40 space-y-3 rounded-lg border px-3 py-2.5 text-sm",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(At,{className:"text-muted-foreground mt-0.5 size-(--size-icon-sm) flex-shrink-0"}),t.jsxs("div",{className:"min-w-0 space-y-1",children:[t.jsx("p",{className:"font-medium",children:"Somebody changed this room’s files outside DorkOS"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:M?`This room’s files are on ${D.branch??"no branch"} instead of main. Nobody can save a file here and no agent can merge into it until they are back on main. DorkOS will not move a branch it did not move, in case there is work on it.`:"Nobody can save a file here, and no agent can merge its work in, until these are dealt with."})]})]}),!M&&t.jsxs(t.Fragment,{children:[t.jsx("ul",{className:"space-y-1.5",children:D.strays.map(k=>t.jsxs("li",{className:"flex items-center gap-2",children:[t.jsx(_t,{id:`stray-${e}-${k.path}`,checked:R.includes(k.path),onCheckedChange:()=>b(k.path),disabled:c.isPending}),t.jsx("label",{htmlFor:`stray-${e}-${k.path}`,className:"min-w-0 flex-1 cursor-pointer truncate font-mono text-xs",title:k.path,children:k.path}),t.jsx("span",{className:"text-muted-foreground flex-shrink-0 text-xs",children:Mn[k.kind]})]},k.path))}),D.strayCount>D.strays.length&&t.jsxs("p",{className:"text-muted-foreground text-xs",children:["…and ",D.strayCount-D.strays.length," more, not listed here. Keeping them all still keeps every one."]}),q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-xs",children:R.length===1?"Throw away that change? It cannot be brought back.":`Throw away those ${R.length} changes? They cannot be brought back.`}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(Y,{type:"button",variant:"ghost",size:"sm",disabled:c.isPending,onClick:()=>g(!1),children:"Cancel"}),t.jsx(Y,{type:"button",variant:"destructive",size:"sm",disabled:c.isPending,onClick:()=>c.mutate({action:"discard",paths:[...R]}),children:"Yes, discard"})]})]}):t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:c.isPending,onClick:()=>c.mutate({action:"commit"}),children:"Keep them all"}),t.jsx(Y,{type:"button",variant:"ghost",size:"sm",disabled:c.isPending||R.length===0,onClick:()=>g(!0),children:R.length===0?"Discard…":`Discard ${R.length}`})]})]}),r!==null&&t.jsx("p",{className:"text-destructive text-xs",children:r})]})}const Ee="pointer-coarse:size-11";function Kn({roomId:e,canChange:n}){const s=ne(),m=oe(),p=K(M=>M.showHidden),[i,o]=a.useState(null),g=a.useMemo(()=>Xe({transport:s,queryClient:m,roomId:e,canChange:n}),[s,m,e,n]),r=ce(ke(g,Q,p,m)),d=r.isSuccess&&r.data.absent!==!0||r.isError,[c,D]=a.useState(null);return d&&c!==e&&D(e),!d&&c!==e?null:t.jsxs("section",{"aria-label":"Room files",className:"space-y-2",children:[t.jsxs("header",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),t.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Files"}),t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx(Pn,{roomId:e})}),n&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"New file",title:"New file",disabled:i===null,onClick:()=>i==null?void 0:i.newFile(),children:t.jsx(et,{className:"text-muted-foreground"})}),t.jsx(Y,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"New folder",title:"New folder",disabled:i===null,onClick:()=>i==null?void 0:i.newFolder(),children:t.jsx(We,{className:"text-muted-foreground"})}),t.jsx(Y,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"Upload files",title:"Upload files",disabled:(i==null?void 0:i.upload)===void 0,onClick:()=>{var M;return(M=i==null?void 0:i.upload)==null?void 0:M.call(i)},children:t.jsx(nn,{className:"text-muted-foreground"})})]}),t.jsx(at,{})]}),t.jsx(_n,{roomId:e}),t.jsx("div",{"data-slot":"room-files-body",className:"border-border/60 h-72 overflow-hidden rounded-lg border",children:t.jsx(Tn,{source:g,onCommands:o})})]})}function Hn({roomId:e,attachment:n}){var d;const s=ne(),m=oe(),p=a.useMemo(()=>Xe({transport:s,queryClient:m,roomId:e}),[s,m,e]),i=ce(ke(p,Q,!1,m)),[o,g]=a.useState(!1),r=zt(e);return!i.isSuccess||i.data.absent===!0||((d=r.data)==null?void 0:d.archived)!==!1?null:t.jsxs(t.Fragment,{children:[t.jsx(Y,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Save ${n.name} to the room’s files`,title:"Save to room files",className:"text-muted-foreground hover:text-foreground mt-0.5 pointer-coarse:size-11",onClick:()=>g(!0),children:t.jsx($t,{})}),o&&t.jsx(Ln,{roomId:e,source:p,attachment:n,onClose:()=>g(!1)})]})}function Ln({roomId:e,source:n,attachment:s,onClose:m}){const p=ne(),i=oe(),[o,g]=a.useState(Q),[r,d]=a.useState(s.name),[c,D]=a.useState(null),[M,R]=a.useState(!1),q=a.useId(),b=ce(ke(n,o,!1,i)),H=a.useMemo(()=>{var k;return nt(((k=b.data)==null?void 0:k.entries)??[]).filter(h=>h.type==="dir")},[b.data]),$=async()=>{var h,x;const k=r.trim();if(k!==""){R(!0),D(null);try{await p.saveAttachmentToRoomFiles(e,{attachmentId:s.id,dir:o,name:k,baseCommit:((h=b.data)==null?void 0:h.commit)??null}),i.invalidateQueries({queryKey:["file-explorer","tree",n.scopeKey]}),J.success(`Saved ${k} to the room’s files`),m()}catch(j){let C;try{C=en(j,i,e)}catch{C={status:"refused",reason:Ve(j)??"That didn’t save. Try again in a moment."}}if(C.status==="exists"){const S=(((x=b.data)==null?void 0:x.entries)??[]).map(I=>I.name);D({reason:`This folder already has a file called “${k}”. Pick another name.`,suggestion:Pe({name:k,isDir:!1,taken:[...S,k]})})}else C.status==="conflict"?(D({reason:"Somebody changed this folder while you were choosing, so nothing was saved. Try again."}),b.refetch()):C.status==="refused"&&D({reason:C.reason})}finally{R(!1)}}};return t.jsx(It,{open:!0,onOpenChange:k=>!k&&m(),children:t.jsxs(Kt,{className:"sm:max-w-md",children:[t.jsxs(Ht,{children:[t.jsx(Ut,{children:"Save to room files"}),t.jsx(qt,{children:"Keep this file with the room’s files, where everyone in the room and their agents can find it."})]}),t.jsxs(Qt,{className:"space-y-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Folder"}),t.jsxs("div",{role:"group","aria-label":"Folders",className:"border-border/60 max-h-56 overflow-auto rounded-md border",children:[t.jsx("p",{className:"bg-muted/40 truncate px-3 py-1.5 font-mono text-xs",children:o===Q?"Top folder":`${o}/`}),o!==Q&&t.jsx($e,{label:"Up one folder",icon:t.jsx(tn,{className:"text-muted-foreground size-(--size-icon-sm)"}),onClick:()=>g(G(o))}),b.isPending?t.jsx("div",{className:"flex h-12 items-center justify-center",children:t.jsx(Fe,{size:"sm",className:"text-muted-foreground",label:"Loading folders"})}):H.length===0?t.jsx("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:"No folders in here."}):H.map(k=>t.jsx($e,{label:k.name,icon:t.jsx(be,{className:"size-(--size-icon-sm) text-sky-500"}),chevron:!0,onClick:()=>g(ee(o,ie(k.path)))},k.path))]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:q,className:"text-muted-foreground text-xs font-medium",children:"Name"}),t.jsx(Bt,{id:q,value:r,onChange:k=>{d(k.target.value),D(null)},spellCheck:!1,autoComplete:"off"})]}),c!==null&&t.jsxs("div",{role:"alert",className:"text-destructive space-y-1 text-xs",children:[t.jsx("p",{children:c.reason}),c.suggestion!==void 0&&t.jsxs(Y,{type:"button",variant:"outline",size:"xs",onClick:()=>{d(c.suggestion),D(null)},children:["Use “",c.suggestion,"”"]})]})]}),t.jsxs(Wt,{className:"gap-2",children:[t.jsx(Y,{type:"button",variant:"ghost",onClick:m,children:"Cancel"}),t.jsx(Y,{type:"button",disabled:M||r.trim()===""||b.isPending,onClick:()=>void $(),children:M?"Saving…":o===Q?"Save to the top folder":`Save to ${ie(o)}`})]})]})})}function $e({label:e,icon:n,chevron:s=!1,onClick:m}){return t.jsxs("button",{type:"button",onClick:m,className:"hover:bg-accent/50 focus-visible:bg-accent flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm outline-none",children:[n,t.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),s&&t.jsx(He,{className:"text-muted-foreground size-3.5"})]})}export{Tn as FileExplorer,In as FileExplorerActions,Zt as FilePreviewDialog,sn as HIDDEN_ENTRY_NAMES,at as HiddenEntriesToggle,Qn as NO_PROVENANCE,Re as PINNED_ENTRY_NAMES,Bn as ROOM_FILES_REFRESH_INTERVAL_MS,Kn as RoomFilesSection,Hn as SaveToRoomFilesButton,Xe as createRoomFilesSource,mn as createSessionCwdSource,le as explorerDirQueryKey,ke as explorerDirQueryOptions,an as isHiddenEntryName,Ne as isPinnedEntryName,rn as pinnedFirst,Xt as provenanceLine,Ye as roomRepoStatusQueryOptions,nt as withoutHidden};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as p,a as u,p as n,s as l,t as e}from"./index-
|
|
1
|
+
import{L as p,a as u,p as n,s as l,t as e}from"./index-3nUBnton.js";import{html as m}from"./index-CNPnwL--.js";import{javascriptLanguage as b}from"./index-BK5zyBqg.js";import{L as S,a as r}from"./index-BlNzH0bV.js";import"./index-B4Z9VBPe.js";import"./index-1tkVhrNa.js";const c=S.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,nodeProps:[["isolate",-3,3,13,17,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new r("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new r("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new r("[~RPwxU~ZOp~~",11,15),new r("[~RPrsU~ZOn~~",11,14),new r("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new r("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),P=b.parser.configure({top:"SingleExpression"}),o=c.configure({props:[l({Text:e.content,Is:e.definitionOperator,AttributeName:e.attributeName,VueAttributeName:e.keyword,Identifier:e.variableName,"AttributeValue ScriptAttributeValue":e.attributeValue,Entity:e.character,"{{ }}":e.brace,"@ :":e.punctuation})]}),s={parser:P},Q=o.configure({wrap:n((O,t)=>O.name=="InterpolationContent"?s:null)}),g=o.configure({wrap:n((O,t)=>O.name=="AttributeScript"?s:null),top:"Attribute"}),y={parser:Q},R={parser:g},a=m();function i(O){return O.configure({dialect:"selfClosing",wrap:n(X)},"vue")}const T=i(a.language);function X(O,t){switch(O.name){case"Attribute":return/^(@|:|v-)/.test(t.read(O.from,O.from+2))?R:null;case"Text":return y}return null}function C(O={}){let t=a;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof p))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new u(t.language==a.language?T:i(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["{",'"']}})])}export{C as vue,T as vueLanguage};
|