1import{m as u,r as c,l as w,q as f,j as e,B as x,J as v,t as k,p as W,u as h,h as y,i as S,G as I,v as N,a6 as F,Q as z,S as L,a7 as _,M as G,a8 as D,y as B,a9 as A,n as M,V,aa as H,k as O}from"./index-DZWvLTRi.js";const U=u(t=>({})),Q=({dispatch:t})=>{const[a,l]=c.useState("");w(o=>o.user);const i=w(o=>o.projects),{allProjects:r}=i,n=c.useMemo(()=>r.filter(o=>{var d;return!((d=o==null?void 0:o.status)!=null&&d.inactive)}),[r]),s=c.useMemo(()=>{const o=a.toLowerCase();return n.filter(d=>d.title.toLowerCase().includes(o))},[a,n]);return{search:a,setSearch:l,projects:a!==""?s:n,loaded:!0}},q=u(t=>({root:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",flexDirection:"column",width:"100%"}})),J=({children:t})=>{const a=q();return f(),e.jsx(x,{children:e.jsx("div",{className:a.root,children:t})})},K=u(t=>({root:{}})),X=u(t=>({container:{display:"flex",justifyContent:"center",alignItems:"center",gap:"2rem",textTransform:"none",padding:"12px",textAlign:"center",[t.breakpoints.down("sm")]:{flexDirection:"column",gap:"1rem"}},description:{width:"100%",textAlign:"center",font:"normal normal 400 13.5px/15px Inter",marginTop:0,marginBottom:0,paddingTop:8,paddingBottom:8,color:t.palette.mode==="light"?"rgb(100 116 139)":"rgb(171,171,171)"}})),P=({children:t})=>{const a=X();return e.jsx(v,{size:{xs:12,sm:12,md:12,lg:12,xl:12},children:e.jsx(x,{className:a.container,children:e.jsx("p",{className:a.description,children:t})})})},Y=u(t=>({root:{},card:{boxShadow:"inset 0px 0px 1px 1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)!important",borderRadius:"15px!important",transition:"500ms easy-in"},content:{minHeight:"70px!important",cursor:"default!important",padding:"24px 16px 16px 16px",width:"100%"}})),Z=({id:t,title:a,onEdit:l,onDelete:i})=>{const r=Y(),n=c.useContext(k),s=f();W(m=>m.breakpoints.down("sm"));const{translate:o}=h();return y(),S(),c.useContext(I).language,e.jsx(e.Fragment,{children:e.jsx(x,{className:r.root,children:e.jsxs(x,{style:{maxWidth:"100%",marginTop:"1rem",cursor:"default",boxSizing:"border-box",display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"0px",width:"300px",height:"123px",background:n.mode==="light"?"#FFFFFF":"#303030",border:n.mode==="light"?"1px solid #E5E3E8":"none",borderRadius:"13px",flex:"none",order:"0",flexGrow:"1"},children:[e.jsx(x,{className:r.content,style:{maxWidth:"100%"},children:e.jsx(N,{gutterBottom:!0,style:{color:n.mode==="light"?"#39274B":"#fff",fontFamily:"Inter",lineHeight:"125%",fontSize:"20px",fontWeight:"700",flex:"none",order:0,flexGrow:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",maxWidth:"100%",marginBottom:"10px"},children:a===""?o("page.project.list.notTitle"):a})}),e.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-evenly",alignItems:"center",borderTop:n.mode==="light"?"1px solid #E5E3E8":"1px solid #757575",color:n.mode==="light"?s.palette.primary.main:s.palette.secondary.main},children:[e.jsx(x,{sx:{fontFamily:"Inter",fontSize:"14px",fontWeight:"600",width:"100%",height:"3rem",display:"flex",justifyContent:"center",borderRight:n.mode==="light"?"1px solid #E5E3E8":"1px solid #757575",alignItems:"center","&:hover":{cursor:"pointer",backgroundColor:n.mode==="light"?"#E5E3E8":"#414141ba",borderRadius:"0px 0px 0px 15px"}},onClick:()=>l(t),children:o("page.project.list.action.update")}),e.jsx(x,{sx:{width:"100%",height:"3rem",display:"flex",justifyContent:"center",alignItems:"center",fontFamily:"Inter",fontSize:"14px",fontWeight:"600","&:hover":{cursor:"pointer",backgroundColor:n.mode==="light"?"#E5E3E8":"#414141ba",borderRadius:"0px 0px 15px 0px"}},onClick:()=>i(t),children:o("page.project.list.action.delete")})]})]})})})},ee=u(t=>({root:{width:"100%",display:"flex",gap:"1rem",flexDirection:"row",alignItems:"center",height:"50px",[t.breakpoints.down("xs")]:{flexDirection:"column-reverse",height:"auto"}},container:{width:"949px",display:"flex",justifyContent:"center",alignItems:"center",gap:"2rem",textTransform:"none",paddingBottom:"0px!important",[t.breakpoints.down(1250)]:{width:"700px"},[t.breakpoints.down(600)]:{width:"300px",flexDirection:"column",gap:"1rem",padding:"0px!important"}},searchBar:{background:t.palette.mode==="light"?"#F2F2F2!important":"#323232!important",height:"53px",display:"flex",width:"100%",flexDirection:"row",alignItems:"center",borderRadius:"10px","& > img":{margin:"0px 19px"}}
1,button:{marginLeft:"16px",whiteSpace:"nowrap",width:"100%",height:"50px",textTransform:"unset",maxWidth:"unset",font:" normal normal 400 15px/18px Inter",letterSpacing:0,[t.breakpoints.down(600)]:{width:"100%",margin:0,marginBottom:"16px"}}})),te=({user:t,projects:a,value:l,setValue:i})=>{const r=ee(),n=c.useContext(k),s=f();y(),S();const{translate:o}=h(),d=c.useContext(I);return e.jsxs(x,{className:r.container,children:[e.jsx(F,{loading:!1,variant:"contained",disableElevation:!0,disabled:!1,sx:{minWidth:"170px",cursor:"pointer!important",fontFamily:"Inter",backgroundColor:"#09B286",textTransform:"none",padding:"8px 24px 8px 24px",fontWeight:"600",fontSize:"16px","&:hover":{backgroundColor:`${s.palette.secondary.dark}`},[s.breakpoints.down("sm")]:{width:"100%"}},onClick:d.modal.project.create.toggle,children:o("page.project.list.action.create")}),e.jsx("div",{className:r.root,children:e.jsxs(z,{sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:n.mode==="light"?"#efefef":"#303030",textTransform:"none",padding:"7px 12px 7px 12px",borderRadius:"10px",boxShadow:n.mode==="light"?"0px 18px 56px -12px rgba(227, 227, 238, 0.8)":"0px 18px 56px -12px rgba(38, 38, 39, 0.8)",[s.breakpoints.down("sm")]:{padding:"7px 20px 7px 20px"}},children:[e.jsx(L,{sx:{flexGrow:1,fontFamily:"Inter",fontSize:"14px",fontWeight:"500",color:s.palette.text.primary,[s.breakpoints.down("sm")]:{width:"100%"}},placeholder:o("page.project.list.search.placeholder"),value:l,onChange:m=>i(m.target.value),spellCheck:!1}),e.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#09B286",borderRadius:"5px",padding:"0.3rem"},children:e.jsx(_,{sx:{height:"1rem",width:"1rem",color:"#fff"}})})]})})]})},oe=({search:t,setSearch:a,user:l,projects:i,loaded:r,onEdit:n,onDelete:s})=>{K();const{translate:o}=h();return e.jsxs(x,{children:[e.jsx(te,{user:l,projects:i,value:t,setValue:a}),e.jsxs(x,{mt:5,children:[e.jsx(v,{size:{xs:12},children:e.jsxs(v,{container:!0,spacing:2,children:[t!==""&&i.length===0&&e.jsx(P,{children:o("page.project.list.notFound")}),t===""&&i.length===0&&e.jsx(P,{children:o(r?"page.project.list.notAdded":"page.project.list.loading")})]})}),e.jsx(x,{sx:{display:"grid",gap:"1.5rem",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr",md:"1fr 1fr 1fr"}},children:i.map(d=>e.jsx(Z,{id:d._id,title:d.title,onEdit:n,onDelete:s},d._id))})]})]})},ne=u(t=>({root:{width:"100%"},title:{fontSize:"1.875rem",lineHeight:"2.25rem",fontWeight:"700"}})),re=({})=>{const t=ne(),a=f(),{translate:l}=h();return e.jsx(x,{sx:{display:"flex",width:"949px",gap:"2rem",[a.breakpoints.down(1250)]:{width:"700px",gap:"0.5rem"},[a.breakpoints.down(1e3)]:{height:"max-content",width:"100%",flexDirection:"column",gap:"0.5rem"}},children:e.jsx("p",{className:t.title,children:l("page.project.list.title")})})},se=u(t=>({root:{display:"flex",justifyContent:"center",alignItems:"center",backdropFilter:"blur(3px)",paddingLeft:"20px",paddingRight:"20px"}})),ae=({id:t,open:a,toggle:l})=>{const i=se(),r=c.useContext(k),n=f(),s=y();S();const{translate:o}=h();c.useContext(I);const[d,m]=c.useState({_id:null,title:"",description:""}),[g,j]=c.useState(!1),R=w(p=>p.projects),{allProjects:b}=R,$=(p,C)=>{m({...d,[C]:p.target.value})},E=async()=>{m({_id:null,title:"",description:""}),j(!1),l("")},T=async p=>{p&&p.preventDefault(),j(!0),s(A(d,{success:()=>{j(!1),m({_id:null,title:"",description:""}),M.success(o("notify.project.update.success")),l("")},error:()=>{j(!1)}}))};return c.useEffect(()=>{if(t){const p=b==null?void 0:b.find(C=>C._id===t);p&&!g&&m({_id:p._id,title:p.title,description:p.description})}},[t,b,g]),e.jsx(G,{open:a,toggle:E,containerClass:i.root,children:e.jsx("form",{onSubmit:T,noValidate:!0,autoComplete:"off",children:e.jsxs(x,{sx:{backgroundColor:r.mode==="light"?`${n.palette.background.paper}`:`${n.palette.background.default}`,borderRadius:"15px",padding:"0rem 1rem",display:"flex",flexDirection:"column",gap:"2rem"},children:[e.jsxs("div",{children:[e.jsx("h2",{id:"parent-modal-title",children:o("page.project.modal.update.title")}),e.jsx("p",{id:"parent-modal-description",children:o("page.project.modal.update.description")})]}),e.jsx(D,{id:"outlined-basic",label:o("page.project.modal.update.form.name.label"),variant:"outlined",color:r.mode==="light"?"primary":"secondary",value:d.title,onChange:p=>$(p,"title")}),e.jsx(D,{id:"outlined-multiline-static",label:o("page.project.modal.update.form.description.label"),multiline:!0,rows:4,color:r.mode==="light"?"primary":"secondary",value:d.description,onChange:p=>$(p,"description")}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"1rem"},children:[e.jsx(B,{onClick:E,variant:"outlined",color:r.mode==="light"?"primary":"secondary",sx:{textTransform:"none!important",fontFamily:"Inter"},children:o("page.project.modal.update.action.cancel")}),e.jsx(F,{loading:g,onClick:T,variant:"contained",style:{backgroundColor:r.mode==="light"?`${n.palette.primary.main}`:`${n.palette.secondary.main}`,color:g?r.mode==="light"?`${n.palette.primary.main}`:`${n.palette.secondary.main}`:r.mode==="light"?`${n.palette.text.white}`:`${n.palette.text.black}`},sx:{textTransform:"none!important",fontFamily:"Inter"},children:o("page.project.modal.update.action.confirm")})]})]})})})},ie=()=>{const[t,a]=c.useState(""),[l,i]=c.useState(!1);return{id:t,open:l,setOpen:i,onClose:()=>{a(""),i(!1)},onDelete:s=>{a(s),i(!0)}}},le=({id:t,open:a,onClose:l})=>{const i=c.useContext(k),r=f(),n=y(),{translate:s}=h(),[o,d]=c.useState(!1),m=async g=>{g&&g.preventDefault(),d(!0),n(H(t,{success:()=>{setTimeout(()=>d(!1),1e3*2),M.success(s("notify.project.delete.success")),l()},error:()=>{d(!1),l()}}))};return e.jsx(V,{open:a,onClose:l,"aria-labelledby":"parent-modal-title","aria-describedby":"parent-modal-description",sx:{dis
1play:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",backdropFilter:"blur(3px)"},children:e.jsx("form",{onSubmit:m,noValidate:!0,autoComplete:"off",children:e.jsxs(x,{sx:{width:400,backgroundColor:i.mode==="light"?`${r.palette.background.paper}`:`${r.palette.background.default}`,borderRadius:"15px",padding:"1rem 2rem",display:"flex",flexDirection:"column",gap:"2rem"},children:[e.jsxs("div",{children:[e.jsx("h2",{id:"parent-modal-title",children:s("page.project.modal.delete.title")}),e.jsx("p",{id:"parent-modal-description",children:s("page.project.modal.delete.description")})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"1rem"},children:[e.jsx(B,{onClick:l,variant:"outlined",color:i.mode==="light"?"primary":"secondary",sx:{textTransform:"none!important",fontFamily:"Inter"},children:s("page.project.modal.delete.action.cancel")}),e.jsx(F,{loading:o,onClick:m,variant:"contained",style:{backgroundColor:i.mode==="light"?`${r.palette.primary.main}`:`${r.palette.secondary.main}`,color:o?i.mode==="light"?`${r.palette.primary.main}`:`${r.palette.secondary.main}`:i.mode==="light"?`${r.palette.text.white}`:`${r.palette.text.black}`},sx:{textTransform:"none!important",fontFamily:"Inter"},children:s("page.project.modal.delete.action.confirm")})]})]})})})},de=()=>{const[t,a]=c.useState(""),[l,i]=c.useState(!1),r=s=>{a(s),i(!0)},n=c.useCallback(s=>{i(o=>!o),a(s)},[]);return{id:t,open:l,setOpen:i,toggle:n,onEdit:r}},pe=()=>{U();const t=y();S(),h(),O();const a=w(d=>d.user),{search:l,setSearch:i,projects:r,loaded:n}=Q({dispatch:t}),s=ie(),o=de();return e.jsxs(J,{children:[e.jsx(re,{}),e.jsx(oe,{search:l,setSearch:i,user:a,projects:r,loaded:n,onEdit:o.onEdit,onDelete:s.onDelete}),e.jsx(ae,{id:o.id,open:o.open,toggle:o.toggle}),e.jsx(le,{id:s.id,open:s.open,onClose:s.onClose})]})};export{pe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.