import{u as A,c as o,i as r,b as N,A as I,m as E,e as M,t as n,f as O}from"./main-B-KzsHRi.js";var L=n('<div class=freno-teams><div class=freno-page-header><h1>Teams</h1><button class="freno-btn freno-btn-primary">+ New Team</button></div><div class=freno-team-grid><button class="freno-team-card freno-team-card-new"><div class=freno-team-icon>+</div><h3>Create Team'),W=n("<div class=freno-team-icon>👥"),j=n("<h3>"),P=n("<p class=freno-team-members> member"),R=n("<span class=freno-date>Created "),q=n('<div class=freno-modal-overlay><div class=freno-modal><div class=freno-modal-header><h2>Create New Team</h2><button class=freno-btn-icon>✕</button></div><form class=freno-form><div class=freno-form-group><label class=freno-label for=team-name>Team Name</label><input class=freno-input id=team-name type=text placeholder="My Writing Team"autofocus></div><div class=freno-form-actions><button type=submit class="freno-btn freno-btn-primary">Create Team</button><button type=button class="freno-btn freno-btn-secondary">Cancel');const B=()=>{const h=A(),[v]=o([{id:"team_default",name:"My Workspace",members:[{userId:h().user?.id||"",role:"owner",joinedAt:new Date().toISOString()}],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}]),[g,a]=o(!1),[m,c]=o("");return(()=>{var i=L(),f=i.firstChild,C=f.firstChild,S=C.nextSibling,d=f.nextSibling,$=d.firstChild;return S.$$click=()=>a(!0),r(d,()=>v().map(t=>N(I,{get href(){return`/teams/${t.id}`},class:"freno-team-card",get children(){return[W(),(()=>{var e=j();return r(e,()=>t.name),e})(),(()=>{var e=P(),s=e.firstChild;return r(e,()=>t.members.length,s),r(e,()=>t.members.length!==1?"s":"",null),e})(),(()=>{var e=R();return e.firstChild,r(e,()=>new Date(t.createdAt).toLocaleDateString(),null),e})()]}})),$),$.$$click=()=>a(!0),r(i,(()=>{var t=E(()=>!!g());return()=>t()&&(()=>{var e=q(),s=e.firstChild,u=s.firstChild,w=u.firstChild,T=w.nextSibling,b=u.nextSibling,p=b.firstChild,x=p.firstChild,_=x.nextSibling,y=p.nextSibling,k=y.firstChild,D=k.nextSibling;return e.$$click=()=>a(!1),s.$$click=l=>l.stopPropagation(),T.$$click=()=>a(!1),b.addEventListener("submit",l=>{l.preventDefault(),m().trim()&&(a(!1),c(""))}),_.$$input=l=>c(l.target.value),D.$$click=()=>a(!1),M(()=>_.value=m()),e})()})(),null),i})()};O(["click","input"]);export{B as TeamManagement};
//# sourceMappingURL=TeamManagement-QZVmDfOZ.js.map
