import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as ee,l as te,m as c,n as l,o as u,p as d,r as ne,s as f,u as p,v as m,y as h}from"./VDataTable-mNO8ZwUg.js";import{Er as g,Gn as _,Jn as v,Nn as y,Tr as b,ar as x,en as S,er as C,fr as w,j as T,on as E,qn as D,sn as O,un as k}from"./index-9ZGEqHPG.js";var A=k({itemsLength:{type:[Number,String],required:!0},...h(),...l(),...e()},`VDataTableServer`),j=E()({name:`VDataTableServer`,props:A(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:expanded":e=>!0,"update:groupBy":e=>!0},setup(e,{attrs:l,slots:h}){let{groupBy:E}=r(e),{initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=m(e),{disableSort:F}=g(e),I=D(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:E,showSelect:b(()=>e.showSelect),showExpand:b(()=>e.showExpand)}),{items:z}=ee(e,L),{toggleSort:B}=d({initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=te({groupBy:E,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=p(z,E,V,()=>!!h[`group-summary`]),{isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,someSelected:oe,allSelected:se}=c(e,{allItems:z,currentPage:z}),{isExpanded:ce,toggleExpand:le}=f(e),Q=D(()=>U(z.value));ne({page:N,itemsPerPage:P,sortBy:A,groupBy:E,search:b(()=>e.search)}),w(`v-data-table`,{toggleSort:B,sortBy:A}),O({VDataTableRows:{hideNoData:b(()=>e.hideNoData),noDataText:b(()=>e.noDataText),loading:b(()=>e.loading),loadingText:b(()=>e.loadingText)}});let $=D(()=>({page:N.value,itemsPerPage:P.value,sortBy:A.value,pageCount:W.value,toggleSort:B,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J,someSelected:oe.value,allSelected:se.value,isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,isExpanded:ce,toggleExpand:le,isGroupOpen:H,toggleGroup:re,items:Q.value.map(e=>e.raw),internalItems:Q.value,groupedItems:Y.value,columns:L.value,headers:R.value}));S(()=>{let n=o.filterProps(e),r=i.filterProps(y(e,[`multiSort`])),a=u.filterProps(e),s=t.filterProps(e);return C(t,x({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>h.top?.($.value),default:()=>h.default?h.default($.value):v(_,null,[h.colgroup?.($.value),!e.hideDefaultHeader&&v(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[C(i,x(r,{multiSort:!!e.multiSort}),h)]),h.thead?.($.value),!e.hideDefaultBody&&v(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[h[`body.prepend`]?.($.value),h.body?h.body($.value):C(u,x(l,a,{items:Y.value}),h),h[`body.append`]?.($.value)]),h.tbody?.($.value),h.tfoot?.($.value)]),bottom:()=>h.bottom?h.bottom($.value):!e.hideDefaultFooter&&v(_,null,[C(T,null,null),C(o,n,{prepend:h[`footer.prepend`]})])})})}});export{j as t};