1import{O as c,P as h,av as w,aJ as y,K as g,aB as b,l as k,cz as N}from"./DREHXjTd.js";const i=b({});function B(){const t=c.value?.account.id,{client:s,streamingClient:r}=h();async function f(){if(!t||!i[t])return;const n=i[t][1][0];i[t][1]=[],n&&await s.value.v1.markers.create({notifications:{lastReadId:n}})}async function l(n,o){for await(const a of n)a.event==="notification"&&i[o]&&i[o][1].unshift(a.payload.id)}async function d(){if(!k.value||!t||i[t]!==void 0||!c.value?.token)return;let n;const o=new Promise(e=>n=e);i[t]=[o,[]],await N(r).toBeTruthy();const a=r.value.user.subscribe();n(a),l(a,t);const m=await s.value.v1.markers.fetch({timeline:["notifications"]}),p=s.value.v1.notifications.list({limit:30}).values();do{const e=await p.next();if(!e.done&&e.value.length)for(const u of e.value){if(u.id===m.notifications.lastReadId)return;i[t][1].push(u.id)}else break}while(!0)}function v(){!t||!i[t]||(i[t][0].then(n=>n.unsubscribe()),i[t]=void 0)}return w(c,v),y(()=>{d()}),{notifications:g(()=>t?i[t]?.[1].length??0:0),clearNotifications:f}}export{B as u};
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.