1import{c as e}from"./D_on4AFH.js";import{t}from"./CUahCeih.js";import{t as n}from"./DYWcKvqL.js";import{t as r}from"./BvtST-mO.js";import{t as i}from"./D6-A0BV2.js";function a(){let a=n(`community-unread-count`,()=>0),o=n(`community-notifications`,()=>[]),s=n(`community-notifications-meta`,()=>null),c=e(),l=r(),{buildHeaders:u}=i(),d=c.public.communityApiUrl;return{unreadCount:a,notifications:o,meta:s,fetchUnreadCount:async()=>{if(l.isLoggedIn)try{let e=await t(`${d}/v1/notifications/`,{params:{unreadOnly:`true`,limit:`1`},headers:await u()});a.value=e?.meta?.total??0}catch{}},fetchNotifications:async(e=1)=>{if(l.isLoggedIn)try{let n=await t(`${d}/v1/notifications/`,{params:{page:String(e),limit:`20`},headers:await u()});o.value=e===1?n?.data??[]:[...o.value,...n?.data??[]],s.value=n?.meta??null}catch{}},markAsRead:async e=>{try{await t(`${d}/v1/notifications/${e}/read`,{method:`PATCH`,headers:await u()});let n=o.value.find(t=>t.id===e);n&&!n.isRead&&(n.isRead=!0,a.value=Math.max(0,a.value-1))}catch{}},markAllAsRead:async()=>{try{await t(`${d}/v1/notifications/read-all`,{method:`PATCH`,headers:await u()}),o.value.forEach(e=>e.isRead=!0),a.value=0}catch{}}}}export{a as t};
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.