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 h,v as g,y as _}from"./VDataTable-CvpeYUTC.js";import{Er as v,Hr as y,Mr as b,Tn as x,br as S,ci as C,gr as w,kn as T,li as E,rr as D,v as te,vn as ne,wn as O,yr as k}from"./index-BKLG6eUi.js";var A=T({itemsLength:{type:[Number,String],required:!0},..._(),...d(),...e()},`VDataTableServer`),j=O()({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:_}){let{groupBy:T}=r(e),{initialSortOrder:O,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=g(e),{disableSort:F}=E(e),I=k(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:T,showSelect:C(()=>e.showSelect),showExpand:C(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:O,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({groupBy:T,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=h(z,T,V,()=>!!_[`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=k(()=>U(z.value));ee({page:N,itemsPerPage:P,sortBy:A,groupBy:T,search:C(()=>e.search)}),y(`v-data-table`,{toggleSort:B,sortBy:A}),x({VDataTableRows:{hideNoData:C(()=>e.hideNoData),noDataText:C(()=>e.noDataText),loading:C(()=>e.loading),loadingText:C(()=>e.loadingText)}});let $=k(()=>({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}));ne(()=>{let n=o.filterProps(e),r=i.filterProps(D(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return v(t,b({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>_.top?.($.value),default:()=>_.default?_.default($.value):S(w,null,[_.colgroup?.($.value),!e.hideDefaultHeader&&S(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[v(i,b(r,{multiSort:!!e.multiSort}),_)]),_.thead?.($.value),!e.hideDefaultBody&&S(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[_[`body.prepend`]?.($.value),_.body?_.body($.value):v(f,b(d,a,{items:Y.value}),_),_[`body.append`]?.($.value)]),_.tbody?.($.value),_.tfoot?.($.value)]),bottom:()=>_.bottom?_.bottom($.value):!e.hideDefaultFooter&&S(w,null,[v(te,null,null),v(o,n,{prepend:_[`footer.prepend`]})])})})}});export{j as t};