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