import{r as c,W as i,aJ as x}from"./@ui-core-DKdciH1Z.js";function w(){const t=c.createContext(null);function e(){const o=i.useContext(t);if(!o)throw new Error("DataTableConsumerContext must be used within its Provider");return o}function n({children:o}){const[r,u]=c.useState({}),s=l(r),a=s.length;return x.jsx(t.Provider,{value:{rowSelection:r,setRowSelection:u,selectedRowIDs:s,selectedRowCount:a},children:o})}return{Context:t,ContextProvider:n,useContext:e}}function l(t){return Object.entries(t).filter(([e,n])=>n).map(([e])=>e)}export{w as c};
