1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5470],{43420:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 00-44.4 0L77.5 505a63.9 63.9 0 00-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0018.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"}}]},name:"home",theme:"outlined"}},5260:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"}},5005:function(e,t,s){"use strict";var r=s(64836),a=s(18698);t.Z=void 0;var i=r(s(42122)),n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=a(e)&&"function"!=typeof e)return{default:e};var s=_getRequireWildcardCache(t);if(s&&s.has(e))return s.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&({}).hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,s&&s.set(e,r),r}(s(67294)),o=r(s(43420)),c=r(s(92074));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache=function(e){return e?s:t})(e)}var l=n.forwardRef(function(e,t){return n.createElement(c.default,(0,i.default)((0,i.default)({},e),{},{ref:t,icon:o.default}))});t.Z=l},34700:function(e,t,s){"use strict";var r=s(64836),a=s(18698);t.Z=void 0;var i=r(s(42122)),n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=a(e)&&"function"!=typeof e)return{default:e};var s=_getRequireWildcardCache(t);if(s&&s.has(e))return s.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&({}).hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,s&&s.set(e,r),r}(s(67294)),o=r(s(5260)),c=r(s(92074));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache=function(e){return e?s:t})(e)}var l=n.forwardRef(function(e,t){return n.createElement(c.default,(0,i.default)((0,i.default)({},e),{},{ref:t,icon:o.default}))});t.Z=l},23493:function(e,t,s){var r=s(23279),a=s(13218);e.exports=function(e,t,s){var i=!0,n=!0;if("function"!=typeof e)throw TypeError("Expected a function");return a(s)&&(i="leading"in s?!!s.leading:i,n="trailing"in s?!!s.trailing:n),r(e,t,{leading:i,maxWait:t,trailing:n})}},94740:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/associations/[associationId]/members",function(){return s(77596)}])},77596:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return _}});var r=s(85893),a=s(67294),i=s(11163),n=s(5434),o=s(89298),c=s(3281),l=s(83105),u=s(63750),d=s(16498),m=s(90379),f=s(94543),p=s(64480),x=s(93974),h=s(67421),b=s(23823),v=s(93162),j=s(86501),g=s(36940),components_MembersList=e=>{let{associationId:t,search:s,setSelectedMember:a}=e,{t:i}=(0,h.$G)(["associations"]),{isLoading:n,data:o,fetchNextPage:c,fetchPreviousPage:l,hasPreviousPage:y,hasNextPage:N}=(0,d.ns)(t,s),{isLoading:A,refetch:C}=(0,g.Se)({associationId:t,enabled:!1}),onSelectMember=e=>()=>a(e),onClickExportCSV=async()=>{try{let e=await C();if(e.data){let t=new Date().toISOString().split("T")[0];(0,v.saveAs)(e.data,"association-members-".concat(t,".csv"))}}catch(e){j.Am.error(i("members.exportMembersFailed"))}};return(0,r.jsx)(p.Z,{title:i("members.members"),description:i("members.membersDescription"),onNext:c,onPrev:l,hasNextPage:N,hasPreviousPage:y,headerContent:(0,r.jsx)("div",{className:"flex justify-start",children:(0,r.jsx)(b.Z,{onClick:onCl
1ickExportCSV,loading:A})}),children:n?(0,r.jsx)(m.Z,{isLoading:!0}):null==o?void 0:o.map(e=>(0,r.jsx)(x.Z,{avatar:(0,r.jsx)(f.qE,{src:e.user.photoUrl}),label:"".concat(e.user.firstName," ").concat(e.user.lastName),actions:(0,r.jsx)("button",{type:"button","aria-label":"Member actions",onClick:onSelectMember(e),children:(0,r.jsx)(u.evw,{size:20})})},e.id))})},components_AffiliatesList=e=>{let{associationId:t,search:s}=e,{t:a}=(0,h.$G)(["associations"]),{isLoading:i,data:n,fetchNextPage:o,fetchPreviousPage:c,hasPreviousPage:l,hasNextPage:u}=(0,d.dG)(t,s),{isLoading:y,refetch:N}=(0,g._F)({associationId:t,enabled:!1}),onClickExportCSV=async()=>{try{let e=await N();if(e.data){let t=new Date().toISOString().split("T")[0];(0,v.saveAs)(e.data,"association-affiliate-members-".concat(t,".csv"))}}catch(e){j.Am.error(a("members.exportAffiliatedMembersFailed"))}};return(0,r.jsx)(p.Z,{title:a("members.affiliates"),description:a("members.affiliatesDescription"),onNext:o,onPrev:c,hasNextPage:u,hasPreviousPage:l,headerContent:(0,r.jsx)("div",{className:"flex justify-start",children:(0,r.jsx)(b.Z,{onClick:onClickExportCSV,loading:y})}),children:i?(0,r.jsx)(m.Z,{isLoading:!0}):null==n?void 0:n.map(e=>(0,r.jsx)(x.Z,{avatar:(0,r.jsx)(f.qE,{src:e.user.photoUrl}),label:"".concat(e.user.firstName," ").concat(e.user.lastName)},e.user.id))})},y=s(52396),components_RequestsList=e=>{let{associationId:t,search:s}=e,{t:a}=(0,h.$G)(["associations"]),{isLoading:i,data:n,fetchNextPage:o,fetchPreviousPage:c,hasPreviousPage:l,hasNextPage:u}=(0,d.KR)(t,s),{mutate:b,isLoading:v}=(0,d.Lo)(),acceptRequest=e=>{b({associationId:t,userId:e.user.id,status:"approved"},{onSuccess:()=>{y.Vp(a("membershipRequestApproved"))},onError:()=>{y.vU(a("membershipRequestApprovedError"))}})},rejectRequest=e=>{b({associationId:t,userId:e.user.id,status:"rejected"},{onSuccess:()=>{y.Vp(a("membershipRequestRejected"))},onError:()=>{y.vU(a("membershipRequestRejectedError"))}})};return(0,r.jsx)(p.Z,{title:a("members.requests"),description:a("members.requestsDescription"),onNext:o,onPrev:c,hasNextPage:u,hasPreviousPage:l,emptyText:a("members.noRequests"),children:i?(0,r.jsx)(m.Z,{isLoading:!0}):null==n?void 0:n.map(e=>(0,r.jsx)(x.Z,{avatar:(0,r.jsx)(f.qE,{src:e.user.photoUrl}),label:"".concat(e.user.firstName," ").concat(e.user.lastName),actions:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{className:"text-primary-700 text-sm font-bold","aria-label":"Reject request",type:"button",disabled:v,onClick:()=>rejectRequest(e),children:a("members.reject")}),(0,r.jsx)("div",{className:"text-neutral-300",children:"|"}),(0,r.jsx)("button",{className:"text-primary-700 text-sm font-bold","aria-label":"Accept request",type:"button",disabled:v,onClick:()=>acceptRequest(e),children:a("members.accept")})]})},e.id))})},components_AdminsList=e=>{let{associationId:t,search:s,setSelectedMember:a}=e,{t:i}=(0,h.$G)(["associations"]),{isLoading:n,data:o,fetchNextPage:c,fetchPreviousPage:l,hasPreviousPage:b,hasNextPage:v}=(0,d.VT)(t,s),onSelectMember=e=>()=>a(e);return(0,r.jsx)(p.Z,{title:i("members.admins"),description:i("members.adminsDescription"),onNext:c,onPrev:l,hasNextPage:v,hasPreviousPage:b,children:n?(0,r.jsx)(m.Z,{isLoading:!0}):null==o?void 0:o.map(e=>(0,r.jsx)(x.Z,{avatar:(0,r.jsx)(f.qE,{src:e.user.photoUrl,children:(0,r.jsx)(f.MX,{children:(0,r.jsx)("img",{src:"/img/icons/shield-person-gradient.svg"})})}),label:"".concat(e.user.firstName," ").concat(e.user.lastName),actions:(0,r.jsx)("button",{type:"button","aria-label":"Member actions",onClick:onSelectMember(e),children:(0,r.jsx)(u.evw,{size:20})})},e.id))})},N=s(96671),A=s(48905),C=s(33011),components_MemberOptionsModal=e=>{let{associationId:t,closeMemberOptionsModal:s,visible:a,selectedMember:i}=e,{mutate:n}=(0,d.Lo)(),{mutate:o}=(0,d.NO)(),{t:c}=(0,h.$G)(["associations"]);return(0,r.jsx)(N.Z,{type:N.w.SMALL,onClose:s,autoHeight:!0,hideCloseButton:!0,visible:a,children:(0,r.jsxs)("div",{className:"p-4 flex flex-col",children:[i&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(A.ZP,{type:A.L$.Danger,newRadius:!0,onClick:()=>{o({associationId:t,userId:i.user.id},{onSuccess:()=>{y.Vp("".concat(i.user.firstName," ").concat(i.user.lastName," has been removed from the association.")),s()},onError:()=>{y.vU("An error occurred while trying to remove this user from the association.")}})},children:c("members.actions.removeFromAssociation")}),(null==i?void 0:i.role)==="admin"&&(0,r.jsx)(A.ZP,{type:A.L$.Danger,newRadius:!0,onClick:()=>{n({associationId:t,userId:i.user.id,role:"member",status:"approved"},{onSuccess:()=>{y.Vp("".concat(i.user.firstName," ").concat(i.user.lastName," is now a member of the association")),s()},onError:()=>{y.vU("An error occurred while trying to make this user a member.")}})},children:c("members.actions.removeAsAdmin")}),(null==i?void 0:i.role)==="member"&&(0,r.jsx)(A.ZP,{type:A.L$.Inverted,newRadius:!0,onClick:()=>{n({associationId:t,userId:i.user.id,role:"admin",status:"approved"},{onSuccess:()=>{y.Vp("".concat(i.user.firstName," ").concat(i.user.lastName," is now an admin of the association")),s()},onError:()=>{y.vU("An error occurred while trying to promote this user to admin.")}})},children:c("members.actions.makeAdmin")})]}),(0,r.jsx)(C.Z,{size:4}),(0,r.jsx)("div",{className:"flex gap-2 flex-col pb-2 mt-6",children:(0,r.jsx)(A.ZP,{type:A.L$.Inverted,onClick:s,children:c("members.actions.cancel")})})]})})},associations_AssociationMembers=()=>{let{query:e}=(0,i.useRouter)(),t=e.associationId,[s,u]=(0,a.useState)(""),[d]=(0,o.Z)(s,200),[m,f]=(0,a.useState)(null);return(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(c.Z,{hidePageMenu:!0,isAdmin:!0,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"pb-10",children:(0,r.jsxs)("div",{className:"relative shrink-0 flex h-12 border-1 border-gray-300 rounded-full mt-5 mb-2",children:[(0,r.jsx)(n.Zh8,{className:"absolute left-3 text-gray-400 self-center justify-center",size:24}),(0,r.jsx)("input",{type:"text",className:"w-full h-full px-11 rounded-full text-base text-gray-600 placeholder:text-gray-400",placeholder:"Search",value:s,onChange:e=>{u(e.target.value)}})]})}),(0,r.jsxs)("div",{className:"flex gap-10 flex-col",children:[(0,r.jsxs)("div",{className:"flex flex-col-reverse md:flex-row gap-11",children:[(0,r.jsx)(components_AdminsList,{associationId:t,search:d,setSelectedMember:f}),(0,r.jsx)(components_RequestsList,{associationId:t,search:d})]}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row gap-11",children:[(0,r.jsx)(components_MembersList,{associationId:t,search:d,setSelectedMember:f}),(0,r.jsx)(components_AffiliatesList,{associationId:t,search:d})]})]})]})}),(0,r.jsx)(components_MemberOptionsModal,{closeMemberOptionsModal:()=>{f(()=>null)},selectedMember:m,visible:!!m,associationId:t})]})},w=s(18491);let AssociationMembersScreen=()=>(0,r.jsx)(associations_AssociationMembers,{});var _=AssociationMembersScreen;AssociationMembersScreen.getLayout=e=>(0,r.jsx)(w.Z,{children:e})},36940:function(e,t,s){"use strict";s.d(t,{Cs:function(){return useAssociationGroupsSummary},Se:function(){return useExportAssociationMembersCSV},_F:function(){return useExportAssociationAffiliatesCSV},dS:function(){return useAssociationGroupsInfinite}});var r=s(88767),a=s(43700);let i={all:["associationGroups"],lists:()=>[...i.all,"list"],list:e=>[...i.lists(),e],infinite:e=>[...i.list(e),"infinite"],summary:e=>[...i.all,"summary",e]},useAssociationGroupsInfinite=(e,t)=>
1{let{enabled:s=!0,useUnauthenticatedEndpoint:n=!1,...o}=e,c=[...i.infinite({associationId:e.associationId,query:e.query,letter:e.letter,limit:e.limit}),{useUnauthenticatedEndpoint:n}];return(0,r.useInfiniteQuery)({queryKey:c,queryFn:e=>{let{pageParam:t}=e;return a.D.getAssociationGroups({...o,cursor:t,useUnauthenticatedEndpoint:n})},getNextPageParam:e=>e.nextCursor||void 0,enabled:s&&!!e.associationId,staleTime:3e5,cacheTime:6e5,...t})};function useExportAssociationMembersCSV(e){let{associationId:t,enabled:s=!1}=e;return(0,r.useQuery)(["exportAssociationMembersCSV",{associationId:t}],()=>a.D.exportAssociationMembersCSV(t),{enabled:s,retry:!1,refetchOnWindowFocus:!1})}function useExportAssociationAffiliatesCSV(e){let{associationId:t,enabled:s=!1}=e;return(0,r.useQuery)(["exportAssociationAffiliatesCSV",{associationId:t}],()=>a.D.exportAssociationAffiliatesCSV(t),{enabled:s,retry:!1,refetchOnWindowFocus:!1})}function useAssociationGroupsSummary(e){let{associationId:t,enabled:s=!0}=e;return(0,r.useQuery)(i.summary(t),()=>a.D.getAssociationGroupsSummary(t),{enabled:s&&!!t,staleTime:3e5,cacheTime:6e5})}},43700:function(e,t,s){"use strict";s.d(t,{D:function(){return a}});var r=s(890);async function getAssociationFeed(e){let{associationId:t,searchTerm:s,useUnauthenticatedEndpoint:a=!1,...i}=e,n=Object.fromEntries(Object.entries({...i,query:s}).filter(e=>{let[t,s]=e;return void 0!==s})),{data:o}=await r.Z.get(a?"/service/associations/".concat(t,"/feeds/events"):"/api/associations/".concat(t,"/feeds/events"),{params:n});return o}let a={getAssociationGroups:async e=>{let{associationId:t,useUnauthenticatedEndpoint:s=!1,...a}=e,i=Object.fromEntries(Object.entries(a).filter(e=>{let[t,s]=e;return void 0!==s})),n=await r.Z.get(s?"/service/associations/".concat(t,"/groups"):"/api/associations/".concat(t,"/groups"),{params:i});return n.data},getAssociationFeed:getAssociationFeed,exportAssociationMembersCSV:async e=>{let{data:t}=await r.Z.get("/api/associations/".concat(e,"/members/export"),{responseType:"blob"});return t},exportAssociationAffiliatesCSV:async e=>{let{data:t}=await r.Z.get("/api/associations/".concat(e,"/affiliated-members/export"),{responseType:"blob"});return t},getAssociationGroupsSummary:async e=>{let{data:t}=await r.Z.get("/api/associations/".concat(e,"/groups/summary"));return t}}},23823:function(e,t,s){"use strict";var r=s(85893);s(67294);var a=s(67421),i=s(48905);t.Z=e=>{let{onClick:t,loading:s,text:n}=e,{t:o}=(0,a.$G)(["events"]);return(0,r.jsx)(i.ZP,{type:i.L$.Text,icon:(0,r.jsx)("img",{src:"/img/events/csv.svg",alt:"CSV icon"}),onClick:t,loading:s,className:"text-[#3853C4]",children:n||o("events:dashboard.ticketing.downloadCSV")})}},93974:function(e,t,s){"use strict";var r=s(85893);s(67294),t.Z=e=>{let{label:t,actions:s,avatar:a,title:i}=e;return(0,r.jsxs)("li",{className:"flex items-center gap-3",children:[a,(0,r.jsx)("div",{className:"flex-1 font-normal text-base",children:i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-base font-semibold text-black",children:t}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:i})]}):t}),s&&(0,r.jsx)("div",{className:"flex gap-2",children:s})]})}},64480:function(e,t,s){"use strict";var r=s(85893),a=s(67294),i=s(5434),n=s(93967),o=s.n(n);t.Z=e=>{let{children:t,description:s,headerContent:n,title:c,onNext:l,onPrev:u,hasNextPage:d,hasPreviousPage:m,emptyText:f,colLayout:p=!1}=e;return(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("h3",{className:"font-bold text-lg flex-1 text-neutral-800",children:c}),(0,r.jsx)("button",{className:o()(!m&&"cursor-not-allowed opacity-50"),type:"button",onClick:u,disabled:!m,"aria-label":"Previous results",children:(0,r.jsx)(i.G1X,{size:24})}),(0,r.jsx)("button",{className:o()(!d&&"cursor-not-allowed opacity-50"),type:"button",onClick:l,disabled:!d,"aria-label":"Next results",children:(0,r.jsx)(i.FNi,{size:24})})]}),(0,r.jsx)("p",{className:"text-sm font-normal pt-2",children:s}),n,(0,r.jsx)("div",{className:"pt-4 pb-16",children:a.Children.count(t)>0?(0,r.jsx)("ul",{className:o()("flex flex-col gap-4",p&&"columns-2 gap-[38px] *:md:pb-4 md:block!"),children:t}):(0,r.jsx)("div",{className:"flex flex-1 min-h-28 items-center justify-center font-normal text-base text-neutral-400",children:f||"No members"})})]})}},18491:function(e,t,s){"use strict";var r=s(85893);s(67294);var a=s(11163),i=s(16498),n=s(33703);t.Z=e=>{let{children:t}=e,{query:s}=(0,a.useRouter)(),{data:o,isLoading:c,isError:l}=(0,i.yE)({associationId:s.associationId});return l||o&&!o.isUserAdmin?(0,r.jsx)(n.Z,{to:"/404"}):c?null:(0,r.jsx)(r.Fragment,{children:t})}}},function(e){e.O(0,[2152,6498,4838,6148,9774,2888,179],function(){return e(e.s=94740)}),_N_E=e.O()}]); 2//# sourceMappingURL=members-99d7ba419afca10a.js.map
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.