import{r as m,w as T,u as B,c as o,a as e,t as r,j as p,v as b,e as i,i as h,F as I,f as V,b as w,l as _,g as C,h as A,o as u,n as F,k as R}from"./entry.126c240b.js";import{_ as y}from"./search.f9c251f3.js";const j={class:"animate-fade w-full"},D={class:"bg-white uhjk py-6 mt-6 w-[90%] mx-auto rounded-xl my-12",style:{border:"1.4px solid #EFEFEF"}},M={class:"sm:flex items-center justify-between w-full pb-4",style:{"border-bottom":"1px solid #EFEFEF"}},N={class:"font-bold"},S={class:"sm:flex items-center w-full mt-8 px-4 mx-auto"},z=e("div",{class:"mr-1"},"Cari",-1),H=e("img",{src:y},null,-1),q=[z,H],G=e("div",{class:"mr-1"},"Cari",-1),J=e("img",{src:y},null,-1),K=[G,J],O={class:"w-full mt-8 grid grid-cols-1 sm:grid-cols-2 gap-6"},Q={style:{border:"1px solid #EFEFEF"},class:"sm:flex items-center rounded-xl p-4"},W={class:"pl-2 ui"},X=["onClick"],Y={class:"mt-1 text-[#7F7F7F]"},Z=["onClick"],ee={class:"mt-5 flex items-center justify-between"},te={class:"flex items-center"},se={class:"flex-0 mr-2"},le={class:"flex-1"},ne={class:"text-base font-medium"},ue={__name:"index",async setup(ae){let c,v;const l=m(null),d=m(null),a=m(1),g=m(0),{data:$,total:E}=([c,v]=T(()=>$fetch(_().public.API_PUBLIC_URL+"/api/pengumuman?limit=6&page=1")),c=await c,v(),c);d.value=$,g.value=Math.ceil(E/6);async function k(){let t;if(l.value?t=await $fetch(_().public.API_PUBLIC_URL+`/api/pengumuman?limit=6&page=${a.value}&search=${l.value}`):t=await $fetch(_().public.API_PUBLIC_URL+`/api/pengumuman?limit=6&page=${a.value}`),d.value=t.data,navigator.userAgent.includes("Chrome")){window.scrollTo({behavior:"smooth",top:0,left:0});return}windowScrollTo(window,{behavior:"smooth",top:0,left:0})}async function f(){a.value=1;const{data:t,total:n}=await $fetch(_().public.API_PUBLIC_URL+`/api/pengumuman?limit=6&page=${a.value}&search=${l.value}`);d.value=t,g.value=Math.ceil(n/6)}return B({title:"Pengumuman"}),(t,n)=>{const P=C("v-img"),U=C("v-pagination"),x=A("ripple");return u(),o("div",j,[e("div",D,[e("div",M,[e("h1",N,r(t.$t("pengumuman")),1)]),e("div",S,[p(e("input",{"onUpdate:modelValue":n[0]||(n[0]=s=>h(l)?l.value=s:null),class:"bg-[#F8F8F8] flex-1 sm:flex hidden rounded-xl px-4 h-[50px]",placeholder:"Cari Pengumuman"},null,512),[[b,i(l)]]),p(e("input",{"onUpdate:modelValue":n[1]||(n[1]=s=>h(l)?l.value=s:null),class:"flex sm:hidden bg-[#F8F8F8] w-full rounded-xl px-4 h-[50px]",placeholder:"Cari {{ $t('pengumuman') }}"},null,512),[[b,i(l)]]),p((u(),o("button",{onClick:f,class:"text-base sm:text-lg hidden sm:flex items-center flex-none bg-[#B91C1C] text-white ml-2 rounded-xl font-semibold text-center px-8 py-3"},q)),[[x]]),p((u(),o("button",{onClick:f,class:"text-base sm:text-lg flex sm:hidden items-center w-full justify-center mt-3 flex-none bg-[#2E8586] text-white rounded-xl font-semibold text-center px-8 py-3"},K)),[[x]])]),e("div",O,[(u(!0),o(I,null,V(i(d),s=>(u(),o("div",Q,[e("div",W,[e("div",{onClick:L=>("navigateTo"in t?t.navigateTo:i(F))("/pengumuman/"+s.slug),class:"cursor-pointer mb-1 text-2xl font-semibold"},[e("span",null,r(s.title),1)],8,X),e("div",Y,[e("span",null,[R(r(s.description),1),e("span",{class:"ml-1 text-[#2E8586] font-medium cursor-pointer",onClick:L=>("navigateTo"in t?t.navigateTo:i(F))("/pengumuman/"+s.slug)},"Selengkapnya",8,Z)])]),e("div",ee,[e("div",te,[e("div",se,[w(P,{src:"/avatar.png",width:"30"})]),e("div",le,[e("div",ne,[e("span",null,r(s.created_by),1)])])])])])]))),256))]),w(U,{size:(t.$vuetify.display.mobile,"small"),class:"mt-10 mb-6",modelValue:i(a),"onUpdate:modelValue":[n[2]||(n[2]=s=>h(a)?a.value=s:null),k],"total-visible":5,length:i(g)},null,8,["size","modelValue","length"])])])}}};export{ue as default};
