import{d as I,J as N,r as R,o as d,b as x,w as t,q as e,K as $,s as m,A as v,L as M,M as P,N as h,I as c,y as f,O as g,P as L,Q as T,c as b,F as C,a as E,B as S,R as U,n as k,t as F,S as D,U as O,W as Y,l as j,X as W,Y as q,Z as H}from"./index-2e57ee69.js";import{V as w,a as J}from"./VBadge-2ebabc99.js";import{V as K}from"./VMenu-9f22b74a.js";import{V as Q}from"./VTooltip-4d5f55d5.js";import{V}from"./VDivider-29fb9868.js";import{V as X,a as A,b as B,c as Z}from"./VList-0b71c0f0.js";const G=u=>u?u.split(" ").map(i=>i.charAt(0).toUpperCase()).join(""):"",ee={key:0},te={class:"text-xs text-disabled"},ae={class:"d-flex flex-column align-center gap-4"},se={style:{"block-size":"28px","inline-size":"28px"}},ie=I({__name:"Notifications",props:{notifications:null,badgeProps:{default:void 0},location:{default:"bottom end"}},emits:["read","unread","remove","click:notification"],setup(u,{emit:n}){const i=u,r=N(()=>i.notifications.some(a=>a.isSeen===!1)),p=()=>{const a=i.notifications.map(o=>o.id);r.value?n("read",a):n("unread",a)},_=N(()=>i.notifications.filter(a=>a.isSeen===!1).length);return(a,o)=>{const l=R("IconBtn");return d(),x(l,{id:"notification-btn"},{default:t(()=>[e(w,$(i.badgeProps,{"model-value":i.notifications.some(s=>!s.isSeen),color:"error",content:m(_),class:"notification-badge"}),{default:t(()=>[e(v,{size:"26",icon:"tabler-bell"})]),_:1},16,["model-value","content"]),e(K,{activator:"parent",width:"380px",location:i.location,offset:"14px","close-on-content-click":!1},{default:t(()=>[e(M,{class:"d-flex flex-column"},{default:t(()=>[e(P,{class:"notification-section"},{append:t(()=>[h(e(l,{onClick:p},{default:t(()=>[e(v,{icon:m(r)?"tabler-mail-opened":"tabler-mail"},null,8,["icon"]),e(Q,{activator:"parent",location:"start"},{default:t(()=>[c(f(m(r)?"Mark all as read":"Mark all as unread"),1)]),_:1})]),_:1},512),[[g,i.notifications.length]])]),default:t(()=>[e(L,{class:"text-lg"},{default:t(()=>[c(" Notifications ")]),_:1})]),_:1}),e(V),e(m(T),{options:{wheelPropagation:!1},style:{"max-block-size":"23.75rem"}},{default:t(()=>[e(X,{class:"notification-list rounded-0 py-0"},{default:t(()=>[(d(!0),b(C,null,E(i.notifications,(s,z)=>(d(),b(C,{key:s.title},[z>0?(d(),x(V,{key:0})):S("",!0),e(A,{link:"",lines:"one","min-height":"66px",class:"list-item-hover-class",onClick:y=>a.$emit("click:notification",s)},{prepend:t(()=>[e(J,{start:""},{default:t(()=>[e(U,{size:"40",color:s.color&&s.icon?s.color:void 0,image:s.img||void 0,icon:s.icon||void 0,variant:s.img?void 0:"tonal"},{default:t(()=>[s.text?(d(),b("span",ee,f(m(G)(s.text)),1)):S("",!0)]),_:2},1032,["color","image","icon","variant"])]),_:2},1024)]),append:t(()=>[k("div",ae,[e(w,{dot:"",color:s.isSeen?"#a8aaae":"primary",class:F(`${s.isSeen?"visible-in-hover":""} ms-1`),onClick:D(y=>a.$emit(s.isSeen?"unread":"read",[s.id]),["stop"])},null,8,["color","class","onClick"]),k("div",se,[e(l,{size:"small",class:"visible-in-hover",onClick:y=>a.$emit("remove",s.id)},{default:t(()=>[e(v,{size:"20",icon:"tabler-x"})]),_:2},1032,["onClick"])])])]),default:t(()=>[e(B,null,{default:t(()=>[c(f(s.title),1)]),_:2},1024),e(Z,null,{default:t(()=>[c(f(s.subtitle),1)]),_:2},1024),k("span",te,f(s.time),1)]),_:2},1032,["onClick"])],64))),128)),h(e(A,{class:"text-center text-medium-emphasis",style:{"block-size":"56px"}},{default:t(()=>[e(B,null,{default:t(()=>[c("No Notification Found!")]),_:1})]),_:1},512),[[g,!i.notifications.length]])]),_:1})]),_:1}),e(V),h(e(O,{class:"notification-footer"},{default:t(()=>[e(Y,{block:""},{default:t(()=>[c(" View All Notifications ")]),_:1})]),_:1},512),[[g,i.notifications.length]])]),_:1})]),_:1},8,["location"])]),_:1})}}});const oe="/assets/paypal-01b645d1.svg",ue=I({__name:"NavBarNotifications",setup(u){const n=j([{id:1,img:W,title:"Congratulation Flora! 🎉",subtitle:"Won the monthly best seller badge",time:"Today",isSeen:!0},{id:2,text:"Tom Holland",title:"New user registered.",subtitle:"5 hours ago",time:"Yesterday",isSeen:!1},{id:3,img:q,title:"New message received 👋🏻",subtitle:"You have 10 unread messages",time:"11 Aug",isSeen:!0},{id:4,img:oe,title:"Paypal",subtitle:"Received Payment",time:"25 May",isSeen:!1,color:"error"},{id:5,img:H,title:"Received Order 📦",subtitle:"New order received from john",time:"19 Mar",isSeen:!0}]),i=a=>{n.value.forEach((o,l)=>{a===o.id&&n.value.splice(l,1)})},r=a=>{n.value.forEach(o=>{a.forEach(l=>{l===o.id&&(o.isSeen=!0)})})},p=a=>{n.value.forEach(o=>{a.forEach(l=>{l===o.id&&(o.isSeen=!1)})})},_=a=>{a.isSeen||r([a.id])};return(a,o)=>{const l=ie;return d(),x(l,{notifications:m(n),onRemove:i,onRead:r,onUnread:p,"onClick:notification":_},null,8,["notifications"])}}});export{ue as default};
