PageSourceSearch

https://app.meetalfred.com/BM0jN_F1.js

js meetalfred.com collected 2026-09-24 10:35:57 UTC 15,345 bytes, 1 lines download raw bytes

1import{D as ce,z as Oe,q as e,w as l,x as G,J as u,y as Ee,p as c,N as We}from"./zMQZ3vqD.js";import{m as Me,eg as Le,w as Ve,z as _e,eh as Be,a as Pe,aC as Qe,aE as $e,aD as L,a8 as he,D as Y,b8 as N,c6 as Fe,H as Ge,d as qe,aF as Je,aG as Ue,aH as Ye,ah as ze,G as Z,o as ee,M as te,b6 as ne,bo as Ne,bp as pe,ai as xe,ap as ue,V as se,W as ie,k as me,f as ge,g as je,h as E,aA as ae,i as ve,bw as ye,l as F,ce as we,by as Se,bE as fe}from"./BWeJ4otB.js";import"./BSc7nAdZ.js";import{d as Ke}from"./hle-0Evi.js";import"./dlecG_21.js";import"./DiqFlZAK.js";import"./CxjJ0NBy.js";import{u as De}from"./CHvny7Hy.js";import{A as Xe}from"./DRixcfY2.js";import"./C3Y7KbLQ.js";import"./CHXTyely.js";import"./apHXcpZ8.js";const re=(i,r)=>Me(["get-campaign-invites",JSON.stringify(i)],()=>Le(i),r),Ce=(i,r)=>{const m=ce(),h=Oe(),d=["get-campaign-invites",JSON.stringify(i)],{mutate:P,...k}=Ve("update-campaign-running-state",o=>Be(o),{...r,onMutate:async o=>{await h.cancelQueries({queryKey:d});const I=h.getQueryData(d);return h.setQueryData(d,a=>{var n;return a&&{...a,invites:(n=a==null?void 0:a.invites)==null?void 0:n.filter(p=>!(o!=null&&o.inviteIds.includes(p.id))),total:(a==null?void 0:a.total)-(o==null?void 0:o.inviteIds.length)}}),{prevData:I}},onSuccess:async(o,I,a)=>{await h.refetchQueries({queryKey:d,exact:!1})},onError:(o,I,a)=>{const n=a;n!=null&&n.prevData&&h.setQueryData(d,n.prevData),m(_e({type:"error",message:(o==null?void 0:o.message)??"Oops, something has gone wrong!",autoCloseTime:3e3}))}});return{updateStatus:P,...k}},Te=({date:i})=>{const r=Ke(i).local();return e.jsxs(l,{children:[e.jsx(Pe,{children:r.format("ddd, D MMM YYYY")}),e.jsx(Pe,{fontSize:"12px",lineHeight:"16px",color:"greyNeutral.60",children:r.format("h:mm a")})]})},Ze=8,et=G(l,{target:"e7y5tpd5"})({name:"t5mf48",styles:"display:flex;flex-direction:column;flex:1;min-height:0;width:100%"}),tt=G(l,{target:"e7y5tpd4"})({name:"2dwxbm",styles:"margin:16px 0;display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:16px"}),nt=G(l,{target:"e7y5tpd3"})("height:1px;background-color:",({theme:i})=>i.palette.greyBlue[20],";"),st=G(l,{target:"e7y5tpd2"})("flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;border-radius:12px;border:1px solid ",({theme:i})=>i.palette.greyBlue[30],";background-color:#ffffff;overflow:hidden;"),it=G(l,{target:"e7y5tpd1"})({name:"1qcgktf",styles:"flex:1;min-height:0;overflow:hidden"}),oe=G(l,{target:"e7y5tpd0"})({name:"fxp7t8",styles:"flex:1;min-width:0"}),at=()=>e.jsx(u,{variant:"rounded",height:34}),rt=({variant:i})=>i==="withdrawn"?e.jsxs(e.Fragment,{children:[e.jsx(oe,{children:e.jsx(u,{variant:"rounded",width:"40%",height:18,sx:L})}),e.jsx(l,{width:"260px",children:e.jsx(u,{variant:"rounded",width:60,height:18,sx:L})})]}):e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"rounded",width:16,height:16,sx:L}),e.jsx(oe,{children:e.jsx(u,{variant:"rounded",width:"40%",height:18,sx:L})}),e.jsx(l,{width:"140px",children:e.jsx(u,{variant:"rounded",width:60,height:18,sx:L})}),i==="received"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{width:"80px",children:e.jsx(u,{variant:"rounded",width:60,height:18,sx:L})}),e.jsx(l,{width:"80px",children:e.jsx(u,{variant:"rounded",width:50,height:18,sx:L})})]}),i==="sent"&&e.jsx(l,{width:"120px",children:e.jsx(u,{variant:"rounded",width:80,height:18,sx:L})})]}),ot=({variant:i})=>i==="withdrawn"?e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"circular",width:32,height:32}),e.jsx(oe,{children:e.jsx(u,{variant:"rounded",width:"55%",height:16})}),e.jsx(l,{width:"260px",children:e.jsx(u,{variant:"rounded",width:"70%",height:16})})]}):e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"rounded",width:16,height:16}),e.jsx(u,{variant:"circular",width:32,height:32}),e.jsx(oe,{children:e.jsx(u,{variant:"rounded",width:"55%",height:16})}),e.jsx(l,{width:"140px",children:e.jsx(u,{variant:"rounded",width:"70%",height:16})}),i==="received"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{width:"80px",children:e.jsx(u,{variant:"rounded",width:64,height:28})}),e.jsx(l,{width:"80px",children:e.jsx(u,{variant:"rounded",width:56,height:28})})]}),i==="sent"&&e.jsx(l,{width:"120px",children:e.jsx(u,{variant:"rounded",width:100,height:28})})]}),ke=({variant:i,"data-testid":r="invitations-table-skeleton"})=>{const m=i==="sent"?2:1;return e.jsxs(et,{"data-testid":r,children:[e.jsx(nt,{}),e.jsx(tt,{children:Array.from({length:m},(h,d)=>e.jsx(at,{},d))}),e.jsxs(st,{children:[e.jsx(Qe,{children:e.jsx(rt,{variant:i})}),e.jsx(it,{children:Array.from({length:Ze},(h,d)=>e.jsx($e,{children:e.jsx(ot,{variant:i})},d))})]})]})},le={page:N,perPage:Y,sortField:"sentTime",sortOrder:"DESC"},be={page:N,perPage:Y,sortField:"name",sortOrder:"ASC",filters:[Fe.INVITE_WITHDRAWN],skipNoPersonActions:!0},Ie=({children:i,selected:r,getInvitesParams:m=le,getWithdrawnInvitesParams:h=be,onSuccess:d})=>{const{tab:P}=Ee(),k=ce(),{companyName:o}=he(),{updateStatus:I}=Ce(m),a=x=>I({status:x,inviteIds:r},{onSuccess:d}),{data:n}=re({...P==="sent"?m:le,status:"SENT"},{refetchOnMount:!0}),{data:p}=re({...P==="received"?m:le,status:"RECEIVED"},{refetchOnMount:!0}),{data:g}=De(P==="withdrawn"?h:be,{refetchOnMount:!0}),O=r.length,D=[{name:"Sent",count:n==null?void 0:n.total,route:"sent"},{name:"Received",count:p==null?void 0:p.total,route:"received"},{name:"Withdrawn",count:g==null?void 0:g.total,route:"withdrawn"}],b=()=>{switch(P){case"sent":return[{title:"Withdraw",onClick:()=>a("WITHDRAW"),description:"profile(s) to withdraw"}];
1case"received":return[{title:"Accept",onClick:()=>a("ACCEPT"),description:"invitation(s) to accept"},{title:"Reject",onClick:()=>a("REJECT"),description:"invitation(s) to reject",variant:"warning"}];default:return[]}},A=(x,y)=>k(O?ee({type:te.INVITE,headerText:"Success",params:{description:`The selected ${x} will be added to ${o}’s next batch for processing.`,buttonText:"Proceed",onConfirm:y}}):ee({type:te.INVITE,headerText:"Warning",params:{description:"Please select at least one invitation to make this action.",buttonText:"Close"}}));return e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{children:[e.jsx(qe,{children:"Invitations"}),e.jsx(Je,{children:D.map(({name:x,count:y=0,route:f})=>{const w=`/invitations/${f}`;return e.jsx(Ue,{to:w,count:y,children:x},w)})}),e.jsx(Ye,{articleLink:"https://help.meetalfred.com/en/articles/5276922-rejected-or-pending-invitations-by-recipients",videoLink:"https://player.vimeo.com/video/622842901"})]}),e.jsxs(ze,{position:"relative",children:[i,e.jsx(Xe,{selected:O,children:b().map(({title:x,description:y,onClick:f,variant:w="primary"})=>e.jsx(Z,{variant:w,onClick:()=>A(y,f),children:x},x))})]})]})},ct=()=>{var K;const i=ce(),{companyName:r}=he(),[m,h]=c.useState(N),[d,P]=c.useState(Y),[k,o]=c.useState("sentTime"),[I,a]=c.useState("DESC"),[n,p]=c.useState([]),[g,O]=c.useState({name:""}),D=ne(((K=g.name)==null?void 0:K.trim())||"",300),b={page:m,perPage:d,status:"RECEIVED",sortField:k,sortOrder:I,name:D},{data:A,isLoading:x,isFetching:y}=re(b),f=Ne(x),{invites:w=[],total:C=0}=A??{},H=t=>t&&n.some(j=>j===t),M=(w==null?void 0:w.map(({id:t})=>t))||[],V=M.every(t=>H(t)),W=!!C&&V,_=g.name?"No profiles meet your search criteria":"No invitations yet.",{updateStatus:T}=Ce(b),R=(t,j)=>{const $=t==="ACCEPT"?"accept":"reject";return i(ee({type:te.INVITE,headerText:"Success",params:{description:`The selected profile(s) to ${$} will be added to ${r}’s next batch for processing.`,buttonText:"Proceed",onConfirm:()=>T({status:t,inviteIds:[j]})}}))},q=()=>p(W?n.filter(t=>!M.some(j=>j===t)):[...n,...M.filter(t=>!H(t))]),J=t=>n.includes(t)?p(n.filter(j=>j!==t)):p(j=>[...j,t]),v=t=>{h(t.page),P(t.perPage)},Q={sortOrder:I,sortField:k,onSortFieldChange:(t,j)=>{o(t),a(j)}},U=t=>{h(N),O(j=>({...j,...t}))};c.useEffect(()=>{(w==null?void 0:w.length)===0&&m>1&&!x&&h(N)},[A]);const z=!f&&!C&&!D&&!x&&!y;let B="data";return f?B="skeleton":z&&(B="empty"),e.jsx(Ie,{selected:n,onSuccess:()=>p([]),getInvitesParams:B==="data"?b:void 0,children:e.jsx(pe,{"data-testid":"invitations-received-morph-stack",view:B,skeleton:e.jsx(ke,{variant:"received"}),emptyState:e.jsx(fe,{src:"https://player.vimeo.com/video/622842901",title:"No invitations yet",description:"It looks like you don't have invitations yet."}),children:e.jsxs(l,{display:"flex",flexDirection:"column",width:"100%",height:"100%",minHeight:0,children:[e.jsx(xe,{}),e.jsx(ue,{children:e.jsx(se,{placeholder:"Search by name...",name:"name",leftIcon:e.jsx(ie,{}),value:g.name,onChange:t=>U({name:t.target.value})})}),e.jsxs(me,{processing:y,paginationProps:{page:m,perPage:d,total:C,onPaginationChange:v},children:[e.jsx(ge,{children:e.jsxs(je,{children:[e.jsx(E,{width:"52px",children:e.jsx(ae,{type:"checkbox",checkIcon:n.length>0&&W?"check-mark":"dash",checked:n.length>0,onChange:q})}),e.jsx(E,{name:"name",sorting:Q,children:"Name"}),e.jsx(E,{name:"sentTime",sorting:Q,width:"160px",children:"Date"}),e.jsx(E,{width:"97px"}),e.jsx(E,{width:"91px"})]})}),e.jsx(ve,{placeholder:!C&&_,children:w.map(({id:t,picture:j,name:$,sentTime:s,occupation:S},de)=>{const X=n.includes(t);return e.jsxs(ye,{staggerDelayMs:Se(de),checked:X,children:[e.jsx(F,{preventClick:!0,children:e.jsx(ae,{type:"checkbox",checked:X,onChange:()=>J(t)})}),e.jsx(F,{sx:{padding:"12px 16px !important"},contentStyle:{width:"100%"},children:e.jsx(we,{name:$,picture:j,title:S})}),e.jsx(F,{sx:{padding:"15px 16px !important"},children:e.jsx(Te,{date:s})}),e.jsx(F,{preventClick:!0,sx:{padding:"17px 8px 17px 16px !important"},children:e.jsx(Z,{variant:"transparent",scale:"s",onClick:()=>R("ACCEPT",t),children:"Accept"})}),e.jsx(F,{preventClick:!0,sx:{padding:"17px 16px 17px 8px !important"},children:e.jsx(Z,{variant:"warning-transparent",scale:"s",onClick:()=>R("REJECT",t),children:"Reject"})})]},t)})})]})]})})})},dt=()=>{var j,$;const i=ce(),{companyName:r}=he(),[m,h]=c.useState(N),[d,P]=c.useState(Y),[k,o]=c.useState("sentTime"),[I,a]=c.useState("DESC"),[n,p]=c.useState([]),[g,O]=c.useState({name:"",occupation:""}),D=ne(((j=g.name)==null?void 0:j.trim())||"",300),b=ne((($=g.occupation)==null?void 0:$.trim())||"",300),A=D||b,x={page:m,perPage:d,status:"SENT",sortField:k,sortOrder:I,name:D,occupation:b},{data:y,isLoading:f,isFetching:w}
1=re(x),{invites:C=[],total:H=0}=y??{},M=s=>s&&n.some(S=>S===s),V=(C==null?void 0:C.map(({id:s})=>s))||[],W=V.every(s=>M(s)),_=!!H&&W,T=g.name||g.occupation?"No profiles meet your search criteria":"No invitations yet.",R=s=>n.includes(s)?p(n.filter(S=>S!==s)):p(S=>[...S,s]),q=()=>p(_?n.filter(s=>!V.some(S=>S===s)):[...n,...V.filter(s=>!M(s))]),J=s=>{h(s.page),P(s.perPage)},v={sortOrder:I,sortField:k,onSortFieldChange:(s,S)=>{o(s),a(S)}},{updateStatus:Q}=Ce(x),U=s=>{i(ee({type:te.INVITE,headerText:"Success",params:{description:`The selected profile(s) to withdraw will be added to ${r}’s next batch for processing.`,buttonText:"Proceed",onConfirm:()=>Q({status:"WITHDRAW",inviteIds:[s]})}}))},z=s=>{h(N),O(S=>({...S,...s}))};c.useEffect(()=>{(C==null?void 0:C.length)===0&&m>1&&!f&&h(N)},[y]);const B=f&&!A,K=!B&&!H&&!A;let t="data";return B?t="skeleton":K&&(t="empty"),e.jsx(Ie,{selected:n,onSuccess:()=>p([]),getInvitesParams:t==="data"?x:void 0,children:e.jsx(pe,{"data-testid":"invitations-sent-morph-stack",view:t,skeleton:e.jsx(ke,{variant:"sent"}),emptyState:e.jsx(fe,{src:"https://player.vimeo.com/video/622842901",title:"No invitations yet",description:"It looks like you don't have invitations yet."}),children:e.jsxs(l,{display:"flex",flexDirection:"column",width:"100%",height:"100%",minHeight:0,children:[e.jsx(xe,{}),e.jsxs(ue,{children:[e.jsx(se,{placeholder:"Search by name...",name:"name",leftIcon:e.jsx(ie,{}),value:g.name,onChange:s=>z({name:s.target.value})}),e.jsx(se,{placeholder:"Search by job title...",name:"occupation",leftIcon:e.jsx(ie,{}),value:g.occupation,onChange:s=>z({occupation:s.target.value})})]}),e.jsxs(me,{processing:f||w,paginationProps:{page:m,perPage:d,total:H,onPaginationChange:J},children:[e.jsx(ge,{children:e.jsxs(je,{children:[e.jsx(E,{width:"52px",children:e.jsx(ae,{type:"checkbox",checkIcon:n.length>0&&_?"check-mark":"dash",checked:n.length>0,onChange:q})}),e.jsx(E,{name:"name",sorting:v,children:"Name"}),e.jsx(E,{name:"sentTime",sorting:v,width:"160px",children:"Date"}),e.jsx(E,{width:"125px"})]})}),e.jsx(ve,{placeholder:!H&&T,children:C.map(({id:s,picture:S,name:de,sentTime:X,occupation:Ae},He)=>{const Re=n.includes(s);return e.jsxs(ye,{staggerDelayMs:Se(He),checked:Re,children:[e.jsx(F,{preventClick:!0,children:e.jsx(ae,{type:"checkbox",checked:n.includes(s),onChange:()=>R(s)})}),e.jsx(F,{contentStyle:{width:"100%"},sx:{padding:"12px 16px !important"},children:e.jsx(we,{name:de,picture:S,title:Ae})}),e.jsx(F,{sx:{padding:"15px 16px !important"},children:e.jsx(Te,{date:X})}),e.jsx(F,{preventClick:!0,sx:{padding:"17px 16px !important"},children:e.jsx(Z,{variant:"transparent",scale:"s",onClick:()=>U(s),children:"Withdraw"})})]},s)})})]})]})})})},lt=()=>{var _;const[i,r]=c.useState(N),[m,h]=c.useState(Y),[d,P]=c.useState("date"),[k,o]=c.useState("DESC"),[I,a]=c.useState([]),[n,p]=c.useState({name:""}),g=ne(((_=n.name)==null?void 0:_.trim())||"",300),O={page:i,perPage:m,sortField:d,sortOrder:k,filters:[Fe.INVITE_WITHDRAWN],skipNoPersonActions:!0,...g?{names:[g]}:{}},{data:D,isLoading:b,isFetching:A}=De(O),x=Ne(b),{actions:y=[],total:f=0}=D??{},w=n.name?"No profiles meet your search criteria":"No withdrawn invitations yet.",C=T=>{r(T.page),h(T.perPage)},H={sortOrder:k,sortField:d,onSortFieldChange:(T,R)=>{P(T),o(R)}},M=T=>{r(N),p(R=>({...R,...T}))};c.useEffect(()=>{(y==null?void 0:y.length)===0&&i>1&&!b&&r(N)},[D]);const V=!x&&!f&&!g&&!b&&!A;let W="data";return x?W="skeleton":V&&(W="empty"),e.jsx(Ie,{selected:I,onSuccess:()=>a([]),getWithdrawnInvitesParams:W==="data"?O:void 0,children:e.jsx(pe,{"data-testid":"invitations-withdrawn-morph-stack",view:W,skeleton:e.jsx(ke,{variant:"withdrawn"}),emptyState:e.jsx(fe,{src:"https://player.vimeo.com/video/622842901",title:"No invitations yet",description:"It looks like you don't have invitations yet."}),children:e.jsxs(l,{display:"flex",flexDirection:"column",width:"100%",height:"100%",minHeight:0,children:[e.jsx(xe,{}),e.jsx(ue,{children:e.jsx(se,{placeholder:"Search by name...",name:"name",leftIcon:e.jsx(ie,{}),value:n.name,onChange:T=>M({name:T.target.value})})}),e.jsxs(me,{processing:A,paginationProps:{page:i,perPage:m,total:f,onPaginationChange:C},children:[e.jsx(ge,{children:e.jsxs(je,{children:[e.jsx(E,{name:"name",sorting:H,children:"Name"}),e.jsx(E,{name:"date",sorting:H,width:"280px",children:"Date"})]})}),e.jsx(ve,{placeholder:!f&&w,children:y.map(({id:T,person:R,createdAt:q},J)=>{const{linkedInData:v,name:Q,picture:U}=R||{};return e.jsxs(ye,{staggerDelayMs:Se(J),children:[e.jsx(F,{sx:{padding:"12px 16px !important"},contentStyle:{width:"100%"},children:e.jsx(we,{name:Q,picture:U,fallbackPicture:v==null?void 0:v.pic,title:v==null?void 0:v.headline,company:v==null?void 0:v.company,degree:v==null?void 0:v.connectionLevel})}),e.jsx(F,{sx:{padding:"15px 16px !important"},children:e.jsx(Te,{date:q})})]},T)})})]})]})})})},Ct=()=>{const{tab:i}=Ee(),r=()=>{switch(i){case"sent":return e.jsx(dt,{});
1case"received":return e.jsx(ct,{});case"withdrawn":return e.jsx(lt,{});default:return e.jsx(We,{to:"/invitations/sent"})}};return e.jsx(e.Fragment,{children:r()})};export{Ct as Invitations};

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.