Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mantine-datatable

Package Overview
Dependencies
Maintainers
0
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mantine-datatable - npm Package Compare versions

Comparing version 7.10.3 to 7.10.4

2

dist/index.js

@@ -1,2 +0,2 @@

"use strict";"use client";var En=Object.create;var ot=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var In=Object.getPrototypeOf,Hn=Object.prototype.hasOwnProperty;var On=(e,t)=>{for(var o in t)ot(e,o,{get:t[o],enumerable:!0})},no=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ln(t))!Hn.call(e,a)&&a!==o&&ot(e,a,{get:()=>t[a],enumerable:!(n=Nn(t,a))||n.enumerable});return e};var V=(e,t,o)=>(o=e!=null?En(In(e)):{},no(t||!e||!e.__esModule?ot(o,"default",{value:e,enumerable:!0}):o,e)),Wn=e=>no(ot({},"__esModule",{value:!0}),e);var Vn={};On(Vn,{DataTable:()=>Pa,differenceBy:()=>It,getRecordId:()=>L,getValueAtPath:()=>it,humanize:()=>he,uniqBy:()=>Xe,useDataTableColumns:()=>Nt});module.exports=Wn(Vn);var Tt=require("@mantine/core"),Ze=require("@mantine/hooks"),Ft=V(require("clsx")),G=require("react");var kt=require("react");var ro=require("@mantine/core"),[lo,xe]=(0,ro.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var io=require("react/jsx-runtime"),Rt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:l,resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:u}=e,[f,p]=(0,kt.useState)(""),[b,T]=(0,kt.useState)("");return(0,io.jsx)(lo,{value:{sourceColumn:f,setSourceColumn:p,targetColumn:b,setTargetColumn:T,columnsToggle:a,setColumnsToggle:l,swapColumns:()=>{if(!o||!n||!f||!b)return;let R=o.indexOf(f),D=o.indexOf(b);if(R!==-1&&D!==-1){let w=o.splice(R,1)[0];o.splice(D,0,w),n([...o])}},resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:u},children:t})};var Et=require("react/jsx-runtime");function so(){return(0,Et.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Et.jsx)("td",{})})}var at=require("@mantine/core");var ae=require("react/jsx-runtime");function co(){return(0,ae.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ae.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ae.jsx)("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),(0,ae.jsx)("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),(0,ae.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,ae.jsx)("path",{d:"M3 3l18 18"})]})}var ee=require("react/jsx-runtime");function uo({icon:e,text:t,pt:o,pb:n,active:a,children:l}){return(0,ee.jsx)(at.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:l||(0,ee.jsxs)(ee.Fragment,{children:[e||(0,ee.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,ee.jsx)(co,{})}),(0,ee.jsx)(at.Text,{component:"div",size:"sm",c:"dimmed",children:t})]})})}var Ne=require("@mantine/core"),Lo=V(require("clsx")),Io=require("react");var vo=require("@mantine/core"),xo=V(require("clsx"));var nt=require("@mantine/hooks"),mo=require("react"),Nt=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function n(c,C){let s=[];return c.forEach(m=>{C.find(S=>S.accessor===m)&&s.push(m)}),C.forEach(m=>{s.includes(m.accessor)||s.push(m.accessor)}),s}function a(c,C){let s=[];return c.forEach(m=>{C.find(S=>S.accessor===m.accessor)&&s.push(m)}),C.forEach(m=>{s.find(S=>S.accessor===m.accessor)||s.push({accessor:m.accessor,defaultToggle:m.defaultToggle||!0,toggleable:m.toggleable,toggled:m.defaultToggle===void 0?!0:m.defaultToggle})}),s}function l(c,C){let s=[];return c.forEach(m=>{let S=Object.keys(m)[0];C.find(g=>g.accessor===S)&&s.push(m)}),C.forEach(m=>{let S=m.accessor;if(!s.find(g=>Object.keys(g)[0]===S)){let g={};g[S]="",s.push(g)}}),s}function r(){let[c,C]=(0,nt.useLocalStorage)({key:`${e}-columns-order`,defaultValue:u,getInitialValueInEffect:o}),s=n(c,t),m=JSON.stringify(c);return JSON.stringify(s)!==m&&C(s),[s,C]}function i(){let[c,C]=(0,nt.useLocalStorage)({key:`${e}-columns-toggle`,defaultValue:p,getInitialValueInEffect:o}),s=a(c,t),m=JSON.stringify(c);return JSON.stringify(s)!==m&&C(s),[a(c,t),C]}function d(){let[c,C]=(0,nt.useLocalStorage)({key:`${e}-columns-width`,defaultValue:f,getInitialValueInEffect:o}),s=l(c,t),m=JSON.stringify(c);return JSON.stringify(s)!==m&&C(s),[l(c,t),C]}let u=t&&t.map(c=>c.accessor)||[],f=t&&t.map(c=>({[c.accessor]:c.width??"initial"}))||[],p=t&&t.map(c=>({accessor:c.accessor,defaultToggle:c.defaultToggle||!0,toggleable:c.toggleable,toggled:c.defaultToggle===void 0?!0:c.defaultToggle})),[b,T]=r(),[h,R]=i(),[D,w]=d(),P=()=>T(u),v=()=>{R(p)},x=()=>w(f);return{effectiveColumns:(0,mo.useMemo)(()=>b?b.map(s=>t.find(m=>m.accessor===s)).map(s=>({...s,hidden:!h.find(m=>m.accessor===s?.accessor)?.toggled})).map(s=>({...s,width:D.find(m=>m[s?.accessor])?.[s?.accessor]})):t,[t,b,h,D]),setColumnsOrder:T,columnsOrder:b,resetColumnsOrder:P,columnsToggle:h,setColumnsToggle:R,resetColumnsToggle:v,columnsWidth:D,setColumnsWidth:w,setColumnWidth:(c,C)=>{let s=D.map(m=>m[c]?{[c]:C}:m);w(s)},resetColumnsWidth:x}};var po=require("@mantine/hooks");function ge(){let[e]=(0,po.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var rt=require("react"),fo=typeof window<"u"?rt.useLayoutEffect:rt.useEffect;var lt=require("react");function bo(e){let[t,o]=(0,lt.useState)(null),n=e?.join(":")||"";return(0,lt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var Me=require("react");function An(e,t){let o=()=>{t(e.map(a=>a.matches))},n=e.map(a=>{try{return a.addEventListener("change",o),()=>a.removeEventListener("change",o)}catch{return a.addListener(o),()=>a.removeListener(o)}});return()=>{n.forEach(a=>a())}}function zn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function To(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,Me.useState)(o?t:zn(e,t)),l=(0,Me.useRef)();return(0,Me.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(r=>window.matchMedia(r)),a(l.current.map(r=>r.matches)),An(l.current,r=>{a(r)})},[e]),n}var go=require("@mantine/core"),Lt=require("react");function ho(e){let t=(0,go.useMantineTheme)(),o=(0,Lt.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,Lt.useMemo)(()=>e.map(()=>!0),[e]);return To(o,n)}var Co=require("@mantine/core"),yo=require("@mantine/hooks");function ne(e){let t=(0,Co.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,yo.useMediaQuery)(o||"",!0)}var Do=require("react");function he(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function It(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function Xe(e,t){return e.filter((o,n,a)=>n===a.findIndex(l=>t(o)===t(l)))}function it(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function L(e,t){return typeof t=="string"?it(e,t):t(e)}function So({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:d,initiallyExpanded:u}=e;t&&i==="always"?n=t.map(f=>L(f,o)):u&&(n=t.filter((f,p)=>u({record:f,index:p})).map(f=>L(f,o)),d||(n=[n[0]]))}let a,l,r=(0,Do.useState)(n);if(e){let{expandable:i,trigger:d,allowMultiple:u,collapseProps:f,content:p}=e;e.expanded?{recordIds:a,onRecordIdsChange:l}=e.expanded:[a,l]=r;let b=T=>l?.(a.filter(h=>h!==L(T,o)));return{expandOnClick:d!=="always"&&d!=="never",isRowExpanded:T=>d==="always"?!0:a.includes(L(T,o)),isExpandable:({record:T,index:h})=>i?i({record:T,index:h}):!0,expandRow:T=>{let h=L(T,o);l?.(u?[...a,h]:[h])},collapseRow:b,collapseProps:f,content:({record:T,index:h})=>()=>p({record:T,index:h,collapse:()=>b(T)})}}}var Ht=require("@mantine/hooks"),Qe=require("react");function wo(e,t){let[o,n]=(0,Qe.useState)(e),[a,l]=(0,Qe.useState)(e),r=(0,Ht.useTimeout)(()=>n(!0),0),i=(0,Ht.useTimeout)(()=>l(!1),t||200);return(0,Qe.useEffect)(()=>{e?(i.clear(),l(!0),r.start()):(r.clear(),n(!1),i.start())},[r,i,e]),{expanded:o,visible:a}}var ke="mantine-datatable-nowrap",Re="mantine-datatable-ellipsis",J="mantine-datatable-pointer-cursor",st="mantine-datatable-context-menu-cursor",Po="mantine-datatable-text-selection-disabled",re="mantine-datatable-text-align-left",le="mantine-datatable-text-align-center",ie="mantine-datatable-text-align-right";var ko=require("react/jsx-runtime");function Mo({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:l,textAlign:r,width:i}){return ne(o)?(0,ko.jsx)(vo.TableTh,{className:(0,xo.default)({[ke]:a||l,[Re]:l,[re]:r==="left",[le]:r==="center",[ie]:r==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}var Ro=require("@mantine/core"),No=require("react/jsx-runtime");function Eo({shadowVisible:e}){return(0,No.jsx)(Ro.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Ee=require("react/jsx-runtime"),Ho=(0,Io.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:l,selectorCellShadowVisible:r,scrollDiff:i},d){let u=i<0;return(0,Ee.jsx)(Ne.TableTfoot,{ref:d,className:(0,Lo.default)("mantine-datatable-footer",t),style:[{position:u?"relative":"sticky",bottom:(0,Ne.rem)(u?i:0)},o],children:(0,Ee.jsxs)(Ne.TableTr,{children:[l&&(0,Ee.jsx)(Eo,{shadowVisible:r}),n.map(({hidden:f,...p})=>{if(f)return null;let{accessor:b,visibleMediaQuery:T,textAlign:h,width:R,footer:D,footerClassName:w,footerStyle:P,noWrap:v,ellipsis:x}={...a,...p};return(0,Ee.jsx)(Mo,{className:w,style:P,visibleMediaQuery:T,textAlign:h,width:R,title:D,noWrap:v,ellipsis:x},b)})]})})});var O=require("@mantine/core"),ea=V(require("clsx")),mt=require("react");var Oo=require("@mantine/core"),Wo=V(require("clsx")),Ot=require("react");var zo=require("react/jsx-runtime");function Ao({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:l}}){let r=(0,Ot.useMemo)(()=>t.map(({visibleMediaQuery:u})=>u),[t]),i=ho(r),d=(0,Ot.useMemo)(()=>t.filter(({hidden:u},f)=>!u&&i?.[f]).length,[t,i]);return d>0?(0,zo.jsx)(Oo.TableTh,{colSpan:d,className:(0,Wo.default)("mantine-datatable-column-group-header-cell",{[re]:n==="left",[le]:n==="center",[ie]:n==="right"},a),style:l,children:o??he(e)}):null}var W=require("@mantine/core"),Ke=V(require("clsx")),ct=require("react");var se=require("@mantine/core"),_o=require("@mantine/hooks");var Ue=require("react/jsx-runtime");function Vo(){return(0,Ue.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ue.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ue.jsx)("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}var $e=require("react/jsx-runtime");function Fo(){return(0,$e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,$e.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,$e.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var Ce=require("react/jsx-runtime");function Bo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,_o.useDisclosure)(!1);return(0,Ce.jsxs)(se.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,Ce.jsx)(se.PopoverTarget,{children:(0,Ce.jsx)(se.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:r=>{r.preventDefault(),a()},children:(0,Ce.jsx)(t?Fo:Vo,{})})}),(0,Ce.jsx)(se.PopoverDropdown,{onClick:r=>r.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var Go=require("@mantine/core"),dt=require("react");var Qo=require("react/jsx-runtime"),Xo=e=>{let{accessor:t,columnRef:o}=e,n=(0,dt.useRef)(null),[a,l]=(0,dt.useState)(0),{setColumnWidth:r}=xe(),i=p=>{p.preventDefault(),p.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",u),document.body.style.cursor="col-resize"},d=p=>{if(!o.current)return;let b=p.clientX-o.current.getBoundingClientRect().right,h=`${o.current.getBoundingClientRect().width+b}px`;o.current.style.width=h,r(t,o.current.style.width),l(-b)},u=()=>{o.current&&(document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u),document.body.style.cursor="initial",r(t,o.current.style.width),l(0))};return(0,Qo.jsx)("div",{ref:n,onClick:p=>p.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",r(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,Go.rem)(a)}})};var ye=require("react/jsx-runtime");function Uo(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M12 5l0 14"}),(0,ye.jsx)("path",{d:"M16 9l-4 -4"}),(0,ye.jsx)("path",{d:"M8 9l4 -4"})]})}var De=require("react/jsx-runtime");function $o(){return(0,De.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,De.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,De.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,De.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,De.jsx)("path",{d:"M12 3l0 18"})]})}var Z=require("react/jsx-runtime");function Ko(){return(0,Z.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Z.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Le=require("react/jsx-runtime");function Jo(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M18 6l-12 12"}),(0,Le.jsx)("path",{d:"M6 6l12 12"})]})}var M=require("react/jsx-runtime");function Zo({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:l,draggable:r,toggleable:i,resizable:d,sortIcons:u,textAlign:f,width:p,sortStatus:b,onSortStatusChange:T,filter:h,filtering:R,sortKey:D}){let{setSourceColumn:w,setTargetColumn:P,swapColumns:v,setColumnsToggle:x}=xe(),[_,I]=(0,ct.useState)(!1),c=(0,ct.useRef)(null);if(!ne(n))return null;let C=a??he(o),s=typeof C=="string"?C:void 0,m=l&&T?H=>{H?.defaultPrevented||T({sortKey:D,columnAccessor:o,direction:b?.columnAccessor===o?b.direction==="asc"?"desc":"asc":b?.direction??"asc"})}:void 0,S=H=>{H.stopPropagation(),w(o),I(!1)},g=H=>{H.preventDefault(),P(o),I(!0)},N=()=>{P(o),I(!1),v()},A=()=>{I(!0)},X=()=>{I(!1)},K=H=>{H.stopPropagation(),x(ue=>ue.map(q=>q.accessor===o?{...q,toggled:!1}:q))};return(0,M.jsxs)(W.TableTh,{className:(0,Ke.default)({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":d},e),style:[{width:p,...d?{minWidth:"1px"}:{minWidth:p,maxWidth:p}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:m,onKeyDown:H=>H.key==="Enter"&&m?.(),ref:c,children:[(0,M.jsxs)(W.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,M.jsxs)(W.Flex,{align:"center",w:"100%",className:(0,Ke.default)({"mantine-datatable-header-cell-draggable":r,"mantine-datatable-header-cell-drag-over":_}),draggable:r,onDragStart:r?S:void 0,onDragEnter:r?A:void 0,onDragOver:r?g:void 0,onDrop:r?N:void 0,onDragLeave:r?X:void 0,children:[r?(0,M.jsx)(W.Center,{role:"img","aria-label":"Drag column",children:(0,M.jsx)(W.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:H=>{H.stopPropagation()},children:(0,M.jsx)(Ko,{})})}):null,(0,M.jsx)(W.Box,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-text",{[re]:f==="left",[le]:f==="center",[ie]:f==="right"},ke,Re),title:s,children:C})]}),i?(0,M.jsx)(W.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,M.jsx)(W.ActionIcon,{size:"xs",variant:"light",onClick:K,children:(0,M.jsx)(Jo,{})})}):null,l||b?.columnAccessor===o?(0,M.jsx)(M.Fragment,{children:b?.columnAccessor===o?(0,M.jsx)(W.Center,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":b.direction==="desc"}),role:"img","aria-label":`Sorted ${b.direction==="desc"?"descending":"ascending"}`,children:u?.sorted||(0,M.jsx)(Uo,{})}):(0,M.jsx)(W.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:u?.unsorted||(0,M.jsx)($o,{})})}):null,h?(0,M.jsx)(Bo,{isActive:!!R,children:h}):null]}),d?(0,M.jsx)(Xo,{accessor:o,columnRef:c}):null]})}var ut=require("@mantine/core"),Yo=V(require("clsx")),qo=require("react");var Wt=require("react/jsx-runtime"),jo=(0,qo.forwardRef)(function({className:t,style:o,trigger:n,shadowVisible:a,checked:l,indeterminate:r,checkboxProps:i,onChange:d,rowSpan:u},f){let p=!i.disabled;return(0,Wt.jsx)(ut.TableTh,{ref:f,className:(0,Yo.default)("mantine-datatable-header-selector-cell",{[J]:n==="cell"&&p},t),style:o,rowSpan:u,"data-shadow-visible":a||void 0,onClick:n==="cell"&&p?d:void 0,children:(0,Wt.jsx)(ut.Checkbox,{classNames:p?{input:J}:void 0,checked:l,indeterminate:r,onChange:d,...i,disabled:!(d||i.onChange)||i.disabled})})});var F=require("react/jsx-runtime"),ta=(0,mt.forwardRef)(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:l,onSortStatusChange:r,columns:i,defaultColumnProps:d,groups:u,selectionTrigger:f,selectionVisible:p,selectionChecked:b,selectionIndeterminate:T,onSelectionChange:h,selectionCheckboxProps:R,selectorCellShadowVisible:D,selectionColumnClassName:w,selectionColumnStyle:P},v){let x=p?(0,F.jsx)(jo,{ref:t,className:w,style:P,trigger:f,shadowVisible:D,checked:b,indeterminate:T,checkboxProps:R,onChange:h,rowSpan:u?2:void 0}):null,{columnsToggle:_,setColumnsToggle:I}=xe(),[c,C]=(0,mt.useState)(!1),s=i.some(g=>g.toggleable),m=s?Object.fromEntries(i.map(({accessor:g,title:N})=>[g,N??he(String(g))])):void 0,S=(0,F.jsxs)(O.TableThead,{className:(0,ea.default)("mantine-datatable-header",o),style:n,ref:v,onContextMenu:s?g=>{g.preventDefault(),C(N=>!N)}:void 0,children:[u&&(0,F.jsxs)(O.TableTr,{children:[x,u.map(g=>(0,F.jsx)(Ao,{group:g},g.id))]}),(0,F.jsxs)(O.TableTr,{children:[!u&&x,i.map(({hidden:g,...N},A)=>{if(g)return null;let{accessor:X,visibleMediaQuery:K,textAlign:H,width:ue,title:q,sortable:Oe,draggable:me,toggleable:We,resizable:Ae,titleClassName:j,titleStyle:gt,filter:ht,filtering:Ct,sortKey:yt}={...d,...N};return(0,F.jsx)(Zo,{accessor:X,className:j,style:gt,visibleMediaQuery:K,textAlign:H,width:ue,title:q,sortable:Oe,draggable:me,toggleable:We,resizable:Ae&&A<i.length-1,sortStatus:a,sortIcons:l,sortKey:yt,onSortStatusChange:r,filter:ht,filtering:Ct},X)})]})]});return s?(0,F.jsxs)(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:c,onChange:C,children:[(0,F.jsx)(O.PopoverTarget,{children:S}),(0,F.jsx)(O.PopoverDropdown,{children:(0,F.jsx)(O.Stack,{children:_.filter(g=>g.toggleable).map(g=>(0,F.jsx)(O.Group,{children:(0,F.jsx)(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:m[g.accessor],checked:g.toggled,onChange:N=>{I(_.map(A=>A.accessor===g.accessor?{...A,toggled:N.currentTarget.checked}:A))}})},g.accessor))})})]}):S});var pt=require("@mantine/core"),oa=V(require("clsx")),At=require("react/jsx-runtime");function aa({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:l,type:r,color:i}){return(0,At.jsx)(pt.Center,{pt:e,pb:t,className:(0,oa.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,At.jsx)(pt.Loader,{size:l,type:r,color:i}))})}var de=require("@mantine/core"),zt=V(require("clsx")),ua=require("react");var k=require("@mantine/core"),da=V(require("clsx"));var na=require("@mantine/core");function E(e,t,o){return e?(0,na.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function ra({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:l,highlightOnHoverColor:r}){return{"--mantine-datatable-color-light":E(t,e,"light"),"--mantine-datatable-color-dark":E(t,e,"dark"),"--mantine-datatable-background-color-light":E(o,e,"light"),"--mantine-datatable-background-color-dark":E(o,e,"dark"),"--mantine-datatable-border-color-light":E(n,e,"light"),"--mantine-datatable-border-color-dark":E(n,e,"dark"),"--mantine-datatable-row-border-color-light":E(a,e,"light"),"--mantine-datatable-row-border-color-dark":E(a,e,"dark"),"--mantine-datatable-striped-color-light":E(l,e,"light"),"--mantine-datatable-striped-color-dark":E(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":E(r,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":E(r,e,"dark")}}function ft({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":E(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":E(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":E(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":E(o,e,"dark")}}function la({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":E(t,e,"light"),"--mantine-datatable-row-color-dark":E(t,e,"dark"),"--mantine-datatable-row-background-color-light":E(o,e,"light"),"--mantine-datatable-row-background-color-dark":E(o,e,"dark")}}var Ie=require("react/jsx-runtime");function ia(){return(0,Ie.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ie.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ie.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Ie.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var $=require("react/jsx-runtime"),sa={xs:(0,k.rem)(22),sm:(0,k.rem)(26),md:(0,k.rem)(32),lg:(0,k.rem)(38),xl:(0,k.rem)(44)};function ca({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:l,onChange:r}){return(0,$.jsxs)(k.Group,{gap:"xs",children:[(0,$.jsx)(k.Text,{component:"div",size:e,children:t}),(0,$.jsxs)(k.Menu,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[(0,$.jsx)(k.MenuTarget,{children:(0,$.jsx)(k.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,$.jsx)(ia,{}),style:[{fontWeight:"normal"},i=>({height:sa[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),(0,$.jsx)(k.MenuDropdown,{children:o.map(i=>{let d=i===n;return(0,$.jsx)(k.MenuItem,{className:(0,da.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:sa[e]},d&&(a||l)?u=>ft({theme:u,paginationActiveTextColor:a,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>r(i),children:(0,$.jsx)(k.Text,{component:"div",size:e,children:i})},i)})})]})]})}var He=require("react/jsx-runtime"),ma=(0,ua.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:l,paginationWithEdges:r,paginationActiveTextColor:i,paginationActiveBackgroundColor:d,paginationSize:u,loadingText:f,noRecordsText:p,paginationText:b,totalRecords:T,recordsPerPage:h,onRecordsPerPageChange:R,recordsPerPageLabel:D,recordsPerPageOptions:w,recordsLength:P,horizontalSpacing:v,paginationWrapBreakpoint:x,getPaginationControlProps:_},I){let c;if(n)c=f;else if(!T)c=p;else{let s=(a-1)*h+1,m=s+P-1;c=b({from:s,to:m,totalRecords:T})}let C=ne(({breakpoints:s})=>`(min-width: ${typeof x=="number"?`${(0,de.rem)(x)}rem`:s[x]||x})`);return(0,He.jsxs)(de.Box,{ref:I,px:v??"xs",py:"xs",className:(0,zt.default)("mantine-datatable-pagination",t),style:[{flexDirection:C?"row":"column"},o],children:[(0,He.jsx)(de.Text,{component:"div",className:"mantine-datatable-pagination-text",size:u,children:c}),w&&(0,He.jsx)(ca,{activeTextColor:i,activeBackgroundColor:d,size:u,label:D,values:w,value:h,onChange:R}),(0,He.jsx)(de.Pagination,{classNames:{root:(0,zt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!P}),control:"mantine-datatable-pagination-pages-control"},style:i||d?s=>ft({theme:s,paginationActiveTextColor:i,paginationActiveBackgroundColor:d}):void 0,withEdges:r,value:a,onChange:l,size:u,total:Math.ceil(T/h),getControlProps:_})]})});var ya=require("@mantine/core"),Da=V(require("clsx"));var pa=require("@mantine/core"),fa=V(require("clsx"));var Ta=require("react/jsx-runtime");function ba({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:l,onDoubleClick:r,onContextMenu:i,noWrap:d,ellipsis:u,textAlign:f,width:p,accessor:b,render:T,defaultRender:h,customCellAttributes:R}){return ne(o)?(0,Ta.jsx)(pa.TableTd,{className:(0,fa.default)({[ke]:d||u,[Re]:u,[J]:l||r,[st]:i,[re]:f==="left",[le]:f==="center",[ie]:f==="right"},e),style:[{width:p,minWidth:p,maxWidth:p},t],onClick:l,onDoubleClick:r,onContextMenu:i,...R?.(n,a),children:T?T(n,a):h?h(n,a,b):it(n,b)}):null}var Se=require("@mantine/core");var Y=require("react/jsx-runtime");function ga({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:l}=wo(e,n?.transitionDuration);return l?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Se.TableTr,{}),(0,Y.jsx)(Se.TableTr,{children:(0,Y.jsx)(Se.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,Y.jsx)(Se.Collapse,{in:a,...n,children:(0,Y.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var bt=require("@mantine/core"),ha=V(require("clsx"));var Vt=require("react/jsx-runtime");function Ca({className:e,style:t,record:o,index:n,trigger:a,onChange:l,withRightShadow:r,checkboxProps:i,getCheckboxProps:d,...u}){let f={...i,...d(o,n)},p=!u.disabled&&!f.disabled,b=T=>{T.stopPropagation(),a==="cell"&&p&&l?.(T)};return(0,Vt.jsx)(bt.TableTd,{className:(0,ha.default)("mantine-datatable-row-selector-cell",{[J]:a==="cell"&&p},e),style:t,"data-shadow-visible":r||void 0,onClick:b,children:(0,Vt.jsx)(bt.Checkbox,{classNames:p?{input:J}:void 0,onChange:l,...u,...f})})}var te=require("react/jsx-runtime");function Sa({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:l,selectionVisible:r,selectionChecked:i,onSelectionChange:d,isRecordSelectable:u,selectionCheckboxProps:f,getSelectionCheckboxProps:p,onClick:b,onDoubleClick:T,onContextMenu:h,onCellClick:R,onCellDoubleClick:D,onCellContextMenu:w,expansion:P,customAttributes:v,color:x,backgroundColor:_,className:I,style:c,selectorCellShadowVisible:C,selectionColumnClassName:s,selectionColumnStyle:m}){return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)(ya.TableTr,{className:(0,Da.default)("mantine-datatable-row",{[J]:b||T||P?.isExpandable({record:e,index:t})&&P?.expandOnClick},{[st]:h},typeof I=="function"?I(e,t):I),"data-selected":i||void 0,onClick:S=>{if(P){let{isExpandable:g,isRowExpanded:N,expandOnClick:A,expandRow:X,collapseRow:K}=P;g({record:e,index:t})&&A&&(N(e)?K(e):X(e))}b?.({event:S,record:e,index:t})},onDoubleClick:T?S=>T({event:S,record:e,index:t}):void 0,onContextMenu:h?S=>h({event:S,record:e,index:t}):void 0,style:[x||_?S=>{let g=x?.(e,t),N=_?.(e,t);return la({theme:S,color:g,backgroundColor:N})}:void 0,c?.(e,t)],...v?.(e,t),children:[r&&(0,te.jsx)(Ca,{className:s,style:m,record:e,index:t,trigger:l,withRightShadow:C,checked:i,disabled:!d||(u?!u(e,t):!1),onChange:d,checkboxProps:f,getCheckboxProps:p}),o.map(({hidden:S,...g},N)=>{if(S)return null;let{accessor:A,visibleMediaQuery:X,textAlign:K,noWrap:H,ellipsis:ue,width:q,render:Oe,cellsClassName:me,cellsStyle:We,customCellAttributes:Ae}={...n,...g};return(0,te.jsx)(ba,{className:typeof me=="function"?me(e,t):me,style:We?.(e,t),visibleMediaQuery:X,record:e,index:t,onClick:R?j=>R({event:j,record:e,index:t,column:g,columnIndex:N}):void 0,onDoubleClick:D?j=>D({event:j,record:e,index:t,column:g,columnIndex:N}):void 0,onContextMenu:w?j=>w({event:j,record:e,index:t,column:g,columnIndex:N}):void 0,accessor:A,textAlign:K,noWrap:H,ellipsis:ue,width:q,render:Oe,defaultRender:a,customCellAttributes:Ae},A)})]}),P&&(0,te.jsx)(ga,{colSpan:o.filter(({hidden:S})=>!S).length+(r?1:0),open:P.isRowExpanded(e),content:P.content({record:e,index:t}),collapseProps:P.collapseProps})]})}var ce=require("@mantine/core"),Je=V(require("clsx")),we=require("react/jsx-runtime");function wa({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:l,headerHeight:r,footerHeight:i,onScrollPositionChange:d,children:u,viewportRef:f,scrollAreaProps:p}){return(0,we.jsxs)(ce.ScrollArea,{...p,viewportRef:f,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:d,children:[u,(0,we.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:r?(0,ce.rem)(r):0}}),(0,we.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,we.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,we.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:i?(0,ce.rem)(i+1):0}})]})}var z=require("react/jsx-runtime");function Pa({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,maxHeight:l,shadow:r,verticalAlign:i="center",fetching:d,columns:u,storeColumnsKey:f="mantine-datatable",groups:p,pinFirstColumn:b,pinLastColumn:T,defaultColumnProps:h,defaultColumnRender:R,idAccessor:D="id",records:w,selectionTrigger:P="checkbox",selectedRecords:v,onSelectedRecordsChange:x,selectionColumnClassName:_,selectionColumnStyle:I,isRecordSelectable:c,selectionCheckboxProps:C,allRecordsSelectionCheckboxProps:s={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:m=(B,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:S,sortIcons:g,onSortStatusChange:N,horizontalSpacing:A,page:X,onPageChange:K,totalRecords:H,recordsPerPage:ue,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:me="Records per page",paginationWithEdges:We,paginationActiveTextColor:Ae,paginationActiveBackgroundColor:j,paginationSize:gt="sm",paginationText:ht=({from:B,to:pe,totalRecords:fe})=>`${B} - ${pe} / ${fe}`,paginationWrapBreakpoint:Ct="sm",getPaginationControlProps:yt=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:va,customLoader:xa,loaderSize:Ma,loaderType:ka,loaderColor:Ra,loadingText:Ea="...",emptyState:Na,noRecordsText:_t="No records",noRecordsIcon:La,highlightOnHover:Ia,striped:Ha,noHeader:Oa,onRowClick:Wa,onRowDoubleClick:Aa,onRowContextMenu:za,onCellClick:Va,onCellDoubleClick:Fa,onCellContextMenu:_a,onScroll:Bt,onScrollToTop:Gt,onScrollToBottom:Xt,onScrollToLeft:Qt,onScrollToRight:Ut,c:Ba,backgroundColor:Ga,borderColor:Xa,rowBorderColor:Qa,stripedColor:Ua,highlightOnHoverColor:$a,rowColor:Ka,rowBackgroundColor:Ja,rowExpansion:Za,rowClassName:Ya,rowStyle:qa,customRowAttributes:ja,scrollViewportRef:en,scrollAreaProps:tn,tableRef:on,bodyRef:an,m:nn,my:rn,mx:ln,mt:sn,mb:dn,ml:cn,mr:un,className:mn,classNames:ze,style:pn,styles:Ve,...$t}){let{ref:B,width:pe,height:fe}=ge(),Fe=(0,G.useMemo)(()=>p?.flatMap(y=>y.columns)??u,[u,p]),Kt=Nt({key:f,columns:Fe}),{ref:fn,height:Dt}=ge(),{ref:bn,width:St,height:_e}=ge(),{ref:Tn,height:gn}=ge(),{ref:hn,height:Jt}=ge(),{ref:Cn,width:yn}=ge(),Dn=(0,Ze.useMergedRef)(bn,on),Sn=(0,Ze.useMergedRef)(B,en),[wt,Zt]=(0,G.useState)(!0),[Pt,Yt]=(0,G.useState)(!0),[Be,qt]=(0,G.useState)(!0),[Ye,jt]=(0,G.useState)(!0),wn=So({rowExpansion:Za,records:w,idAccessor:D}),vt=(0,G.useCallback)(()=>{let y=B.current?.scrollTop||0,oe=B.current?.scrollLeft||0;if(d||_e<=fe)Zt(!0),Yt(!0);else{let Q=y===0,U=_e-y-fe<1;Zt(Q),Yt(U),Q&&Q!==wt&&Gt?.(),U&&U!==Pt&&Xt?.()}if(d||St===pe)qt(!0),jt(!0);else{let Q=oe===0,U=St-oe-pe<1;qt(Q),jt(U),Q&&Q!==Be&&Qt?.(),U&&U!==Ye&&Ut?.()}},[d,Xt,Qt,Ut,Gt,fe,B,pe,Pt,Be,Ye,wt,_e,St]);fo(vt,[vt]);let eo=(0,Ze.useDebouncedCallback)(vt,50),Pn=(0,G.useCallback)(y=>{Bt?.(y),eo()},[eo,Bt]),vn=(0,G.useCallback)(y=>{B.current?.scrollTo({top:0,left:0}),K(y)},[K,B]),qe=w?.length,to=w?.map(y=>L(y,D)),Pe=!!v,Ge=v?.map(y=>L(y,D)),oo=to!==void 0&&Ge!==void 0&&Ge.length>0,xt=c?w?.filter(c):w,je=xt?.map(y=>L(y,D)),et=oo&&je.every(y=>Ge.includes(y)),xn=oo&&je.some(y=>Ge.includes(y)),Mn=(0,G.useCallback)(()=>{v&&x&&x(et?v.filter(y=>!je.includes(L(y,D))):Xe([...v,...xt],y=>L(y,D)))},[et,D,x,je,xt,v]),{lastSelectionChangeIndex:tt,setLastSelectionChangeIndex:kn}=bo(to),Mt=Pe&&!Be&&!b;return(0,z.jsx)(Rt,{...Kt,children:(0,z.jsxs)(Tt.Box,{...{m:nn,my:rn,mx:ln,mt:sn,mb:dn,ml:cn,mr:un},className:(0,Ft.default)("mantine-datatable",{"mantine-datatable-with-border":e},mn,ze?.root),style:[y=>({...ra({theme:y,c:Ba,backgroundColor:Ga,borderColor:Xa,rowBorderColor:Qa,stripedColor:Ua,highlightOnHoverColor:$a}),borderRadius:y.radius[t]||t,boxShadow:y.shadows[r]||r,height:n,minHeight:a,maxHeight:l}),pn,Ve?.root],children:[(0,z.jsx)(wa,{viewportRef:Sn,topShadowVisible:!wt,leftShadowVisible:!Be,leftShadowBehind:Pe||!!b,rightShadowVisible:!Ye,rightShadowBehind:T,bottomShadowVisible:!Pt,headerHeight:Dt,footerHeight:gn,onScrollPositionChange:Pn,scrollAreaProps:tn,children:(0,z.jsxs)(Tt.Table,{ref:Dn,horizontalSpacing:A,className:(0,Ft.default)("mantine-datatable-table",{[Po]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":$t.withRowBorders&&_e<fe,"mantine-datatable-pin-last-column":T,"mantine-datatable-pin-last-column-scrolled":!Ye&&T,"mantine-datatable-selection-column-visible":Pe,"mantine-datatable-pin-first-column":b,"mantine-datatable-pin-first-column-scrolled":!Be&&b},ze?.table),style:{...Ve?.table,"--mantine-datatable-selection-column-width":`${yn}px`},"data-striped":qe&&Ha||void 0,"data-highlight-on-hover":Ia||void 0,...$t,children:[Oa?null:(0,z.jsx)(Rt,{...Kt,children:(0,z.jsx)(ta,{ref:fn,selectionColumnHeaderRef:Cn,className:ze?.header,style:Ve?.header,columns:Fe,defaultColumnProps:h,groups:p,sortStatus:S,sortIcons:g,onSortStatusChange:N,selectionTrigger:P,selectionVisible:Pe,selectionChecked:et,selectionIndeterminate:xn&&!et,onSelectionChange:Mn,selectionCheckboxProps:{...C,...s},selectorCellShadowVisible:Mt,selectionColumnClassName:_,selectionColumnStyle:I})}),(0,z.jsx)("tbody",{ref:an,children:qe?w.map((y,oe)=>{let Q=L(y,D),U=Ge?.includes(Q)||!1,ao;return x&&v&&(ao=Rn=>{if(Rn.nativeEvent.shiftKey&&tt!==null){let ve=w.filter(oe>tt?(be,Te)=>Te>=tt&&Te<=oe&&(c?c(be,Te):!0):(be,Te)=>Te>=oe&&Te<=tt&&(c?c(be,Te):!0));x(U?It(v,ve,be=>L(be,D)):Xe([...v,...ve],be=>L(be,D)))}else x(U?v.filter(ve=>L(ve,D)!==Q):Xe([...v,y],ve=>L(ve,D)));kn(oe)}),(0,z.jsx)(Sa,{record:y,index:oe,columns:Fe,defaultColumnProps:h,defaultColumnRender:R,selectionTrigger:P,selectionVisible:Pe,selectionChecked:U,onSelectionChange:ao,isRecordSelectable:c,selectionCheckboxProps:C,getSelectionCheckboxProps:m,onClick:Wa,onDoubleClick:Aa,onCellClick:Va,onCellDoubleClick:Fa,onContextMenu:za,onCellContextMenu:_a,expansion:wn,color:Ka,backgroundColor:Ja,className:Ya,style:qa,customAttributes:ja,selectorCellShadowVisible:Mt,selectionColumnClassName:_,selectionColumnStyle:I},Q)}):(0,z.jsx)(so,{})}),Fe.some(({footer:y})=>y)&&(0,z.jsx)(Ho,{ref:Tn,className:ze?.footer,style:Ve?.footer,columns:Fe,defaultColumnProps:h,selectionVisible:Pe,selectorCellShadowVisible:Mt,scrollDiff:_e-fe})]})}),X&&(0,z.jsx)(ma,{ref:hn,className:ze?.pagination,style:Ve?.pagination,horizontalSpacing:A,fetching:d,page:X,onPageChange:vn,totalRecords:H,recordsPerPage:ue,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:me,paginationWithEdges:We,paginationActiveTextColor:Ae,paginationActiveBackgroundColor:j,paginationSize:gt,paginationText:ht,paginationWrapBreakpoint:Ct,getPaginationControlProps:yt,noRecordsText:_t,loadingText:Ea,recordsLength:qe}),(0,z.jsx)(aa,{pt:Dt,pb:Jt,fetching:d,backgroundBlur:va,customContent:xa,size:Ma,type:ka,color:Ra}),(0,z.jsx)(uo,{pt:Dt,pb:Jt,icon:La,text:_t,active:!d&&!qe,children:Na})]})})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy,useDataTableColumns});
"use strict";"use client";var En=Object.create;var ot=Object.defineProperty;var Nn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var In=Object.getPrototypeOf,Hn=Object.prototype.hasOwnProperty;var On=(e,t)=>{for(var o in t)ot(e,o,{get:t[o],enumerable:!0})},no=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ln(t))!Hn.call(e,a)&&a!==o&&ot(e,a,{get:()=>t[a],enumerable:!(n=Nn(t,a))||n.enumerable});return e};var A=(e,t,o)=>(o=e!=null?En(In(e)):{},no(t||!e||!e.__esModule?ot(o,"default",{value:e,enumerable:!0}):o,e)),Wn=e=>no(ot({},"__esModule",{value:!0}),e);var Vn={};On(Vn,{DataTable:()=>Pa,differenceBy:()=>It,getRecordId:()=>R,getValueAtPath:()=>it,humanize:()=>he,uniqBy:()=>Xe,useDataTableColumns:()=>Nt});module.exports=Wn(Vn);var Tt=require("@mantine/core"),Ze=require("@mantine/hooks"),Ft=A(require("clsx")),B=require("react");var kt=require("react");var ro=require("@mantine/core"),[lo,ve]=(0,ro.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var io=require("react/jsx-runtime"),Rt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:l,resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d}=e,[m,c]=(0,kt.useState)(""),[p,u]=(0,kt.useState)("");return(0,io.jsx)(lo,{value:{sourceColumn:m,setSourceColumn:c,targetColumn:p,setTargetColumn:u,columnsToggle:a,setColumnsToggle:l,swapColumns:()=>{if(!o||!n||!m||!p)return;let M=o.indexOf(m),y=o.indexOf(p);if(M!==-1&&y!==-1){let b=o.splice(M,1)[0];o.splice(y,0,b),n([...o])}},resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d},children:t})};var Et=require("react/jsx-runtime");function so(){return(0,Et.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Et.jsx)("td",{})})}var at=require("@mantine/core");var ae=require("react/jsx-runtime");function co(){return(0,ae.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ae.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ae.jsx)("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),(0,ae.jsx)("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),(0,ae.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,ae.jsx)("path",{d:"M3 3l18 18"})]})}var ee=require("react/jsx-runtime");function mo({icon:e,text:t,pt:o,pb:n,active:a,children:l}){return(0,ee.jsx)(at.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:l||(0,ee.jsxs)(ee.Fragment,{children:[e||(0,ee.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,ee.jsx)(co,{})}),(0,ee.jsx)(at.Text,{component:"div",size:"sm",c:"dimmed",children:t})]})})}var Ne=require("@mantine/core"),Lo=A(require("clsx")),Io=require("react");var xo=require("@mantine/core"),vo=A(require("clsx"));var nt=require("@mantine/hooks"),uo=require("react"),Nt=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{let n=t&&t.map(b=>b.accessor)||[],a=t&&t.map(b=>({[b.accessor]:b.width??"initial"}))||[],l=t&&t.map(b=>({accessor:b.accessor,defaultToggle:b.defaultToggle||!0,toggleable:b.toggleable,toggled:b.defaultToggle===void 0?!0:b.defaultToggle})),[r,i]=(0,nt.useLocalStorage)({key:`${e}-columns-order`,defaultValue:n,getInitialValueInEffect:o}),[s,d]=(0,nt.useLocalStorage)({key:`${e}-columns-toggle`,defaultValue:l,getInitialValueInEffect:o}),[m,c]=(0,nt.useLocalStorage)({key:`${e}-columns-width`,defaultValue:a,getInitialValueInEffect:o}),p=()=>i(n),u=()=>{d(l)},f=()=>c(a);return{effectiveColumns:(0,uo.useMemo)(()=>r?r.map(T=>t.find(C=>C.accessor===T)).map(T=>({...T,hidden:!s.find(C=>C.accessor===T?.accessor)?.toggled})).map(T=>({...T,width:m.find(C=>C[T?.accessor])?.[T?.accessor]})):t,[t,r,s,m]),setColumnsOrder:i,columnsOrder:r,resetColumnsOrder:p,columnsToggle:s,setColumnsToggle:d,resetColumnsToggle:u,columnsWidth:m,setColumnsWidth:c,setColumnWidth:(b,D)=>{let T=m.map(C=>C[b]?{[b]:D}:C);c(T)},resetColumnsWidth:f}};var po=require("@mantine/hooks");function ge(){let[e]=(0,po.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var rt=require("react"),bo=typeof window<"u"?rt.useLayoutEffect:rt.useEffect;var lt=require("react");function fo(e){let[t,o]=(0,lt.useState)(null),n=e?.join(":")||"";return(0,lt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var Me=require("react");function An(e,t){let o=()=>{t(e.map(a=>a.matches))},n=e.map(a=>{try{return a.addEventListener("change",o),()=>a.removeEventListener("change",o)}catch{return a.addListener(o),()=>a.removeListener(o)}});return()=>{n.forEach(a=>a())}}function zn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function To(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,Me.useState)(o?t:zn(e,t)),l=(0,Me.useRef)();return(0,Me.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(r=>window.matchMedia(r)),a(l.current.map(r=>r.matches)),An(l.current,r=>{a(r)})},[e]),n}var go=require("@mantine/core"),Lt=require("react");function ho(e){let t=(0,go.useMantineTheme)(),o=(0,Lt.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,Lt.useMemo)(()=>e.map(()=>!0),[e]);return To(o,n)}var Co=require("@mantine/core"),yo=require("@mantine/hooks");function ne(e){let t=(0,Co.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,yo.useMediaQuery)(o||"",!0)}var Do=require("react");function he(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function It(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function Xe(e,t){return e.filter((o,n,a)=>n===a.findIndex(l=>t(o)===t(l)))}function it(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function R(e,t){return typeof t=="string"?it(e,t):t(e)}function wo({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:s,initiallyExpanded:d}=e;t&&i==="always"?n=t.map(m=>R(m,o)):d&&(n=t.filter((m,c)=>d({record:m,index:c})).map(m=>R(m,o)),s||(n=[n[0]]))}let a,l,r=(0,Do.useState)(n);if(e){let{expandable:i,trigger:s,allowMultiple:d,collapseProps:m,content:c}=e;e.expanded?{recordIds:a,onRecordIdsChange:l}=e.expanded:[a,l]=r;let p=u=>l?.(a.filter(f=>f!==R(u,o)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:u=>s==="always"?!0:a.includes(R(u,o)),isExpandable:({record:u,index:f})=>i?i({record:u,index:f}):!0,expandRow:u=>{let f=R(u,o);l?.(d?[...a,f]:[f])},collapseRow:p,collapseProps:m,content:({record:u,index:f})=>()=>c({record:u,index:f,collapse:()=>p(u)})}}}var Ht=require("@mantine/hooks"),Qe=require("react");function So(e,t){let[o,n]=(0,Qe.useState)(e),[a,l]=(0,Qe.useState)(e),r=(0,Ht.useTimeout)(()=>n(!0),0),i=(0,Ht.useTimeout)(()=>l(!1),t||200);return(0,Qe.useEffect)(()=>{e?(i.clear(),l(!0),r.start()):(r.clear(),n(!1),i.start())},[r,i,e]),{expanded:o,visible:a}}var ke="mantine-datatable-nowrap",Re="mantine-datatable-ellipsis",J="mantine-datatable-pointer-cursor",st="mantine-datatable-context-menu-cursor",Po="mantine-datatable-text-selection-disabled",re="mantine-datatable-text-align-left",le="mantine-datatable-text-align-center",ie="mantine-datatable-text-align-right";var ko=require("react/jsx-runtime");function Mo({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:l,textAlign:r,width:i}){return ne(o)?(0,ko.jsx)(xo.TableTh,{className:(0,vo.default)({[ke]:a||l,[Re]:l,[re]:r==="left",[le]:r==="center",[ie]:r==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}var Ro=require("@mantine/core"),No=require("react/jsx-runtime");function Eo({shadowVisible:e}){return(0,No.jsx)(Ro.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Ee=require("react/jsx-runtime"),Ho=(0,Io.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:l,selectorCellShadowVisible:r,scrollDiff:i},s){let d=i<0;return(0,Ee.jsx)(Ne.TableTfoot,{ref:s,className:(0,Lo.default)("mantine-datatable-footer",t),style:[{position:d?"relative":"sticky",bottom:(0,Ne.rem)(d?i:0)},o],children:(0,Ee.jsxs)(Ne.TableTr,{children:[l&&(0,Ee.jsx)(Eo,{shadowVisible:r}),n.map(({hidden:m,...c})=>{if(m)return null;let{accessor:p,visibleMediaQuery:u,textAlign:f,width:M,footer:y,footerClassName:b,footerStyle:D,noWrap:T,ellipsis:C}={...a,...c};return(0,Ee.jsx)(Mo,{className:b,style:D,visibleMediaQuery:u,textAlign:f,width:M,title:y,noWrap:T,ellipsis:C},p)})]})})});var N=require("@mantine/core"),ea=A(require("clsx")),ut=require("react");var Oo=require("@mantine/core"),Wo=A(require("clsx")),Ot=require("react");var zo=require("react/jsx-runtime");function Ao({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:l}}){let r=(0,Ot.useMemo)(()=>t.map(({visibleMediaQuery:d})=>d),[t]),i=ho(r),s=(0,Ot.useMemo)(()=>t.filter(({hidden:d},m)=>!d&&i?.[m]).length,[t,i]);return s>0?(0,zo.jsx)(Oo.TableTh,{colSpan:s,className:(0,Wo.default)("mantine-datatable-column-group-header-cell",{[re]:n==="left",[le]:n==="center",[ie]:n==="right"},a),style:l,children:o??he(e)}):null}var H=require("@mantine/core"),Ke=A(require("clsx")),ct=require("react");var se=require("@mantine/core"),_o=require("@mantine/hooks");var Ue=require("react/jsx-runtime");function Vo(){return(0,Ue.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ue.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ue.jsx)("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}var $e=require("react/jsx-runtime");function Fo(){return(0,$e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,$e.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,$e.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var Ce=require("react/jsx-runtime");function Bo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,_o.useDisclosure)(!1);return(0,Ce.jsxs)(se.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,Ce.jsx)(se.PopoverTarget,{children:(0,Ce.jsx)(se.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:r=>{r.preventDefault(),a()},children:(0,Ce.jsx)(t?Fo:Vo,{})})}),(0,Ce.jsx)(se.PopoverDropdown,{onClick:r=>r.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var Go=require("@mantine/core"),dt=require("react");var Qo=require("react/jsx-runtime"),Xo=e=>{let{accessor:t,columnRef:o}=e,n=(0,dt.useRef)(null),[a,l]=(0,dt.useState)(0),{setColumnWidth:r}=ve(),i=c=>{c.preventDefault(),c.stopPropagation(),document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),document.body.style.cursor="col-resize"},s=c=>{if(!o.current)return;let p=c.clientX-o.current.getBoundingClientRect().right,f=`${o.current.getBoundingClientRect().width+p}px`;o.current.style.width=f,r(t,o.current.style.width),l(-p)},d=()=>{o.current&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),document.body.style.cursor="initial",r(t,o.current.style.width),l(0))};return(0,Qo.jsx)("div",{ref:n,onClick:c=>c.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",r(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,Go.rem)(a)}})};var ye=require("react/jsx-runtime");function Uo(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M12 5l0 14"}),(0,ye.jsx)("path",{d:"M16 9l-4 -4"}),(0,ye.jsx)("path",{d:"M8 9l4 -4"})]})}var De=require("react/jsx-runtime");function $o(){return(0,De.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,De.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,De.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,De.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,De.jsx)("path",{d:"M12 3l0 18"})]})}var Z=require("react/jsx-runtime");function Ko(){return(0,Z.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Z.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Z.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Le=require("react/jsx-runtime");function Jo(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M18 6l-12 12"}),(0,Le.jsx)("path",{d:"M6 6l12 12"})]})}var w=require("react/jsx-runtime");function Zo({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:l,draggable:r,toggleable:i,resizable:s,sortIcons:d,textAlign:m,width:c,sortStatus:p,onSortStatusChange:u,filter:f,filtering:M,sortKey:y}){let{setSourceColumn:b,setTargetColumn:D,swapColumns:T,setColumnsToggle:C}=ve(),[F,L]=(0,ct.useState)(!1),x=(0,ct.useRef)(null);if(!ne(n))return null;let V=a??he(o),I=typeof V=="string"?V:void 0,$=l&&u?E=>{E?.defaultPrevented||u({sortKey:y,columnAccessor:o,direction:p?.columnAccessor===o?p.direction==="asc"?"desc":"asc":p?.direction??"asc"})}:void 0,k=E=>{E.stopPropagation(),b(o),L(!1)},h=E=>{E.preventDefault(),D(o),L(!0)},v=()=>{D(o),L(!1),T()},O=()=>{L(!0)},G=()=>{L(!1)},K=E=>{E.stopPropagation(),C(me=>me.map(q=>q.accessor===o?{...q,toggled:!1}:q))};return(0,w.jsxs)(H.TableTh,{className:(0,Ke.default)({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":s},e),style:[{width:c,...s?{minWidth:"1px"}:{minWidth:c,maxWidth:c}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:$,onKeyDown:E=>E.key==="Enter"&&$?.(),ref:x,children:[(0,w.jsxs)(H.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,w.jsxs)(H.Flex,{align:"center",w:"100%",className:(0,Ke.default)({"mantine-datatable-header-cell-draggable":r,"mantine-datatable-header-cell-drag-over":F}),draggable:r,onDragStart:r?k:void 0,onDragEnter:r?O:void 0,onDragOver:r?h:void 0,onDrop:r?v:void 0,onDragLeave:r?G:void 0,children:[r?(0,w.jsx)(H.Center,{role:"img","aria-label":"Drag column",children:(0,w.jsx)(H.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:E=>{E.stopPropagation()},children:(0,w.jsx)(Ko,{})})}):null,(0,w.jsx)(H.Box,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-text",{[re]:m==="left",[le]:m==="center",[ie]:m==="right"},ke,Re),title:I,children:V})]}),i?(0,w.jsx)(H.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,w.jsx)(H.ActionIcon,{size:"xs",variant:"light",onClick:K,children:(0,w.jsx)(Jo,{})})}):null,l||p?.columnAccessor===o?(0,w.jsx)(w.Fragment,{children:p?.columnAccessor===o?(0,w.jsx)(H.Center,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":p.direction==="desc"}),role:"img","aria-label":`Sorted ${p.direction==="desc"?"descending":"ascending"}`,children:d?.sorted||(0,w.jsx)(Uo,{})}):(0,w.jsx)(H.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:d?.unsorted||(0,w.jsx)($o,{})})}):null,f?(0,w.jsx)(Bo,{isActive:!!M,children:f}):null]}),s?(0,w.jsx)(Xo,{accessor:o,columnRef:x}):null]})}var mt=require("@mantine/core"),Yo=A(require("clsx")),qo=require("react");var Wt=require("react/jsx-runtime"),jo=(0,qo.forwardRef)(function({className:t,style:o,trigger:n,shadowVisible:a,checked:l,indeterminate:r,checkboxProps:i,onChange:s,rowSpan:d},m){let c=!i.disabled;return(0,Wt.jsx)(mt.TableTh,{ref:m,className:(0,Yo.default)("mantine-datatable-header-selector-cell",{[J]:n==="cell"&&c},t),style:o,rowSpan:d,"data-shadow-visible":a||void 0,onClick:n==="cell"&&c?s:void 0,children:(0,Wt.jsx)(mt.Checkbox,{classNames:c?{input:J}:void 0,checked:l,indeterminate:r,onChange:s,...i,disabled:!(s||i.onChange)||i.disabled})})});var z=require("react/jsx-runtime"),ta=(0,ut.forwardRef)(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:l,onSortStatusChange:r,columns:i,defaultColumnProps:s,groups:d,selectionTrigger:m,selectionVisible:c,selectionChecked:p,selectionIndeterminate:u,onSelectionChange:f,selectionCheckboxProps:M,selectorCellShadowVisible:y,selectionColumnClassName:b,selectionColumnStyle:D},T){let C=c?(0,z.jsx)(jo,{ref:t,className:b,style:D,trigger:m,shadowVisible:y,checked:p,indeterminate:u,checkboxProps:M,onChange:f,rowSpan:d?2:void 0}):null,{columnsToggle:F,setColumnsToggle:L}=ve(),[x,V]=(0,ut.useState)(!1),I=i.some(h=>h.toggleable),$=I?Object.fromEntries(i.map(({accessor:h,title:v})=>[h,v??he(String(h))])):void 0,k=(0,z.jsxs)(N.TableThead,{className:(0,ea.default)("mantine-datatable-header",o),style:n,ref:T,onContextMenu:I?h=>{h.preventDefault(),V(v=>!v)}:void 0,children:[d&&(0,z.jsxs)(N.TableTr,{children:[C,d.map(h=>(0,z.jsx)(Ao,{group:h},h.id))]}),(0,z.jsxs)(N.TableTr,{children:[!d&&C,i.map(({hidden:h,...v},O)=>{if(h)return null;let{accessor:G,visibleMediaQuery:K,textAlign:E,width:me,title:q,sortable:Oe,draggable:ue,toggleable:We,resizable:Ae,titleClassName:j,titleStyle:gt,filter:ht,filtering:Ct,sortKey:yt}={...s,...v};return(0,z.jsx)(Zo,{accessor:G,className:j,style:gt,visibleMediaQuery:K,textAlign:E,width:me,title:q,sortable:Oe,draggable:ue,toggleable:We,resizable:Ae&&O<i.length-1,sortStatus:a,sortIcons:l,sortKey:yt,onSortStatusChange:r,filter:ht,filtering:Ct},G)})]})]});return I?(0,z.jsxs)(N.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:x,onChange:V,children:[(0,z.jsx)(N.PopoverTarget,{children:k}),(0,z.jsx)(N.PopoverDropdown,{children:(0,z.jsx)(N.Stack,{children:F.filter(h=>h.toggleable).map(h=>(0,z.jsx)(N.Group,{children:(0,z.jsx)(N.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:$[h.accessor],checked:h.toggled,onChange:v=>{L(F.map(O=>O.accessor===h.accessor?{...O,toggled:v.currentTarget.checked}:O))}})},h.accessor))})})]}):k});var pt=require("@mantine/core"),oa=A(require("clsx")),At=require("react/jsx-runtime");function aa({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:l,type:r,color:i}){return(0,At.jsx)(pt.Center,{pt:e,pb:t,className:(0,oa.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,At.jsx)(pt.Loader,{size:l,type:r,color:i}))})}var de=require("@mantine/core"),zt=A(require("clsx")),ma=require("react");var S=require("@mantine/core"),da=A(require("clsx"));var na=require("@mantine/core");function P(e,t,o){return e?(0,na.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function ra({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:l,highlightOnHoverColor:r}){return{"--mantine-datatable-color-light":P(t,e,"light"),"--mantine-datatable-color-dark":P(t,e,"dark"),"--mantine-datatable-background-color-light":P(o,e,"light"),"--mantine-datatable-background-color-dark":P(o,e,"dark"),"--mantine-datatable-border-color-light":P(n,e,"light"),"--mantine-datatable-border-color-dark":P(n,e,"dark"),"--mantine-datatable-row-border-color-light":P(a,e,"light"),"--mantine-datatable-row-border-color-dark":P(a,e,"dark"),"--mantine-datatable-striped-color-light":P(l,e,"light"),"--mantine-datatable-striped-color-dark":P(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":P(r,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":P(r,e,"dark")}}function bt({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":P(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":P(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":P(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":P(o,e,"dark")}}function la({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":P(t,e,"light"),"--mantine-datatable-row-color-dark":P(t,e,"dark"),"--mantine-datatable-row-background-color-light":P(o,e,"light"),"--mantine-datatable-row-background-color-dark":P(o,e,"dark")}}var Ie=require("react/jsx-runtime");function ia(){return(0,Ie.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ie.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ie.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Ie.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var U=require("react/jsx-runtime"),sa={xs:(0,S.rem)(22),sm:(0,S.rem)(26),md:(0,S.rem)(32),lg:(0,S.rem)(38),xl:(0,S.rem)(44)};function ca({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:l,onChange:r}){return(0,U.jsxs)(S.Group,{gap:"xs",children:[(0,U.jsx)(S.Text,{component:"div",size:e,children:t}),(0,U.jsxs)(S.Menu,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[(0,U.jsx)(S.MenuTarget,{children:(0,U.jsx)(S.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,U.jsx)(ia,{}),style:[{fontWeight:"normal"},i=>({height:sa[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),(0,U.jsx)(S.MenuDropdown,{children:o.map(i=>{let s=i===n;return(0,U.jsx)(S.MenuItem,{className:(0,da.default)({"mantine-datatable-page-size-selector-active":s}),style:[{height:sa[e]},s&&(a||l)?d=>bt({theme:d,paginationActiveTextColor:a,paginationActiveBackgroundColor:l}):void 0],disabled:s,onClick:()=>r(i),children:(0,U.jsx)(S.Text,{component:"div",size:e,children:i})},i)})})]})]})}var He=require("react/jsx-runtime"),ua=(0,ma.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:l,paginationWithEdges:r,paginationActiveTextColor:i,paginationActiveBackgroundColor:s,paginationSize:d,loadingText:m,noRecordsText:c,paginationText:p,totalRecords:u,recordsPerPage:f,onRecordsPerPageChange:M,recordsPerPageLabel:y,recordsPerPageOptions:b,recordsLength:D,horizontalSpacing:T,paginationWrapBreakpoint:C,getPaginationControlProps:F},L){let x;if(n)x=m;else if(!u)x=c;else{let I=(a-1)*f+1,$=I+D-1;x=p({from:I,to:$,totalRecords:u})}let V=ne(({breakpoints:I})=>`(min-width: ${typeof C=="number"?`${(0,de.rem)(C)}rem`:I[C]||C})`);return(0,He.jsxs)(de.Box,{ref:L,px:T??"xs",py:"xs",className:(0,zt.default)("mantine-datatable-pagination",t),style:[{flexDirection:V?"row":"column"},o],children:[(0,He.jsx)(de.Text,{component:"div",className:"mantine-datatable-pagination-text",size:d,children:x}),b&&(0,He.jsx)(ca,{activeTextColor:i,activeBackgroundColor:s,size:d,label:y,values:b,value:f,onChange:M}),(0,He.jsx)(de.Pagination,{classNames:{root:(0,zt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!D}),control:"mantine-datatable-pagination-pages-control"},style:i||s?I=>bt({theme:I,paginationActiveTextColor:i,paginationActiveBackgroundColor:s}):void 0,withEdges:r,value:a,onChange:l,size:d,total:Math.ceil(u/f),getControlProps:F})]})});var ya=require("@mantine/core"),Da=A(require("clsx"));var pa=require("@mantine/core"),ba=A(require("clsx"));var Ta=require("react/jsx-runtime");function fa({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:l,onDoubleClick:r,onContextMenu:i,noWrap:s,ellipsis:d,textAlign:m,width:c,accessor:p,render:u,defaultRender:f,customCellAttributes:M}){return ne(o)?(0,Ta.jsx)(pa.TableTd,{className:(0,ba.default)({[ke]:s||d,[Re]:d,[J]:l||r,[st]:i,[re]:m==="left",[le]:m==="center",[ie]:m==="right"},e),style:[{width:c,minWidth:c,maxWidth:c},t],onClick:l,onDoubleClick:r,onContextMenu:i,...M?.(n,a),children:u?u(n,a):f?f(n,a,p):it(n,p)}):null}var we=require("@mantine/core");var Y=require("react/jsx-runtime");function ga({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:l}=So(e,n?.transitionDuration);return l?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(we.TableTr,{}),(0,Y.jsx)(we.TableTr,{children:(0,Y.jsx)(we.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,Y.jsx)(we.Collapse,{in:a,...n,children:(0,Y.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var ft=require("@mantine/core"),ha=A(require("clsx"));var Vt=require("react/jsx-runtime");function Ca({className:e,style:t,record:o,index:n,trigger:a,onChange:l,withRightShadow:r,checkboxProps:i,getCheckboxProps:s,...d}){let m={...i,...s(o,n)},c=!d.disabled&&!m.disabled,p=u=>{u.stopPropagation(),a==="cell"&&c&&l?.(u)};return(0,Vt.jsx)(ft.TableTd,{className:(0,ha.default)("mantine-datatable-row-selector-cell",{[J]:a==="cell"&&c},e),style:t,"data-shadow-visible":r||void 0,onClick:p,children:(0,Vt.jsx)(ft.Checkbox,{classNames:c?{input:J}:void 0,onChange:l,...d,...m})})}var te=require("react/jsx-runtime");function wa({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:l,selectionVisible:r,selectionChecked:i,onSelectionChange:s,isRecordSelectable:d,selectionCheckboxProps:m,getSelectionCheckboxProps:c,onClick:p,onDoubleClick:u,onContextMenu:f,onCellClick:M,onCellDoubleClick:y,onCellContextMenu:b,expansion:D,customAttributes:T,color:C,backgroundColor:F,className:L,style:x,selectorCellShadowVisible:V,selectionColumnClassName:I,selectionColumnStyle:$}){return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)(ya.TableTr,{className:(0,Da.default)("mantine-datatable-row",{[J]:p||u||D?.isExpandable({record:e,index:t})&&D?.expandOnClick},{[st]:f},typeof L=="function"?L(e,t):L),"data-selected":i||void 0,onClick:k=>{if(D){let{isExpandable:h,isRowExpanded:v,expandOnClick:O,expandRow:G,collapseRow:K}=D;h({record:e,index:t})&&O&&(v(e)?K(e):G(e))}p?.({event:k,record:e,index:t})},onDoubleClick:u?k=>u({event:k,record:e,index:t}):void 0,onContextMenu:f?k=>f({event:k,record:e,index:t}):void 0,style:[C||F?k=>{let h=C?.(e,t),v=F?.(e,t);return la({theme:k,color:h,backgroundColor:v})}:void 0,x?.(e,t)],...T?.(e,t),children:[r&&(0,te.jsx)(Ca,{className:I,style:$,record:e,index:t,trigger:l,withRightShadow:V,checked:i,disabled:!s||(d?!d(e,t):!1),onChange:s,checkboxProps:m,getCheckboxProps:c}),o.map(({hidden:k,...h},v)=>{if(k)return null;let{accessor:O,visibleMediaQuery:G,textAlign:K,noWrap:E,ellipsis:me,width:q,render:Oe,cellsClassName:ue,cellsStyle:We,customCellAttributes:Ae}={...n,...h};return(0,te.jsx)(fa,{className:typeof ue=="function"?ue(e,t):ue,style:We?.(e,t),visibleMediaQuery:G,record:e,index:t,onClick:M?j=>M({event:j,record:e,index:t,column:h,columnIndex:v}):void 0,onDoubleClick:y?j=>y({event:j,record:e,index:t,column:h,columnIndex:v}):void 0,onContextMenu:b?j=>b({event:j,record:e,index:t,column:h,columnIndex:v}):void 0,accessor:O,textAlign:K,noWrap:E,ellipsis:me,width:q,render:Oe,defaultRender:a,customCellAttributes:Ae},O)})]}),D&&(0,te.jsx)(ga,{colSpan:o.filter(({hidden:k})=>!k).length+(r?1:0),open:D.isRowExpanded(e),content:D.content({record:e,index:t}),collapseProps:D.collapseProps})]})}var ce=require("@mantine/core"),Je=A(require("clsx")),Se=require("react/jsx-runtime");function Sa({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:l,headerHeight:r,footerHeight:i,onScrollPositionChange:s,children:d,viewportRef:m,scrollAreaProps:c}){return(0,Se.jsxs)(ce.ScrollArea,{...c,viewportRef:m,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:s,children:[d,(0,Se.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:r?(0,ce.rem)(r):0}}),(0,Se.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,Se.jsx)("div",{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,Se.jsx)(ce.Box,{className:(0,Je.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:i?(0,ce.rem)(i+1):0}})]})}var W=require("react/jsx-runtime");function Pa({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,maxHeight:l,shadow:r,verticalAlign:i="center",fetching:s,columns:d,storeColumnsKey:m="mantine-datatable",groups:c,pinFirstColumn:p,pinLastColumn:u,defaultColumnProps:f,defaultColumnRender:M,idAccessor:y="id",records:b,selectionTrigger:D="checkbox",selectedRecords:T,onSelectedRecordsChange:C,selectionColumnClassName:F,selectionColumnStyle:L,isRecordSelectable:x,selectionCheckboxProps:V,allRecordsSelectionCheckboxProps:I={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:$=(_,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:k,sortIcons:h,onSortStatusChange:v,horizontalSpacing:O,page:G,onPageChange:K,totalRecords:E,recordsPerPage:me,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:ue="Records per page",paginationWithEdges:We,paginationActiveTextColor:Ae,paginationActiveBackgroundColor:j,paginationSize:gt="sm",paginationText:ht=({from:_,to:pe,totalRecords:be})=>`${_} - ${pe} / ${be}`,paginationWrapBreakpoint:Ct="sm",getPaginationControlProps:yt=_=>_==="previous"?{"aria-label":"Previous page"}:_==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:xa,customLoader:va,loaderSize:Ma,loaderType:ka,loaderColor:Ra,loadingText:Ea="...",emptyState:Na,noRecordsText:_t="No records",noRecordsIcon:La,highlightOnHover:Ia,striped:Ha,noHeader:Oa,onRowClick:Wa,onRowDoubleClick:Aa,onRowContextMenu:za,onCellClick:Va,onCellDoubleClick:Fa,onCellContextMenu:_a,onScroll:Bt,onScrollToTop:Gt,onScrollToBottom:Xt,onScrollToLeft:Qt,onScrollToRight:Ut,c:Ba,backgroundColor:Ga,borderColor:Xa,rowBorderColor:Qa,stripedColor:Ua,highlightOnHoverColor:$a,rowColor:Ka,rowBackgroundColor:Ja,rowExpansion:Za,rowClassName:Ya,rowStyle:qa,customRowAttributes:ja,scrollViewportRef:en,scrollAreaProps:tn,tableRef:on,bodyRef:an,m:nn,my:rn,mx:ln,mt:sn,mb:dn,ml:cn,mr:mn,className:un,classNames:ze,style:pn,styles:Ve,...$t}){let{ref:_,width:pe,height:be}=ge(),Fe=(0,B.useMemo)(()=>c?.flatMap(g=>g.columns)??d,[d,c]),Kt=Nt({key:m,columns:Fe}),{ref:bn,height:Dt}=ge(),{ref:fn,width:wt,height:_e}=ge(),{ref:Tn,height:gn}=ge(),{ref:hn,height:Jt}=ge(),{ref:Cn,width:yn}=ge(),Dn=(0,Ze.useMergedRef)(fn,on),wn=(0,Ze.useMergedRef)(_,en),[St,Zt]=(0,B.useState)(!0),[Pt,Yt]=(0,B.useState)(!0),[Be,qt]=(0,B.useState)(!0),[Ye,jt]=(0,B.useState)(!0),Sn=wo({rowExpansion:Za,records:b,idAccessor:y}),xt=(0,B.useCallback)(()=>{let g=_.current?.scrollTop||0,oe=_.current?.scrollLeft||0;if(s||_e<=be)Zt(!0),Yt(!0);else{let X=g===0,Q=_e-g-be<1;Zt(X),Yt(Q),X&&X!==St&&Gt?.(),Q&&Q!==Pt&&Xt?.()}if(s||wt===pe)qt(!0),jt(!0);else{let X=oe===0,Q=wt-oe-pe<1;qt(X),jt(Q),X&&X!==Be&&Qt?.(),Q&&Q!==Ye&&Ut?.()}},[s,Xt,Qt,Ut,Gt,be,_,pe,Pt,Be,Ye,St,_e,wt]);bo(xt,[xt]);let eo=(0,Ze.useDebouncedCallback)(xt,50),Pn=(0,B.useCallback)(g=>{Bt?.(g),eo()},[eo,Bt]),xn=(0,B.useCallback)(g=>{_.current?.scrollTo({top:0,left:0}),K(g)},[K,_]),qe=b?.length,to=b?.map(g=>R(g,y)),Pe=!!T,Ge=T?.map(g=>R(g,y)),oo=to!==void 0&&Ge!==void 0&&Ge.length>0,vt=x?b?.filter(x):b,je=vt?.map(g=>R(g,y)),et=oo&&je.every(g=>Ge.includes(g)),vn=oo&&je.some(g=>Ge.includes(g)),Mn=(0,B.useCallback)(()=>{T&&C&&C(et?T.filter(g=>!je.includes(R(g,y))):Xe([...T,...vt],g=>R(g,y)))},[et,y,C,je,vt,T]),{lastSelectionChangeIndex:tt,setLastSelectionChangeIndex:kn}=fo(to),Mt=Pe&&!Be&&!p;return(0,W.jsx)(Rt,{...Kt,children:(0,W.jsxs)(Tt.Box,{...{m:nn,my:rn,mx:ln,mt:sn,mb:dn,ml:cn,mr:mn},className:(0,Ft.default)("mantine-datatable",{"mantine-datatable-with-border":e},un,ze?.root),style:[g=>({...ra({theme:g,c:Ba,backgroundColor:Ga,borderColor:Xa,rowBorderColor:Qa,stripedColor:Ua,highlightOnHoverColor:$a}),borderRadius:g.radius[t]||t,boxShadow:g.shadows[r]||r,height:n,minHeight:a,maxHeight:l}),pn,Ve?.root],children:[(0,W.jsx)(Sa,{viewportRef:wn,topShadowVisible:!St,leftShadowVisible:!Be,leftShadowBehind:Pe||!!p,rightShadowVisible:!Ye,rightShadowBehind:u,bottomShadowVisible:!Pt,headerHeight:Dt,footerHeight:gn,onScrollPositionChange:Pn,scrollAreaProps:tn,children:(0,W.jsxs)(Tt.Table,{ref:Dn,horizontalSpacing:O,className:(0,Ft.default)("mantine-datatable-table",{[Po]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":$t.withRowBorders&&_e<be,"mantine-datatable-pin-last-column":u,"mantine-datatable-pin-last-column-scrolled":!Ye&&u,"mantine-datatable-selection-column-visible":Pe,"mantine-datatable-pin-first-column":p,"mantine-datatable-pin-first-column-scrolled":!Be&&p},ze?.table),style:{...Ve?.table,"--mantine-datatable-selection-column-width":`${yn}px`},"data-striped":qe&&Ha||void 0,"data-highlight-on-hover":Ia||void 0,...$t,children:[Oa?null:(0,W.jsx)(Rt,{...Kt,children:(0,W.jsx)(ta,{ref:bn,selectionColumnHeaderRef:Cn,className:ze?.header,style:Ve?.header,columns:Fe,defaultColumnProps:f,groups:c,sortStatus:k,sortIcons:h,onSortStatusChange:v,selectionTrigger:D,selectionVisible:Pe,selectionChecked:et,selectionIndeterminate:vn&&!et,onSelectionChange:Mn,selectionCheckboxProps:{...V,...I},selectorCellShadowVisible:Mt,selectionColumnClassName:F,selectionColumnStyle:L})}),(0,W.jsx)("tbody",{ref:an,children:qe?b.map((g,oe)=>{let X=R(g,y),Q=Ge?.includes(X)||!1,ao;return C&&T&&(ao=Rn=>{if(Rn.nativeEvent.shiftKey&&tt!==null){let xe=b.filter(oe>tt?(fe,Te)=>Te>=tt&&Te<=oe&&(x?x(fe,Te):!0):(fe,Te)=>Te>=oe&&Te<=tt&&(x?x(fe,Te):!0));C(Q?It(T,xe,fe=>R(fe,y)):Xe([...T,...xe],fe=>R(fe,y)))}else C(Q?T.filter(xe=>R(xe,y)!==X):Xe([...T,g],xe=>R(xe,y)));kn(oe)}),(0,W.jsx)(wa,{record:g,index:oe,columns:Fe,defaultColumnProps:f,defaultColumnRender:M,selectionTrigger:D,selectionVisible:Pe,selectionChecked:Q,onSelectionChange:ao,isRecordSelectable:x,selectionCheckboxProps:V,getSelectionCheckboxProps:$,onClick:Wa,onDoubleClick:Aa,onCellClick:Va,onCellDoubleClick:Fa,onContextMenu:za,onCellContextMenu:_a,expansion:Sn,color:Ka,backgroundColor:Ja,className:Ya,style:qa,customAttributes:ja,selectorCellShadowVisible:Mt,selectionColumnClassName:F,selectionColumnStyle:L},X)}):(0,W.jsx)(so,{})}),Fe.some(({footer:g})=>g)&&(0,W.jsx)(Ho,{ref:Tn,className:ze?.footer,style:Ve?.footer,columns:Fe,defaultColumnProps:f,selectionVisible:Pe,selectorCellShadowVisible:Mt,scrollDiff:_e-be})]})}),G&&(0,W.jsx)(ua,{ref:hn,className:ze?.pagination,style:Ve?.pagination,horizontalSpacing:O,fetching:s,page:G,onPageChange:xn,totalRecords:E,recordsPerPage:me,onRecordsPerPageChange:q,recordsPerPageOptions:Oe,recordsPerPageLabel:ue,paginationWithEdges:We,paginationActiveTextColor:Ae,paginationActiveBackgroundColor:j,paginationSize:gt,paginationText:ht,paginationWrapBreakpoint:Ct,getPaginationControlProps:yt,noRecordsText:_t,loadingText:Ea,recordsLength:qe}),(0,W.jsx)(aa,{pt:Dt,pb:Jt,fetching:s,backgroundBlur:xa,customContent:va,size:Ma,type:ka,color:Ra}),(0,W.jsx)(mo,{pt:Dt,pb:Jt,icon:La,text:_t,active:!s&&!qe,children:Na})]})})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy,useDataTableColumns});
//# sourceMappingURL=index.js.map
{
"name": "mantine-datatable",
"version": "7.10.3",
"version": "7.10.4",
"description": "The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc