PageSourceSearch

https://www.vrijwilligerspunt.com/assets/index-DsBUW_6x.js

js vrijwilligerspunt.com collected 2026-09-25 14:47:55 UTC 20,597 bytes, 2 lines download raw bytes

1import{a as w,dn as Se,dL as ye,t as I,j as e,_ as Ne,dp as z,cL as je,cJ as Z,G as q,dZ as xe,w as Y,d_ as ee,A as T,cg as Ce,X as Fe,ch as Ie,ah as E,d$ as M,bq as re,Y as Oe,bm as Le,B as U,aD as $,a3 as P,aH as L,c as oe,z as le,aX as we,aY as ze,e0 as De,e1 as ce,c_ as C,b as de,e2 as me,ck as Pe,e3 as Q,e4 as Re,aC as D,d as Te,aW as Ae,e5 as Ee,p as Me}from"./index-DEpx10yq.js";import{r as c,F as O,c6 as G,b9 as W,b2 as Ve,ad as $e,c7 as Ue,c8 as _e,c9 as Be}from"./vendor-BuXdE1tY.js";import{C as qe,V as Qe,u as Ge,a as We}from"./Conversation-CWrh47y3.js";import{s as Ye}from"./zod-Bno7PSKN.js";import{B as Je}from"./Badge-Ww_xYfFV.js";import{F as He}from"./fathom-vsAwhi_q.js";import{bn as Ke,bo as te,bp as N,bq as ne,br as V,bs as F}from"./app-4WdNMoJ4.js";import{c as Xe}from"./index.module-B2xiHG4i.js";import{R as Ze}from"./index-BMOHDX7A.js";import"./dayjs-timezone-iana-plugin-BLhLpZHa.js";import"./applications-CuypLuo4.js";import"./deed-JK3bCACr.js";import"./Flex-Cz2seYrx.js";import"./applicationStatusColors-NtXGdHIU.js";import"./getDeedCommitment-BzyYFwSX.js";import"./usePermission-qJgqIwNI.js";import"./useAccess-zZp0IcMv.js";import"./Textarea-CsRu8kHr.js";import"./get-env-0ZX7pgpg.js";import"./useCreateReport-3KNRDBQW.js";import"./CircularProfile-DcTzsMWb.js";import"./use-local-storage-Ch15PQMJ.js";import"./UserMiniProfile-CMLN97Vb.js";import"./Tags-CxRpTUPs.js";import"./tags.hooks-pTz7HNhG.js";import"./nl2br-C5jdqXmD.js";import"./memberships-DyHjVvT4.js";import"./ResetPasswordForm-BjFN92Mv.js";import"./index-CuBUkoZP.js";import"./helpers-B9PHCvKt.js";import"./AddressFieldsInput-P-cJyvLH.js";import"./operations.graphql-C0-m0XGS.js";import"./operations.graphql-CDxOkHau.js";import"./sdgs-BmO7BZQd.js";import"./index.t10s-CuJ7C0V8.js";import"./DeedForm.t10s-D944V4i3.js";import"./OrganizationForm.t10s-CVuRtN-Q.js";import"./WhitelabelForm.t10s-Wv0ryTAP.js";import"./EmptyState-CftI0Jl5.js";import"./ReactQueryLoader-BmbOdIhF.js";import"./RichText-DbmvLbYm.js";import"./collapseNbsp-CzVL4EIi.js";import"./Timestamp-B0vioKD7.js";import"./sectionKeys-C7RiTDXv.js";import"./url-BRe_NL2S.js";import"./usePostcodeGroups-cuGkbYMj.js";import"./admin-Ba69bkYW.js";import"./contract.graphql-BIxXReRC.js";import"./useLatestRef-biBs-Fu4.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;
1n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="24fb076f-9601-4525-842e-d506ac09917c",t._sentryDebugIdIdentifier="sentry-dbid-24fb076f-9601-4525-842e-d506ac09917c")}catch{}const et={en:"Search for a user in your network",nl:"Zoek een gebruiker in jouw netwerk"},tt={search:et},nt=({id:t,onChange:n,value:i})=>{const r=w(tt),a=Se({onDropdownClose:()=>a.resetSelectedOption()}),[d,m]=c.useState(""),[g]=ye(d,200),[l,p]=c.useState(i??[]);c.useEffect(()=>{p(i??[])},[i]);const h=c.useCallback(s=>{n(l.filter(k=>!(k.id===s.id&&k.type===s.type)))},[n,l]),{data:v,isFetching:o}=I.me.myNetwork.useQuery({query:g},{enabled:g.trim().length>0}),b=c.useMemo(()=>v?.results??[],[v]),x=c.useCallback(s=>{const k=b.find(u=>`${u.type}-${u.id}`===s);if(!k)return;l.some(u=>u.id===k.id&&u.type===k.type)||n([...l,k]),m(""),a.closeDropdown()},[a,n,l,b]);return e.jsxs(Ne,{gap:"sm",children:[e.jsxs(z,{store:a,onOptionSubmit:x,children:[e.jsx(z.Target,{children:e.jsx(je,{id:t,value:d,placeholder:r("search"),rightSection:o?e.jsx(Z,{size:"xs"}):null,onChange:s=>{m(s.currentTarget.value),a.openDropdown()},onFocus:()=>a.openDropdown()})}),e.jsx(z.Dropdown,{children:e.jsx(z.Options,{children:o||b.length===0?e.jsx(z.Empty,{children:o?e.jsx(Z,{size:"xs"}):g?r.g("noResults"):r("search")}):b.map(s=>e.jsx(z.Option,{value:`${s.type}-${s.id}`,children:e.jsxs(q,{w:"100%",justify:"space-between",gap:"sm",children:[e.jsxs(q,{gap:"sm",justify:"center",children:[e.jsx(xe,{src:s.image,radius:"xl",size:28,children:e.jsx(O,{icon:s.type==="user"?G:W})}),e.jsx(Y,{lineClamp:1,c:"inherit",children:s.label})]}),e.jsx(Je,{variant:"light",c:"inherit",rightSection:e.jsx(O,{icon:s.type==="user"?G:W}),children:r.g(s.type)})]})},`${s.type}-${s.id}`))})})]}),e.jsx(ee.Group,{gap:2,...T("autocomplete-users-and-org-selected"),children:l.map(s=>e.jsx(ee,{size:"md",withRemoveButton:!0,onRemove:()=>h(s),children:e.jsxs(q,{gap:"xs",wrap:"nowrap",children:[e.jsx(O,{icon:s.type==="user"?G:W}),e.jsx(Y,{"data-testid":"tag",children:s.label})]})},`${s.type}.${s.id}`))})]})},st={en:"Send",nl:"Verzenden"},it={en:"Message",nl:"Bericht"},at={en:"To",nl:"Naar"},rt={en:"Type the name of the person or %{g:organization} and select them from the shown results",nl:"Typ de naam van de persoon of %{g:organization} en selecteer ze uit de getoonde resultaten"},ot={en:"From",nl:"Van"},lt={en:"Subject",nl:"Onderwerp"},ct={en:"Me",nl:"Mij"},dt={en:"Create a new Conversation",nl:"Creëer een nieuw gesprek"},mt={en:"%{g:organization | capitalize}",nl:"%{g:organization | capitalize}"},ut={en:"User",nl:"Gebruiker"},ue={buttonSendLabel:st,labelMessage:it,labelRecipients:at,labelRecipientsDescription:rt,labelSender:ot,labelSubject:lt,selectSendOptionMeLabel:ct,title:dt,typeLabelOrganization:mt,typeLabelUser:ut},pt={definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ConversationOrganizationPermissions"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OrganizationPermissions"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"messages"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create"}},{kind:"Field",name:{kind:"Name",value:"delete"}},{kind:"Field",name:{kind:"Name",value:"read"}},{kind:"Field",name:{kind:"Name",value:"update"}}]}}]}}]},pe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ConversationsFilterMyOrganizations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"memberships"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accessLevel"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"permissions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ConversationOrganizationPermissions"}}]}}]}}]}}]}}]}},...pt.definitions]},ht={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ConversationCreateFormUsersByIds"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ids"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listUsers"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ids"},value:{kind:"Variable",name:{kind:"Name",value:"ids"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"image"}},{kind:"Field",name:{kind:"Name",value:"fullName"}}]}}]}}]}}]}}]},bt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ConversationCreateFormOrgById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"idOrSlug"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"image"}}]}}]}}]},gt=C.object({from:C.literal("me").or(C.string().regex(/^[1-9]\d*$/)),recipients:C.array(C.object({id:C.number().int().positive(),type:C.enum(["user","organization"]),label:C.string(),image:C.string()})).min(1),subject:C.string().superRefine((t,n)=>{t.trim()||n.addIssue({code:"too_small",inclusive:!0,minimum:1,type:"string"})}),message:C.string().superRefine((t,n)=>{t.trim()||n.addIssue({code:"too_small",inclusive:!0,minimum:1,type:"string"})})}),vt=t=>{const n=t?.organization;return n?[{type:"organization",id:n.id,label:n.name,image:n.image}]:[]},kt=t=>(t?.listUsers.edges||[]).map(n=>({type:"user",id:n.node.id,label:n.node.fullName,image:n.node.image})),se=/^[1-9]\d*$/,ft=()=>{const[t]=P(),{toOrg:n,toUsers:i}=c.useMemo(()=>{const g=t.get(L.toOrg),l=g&&se.test(g)?g:void 0,p=t.get(L.toUsers
1)?.split(",").filter(h=>se.test(h));return{...l&&{toOrg:l},...p&&p.length>0&&{toUsers:p}}},[t]),r=$(ht,{skip:!i,variables:{ids:i??[]}}),a=$(bt,{skip:!n,variables:{id:n??"-1"}}),d=c.useMemo(()=>[...kt(r.data),...vt(a.data)],[r.data,a.data]),m=c.useMemo(()=>(i??[]).map(Number),[i]);return{recipients:d,prepopulatedUserIds:m}},St=()=>{const[t]=P(),{prepopulatedSubject:n,prepopulatedMessage:i}=c.useMemo(()=>{const r=t.get(L.subject)?.trim(),a=t.get(L.message);return{...r&&{prepopulatedSubject:r},...a&&{prepopulatedMessage:a}}},[t]);return{prepopulatedSubject:n,prepopulatedMessage:i}},yt=()=>{const[t]=P();return c.useMemo(()=>{const n=t.get(L.deedId),i=n?Number(n):NaN;return Number.isInteger(i)&&i>0?i:void 0},[t])},Nt=()=>{const t=w(ue),n=$(pe,{fetchPolicy:"cache-and-network"});return c.useMemo(()=>{const r=n.data?.viewer?.user?.memberships.filter(a=>a.permissions.messages.update).map(a=>({label:a.organization.name,value:a.organization.id}));return[{value:"me",label:t("selectSendOptionMeLabel")},...r??[]]},[n.data,t])},jt=({askedAboutDeedId:t,prepopulatedUserIds:n})=>{const i=oe(),r=le(),a=I.useUtils(),{mutateAsync:d}=I.conversations.create.useMutation(),{mutateAsync:m}=I.conversations.send.useMutation();return c.useCallback(async l=>{const p=l.recipients.some(s=>s.type==="organization"),h=l.from!=="me",v=l.recipients.filter(s=>s.type==="user").map(s=>s.id),b=!p&&!h&&n.length>0&&n.every(s=>v.includes(s))?t:void 0,x={by:"participants",subject:l.subject,organizationIds:l.recipients.filter(s=>s.type==="organization").map(s=>s.id),userIds:v,asOrganizationId:l.from==="me"?null:Number(l.from)};try{const s=await(b?d({...x,deedId:b}).catch(k=>{if(we(k)!==ze.CONVERSATION_DEED_LINK_INVALID)throw k;return d(x)}):d(x));if(!s.myParticipantId)throw new Error("Unexpected error happened");await m({body:l.message,conversationId:Number(s.id),participantId:Number(s.myParticipantId)}),b&&De(He.DEED_ASK_A_QUESTION_SENT),a.conversations.list.invalidate(),i(ce(s.id))}catch(s){r()(s)}},[t,d,i,n,m,r,a])},xt=()=>{const t=w(ue),n=Nt(),{recipients:i,prepopulatedUserIds:r}=ft(),{prepopulatedSubject:a,prepopulatedMessage:d}=St(),m=yt(),g=jt({askedAboutDeedId:m,prepopulatedUserIds:r}),l=c.useMemo(()=>({recipients:i??[],subject:a??"",message:d??"",from:"me"}),[i,a,d]),p=c.useMemo(()=>({...l,recipients:l.recipients.map(f=>({...f,id:Number(f.id)}))}),[l]),h=Ce({defaultValues:p,resolver:Ye(gt)}),v=c.useRef(null),o=c.useRef(null),b=!i||i.length===0?"recipients":a?"message":"subject",x=c.useCallback(()=>{v.current&&b==="subject"&&v.current.focus(),o.current&&(o.current.style.height="auto",o.current.style.height=`${o.current.scrollHeight}px`,b==="message"&&(o.current.selectionStart=o.current.selectionEnd=o.current.value.length,o.current.focus()))},[b]),s=Fe(),k=h.reset;return c.useEffect(()=>{k(p)},[s.key,k,x,p]),e.jsx(Ie,{...h,children:e.jsxs("form",{className:Ke.root,onSubmit:h.handleSubmit(g),noValidate:!0,...T("conversation-create-form"),children:[e.jsx("h1",{children:t("title")}),n.length>0&&e.jsx(E,{label:t("labelSender"),required:!0,children:({inputId:f})=>e.jsx(M,{control:h.control,name:"from",render:({field:u,fieldState:y})=>e.jsx(re,{id:f,onBlur:u.onBlur,onChange:u.onChange,value:u.value,name:u.name,options:n,error:y.invalid})})}),e.jsx(E,{label:t("labelRecipients"),help:t("labelRecipientsDescription"),required:!0,children:({inputId:f})=>e.jsx(M,{control:h.control,name:"recipients",render:({field:u})=>e.jsx(nt,{id:f,onChange:u.onChange,value:u.value.map(y=>({...y,id:Number(y.id)}))})})}),e.jsx(E,{label:t("labelSubject"),required:!0,children:({inputId:f})=>e.jsx(M,{control:h.control,name:"subject",render:({field:u,fieldState:y})=>e.jsx(Oe,{"aria-invalid":y.invalid,invalid:y.invalid,...u,id:f,ref:j=>{u.ref(j),!(!j||v.current===j)&&(v.current=j,x())},required:!0})})}),e.jsx(E,{label:t("labelMessage"),required:!0,children:({inputId:f})=>e.jsx(M,{control:h.control,name:"message",render:({field:u,fieldState:y})=>e.jsx(Le,{"aria-invalid":y.invalid,invalid:y.invalid,...u,id:f,ref:j=>{u.ref(j),!(!j||o.current===j)&&(o.current=j,x())},required:!0})})}),e.jsx(U,{type:"submit",mt:"sm",loading:h.formState.isSubmitting,children:t("buttonSendLabel")})]})})},Ct={en:"Start a Conversation",nl:"Begin een Gesprek"},Ft={en:"Search messages",nl:"Zoek berichten"},It={en:"Filter by participant",nl:"Filter op deelnemer"},Ot={en:"All",nl:"Alle"},Lt={en:"Me",nl:"Mij"},wt={buttonStartConversationLabel:Ct,inputSearchLabel:Ft,selectOrganizationLabel:It,selectOrganizationOptionAllLabel:Ot,selectOrganizationOptionMeLabel:Lt};function J(t){const n=t.get(L.filterFrom),i=t.get(L.filterSearch);return{...n&&(n==="me"||/^[1-9]\d*$/.test(n))?{from:n}:{},...i?{search:i}:{}}}const zt=({from:t,onFromChange:n,search:i,onSearchChange:r})=>{const a=w(wt),[d,m]=c.useState(i||""),g=Xe(o=>{r(o)},500),l=o=>{m(o),g(o)},p=$(pe,{fetchPolicy:"cache-and-network"}),h=c.useMemo(()=>{const o=p.data?.viewer?.user?.memberships;return!o||!o.length?[]:[{value:"all",label:a("selectOrganizationOptionAllLabel")},{value:"me",label:a("selectOrganizationOptionMeLabel")},...o.filter(b=>b.permissions.messages.read).map(b=>({label:b.organization.name,value:b.organization.id}))]},[p.data,a]),[v]=P();if(p.error)throw p.error;return e.jsxs("form",{noValidate:!0,className:te.root,onSubmit:o=>o.preventDefault(),...T("conversations-filter-form"),children:[e.jsx("div",{children:e.jsx(U,{component:de,...T("conversations-filter-start-conversation-button"),to:{pathname:me(),search:`?${new URLSearchParams(J(v)).toString()}`},leftSection:e.jsx(O,{icon:Ve}),fullWidth:!0,children:a("buttonStartConversationLabel")})}),e.jsxs("div",{children:[h.length>0&&e.jsx(re,{"aria-label":a("selectOrganizationLabel"),options:h,onChange:o=>n(o&&o!=="all"?o:void 0),value:t||"all",className:te.selectOrganization}),e.jsx(Pe,{addonAfter:e.jsx(O,{icon:$e}),placeholder:a("inputSearchLabel"),"aria-label":a("inputSearchLabel"),value:d,onChange:o=>l(o.currentTarget.value)})]})]})},Dt=({conversation:t,isActive:n=!1})=>{const[i]=P();return e.jsx("li",{className:N.listItemRoot,children:e.jsxs(Re,{className:D(N.listItemLink,n&&N.active),to:{pathname:ce(t.i
1d),search:`?${new URLSearchParams(J(i)).toString()}`},children:[e.jsx("div",{className:D(N.listItemSubject,t.isUnread&&N.unread),children:t.subject}),e.jsx("div",{className:N.listItemUnreadStatus,children:t.isUnread&&e.jsx(O,{icon:Ue})}),t.lastMessageAt&&e.jsx("div",{className:N.listItemDate,children:e.jsx(Ze,{value:t.lastMessageAt})}),e.jsx("div",{className:N.listItemParticipants,children:t.participants.map(r=>e.jsx(qe,{participant:r},r.id))})]})})},ie=()=>e.jsxs("li",{className:N.listItemSekeletonRoot,role:"none",children:[e.jsx(Q,{className:N.listItemSekeletonSubject}),e.jsxs("div",{className:N.listItemSekeletonParticipants,children:[e.jsx(Q,{className:N.listItemSekeletonParticipant}),e.jsx(Q,{className:N.listItemSekeletonParticipant})]})]}),Pt=({conversations:t,activeId:n,loading:i,onFetchMoreRequested:r})=>{const a=c.useCallback(d=>{d&&r()},[r]);return e.jsxs("ul",{className:ne.root,...T("conversations-list"),children:[i&&i!=="fetching-more"&&Array.from({length:10}).map((d,m)=>e.jsx(ie,{},`skeleton-${m}`)),t.map(d=>e.jsx(Dt,{conversation:d,isActive:d.id===n},d.id)),i==="fetching-more"&&Array.from({length:3}).map((d,m)=>e.jsx(ie,{},`skeleton-more-${m}`)),!i&&e.jsx("li",{className:ne.visibilityTrackerWrapper,children:e.jsx(Qe,{onVisibilityChange:a})})]})},Rt={en:"Start a Conversation",nl:"Begin een Gesprek"},Tt={en:"There are no conversations.",nl:"Er zijn geen gesprekken."},At={en:"No conversations found",nl:"Geen gesprekken gevonden"},Et={buttonNewConversationLabel:Rt,subtitle:Tt,title:At},Mt={en:"Try again",nl:"Probeer het nog eens."},Vt={en:"You appear to be offline. You can try again once the connection returns.",nl:"Je lijkt offline te zijn. Je kunt het opnieuw proberen zodra de verbinding is hersteld."},$t={en:"Something unexpected happened.",nl:"Er gebeurde iets onverwachts."},Ut={en:"Oops!",nl:"Oeps!"},_t={buttonRetryLabel:Mt,offlineHint:Vt,subtitle:$t,title:Ut},he=({title:t,subtitle:n,button:i,role:r,icon:a})=>e.jsxs("div",{className:V.root,role:r,children:[e.jsx(O,{className:V.icon,icon:a}),e.jsx("h3",{className:V.title,children:t}),e.jsx("p",{className:V.subtitle,children:n}),i]}),Bt=({onRetryClick:t,retrying:n,offline:i})=>{const r=w(_t);return e.jsx(he,{role:"alert",icon:_e,title:r("title"),subtitle:r(i?"offlineHint":"subtitle"),button:e.jsx(U,{color:"danger",loading:n&&!i,disabled:i,onClick:t,children:r("buttonRetryLabel")})})},qt=()=>{const t=w(Et);return e.jsx(he,{role:"status",icon:Be,title:t("title"),subtitle:t("subtitle"),button:e.jsx(U,{component:de,to:me(),children:t("buttonNewConversationLabel")})})},Qt={en:"Leave Conversation",nl:"Verlaat gesprek"},Gt={en:"You appear to be offline. Your inbox will refresh once the connection returns.",nl:"Je lijkt offline te zijn. Je inbox wordt vernieuwd zodra de verbinding is hersteld."},Wt={en:"Messages",nl:"Berichten"},Yt={confirmDialogLeaveConversationTitle:Qt,offlineNotice:Gt,title:Wt},ae=6e4,Jt=12e4,Gn=()=>{const t=oe(),n=w(Yt),i=le(),r=I.useUtils(),[a,d]=P(),m=Te(),g=!!m.id,l=c.useMemo(()=>J(a),[a]),p=I.conversations.leave.useMutation(),h=I.conversations.list.useInfiniteQuery({filter:{subject:l.search,...l.from==="me"?{me:!0}:{},...l.from&&l.from!=="me"?{organizationId:Number(l.from)}:{}}},{getNextPageParam:S=>S.nextCursor??void 0,staleTime:ae,refetchInterval:S=>S.state.error?Jt:ae}),{data:v,error:o,fetchStatus:b,isPending:x,isFetching:s,isFetchingNextPage:k,isError:f,hasNextPage:u,fetchNextPage:y,refetch:j}=h,H=c.useMemo(()=>v?.pages.flatMap(S=>S.conversations)??[],[v]),_=v!==void 0,B=!!o&&!_,be=_&&H.length===0,K=b==="paused",[ge,X]=c.useState(!1),ve=c.useCallback(()=>{X(!0),j().finally(()=>{X(!1)})},[j]);Ge(o,_);const ke=c.useCallback((S,A)=>{Ae.open({children:n("confirmDialogLeaveConversationTitle"),cancelButtonLabel:n.g("cancel"),okButtonProps:{color:"danger"},async onOk(){try{await p.mutateAsync({conversationId:Number(S),asOrganizationId:A?Number(A):void 0}),r.conversations.list.invalidate(),r.conversations.get.invalidate({id:Number(S)}),r.me.unreadConversations.invalidate(),t(Ee())}catch(R){i()(R)}}})},[n,p,r,t,i]),fe=c.useCallback(()=>{u&&!s&&!f&&y()},[y,u,s,f]);return Me(n("title")),e.jsxs("div",{className:D(F.root,g&&F.expanded),children:[e.jsx("div",{className:D(F.filtersWrapper,g&&F.expanded),children:e.jsx(zt,{from:l.from,onFromChange:S=>{const{from:A,...R}=l;d({...R,...S?{from:S}:{}},{replace:!0})},search:l.search,onSearchChange:S=>{const{search:A,...R}=l;d({...R,...S?{search:S}:{}},{replace:!0})}})}),e.jsxs("div",{className:D(F.conversationListWrapper,g&&F.expanded),children:[B&&e.jsx(Bt,{retrying:ge,offline:K,onRetryClick:ve}),!B&&K&&e.jsx(Y,{role:"status",c:"dimmed",ta:"center",p:"sm",children:n("offlineNotice")}),be&&e.jsx(qt,{}),!B&&e.jsx(Pt,{conversations:H,activeId:m.id,loading:x?!0:k?"fetching-more":!1,onFetchMoreRequested:fe})]}),e.jsxs("div",{className:D(F.conversationWrapper,g&&F.expanded),children:[m.id&&m.id!=="new"&&e.jsx(We,{allowReply:!0,id:m.id,onLeaveConversation:ke},m.id),m.id==="new"&&e.jsx(xt,{})]})]})};export{Gn as default};
2//# sourceMappingURL=index-DsBUW_6x.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.