import{p as T,o as P,g as h,m as U,i as M,f as c,s,c as e,a as F,r as j,b as q,t as B,d as N,e as o,h as $,D as n,I as r,j as z,k as G,l as H,n as J,q as K,u as Q,v as V,w as W,x as X}from"./index-0gCBgY3i.js";var a=j(()=>J),Y=c('<button data-button=""><!> <span>Rename</span></button> <button data-button=""><!> <span>Delete this Folder</span></button>',1),Z=c('<div class="flex flex-col w-60 space-y-2"><button data-button=""><!> <span>Create a new Folder</span></button> <button data-button=""><!> <span>Create a new File</span></button> <button data-button=""><!> <span>Upload Files</span></button> <!></div>'),aa=c('<div class="flex-1 relative px-2 py-1 text-gray-700">This branch is protected and no changes can be made.</div>'),ta=c('<div class="flex-1 px-2 py-2" tabindex="-1"><h2 class="sr-only"> </h2> <!></div>');function sa(E,D){T(D,!1);let i=U(null);P(()=>{h(i)&&h(i).focus()}),M();var u=ta(),f=e(u),x=e(f),w=s(f,2);{var O=t=>{var l=Z(),d=e(l);d.__click=()=>{a(a().activeDialog=n.FOLDER_CREATE)};var R=e(d);r(R,{get path(){return z},class:"w4 h-4"});var p=s(d,2);p.__click=()=>{a(a().activeDialog=n.FILE_CREATE)};var L=e(p);r(L,{get path(){return G},class:"w4 h-4"});var v=s(p,2);v.__click=()=>{a(a().activeDialog=n.FILE_UPLOAD)};var y=e(v);r(y,{get path(){return H},class:"w4 h-4"});var A=s(v,2);{var C=_=>{var g=Y(),b=K(g);b.__click=()=>{a(a().activeDialog=n.FOLDER_RENAME)};var I=e(b);r(I,{get path(){return Q},class:"w-4 h-4"});var m=s(b,2);m.__click=()=>{a(a().activeDialog=n.FOLDER_DELETE)};var S=e(m);r(S,{get path(){return V},class:"w-4 h-4"}),o(_,g)};F(A,_=>{a().currentFile?.fullpath&&_(C)})}o(t,l)},k=t=>{var l=aa();o(t,l)};F(w,t=>{!a().apiStatus?.git.protect_default_branch||a().apiStatus?.git.default_branch!==a().currentBranch?.id?t(O):t(k,!1)})}q(u,t=>W(i,t),()=>h(i)),B(()=>N(x,`Actions for the directory ${(a().currentFile?.fullpath?a().currentFile?.fullpath:"/")??""}`)),o(E,u),$()}X(["click"]);export{sa as default};
