import{M as x,$ as A,C as D,ax as H,N as d,W as p,X as i,V as o,Z as r,R as m,a8 as _,Y as l,e,U as a,S as L,az as O,P as R,Q as j,O as n}from"./vendor-CsGITfgk.js";import{f as F,n as w}from"./index-GCDRvGOr.js";import{_ as G}from"./push-message.vue_vue_type_script_setup_true_lang-Cwfq0OQy.js";import{u as Q}from"./usePushMessages-DSitW8He.js";import"./index-DqyRqHAe.js";import"./types-zo7pMMkl.js";const X={class:"!block"},Y={class:"flex items-start justify-between gap-3"},Z={class:"mt-4 lg:mt-5"},q={key:1,class:"p-3 lg:p-6"},J={class:"divide-y rounded-[--vc-radius] border empty:hidden"},K={key:0,class:"my-3 text-center"},le=x({__name:"notifications",setup(ee){const{t:v}=A(),c=D("showUnreadOnly_pushMessages_history",!1);H(c,B);const{items:g,markReadAll:b,markUnreadAll:$,totalCount:C,unreadCountWithHidden:h,loading:P,pages:V,page:u}=Q({showUnreadOnly:c,withHidden:!0});F({title:v("push_messages.title")});function B(){f(1)}function f(t){u.value=t,window.scroll({top:0,behavior:"smooth"})}return(t,y)=>{const M=a("VcBadge"),U=a("VcTypography"),z=a("VcButton"),k=a("VcMenuItem"),I=a("VcDropdownMenu"),N=a("VcSwitch"),S=a("VcEmptyView"),E=a("VcPagination"),T=a("VcWidget");return n(),d("div",X,[p("div",Y,[i(U,{tag:"h1",class:"flex items-center gap-2"},{default:o(()=>[r(l(t.$t("push_messages.title"))+" ",1),e(h)>0?(n(),m(M,{key:0,variant:"outline",size:"lg",rounded:""},{default:o(()=>[r(l(e(h)),1)]),_:1})):_("",!0)]),_:1}),i(I,{placement:"bottom-end",width:"max-content"},{trigger:o(({triggerProps:s})=>[i(z,L({"aria-label":t.$t("common.buttons.toggle_dropdown"),icon:"dots-vertical",variant:"outline",size:"sm"},s),null,16,["aria-label"])]),content:o(({close:s})=>[i(k,{onClick:W=>{s(),e(b)()}},{default:o(()=>[r(l(t.$t("push_messages.options.make_all_as_read")),1)]),_:1},8,["onClick"]),i(k,{onClick:W=>{s(),e($)()}},{default:o(()=>[r(l(t.$t("push_messages.options.make_all_as_unread")),1)]),_:1},8,["onClick"])]),_:1})]),p("div",Z,[i(N,{modelValue:e(c),"onUpdate:modelValue":y[0]||(y[0]=s=>O(c)?c.value=s:null),"aria-label":t.$t("push_messages.show_unread_only"),"label-position":"right"},{default:o(()=>[r(l(t.$t("push_messages.show_unread_only")),1)]),_:1},8,["modelValue","aria-label"])]),i(T,{size:"lg",class:"mt-4 lg:mt-5"},{"default-container":o(()=>[e(C)===0&&!e(P)?(n(),m(S,{key:0,text:t.$t("push_messages.empty_list"),icon:"outline-notifications"},null,8,["text"])):(n(),d("div",q,[p("div",J,[(n(!0),d(R,null,j(e(g),s=>(n(),m(G,{key:s.id,size:"lg",class:"first:rounded-t-[inherit] last:rounded-b-[inherit]","push-message":s},null,8,["push-message"]))),128))]),e(u)>=e(w)?(n(),d("p",K,l(t.$t("reach_limit.page_limit")),1)):_("",!0),e(g).length&&e(V)>1?(n(),m(E,{key:1,page:e(u),pages:Math.min(e(V),e(w)),class:"mt-6","onUpdate:page":f},null,8,["page","pages"])):_("",!0)]))]),_:1})])}}});export{le as default};
//# sourceMappingURL=notifications-PDl8s4UF.js.map
