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 c,l,m as u,n as d,o as f,p,r as ee,s as m,u as te,v as h,y as g}from"./VDataTable-Bw41cMWI.js";import{$n as _,Fr as v,M as y,Pr as b,Qn as x,Rn as S,Xn as C,_r as w,ar as T,cn as E,fn as D,ln as ne,nn as O,ur as k}from"./index-CWbTxj6r.js";var A=D({itemsLength:{type:[Number,String],required:!0},...g(),...d(),...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:d,slots:g}){let{groupBy:E}=r(e),{initialSortOrder:D,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=h(e),{disableSort:F}=v(e),I=x(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:E,showSelect:b(()=>e.showSelect),showExpand:b(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:D,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({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}=te(z,E,V,()=>!!g[`group-summary`]),{isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,someSelected:oe,allSelected:se}=u(e,{allItems:z,currentPage:z}),{isExpanded:ce,toggleExpand:le}=m(e),Q=x(()=>U(z.value));ee({page:N,itemsPerPage:P,sortBy:A,groupBy:E,search:b(()=>e.search)}),w(`v-data-table`,{toggleSort:B,sortBy:A}),ne({VDataTableRows:{hideNoData:b(()=>e.hideNoData),noDataText:b(()=>e.noDataText),loading:b(()=>e.loading),loadingText:b(()=>e.loadingText)}});let $=x(()=>({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}));O(()=>{let n=o.filterProps(e),r=i.filterProps(S(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return T(t,k({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>g.top?.($.value),default:()=>g.default?g.default($.value):_(C,null,[g.colgroup?.($.value),!e.hideDefaultHeader&&_(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[T(i,k(r,{multiSort:!!e.multiSort}),g)]),g.thead?.($.value),!e.hideDefaultBody&&_(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[g[`body.prepend`]?.($.value),g.body?g.body($.value):T(f,k(d,a,{items:Y.value}),g),g[`body.append`]?.($.value)]),g.tbody?.($.value),g.tfoot?.($.value)]),bottom:()=>g.bottom?g.bottom($.value):!e.hideDefaultFooter&&_(C,null,[T(y,null,null),T(o,n,{prepend:g[`footer.prepend`]})])})})}});export{j as t};