import{r as v,b as E,d as $,o as a,c as n,a as e,w as f,e as c,l as R,v as T,z as t,f as g,F as L,m as N,t as y,H as F,B as U,C as z}from"./app-91dba96b.js";import{i as G}from"./index-0653e21c.js";import{u as H}from"./useEmitter-cde057d4.js";import{u as q}from"./useOpenModal-248d9645.js";import{u as J}from"./useDeleteModal-1f988578.js";import{n as K}from"./laravel-vue-pagination.es-47c433e6.js";import{u as i}from"./urlGenerator-87d92adb.js";import Q from"./reciterModal-aeaa093a.js";import{l as W}from"./lodash-569b8a6d.js";import{_ as X}from"./_plugin-vue_export-helper-c27b6911.js";import"./appFunction-1b5b1f43.js";import"./useSubmitForm-bd99a12d.js";import"./helper-7c41612f.js";import"./_commonjsHelpers-725317a4.js";const x=d=>(U("data-v-f93e2235"),d=d(),z(),d),Y={class:"content"},Z={class:"container-fluid p-0"},j={class:"mb-3"},O=x(()=>e("h1",{class:"h3 d-inline align-middle"},[e("strong",null,"Reciter List")],-1)),ee={class:"search-container d-flex justify-content-end align-items-center"},te={class:"row"},se={class:"col-12"},oe={class:"card"},ae={key:1,class:"table-responsive"},le={class:"table mb-3"},ne=x(()=>e("thead",null,[e("tr",null,[e("th",{scope:"col",style:{width:"65%"}},"Reciter"),e("th",{scope:"col",style:{width:"10%"}},"Total Sura"),e("th",{scope:"col",style:{width:"20%"}},"Position"),e("th",{scope:"col",class:"text-end",style:{width:"5%"}},"Action")])],-1)),ce={width:"30%"},ie={class:"d-flex align-items-center"},re=["src"],de={class:"ms-3"},_e={class:"fw-bold"},ue={class:"badge badge-info-light"},pe={class:"table-action"},me={class:"action-icons d-flex justify-content-center"},he={key:0},ve=["href"],fe=["src"],ge={key:1},ye=["onClick"],ke=["src"],we={key:2},Ce=["onClick"],$e=["src"],xe={__name:"index",setup(d){const{isModalActive:u,selectedData:k,closeModal:b}=q(),{deleteUrl:w,isDeleteModal:C,cancelled:D}=J(),p=v({}),m=v(!1),_=v(""),S=W.debounce(()=>{_.value?r(1,_.value):r(1)},500),r=(s=1,l="")=>{m.value=!0,G.get(`reciter?page=${s}&search=${l}`).then(h=>{p.value=h.data}).finally(()=>m.value=!1)},I=s=>{u.value=!0,k.value=`reciter/${s.id}`},M=s=>{C.value=!0,w.value=`reciter/${s.id}`},A=H(),B=()=>{A.on("reload-table",(s=!0)=>{console.log("value"),s&&r()})};return E(()=>{r(),B()}),(s,l)=>{const h=$("app-loader"),P=$("app-delete-modal");return a(),n("main",Y,[e("div",Z,[e("div",j,[O,s.$canAccess("create_reciter")?(a(),n("a",{key:0,href:"",onClick:l[0]||(l[0]=f(o=>u.value=!0,["prevent"])),class:"btn bg-primary text-white float-end"}," Add Reciter ")):c("",!0)])]),e("div",ee,[R(e("input",{type:"text",class:"form-control","onUpdate:modelValue":l[1]||(l[1]=o=>_.value=o),onInput:l[2]||(l[2]=o=>t(S)()),placeholder:"Search..."},null,544),[[T,_.value]])]),e("div",te,[e("div",se,[e("div",oe,[m.value?(a(),g(h,{key:0})):(a(),n("div",ae,[e("table",le,[ne,e("tbody",null,[(a(!0),n(L,null,N(p.value.data,o=>(a(),n("tr",null,[e("td",ce,[e("div",ie,[e("img",{class:"profile-picture",src:o.profile_picture?t(i)(o.profile_picture):t(i)("assets/img/avatar.png"),alt:"Profile Picture"},null,8,re),e("div",de,[e("span",_e,y(o.name),1)])])]),e("td",null,[e("span",ue,y(o.suras_count),1)]),e("td",null,y(o.position),1),e("td",pe,[e("div",me,[s.$canAccess("view_reciter_sura")?(a(),n("div",he,[e("a",{href:t(i)("audio/reciter/sura/list")+"/"+o.id},[e("img",{class:"action_icon",src:t(i)("assets/img/icons/audio.svg"),alt:"Roles Icon"},null,8,fe)],8,ve)])):c("",!0),s.$canAccess("update_reciter")?(a(),n("div",ge,[e("a",{onClick:f(V=>I(o),["prevent"])},[e("img",{class:"action_icon",src:t(i)("assets/img/icons/edit.svg"),alt:"Edit Icon"},null,8,ke)],8,ye)])):c("",!0),s.$canAccess("delete_reciter")?(a(),n("div",we,[e("a",{onClick:f(V=>M(o),["prevent"])},[e("img",{class:"action_icon",src:t(i)("assets/img/icons/trash.svg"),alt:"Trash Icon"},null,8,$e)],8,Ce)])):c("",!0)])])]))),256))])])])),F(t(K),{data:p.value,onPaginationChangePage:r},null,8,["data"])])])]),t(u)?(a(),g(Q,{key:0,"modal-id":"reciter-modal","selected-url":t(k),onClose:t(b)},null,8,["selected-url","onClose"])):c("",!0),t(C)?(a(),g(P,{key:1,"selected-url":t(w),onCancelled:t(D)},null,8,["selected-url","onCancelled"])):c("",!0)])}}},Fe=X(xe,[["__scopeId","data-v-f93e2235"]]);export{Fe as default};
