PageSourceSearch

https://app.vpmsolutions.com/companyMembers.view63916.js

js vpmsolutions.com collected 2026-10-04 02:02:43 UTC 35,553 bytes, 1 lines download raw bytes

1import{o as m,m as h,j as e,d as de,H as ue,B as me,b as Ce,I as Pe,f as E,g as c,h as l,e as s,Y as we,x as U,z as he,A as _e,N as Ae,aZ as je,n as O,T as ve,C as ge,ab as le,ad as ie,t as x,bk as Ne,l as S,S as ke,r as R,P as Be,c as q,av as be,a8 as Ve,E as Y,a3 as $e,af as Fe,a4 as Le,a5 as Oe,w as Ue,au as xe,cy as De,a as Re,F as Ee,b0 as ze,b5 as Ye,an as Me,i as ye,u as qe,$ as Ge,b8 as Ke,aB as re,cD as He,s as Ie}from"./index63916.js";import{u as Te,_ as Ze,a as Je}from"./permissionsTemplateSelect.component.vue_vue_type_script_setup_true_lang63916.js";import{_ as Qe}from"./spinnerFullScreen.component.vue_vue_type_script_setup_true_lang63916.js";import{r as Xe}from"./FolderOpenIcon63916.js";import{r as Se}from"./TrashIcon63916.js";import"./switch.component.vue_vue_type_script_setup_true_lang63916.js";import"./ChevronRightIcon63916.js";import"./ChevronDownIcon63916.js";function es(j,B){return m(),h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3"})])}const ss={class:"fixed inset-0 z-10 overflow-y-auto"},ts={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center lg:p-0"},os={class:"flex w-full items-center justify-between border-b bg-gray-50 px-4 py-2"},as={class:"relative grid grid-cols-8 gap-4 bg-white px-4 py-4"},ns={class:"col-span-8"},rs={class:"col-span-8"},ls={class:"col-span-8"},is={class:"my-2 flex flex-col gap-4 sm:flex-row"},ds={key:0},us={class:"flex w-full justify-end gap-x-1"},ms={class:"mt-1 max-h-40 divide-y overflow-y-auto rounded-md bg-gray-100 shadow-inner"},cs={class:"flex-0 mr-3"},fs={class:"text-sm font-medium text-white"},ps={class:"flex-1 truncate"},ys={class:"truncate text-sm font-medium text-gray-900"},vs={class:"truncate text-xs text-gray-400"},gs={class:"pl-2"},bs=["onClick"],xs={class:"flex w-full items-center justify-end gap-4 border-t bg-gray-50 px-6 py-2"},ws=["disabled"],hs=de({__name:"inviteToCompanyModal.component",props:{open:{type:Boolean},persistent:{type:Boolean}},emits:["close","submit"],setup(j,{emit:B}){const _=ue(),T=me();Ce();const f=j,k=B;let v=R(!1),t=Be({email:"",customMessage:"",allowedWorkspaces:"all"});const C=()=>{$(),k("close")},d=q(()=>({email:{required:$e.withMessage("Email is required",Oe),email:$e.withMessage("Must be a valid email address",Le)},customMessage:{maxLength:$e.withMessage("Maximum 500 characters",Fe(500))}})),w=Pe(d.value,t);let I=R([]);const V=g=>{I.value.splice(I.value.indexOf(g),1)},i=g=>{I.value.push(g)},r=q(()=>g=>I.value.findIndex(o=>o.workspaceId===g.workspaceId)!==-1),$=()=>{t.email="",t.customMessage="",t.allowedWorkspaces="all",I.value=[]},W=async()=>{var o,u;k("submit"),v.value=!0;let g=[];t.allowedWorkspaces==="all"&&(g=(o=_.workspaces)==null?void 0:o.map(M=>M.workspaceId)),t.allowedWorkspaces==="custom"&&(g=(u=I.value)==null?void 0:u.map(M=>M.workspaceId));try{if(!await w.value.$validate())return;(await be.inviteCompanyMembers(_.id,{email:t.email,customMessage:t.customMessage,workspaceIds:g})).data.success&&Ve(()=>{T.success({title:"Invitation sent",message:`Invitation sent to ${t.email}`}),$(),k("close")})}catch(M){Y.error(M)}v.value=!1};return(g,o)=>(m(),E(s(ke),{as:"template",show:f.open},{default:c(()=>[l(s(we),{as:"div",class:"relative z-10",onClose:o[9]||(o[9]=u=>f.persistent?null:C())},{default:c(()=>[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},{default:c(()=>[...o[10]||(o[10]=[e("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1)])]),_:1}),e("div",ss,[e("div",ts,[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:c(()=>[l(s(he),{class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:w-full sm:max-w-3xl"},{default:c(()=>[e("div",os,[o[12]||(o[12]=e("h4",{class:"font-montserrat font-semibold text-gray-900"},"Invite Member",-1)),e("button",{type:"button",class:"rounded-md text-gray-500 hover:text-gray-500 focus:outline-none",onClick:o[0]||(o[0]=u=>C())},[o[11]||(o[11]=e("span",{class:"sr-only"},"Close",-1)),l(s(_e),{class:"h-5 w-5","aria-hidden":"true"})])]),e("div",as,[e("div",ns,[l(s(Ae),{modelValue:s(t).email,"onUpdate:modelValue":o[1]||(o[1]=u=>s(t).email=u),id:"email",type:"text",label:"Email address",placeholder:"[email protected]",error:s(w).email.$errors},null,8,["modelValue","error"])]),e("div",rs,[l(s(je),{modelValue:s(t).customMessage,"onUpdate:modelValue":o[2]||(o[2]=u=>s(t).customMessage=u),id:"customMessage",type:"text",label:"Custom message",optional:!0,maxLength:"500",showLength:!0,rows:"3",placeholder:"Provide a custom message to the member.",error:s(w).customMessage.$errors},null,8,["modelValue","error"])]),e("div",ls,[o[16]||(o[16]=e("label",{for:"visibility",class:"block truncate text-sm font-medium tracking-wide text-gray-700"}
1," Member Access ",-1)),o[17]||(o[17]=e("p",{class:"text-sm text-gray-500"}," Select the workspace(s) you would like this member to have access to ",-1)),e("div",is,[e("button",{class:O([s(t).allowedWorkspaces==="all"?"border-blue-500 bg-white":"bg-gray-50","flex items-center gap-4 rounded-md border px-4 py-2 shadow-sm transition-all duration-150 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 sm:w-1/2"]),onClick:o[3]||(o[3]=u=>s(t).allowedWorkspaces="all")},[e("div",{class:O([s(t).allowedWorkspaces==="all"?"bg-blue-500":"bg-white","flex-0 h-4 w-4 rounded-full border border-gray-200"])},null,2),o[13]||(o[13]=e("div",{class:"flex-1 text-left"},[e("p",{class:"text-sm font-medium text-gray-900"},"All workspaces")],-1))],2),e("button",{class:O([s(t).allowedWorkspaces==="custom"?"border-blue-500 bg-white":"bg-gray-50","flex items-center gap-4 rounded-md border px-4 py-2 shadow-sm transition-all duration-150 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 sm:w-1/2"]),onClick:o[4]||(o[4]=u=>s(t).allowedWorkspaces="custom")},[e("div",{class:O([s(t).allowedWorkspaces==="custom"?"bg-blue-500":"bg-white","flex-0 h-4 w-4 rounded-full border border-gray-200"])},null,2),o[14]||(o[14]=e("div",{class:"flex-1 text-left"},[e("p",{class:"text-sm font-medium text-gray-900"},"Select workspaces")],-1))],2)]),s(t).allowedWorkspaces==="custom"?(m(),E(ve,{key:0,name:"fade",mode:"out-in"},{default:c(()=>[s(_).workspaces?(m(),h("div",ds,[e("div",us,[e("button",{class:"rounded-md px-2 py-1 text-xs font-medium text-blue-600 hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:o[5]||(o[5]=u=>{var M;return(M=s(_).workspaces)==null?void 0:M.forEach(P=>i(P))})}," Select All "),e("button",{class:"rounded-md px-2 py-1 text-xs font-medium text-blue-600 hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:o[6]||(o[6]=u=>ge(I)?I.value=[]:I=[])}," Deselect All ")]),e("ul",ms,[(m(!0),h(le,null,ie(s(_).workspaces,(u,M)=>{var P,y,N,D,b,F;return m(),h("li",{key:M,class:"flex w-full items-center px-4 py-2"},[e("div",cs,[e("div",{class:O([(P=u.workspace)!=null&&P.color?(y=u.workspace)==null?void 0:y.color:"bg-gray-300","flex h-10 w-10 items-center justify-center rounded-md border border-gray-200"])},[e("span",fs,x((N=u.workspace)==null?void 0:N.name.slice(0,2).toUpperCase()),1)],2)]),e("div",ps,[e("h4",ys,x((D=u.workspace)!=null&&D.name?(b=u.workspace)==null?void 0:b.name:"No name"),1),e("p",vs,x((F=u.workspace)==null?void 0:F.description),1)]),e("div",gs,[e("button",{type:"button",class:O([r.value(u)?"bg-blue-500":"bg-white hover:bg-gray-200","flex h-5 w-5 items-center justify-center rounded border border-gray-200 shadow-inner focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"]),onClick:A=>r.value(u)?V(u):i(u)},[o[15]||(o[15]=e("span",{class:"sr-only"},"Select",-1)),r.value(u)?(m(),E(s(Ne),{key:0,class:"h-4 w-4 text-white","aria-hidden":"true"})):S("",!0)],10,bs)])])}),128))])])):S("",!0)]),_:1})):S("",!0)])]),e("div",xs,[e("button",{class:"max-w-min rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-all duration-200 ease-in-out hover:border-gray-300 hover:bg-gray-200 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2",onClick:o[7]||(o[7]=u=>C())}," Cancel "),e("button",{class:"btn-primary max-w-max font-medium",disabled:s(v),onClick:o[8]||(o[8]=u=>W())}," Invite Member ",8,ws)])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}}),_s={class:"fixed inset-0 z-10 overflow-y-auto"},ks={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center lg:p-0"},$s={class:"flex w-full items-center justify-between border-b bg-gray-50 px-4 py-2"},Ms={class:"space-y-6 p-4"},Cs={class:"flex w-full flex-col items-start justify-between sm:flex-row"},Is={class:"flex-1"},Ss={class:"mt-1 flex items-center"},Ns={class:"ml-3"},Rs={class:"text-sm font-medium text-gray-900"},Es={class:"text-sm text-gray-600"},Ts={key:0,class:"flex w-full justify-end gap-x-1"},Ws={class:"mt-1 max-h-40 divide-y overflow-y-auto rounded-md bg-gray-100 shadow-inner"},Ps={class:"flex-0 mr-3"},As={class:"text-sm font-medium text-white"},js={class:"flex-1 truncate"},Bs={class:"truncate text-sm font-medium text-gray-900"}
1,Vs={class:"truncate text-xs text-gray-400"},Fs={class:"pl-2"},Ls=["onClick"],Os={class:"flex w-full items-center justify-end gap-4 border-t bg-gray-50 px-6 py-2"},Us=["disabled"],Ds=de({__name:"manageWorkspacesModal.component",props:{open:{type:Boolean},member:{},persistent:{type:Boolean}},emits:["close","submit"],setup(j,{emit:B}){const _=ue(),T=me();Ce();const f=j;Ue(()=>f.member,(i,r)=>{var $;r&&(($=_.workspaces)==null||$.forEach(W=>{var g,o;((o=(g=W.workspace)==null?void 0:g.members)==null?void 0:o.findIndex(u=>u.userId===f.member.userId))!==-1&&w(W)}),Y.info("Member changed",f.member))});const k=B;let v=R(!1),t=R([]);const C=()=>{t.value=[],k("close")},d=i=>{t.value.splice(t.value.indexOf(i),1)},w=i=>{t.value.push(i)},I=q(()=>i=>t.value.findIndex(r=>r.workspaceId===i.workspaceId)!==-1),V=async()=>{v.value=!0;const i=f.member.userId,r=t.value.map($=>$.workspaceId);try{if(!i||!r)throw new Error("Member ID or Workspace IDs are missing");Y.info(`Adding member ID: ${f.member.id} to workspaces: ${r}`),(await De.updateCompanyMemberWorkspaces({userId:i,workspaceIds:r})).data.success&&(T.success({title:"Success",message:"Member access has been updated"}),await _.syncCompany(),C())}catch($){Y.error($)}v.value=!1};return(i,r)=>(m(),E(s(ke),{as:"template",show:f.open},{default:c(()=>[l(s(we),{as:"div",class:"relative z-10",onClose:r[5]||(r[5]=$=>f.persistent?null:C())},{default:c(()=>[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},{default:c(()=>[...r[6]||(r[6]=[e("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1)])]),_:1}),e("div",_s,[e("div",ks,[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:c(()=>[l(s(he),{class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:w-full sm:max-w-2xl"},{default:c(()=>{var $,W,g,o,u,M,P,y,N,D;return[e("div",$s,[r[8]||(r[8]=e("h4",{class:"font-montserrat font-semibold text-gray-900"},"Manage Workspace Access",-1)),e("button",{type:"button",class:"rounded-md text-gray-500 hover:text-gray-500 focus:outline-none",onClick:r[0]||(r[0]=b=>C())},[r[7]||(r[7]=e("span",{class:"sr-only"},"Close",-1)),l(s(_e),{class:"h-5 w-5","aria-hidden":"true"})])]),e("div",Ms,[e("div",Cs,[e("div",Is,[r[9]||(r[9]=e("h4",{class:"text-sm font-medium text-gray-900"},"Modifying workspaces for:",-1)),e("div",Ss,[l(s(xe),{url:($=f.member.user)==null?void 0:$.avatar,initials:(W=f.member.user)!=null&&W.firstName&&((g=f.member.user)!=null&&g.lastName)?`${(u=(o=f.member.user)==null?void 0:o.firstName)==null?void 0:u.charAt(0)}${(P=(M=f.member.user)==null?void 0:M.lastName)==null?void 0:P.charAt(0)}`:"",for:"avatar",width:"w-9",height:"h-9",borderWidth:"border-0"},null,8,["url","initials"]),e("div",Ns,[e("h4",Rs,x((y=f.member.user)==null?void 0:y.firstName)+" "+x((N=f.member.user)==null?void 0:N.lastName),1),e("p",Es,x((D=f.member.user)==null?void 0:D.email),1)])])])]),r[11]||(r[11]=e("div",null,[e("label",{for:"visibility",class:"block truncate text-sm font-medium tracking-wide text-gray-700"}," Member Access "),e("p",{class:"text-sm text-gray-500"}," Select the workspace(s) you would like this member to have access to ")],-1)),l(ve,{name:"fade",mode:"out-in"},{default:c(()=>[e("div",null,[s(_).workspaces?(m(),h("div",Ts,[e("button",{class:"rounded-md px-2 py-1 text-xs font-medium text-blue-600 hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:r[1]||(r[1]=b=>{var F;return(F=s(_).workspaces)==null?void 0:F.forEach(A=>w(A))})}," Select All "),e("button",{class:"rounded-md px-2 py-1 text-xs font-medium text-blue-600 hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:r[2]||(r[2]=b=>ge(t)?t.value=[]:t=[])}," Deselect All ")])):S("",!0),e("ul",Ws,[(m(!0),h(le,null,ie(s(_).workspaces,(b,F)=>{var A,ce,G,fe,pe,K;return m(),h("li",{key:F,class:"flex w-full items-center px-4 py-2"},[e("div",Ps,[e("div",{class:O([(A=b.workspace)!=null&&A.color?(ce=b.workspace)==null?void 0:ce.color:"bg-gray-300","flex h-10 w-10 items-center justify-center rounded-md border border-gray-200"])},[e("span",As,x((G=b.workspace)==null?void 0:G.name.slice(0,2).toUpperCase()),1)],2)]),e("div",js,[e("h4",Bs,x((fe=b.workspace)!=null&&fe.name?(pe=b.workspace)==null?void 0:pe.name:"No name"),1),e("p",Vs,x((K=b.workspace)==null?void 0:K.description),1)]),e("div",Fs,[e("button",{type:"button",class:O
1([I.value(b)?"bg-blue-500":"bg-white hover:bg-gray-200","flex h-5 w-5 items-center justify-center rounded border border-gray-200 shadow-inner focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"]),onClick:p=>I.value(b)?d(b):w(b)},[r[10]||(r[10]=e("span",{class:"sr-only"},"Select",-1)),I.value(b)?(m(),E(s(Ne),{key:0,class:"h-4 w-4 text-white","aria-hidden":"true"})):S("",!0)],10,Ls)])])}),128))])])]),_:1})]),e("div",Os,[e("button",{class:"max-w-min rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-all duration-200 ease-in-out hover:border-gray-300 hover:bg-gray-200 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2",onClick:r[3]||(r[3]=b=>C())}," Cancel "),e("button",{class:"btn-primary max-w-max font-medium",disabled:s(v),onClick:r[4]||(r[4]=b=>V())}," Update ",8,Us)])]}),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}}),zs={class:"fixed inset-0 z-10 overflow-y-auto rounded-lg"},Ys={class:"flex min-h-full items-end justify-center rounded-lg p-4 text-center sm:items-center lg:p-0"},qs={class:"flex w-full items-center justify-between border-b bg-gray-50 px-4 py-2"},Gs={class:"relative max-h-[calc(100vh-280px)] overflow-y-auto bg-white"},Ks={key:0,class:"h-60"}
1,Hs={key:0,class:"w-full bg-white p-4 sm:p-6"},Zs={key:0,class:"mb-4 flex w-full items-start space-x-2 rounded-md border border-red-500 bg-red-50 px-4 py-2"},Js={class:"flex-0"},Qs={class:"flex w-full flex-col items-start justify-between sm:flex-row"},Xs={class:"flex-1"},et={class:"mt-1 flex items-center"},st={class:"ml-3"},tt={class:"text-sm font-medium text-gray-900"},ot={class:"text-sm text-gray-600"},at={class:"flex-0"},nt={class:"fixed bottom-0 left-0 right-0 flex w-full items-center justify-end gap-4 border-t bg-gray-50 px-6 py-2"},rt=["disabled"],lt=de({__name:"memberPermissionModal.component",props:{open:{type:Boolean},companyMember:{},persistent:{type:Boolean}},emits:["close"],setup(j,{emit:B}){const _=Te(),T=ue(),f=me(),k=Re(),v=Ee(),t=j,C=B;let d=R(!1),w=R(!1);ze(()=>_.loadUserPermissions(t.companyMember));const I=async()=>{var V;d.value=!0;try{await _.updateUserCompanyPermissions((V=t.companyMember.user)==null?void 0:V.id)&&(await T.syncCompany(),f.success({title:"Permissions Updated",message:"The permissions for the user have been updated successfully."}),C("close"))}catch(i){Y.error(i)}d.value=!1};return(V,i)=>(m(),E(s(ke),{as:"template",show:t.open},{default:c(()=>[l(s(we),{as:"div",class:"relative z-10 rounded-lg",onClose:i[3]||(i[3]=r=>t.persistent?null:C("close"))},{default:c(()=>[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},{default:c(()=>[...i[4]||(i[4]=[e("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1)])]),_:1}),e("div",zs,[e("div",Ys,[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:c(()=>[l(s(he),{class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:w-full sm:max-w-4xl"},{default:c(()=>[e("div",qs,[i[6]||(i[6]=e("h4",{class:"font-montserrat font-semibold text-gray-900"},"Manage Permissions",-1)),e("button",{type:"button",class:"rounded-md text-gray-500 hover:text-gray-500 focus:outline-none",onClick:i[0]||(i[0]=r=>C("close"))},[i[5]||(i[5]=e("span",{class:"sr-only"},"Close",-1)),l(s(_e),{class:"h-5 w-5","aria-hidden":"true"})])]),e("div",Gs,[l(ve,{name:"fade",mode:"out-in"},{default:c(()=>[s(w)?(m(),h("div",Ks,[l(s(Qe),{height:"h-12",width:"w-12",borderColor:"border-pink-500",textColor:"text-gray-900",overlay:!1})])):S("",!0)]),_:1}),l(ve,{name:"fade",mode:"out-in"},{default:c(()=>{var r,$,W,g,o,u,M,P,y,N;return[s(w)?S("",!0):(m(),h("div",Hs,[s(k).id===t.companyMember.userId?(m(),h("div",Zs,[e("div",Js,[l(s(Ye),{class:"mx-auto h-6 w-6 text-red-500","aria-hidden":"true"})]),i[7]||(i[7]=e("div",{class:"flex-1"},[e("h4",{class:"font-montserrat text-sm font-semibold text-gray-700"},"View Only"),e("p",{class:"text-sm text-gray-500"}," You cannot modify your own permissions. If you are a company owner you have all permissions, otherwise you may contact your administrator to request additional permissions. ")],-1))])):S("",!0),i[8]||(i[8]=e("h4",{class:"text-sm font-medium text-gray-900"},"Modifying permissions for:",-1)),e("div",Qs,[e("div",Xs,[e("div",et,[l(s(xe),{url:(r=t.companyMember.user)==null?void 0:r.avatar,initials:($=t.companyMember.user)!=null&&$.firstName&&((W=t.companyMember.user)!=null&&W.lastName)?`${(o=(g=t.companyMember.user)==null?void 0:g.firstName)==null?void 0:o.charAt(0)}${(M=(u=t.companyMember.user)==null?void 0:u.lastName)==null?void 0:M.charAt(0)}`:"",for:"avatar",width:"w-9",height:"h-9",borderWidth:"border-0"},null,8,["url","initials"]),e("div",st,[e("h4",tt,x((P=t.companyMember.user)==null?void 0:P.firstName)+" "+x((y=t.companyMember.user)==null?void 0:y.lastName),1),e("p",ot,x((N=t.companyMember.user)==null?void 0:N.email),1)])])]),e("div",at,[l(Ze,{disabled:t.companyMember.userId===s(k).id||!s(v).hasPermission("MANAGE_PERMISSIONS")},null,8,["disabled"])])]),l(Je,{isInvite:!1,disabled:t.companyMember.userId===s(k).id},null,8,["disabled"])]))]}),_:1})]),e("div",nt,[e("button",{class:"max-w-min rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-all duration-200 ease-in-out hover:border-gray-300 hover:bg-gray-200 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2",onClick:i[1]||(i[1]=r=>C("close"))}," Cancel "),e("button",{class:"btn-primary max-w-max",disabled:s(d)||j.companyMember.isOwner||s(k).id===t.companyMember.userId,onClick:i[2]||(i[2]=r=>I())},[s(d)?(m(),E(s(Me),{key:0,class:"mr-2"})):S("",!0),i[9]||(i[9]=ye(" Change Permissions ",-1))],8,rt)])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}}),it={class:"fixed inset-0 z-10 overflow-y-auto"},dt={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center lg:p-0"},ut={class:"flex w-full items-center justify-between border-b bg-gray-50 px-4 py-3 sm:px-6"},mt={class:"relative bg-white"},ct={class:"flex w-full items-center justify-end gap-4 border-t bg-gray-50 px-6 py-2"},ft=["disabled"],pt={class:"flex"},yt={key:0,class:"ml-2 h-4 w-4 animate-spin rounded-full border-t-2 border-gray-100"},vt=de({__name:"removeMemberModal.component",props:{open:{type:Boolean},member:{},persistent:{type:Boolean}},emits:["close"],setup(j,{emit:B}){const _=ue(),T=me(),f=j,k=B;let v=R(!1);const t=async()=>{v.value=!0;try{(await be.removeCompanyMember(f.member.id)).data.success&&(T.success({title:"Success",message:"User removed."}),_.syncCompany(),v.value=!1,k("close"))}catch{v.value=!1,k("close")}};return(C,d)=>(m(),E(s(ke),{as:"template",show:f.open},{default:c(()=>[l(s(we),{as:"div",class:"relative z-10",onClose:d[3]||(d[3]=w=>f.persistent?null:k("close"))},{default:c(()=>[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},{default:c(()=>[...d[4]||(d[4]=[e("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1)])]),_:1}),e("div",it,[e("div",dt,[l(s(U),{as:"template",enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:c(()=>[l(s(he),{class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:w-full sm:max-w-lg"},{default:c(()=>[e("div",ut,[d[6]||(d[6]=e("h4",{class:"font-montserrat text-lg font-medium text-gray-900"},"Remove Member",-1)),e("button",{type:"button",class:"mt-1 rounded-md text-gray-500 hover:text-gray-500 focus:outline-none",onClick:d[0]||(d[0]=w=>k("close"))},[d[5]||(d[5]=e("span",{class:"sr-only"},"Close",-1)),l(s(_e),{class:"h-6 w-6","aria-hidden":"true"})])]),d[8]||(d[8]=e("div",{class:"w-full bg-white p-4 sm:p-6"},[e("p",{class:"text-sm text-gray-500"}," You are about to remove a member from your company. This user will no longer be able to login to your company. Are you certain you wish to remove this member? ")],-1)),e("div",mt,[e("div",ct,[e("button",{class:"max-w-max rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 shadow-sm transition-all duration-200 ease-in-out hover:border-gray-300 hover:bg-gray-200 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2",onClick:d[1]||(d[1]=w=>k("close"))}," Keep Member "),e("button",{class:"max-w-max rounded-md bg-red-600 px-4 py-2 text-sm text-white shadow-sm transition-all duration-200 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:opacity-50",disabled:s(v),onClick:d[2]||(d[2]=w=>t())},[e("div",pt,[d[7]||(d[7]=e("span",{class:"font-medium"},"Remove Member",-1)),s(v)?(m(),h("span",yt)):S("",!0)])],8,ft)])])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}}),gt={class:"max-w-10xl relative mx-auto flex flex-col items-start px-6 py-6"},bt={class:"flex w-full flex-col items-start sm:flex-row sm:items-center"},xt={class:"flex-0"},wt=["disabled"],ht={class:"mt-8 w-full space-y-8"}
1,_t={class:"divide-y shadow sm:overflow-hidden sm:rounded-md"},kt={class:"bg-white px-4 py-6 sm:p-6"},$t={class:"grid grid-cols-8"},Mt={class:"col-span-8 lg:col-span-4 lg:pr-3"},Ct={class:"mt-8"},It={class:"mt-2 select-none list-disc pl-5"},St={class:"col-span-8 rounded-md lg:col-span-4"},Nt={class:"max-h-[366px] divide-y overflow-y-auto rounded-md border border-gray-200"},Rt={class:"flex items-center"},Et={class:"mx-3 flex-1 truncate whitespace-nowrap"},Tt={class:"truncate text-sm font-medium leading-tight text-gray-900"},Wt={class:"truncate text-sm text-gray-500"},Pt={class:"flex items-center space-x-1"},At=["onClick"],jt=["onClick"],Bt=["onClick"],Vt={class:"bg-white px-4 py-6 sm:p-6"},Ft={class:"grid grid-cols-8"},Lt={key:0,class:"col-span-8 max-h-[220px] overflow-y-auto lg:col-span-4"},Ot={class:"mr-2 flex w-full items-center"},Ut={class:"mx-3 flex-1 truncate"},Dt={class:"flex items-center truncate text-sm font-medium leading-none text-gray-900"},zt={class:"truncate leading-4"},Yt={class:"truncate text-sm text-gray-500"},qt={class:"flex items-center space-x-1"},Gt=["onClick"],Kt=["onClick"],Ht={key:1,class:"col-span-8 mt-5 lg:col-span-4"},Zt=["disabled"],Jt=["disabled"],ro=de({__name:"companyMembers.view",setup(j){const B=qe(),_=Te(),T=ue(),f=Re(),k=me(),v=Ce(),t=Ee();Ge(async()=>{await T.syncCompany(),await _.getPermissions()});const C=q(()=>{var a;let p=[];return(a=T.workspaces)==null||a.forEach(H=>{var n,L;(L=(n=H.workspace)==null?void 0:n.members)!=null&&L.some(z=>z.userId===f.id)&&p.push(H.workspace)}),p});let d=R({}),w=R({}),I=R(!1);const V=async()=>{I.value=!1,await T.syncCompany(),v.isLoading&&v.setLoading(!1)};let i=R(!1);const r=p=>{w.value=p,i.value=!0},$=()=>{w.value={},i.value=!1};let W=R(!1);const g=p=>{w.value=p,W.value=!0},o=()=>{d.value={},W.value=!1};let u=R(!1);const M=p=>{d.value=p,u.value=!0},P=()=>{d.value={},u.value=!1,_.selectedPermissions=[]};let y=R(!1),N=R(!1);const D=p=>{y.value=!1,d.value=p,N.value=!0},b=()=>{y.value=!1,d.value={},N.value=!1},F=async()=>{y.value=!0;try{let p={email:d.value.email};if((await be.inviteCompanyMembers(T.id,p)).data.success)return await new Promise(()=>{setTimeout(()=>{y.value=!1,k.success({title:"Success",message:"Invitation sent successfully"}),N.value=!1},1e3)})}catch(p){y.value=!1,Y.error(p)}finally{y.value=!1}};let A=R(!1);const ce=p=>{d.value=p,A.value=!0},G=()=>{d.value={},A.value=!1},fe=async p=>{y.value=!0,v.setLoading(!0);try{if((await be.removeCompanyMember(p)).data.success)return await new Promise(()=>{setTimeout(async()=>{k.success({title:"Success",message:"Invitation revoked successfully"}),G(),await T.syncCompany(),y.value=!1,v.setLoading(!1)},1e3)})}catch(a){Y.error(a)}finally{y.value=!1,v.setLoading(!1)}},pe=q(()=>{var p;return(p=T.members)==null?void 0:p.filter(a=>a.status==="active")});let K=q(()=>{var p;return(p=T.members)==null?void 0:p.filter(a=>a.status==="invited")});return(p,a)=>{var H;return m(),h("div",gt,[e("div",bt,[a[13]||(a[13]=e("div",{class:"flex-1"},[e("h4",{class:"font-montserrat text-xl font-semibold text-gray-900"},"Company Members"),e("p",{class:"text-sm text-gray-500"},"Invite and manage the users of your company")],-1)),e("div",xt,[e("button",{class:"btn-primary mb-4 mt-4 w-full lg:mb-0 lg:w-max",onClick:a[0]||(a[0]=n=>s(B).push({name:"company-members-invite"})),disabled:!s(t).hasPermission("INVITE_MEMBERS")},[s(t).hasPermission("INVITE_MEMBERS")?S("",!0):(m(),E(s(Ke),{key:0,class:"mr-2 h-4 w-4"})),a[12]||(a[12]=ye(" Invite Member ",-1))],8,wt)])]),e("div",ht,[e("div",_t,[e("div",kt,[e("div",$t,[e("div",Mt,[a[15]||(a[15]=e("h4",{class:"block truncate text-sm font-medium tracking-wide text-gray-700"},"Members",-1)),a[16]||(a[16]=e("p",{class:"text-sm text-gray-500"}," You can edit permissions and/or remove the existing members of the company. ",-1)),e("div",Ct,[a[14]||(a[14]=e("h5",{class:"text-sm font-medium text-gray-700"},"My Workspaces",-1)),e("ul",It,[(m(!0),h(le,null,ie(C.value,(n,L)=>(m(),h("li",{key:L,class:"list-item text-sm text-gray-500"},x(n.name),1))),128))])])]),e("div",St,[e("div",Nt,[(m(!0),h(le,null,ie(pe.value,(n,L)=>{var z,Z,J,Q,X,ee,se,te,oe,ae;return m(),h("div",{key:L,class:"w-full bg-gray-50 p-4 transition-all duration-200 ease-in-out"},[e("div",Rt,[l(s(xe),{url:(z=n.user)==null?void 0:z.avatar,initials:(Z=n.user)!=null&&Z.firstName&&((J=n.user)!=null&&J.lastName)?`${(X=(Q=n.user)==null?void 0:Q.firstName)==null?void 0:X.charAt(0)}${(se=(ee=n.user)==null?void 0:ee.lastName)==null?void 0:se.charAt(0)}`:"",for:"avatar",width:"w-10",height:"h-10",borderWidth:"border-0",shadow:"shadow-md"},null,8,["url","initials"]),e("div",Et,[e("h4",Tt,x((te=n.user)==null?void 0:te.firstName)+" "+x((oe=n.user)==null?void 0:oe.lastName)+" "+x(n.isOwner?"(Owner)":""),1),e("p",Wt,x((ae=n.user)==null?void 0:ae.email),1)]),e("div",Pt,[!n.isOwner&&s(t).hasPermission("ADD_OR_REMOVE_WORKSPACE_MEMBERS")?(m(),E(s(re),{key:0,content:"Manage Worksp
1aces",placement:"top"},{default:c(()=>[e("button",{class:"flex items-center rounded-full border border-transparent p-1 text-gray-500 transition-all duration-150 ease-in-out hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-pink-600 focus:ring-offset-2",onClick:ne=>r(n)},[l(s(Xe),{class:"h-5 w-5"})],8,At)]),_:2},1024)):S("",!0),s(t).hasPermission("MANAGE_PERMISSIONS")?(m(),E(s(re),{key:1,content:"Manage Permissions",placement:"top"},{default:c(()=>[e("button",{class:"flex items-center rounded-full border border-transparent p-1 text-gray-500 transition-all duration-150 ease-in-out hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-pink-600 focus:ring-offset-2",onClick:ne=>M(n)},[l(s(He),{class:"h-5 w-5"})],8,jt)]),_:2},1024)):S("",!0),!n.isOwner&&s(t).hasPermission("REMOVE_MEMBERS")?(m(),E(s(re),{key:2,content:"Remove Member",placement:"top"},{default:c(()=>[e("button",{class:"flex items-center rounded-full border border-transparent p-1 text-red-400 transition-all duration-150 ease-in-out hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-pink-600 focus:ring-offset-2",onClick:ne=>g(n)},[l(s(Se),{class:"h-5 w-5"})],8,Bt)]),_:2},1024)):S("",!0)])])])}),128))])])])]),e("div",Vt,[e("div",Ft,[a[19]||(a[19]=e("div",{class:"col-span-8 lg:col-span-4"},[e("h4",{class:"block truncate text-sm font-medium tracking-wide text-gray-700"},"Invites"),e("p",{class:"text-sm text-gray-500"}," You can edit permissions and/or remove the existing members of the workspace. ")],-1)),(H=s(K))!=null&&H.length?(m(),h("div",Lt,[(m(!0),h(le,null,ie(s(K),(n,L)=>{var z,Z,J,Q,X,ee,se,te,oe,ae,ne;return m(),h("div",{key:L,class:"w-full border-l border-r border-t border-gray-200 bg-gray-50 p-4 transition-all duration-200 ease-in-out first:rounded-t-md first:border-l first:border-r first:border-t last:rounded-b-md last:border-b last:border-l last:border-r"},[e("div",Ot,[l(s(xe),{url:(z=n.user)==null?void 0:z.avatar,initials:(Z=n.user)!=null&&Z.firstName&&((J=n.user)!=null&&J.lastName)?`${(X=(Q=n.user)==null?void 0:Q.firstName)==null?void 0:X.charAt(0)}${(se=(ee=n.user)==null?void 0:ee.lastName)==null?void 0:se.charAt(0)}`:"NA",for:"avatar",width:"w-10",height:"h-10",borderWidth:"border-0",shadow:"shadow-md"},null,8,["url","initials"]),e("div",Ut,[e("div",Dt,[e("h4",zt,x((te=n.user)!=null&&te.firstName&&((oe=n.user)!=null&&oe.lastName)?`${(ae=n.user)==null?void 0:ae.firstName} ${(ne=n.user)==null?void 0:ne.lastName}`:"Pending Registration"),1),a[17]||(a[17]=e("span",{class:"ml-2 hidden rounded-full bg-blue-200 px-2 py-0.5 text-xs sm:inline-block"}," Pending ",-1))]),e("p",Yt,x(n!=null&&n.email?n==null?void 0:n.email:""),1)]),e("div",qt,[s(t).hasPermission("INVITE_MEMBERS")?(m(),E(s(re),{key:0,content:"Resend Invite",placement:"top"},{default:c(()=>[e("button",{class:"flex items-center rounded-full border border-transparent p-1 text-gray-500 transition-all duration-150 ease-in-out hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-pink-600 focus:ring-offset-2",onClick:We=>D(n)},[l(s(es),{class:"h-5 w-5"})],8,Gt)]),_:2},1024)):S("",!0),s(t).hasPermission("REMOVE_MEMBERS")?(m(),E(s(re),{key:1,content:"Revoke Invite",placement:"top"},{default:c(()=>[e("button",{class:"flex items-center rounded-full border border-transparent p-1 text-red-400 transition-all duration-150 ease-in-out hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-pink-600 focus:ring-offset-2",onClick:We=>ce(n)},[l(s(Se),{class:"h-5 w-5"})],8,Kt)]),_:2},1024)):S("",!0)])])])}),128))])):(m(),h("div",Ht,[...a[18]||(a[18]=[e("h4",{class:"text-center text-sm font-medium text-gray-500"},"No pending invitations",-1)])]))])])])]),l(hs,{open:s(I),persistent:!1,onSubmit:a[1]||(a[1]=n=>s(v).setLoading(!0)),onClose:a[2]||(a[2]=n=>V())},null,8,["open"]),l(Ds,{open:s(i),member:s(w),persistent:!1,onClose:a[3]||(a[3]=n=>$())},null,8,["open","member"]),l(lt,{open:s(u),companyMember:s(d),persistent:!1,onClose:a[4]||(a[4]=n=>P())},null,8,["open","companyMember"]),l(vt,{open:s(W),member:s(w),persistent:!1,onClose:a[5]||(a[5]=n=>o())},null,8,["open","member"]),l(s(Ie),{open:s(N),title:"Resend Invitation",message:"This will send a new invitation to the user. Are you sure you want to continue?",persistent:!1,closeIcon:!0,onClose:a[8]||(a[8]=n=>ge(N)?N.value=!1:N=!1)},{actions:c(()=>[e("button",{class:"btn-primary w-full sm:max-w-max",disabled:s(y),onClick:a[6]||(a[6]=n=>F())},[s(y)?(m(),E(s(Me),{key:0,height:"h-4",width:"w-4","border-color":"border-white",class:"mr-2"})):S("",!0),ye(" "+x(s(y)?"Sending":"Resend Invite"),1)],8,Zt),e("button",{class:"w-full rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 shadow-sm transition-all duration-200 ease-in-out hover:border-gray-300 hover:bg-gray-200 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2 sm:max-w-max",onClick:a[7]||(a[7]=n=>b())}," Cancel ")]),_:1},8,["open"]),l(s(Ie),{open:s(A),title:"Revoke Invitation",message:"This will revoke the invitation to the user. Are you sure you want to continue?",persistent:!1,closeIcon:!0,onClose:a[11]||(a[11]=n=>ge(A)?A.value=!1:A=!1)},{actions:c(()=>[e("button",{class:"flex w-full items-center rounded-md bg-red-600 px-4 py-2 text-sm font-medium text-white shadow-sm transition-all duration-200 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:opacity-50 sm:max-w-max",disabled:s(y),onClick:a[9]||(a[9]=n=>fe(s(d).id))},[s(y)?(m(),E(s(Me),{key:0,height:"h-4",width:"w-4","border-color":"border-white",class:"mr-2"})):S("",!0),ye(" "+x(s(y)?"Revoking":"Revoke Invite"),1)],8,Jt),e("button",{class:"w-full rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 shadow-sm transition-all duration-200 ease-in-out hover:border-gray-300 hover:bg-gray-200 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2 sm:max-w-max",onClick:a[10]||(a[10]=n=>G())}," Cancel ")]),_:1},8,["open"])])}}});
1export{ro 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.