import{S as Q,i as V,s as W,e as h,t as z,a as E,b as w,c as O,d as r,f as X,g as N,h as v,j as J,k as F,l as R,m as U,n as G,u as Y,o as Z,p as tt,q as et,r as A,D as L,v as nt,w as q,I as S,x as lt,y as at,z as st,A as B,B as I,C as T,E as x,F as K,G as ot,H as rt}from"./index-BcAJnzER.js";function it(o){let t;return{c(){t=h("div"),t.textContent="This branch is protected and no changes can be made.",w(t,"class","flex-1 relative px-2 py-1 text-gray-700")},m(n,i){O(n,t,i)},p:q,i:q,o:q,d(n){n&&R(t)}}}function ut(o){var M;let t,n,i,d,_,u,e,l,m,g,c,p,s,k,a,C,$,D,y;i=new S({props:{path:lt,class:"w4 h-4"}}),l=new S({props:{path:at,class:"w4 h-4"}}),s=new S({props:{path:st,class:"w4 h-4"}});let f=((M=o[1])==null?void 0:M.fullpath)&&H(o);return{c(){t=h("div"),n=h("button"),B(i.$$.fragment),d=E(),_=h("span"),_.textContent="Create a new Folder",u=E(),e=h("button"),B(l.$$.fragment),m=E(),g=h("span"),g.textContent="Create a new File",c=E(),p=h("button"),B(s.$$.fragment),k=E(),a=h("span"),a.textContent="Upload Files",C=E(),f&&f.c(),w(n,"data-button",""),w(e,"data-button",""),w(p,"data-button",""),w(t,"class","flex flex-col w-60 space-y-2")},m(b,P){O(b,t,P),r(t,n),I(i,n,null),r(n,d),r(n,_),r(t,u),r(t,e),I(l,e,null),r(e,m),r(e,g),r(t,c),r(t,p),I(s,p,null),r(p,k),r(p,a),r(t,C),f&&f.m(t,null),$=!0,D||(y=[T(n,"click",o[6]),T(e,"click",o[7]),T(p,"click",o[8])],D=!0)},p(b,P){var j;(j=b[1])!=null&&j.fullpath?f?P&2&&F(f,1):(f=H(b),f.c(),F(f,1),f.m(t,null)):f&&(N(),v(f,1,1,()=>{f=null}),J())},i(b){$||(F(i.$$.fragment,b),F(l.$$.fragment,b),F(s.$$.fragment,b),F(f),$=!0)},o(b){v(i.$$.fragment,b),v(l.$$.fragment,b),v(s.$$.fragment,b),v(f),$=!1},d(b){b&&R(t),x(i),x(l),x(s),f&&f.d(),D=!1,K(y)}}}function H(o){let t,n,i,d,_,u,e,l,m,g,c,p;return n=new S({props:{path:ot,class:"w-4 h-4"}}),e=new S({props:{path:rt,class:"w-4 h-4"}}),{c(){t=h("button"),B(n.$$.fragment),i=E(),d=h("span"),d.textContent="Rename",_=E(),u=h("button"),B(e.$$.fragment),l=E(),m=h("span"),m.textContent="Delete this Folder",w(t,"data-button",""),w(u,"data-button","")},m(s,k){O(s,t,k),I(n,t,null),r(t,i),r(t,d),O(s,_,k),O(s,u,k),I(e,u,null),r(u,l),r(u,m),g=!0,c||(p=[T(t,"click",o[9]),T(u,"click",o[10])],c=!0)},i(s){g||(F(n.$$.fragment,s),F(e.$$.fragment,s),g=!0)},o(s){v(n.$$.fragment,s),v(e.$$.fragment,s),g=!1},d(s){s&&(R(t),R(_),R(u)),x(n),x(e),c=!1,K(p)}}}function ct(o){var s,k;let t,n,i,d=((s=o[1])!=null&&s.fullpath?(k=o[1])==null?void 0:k.fullpath:"/")+"",_,u,e,l,m;const g=[ut,it],c=[];function p(a,C){var $,D,y;return!(($=a[2].data)!=null&&$.git.protect_default_branch)||((D=a[2].data)==null?void 0:D.git.default_branch)!==((y=a[3])==null?void 0:y.id)?0:1}return e=p(o),l=c[e]=g[e](o),{c(){t=h("div"),n=h("h2"),i=z("Actions for the directory "),_=z(d),u=E(),l.c(),w(n,"class","sr-only"),w(t,"class","flex-1 px-2 py-2"),w(t,"tabindex","-1")},m(a,C){O(a,t,C),r(t,n),r(n,i),r(n,_),r(t,u),c[e].m(t,null),o[11](t),m=!0},p(a,[C]){var D,y;(!m||C&2)&&d!==(d=((D=a[1])!=null&&D.fullpath?(y=a[1])==null?void 0:y.fullpath:"/")+"")&&X(_,d);let $=e;e=p(a),e===$?c[e].p(a,C):(N(),v(c[$],1,1,()=>{c[$]=null}),J(),l=c[e],l?l.p(a,C):(l=c[e]=g[e](a),l.c()),F(l,1),l.m(t,null))},i(a){m||(F(l),m=!0)},o(a){v(l),m=!1},d(a){a&&R(t),c[e].d(),o[11](null)}}}function ft(o,t,n){let i,d,_;U(o,G,a=>n(1,i=a));const u=Y();U(o,u,a=>n(2,d=a));const e=Z();U(o,e,a=>n(3,_=a));let l=null;tt(()=>{l&&l.focus()}),et(G.subscribe(()=>{l&&l.focus()}));const m=()=>{A.set(L.FOLDER_CREATE)},g=()=>{A.set(L.FILE_CREATE)},c=()=>{A.set(L.FILE_UPLOAD)},p=()=>{A.set(L.FOLDER_RENAME)},s=()=>{A.set(L.FOLDER_DELETE)};function k(a){nt[a?"unshift":"push"](()=>{l=a,n(0,l)})}return[l,i,d,_,u,e,m,g,c,p,s,k]}class dt extends Q{constructor(t){super(),V(this,t,ft,ct,W,{})}}export{dt as default};
