mantine-datatable 7.1.7 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ The lightweight, dependency-free, **dark-theme aware** table component for your
14
14
 
15
15
  [![Mantine DataTable](https://user-images.githubusercontent.com/581999/279479387-525bb797-cb15-4739-85c6-94ceded94bc1.png)](https://icflorescu.github.io/mantine-datatable/)
16
16
 
17
- **⚠️ Mantine DataTable V7.1 is compatible with Mantine V7.1.**
17
+ **⚠️ Mantine DataTable V7 is compatible with Mantine V7.**
18
18
  **💡 If you're looking for the old version that works with [Mantine V6](https://v6.mantine.dev), head over to [Mantine DataTable V6](https://icflorescu.github.io/mantine-datatable-v6).**
19
19
 
20
20
  ## Features
@@ -32,6 +32,7 @@ The lightweight, dependency-free, **dark-theme aware** table component for your
32
32
  - **[Additive batch rows selection](https://icflorescu.github.io/mantine-datatable/examples/records-selection)** - select or deselect ranges of rows using the Shift key
33
33
  - **[Automatically-scrollable](https://icflorescu.github.io/mantine-datatable/examples/scrollable-vs-auto-height)** - automatically scrollable or auto-height
34
34
  - **[AutoAnimate support](https://icflorescu.github.io/mantine-datatable/examples/using-with-auto-animate)** - animate row sorting, addition and removal
35
+ - **[Column reordering, toggling](https://icflorescu.github.io/mantine-datatable/examples/column-dragging-and-toggling)** and **[resizing](https://icflorescu.github.io/mantine-datatable/examples/column-resizing)** - thanks to the outstanding work of [Giovambattista Fazioli](https://github.com/gfazioli)
35
36
  - **More** - check out the [full documentation](https://icflorescu.github.io/mantine-datatable/)
36
37
 
37
38
  ## Trusted by the community
package/dist/index.d.ts CHANGED
@@ -31,13 +31,29 @@ type DataTableColumn<T = Record<string, unknown>> = {
31
31
  * If true, column will be sortable.
32
32
  */
33
33
  sortable?: boolean;
34
+ /**
35
+ * If set to true, the column can be dragged.
36
+ */
37
+ draggable?: boolean;
38
+ /**
39
+ * If set to true, the column can be toggled.
40
+ */
41
+ toggleable?: boolean;
42
+ /**
43
+ * If set to true, the column can be resized.
44
+ */
45
+ resizable?: boolean;
46
+ /**
47
+ * If set to true, the column will be toggled by default.
48
+ */
49
+ defaultToggle?: boolean;
34
50
  /**
35
51
  * Optional node providing the user with filtering options.
36
52
  * If present, a filter button will be added to the column's header. Upon clicking that button,
37
53
  * a pop-over showing the provided node will be opened.
38
54
  *
39
55
  * Alternatively, a function returning a node can be provided. The function receives props with a `close`
40
- * method which allows programatically closing the pop-over.
56
+ * method which allows programmatically closing the pop-over.
41
57
  *
42
58
  * ```tsx
43
59
  * // …
@@ -554,6 +570,8 @@ type DataTableSelectionProps<T = Record<string, unknown>> = {
554
570
  isRecordSelectable?: never;
555
571
  getRecordSelectionCheckboxProps?: never;
556
572
  allRecordsSelectionCheckboxProps?: never;
573
+ selectionColumnClassName?: never;
574
+ selectionColumnStyle?: never;
557
575
  } | {
558
576
  /**
559
577
  * Defines how selection is triggered.
@@ -569,6 +587,14 @@ type DataTableSelectionProps<T = Record<string, unknown>> = {
569
587
  * Receives and array of selected records as argument.
570
588
  */
571
589
  onSelectedRecordsChange?: (selectedRecords: T[]) => void;
590
+ /**
591
+ * Optional class name applied to selection column.
592
+ */
593
+ selectionColumnClassName?: string;
594
+ /**
595
+ * Optional style applied to selection column.
596
+ */
597
+ selectionColumnStyle?: MantineStyleProp;
572
598
  /**
573
599
  * A function used to determine whether a certain record is selectable.
574
600
  * if the function returns false, the row selection checkbox is disabled.
@@ -687,6 +713,11 @@ type DataTableProps<T = Record<string, unknown>> = {
687
713
  * Default column props; will be merged with column props provided to each column
688
714
  */
689
715
  defaultColumnProps?: DataTableDefaultColumnProps<T>;
716
+ /**
717
+ * If you want to use drag and drop as well as toggle to reorder and toggle columns
718
+ * provide a unique key which will be used to store the column order in localStorage.
719
+ */
720
+ storeColumnsKey?: string | undefined;
690
721
  /**
691
722
  * A default render function for all columns.
692
723
  * Accepts the current record, its index in `records` and the column `accessor` as
@@ -721,6 +752,12 @@ type DataTableProps<T = Record<string, unknown>> = {
721
752
  * its index in `columns` and the click event as properties.
722
753
  */
723
754
  onCellClick?: DataTableCellClickHandler<T>;
755
+ /**
756
+ * Function to call when a row cell is double-clicked.
757
+ * Receives an object with the current record, its index in `records`, the current column,
758
+ * its index in `columns` and the click event as properties.
759
+ */
760
+ onCellDoubleClick?: DataTableCellClickHandler<T>;
724
761
  /**
725
762
  * Function to call when the user right-clicks on a row cell.
726
763
  * Receives an object with the current record, its index in `records`, the current column,
@@ -733,6 +770,12 @@ type DataTableProps<T = Record<string, unknown>> = {
733
770
  * as properties.
734
771
  */
735
772
  onRowClick?: DataTableRowClickHandler<T>;
773
+ /**
774
+ * Function to call when a row is double-clicked.
775
+ * Receives an object with the current record, its index in `records` and the click event
776
+ * as properties.
777
+ */
778
+ onRowDoubleClick?: DataTableRowClickHandler<T>;
736
779
  /**
737
780
  * Function to call when the user right-clicks on a row.
738
781
  * Receives an object with the current record, its index in `records` and the click event
@@ -780,7 +823,66 @@ type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
780
823
  [Property in Key]-?: Type[Property];
781
824
  };
782
825
 
783
- declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, groups, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectionTrigger, selectedRecords, onSelectedRecordsChange, isRecordSelectable, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowContextMenu, onCellClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element;
826
+ declare function DataTable<T>({ withTableBorder, borderRadius, textSelectionDisabled, height, minHeight, shadow, verticalAlign, fetching, columns, storeColumnsKey, groups, pinLastColumn, defaultColumnProps, defaultColumnRender, idAccessor, records, selectionTrigger, selectedRecords, onSelectedRecordsChange, selectionColumnClassName, selectionColumnStyle, isRecordSelectable, allRecordsSelectionCheckboxProps, getRecordSelectionCheckboxProps, sortStatus, sortIcons, onSortStatusChange, horizontalSpacing, page, onPageChange, totalRecords, recordsPerPage, onRecordsPerPageChange, recordsPerPageOptions, recordsPerPageLabel, paginationWithEdges, paginationActiveTextColor, paginationActiveBackgroundColor, paginationSize, paginationText, paginationWrapBreakpoint, getPaginationControlProps, loaderBackgroundBlur, customLoader, loaderSize, loaderType, loaderColor, loadingText, emptyState, noRecordsText, noRecordsIcon, highlightOnHover, striped, noHeader, onRowClick, onRowDoubleClick, onRowContextMenu, onCellClick, onCellDoubleClick, onCellContextMenu, onScroll, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, c, backgroundColor, borderColor, rowBorderColor, stripedColor, highlightOnHoverColor, rowColor, rowBackgroundColor, rowExpansion, rowClassName, rowStyle, customRowAttributes, scrollViewportRef: scrollViewportRefProp, scrollAreaProps, bodyRef, m, my, mx, mt, mb, ml, mr, className, classNames, style, styles, ...otherProps }: DataTableProps<T>): react.JSX.Element;
827
+
828
+ type DataTableColumnToggle = {
829
+ accessor: string | undefined;
830
+ defaultToggle: boolean;
831
+ toggleable: boolean;
832
+ toggled: boolean;
833
+ };
834
+ type DataTableColumnWidth = Record<string, string | number>;
835
+ /**
836
+ * Hook to handle column features such as drag-and-drop reordering, visibility toggling and resizing.
837
+ * @see https://icflorescu.github.io/mantine-datatable/examples/column-dragging-and-toggling/
838
+ */
839
+ declare const useDataTableColumns: <T>({ key, columns, }: {
840
+ /**
841
+ * The key to use in localStorage to store the columns order and toggle state.
842
+ */
843
+ key: string | undefined;
844
+ /**
845
+ * Columns definitions.
846
+ */
847
+ columns: DataTableColumn<T>[];
848
+ }) => {
849
+ readonly effectiveColumns: DataTableColumn<T>[];
850
+ readonly setColumnsOrder: (val: string[] | ((prevState: string[]) => string[])) => void;
851
+ readonly columnsOrder: string[];
852
+ readonly resetColumnsOrder: () => void;
853
+ readonly columnsToggle: DataTableColumnToggle[];
854
+ readonly setColumnsToggle: (val: DataTableColumnToggle[] | ((prevState: DataTableColumnToggle[]) => DataTableColumnToggle[])) => void;
855
+ readonly resetColumnsToggle: () => void;
856
+ readonly columnsWidth: DataTableColumnWidth[];
857
+ readonly setColumnsWidth: (val: DataTableColumnWidth[] | ((prevState: DataTableColumnWidth[]) => DataTableColumnWidth[])) => void;
858
+ readonly setColumnWidth: (accessor: string, width: string | number) => void;
859
+ readonly resetColumnsWidth: () => void;
860
+ };
861
+ /**
862
+ * @deprecated This hook is deprecated and will be removed in a future version. Please use the `useDataTableColumns` hook instead.
863
+ */
864
+ declare const useDragToggleColumns: <T>({ key, columns, }: {
865
+ /**
866
+ * The key to use in localStorage to store the columns order and toggle state.
867
+ */
868
+ key: string | undefined;
869
+ /**
870
+ * Columns definitions.
871
+ */
872
+ columns: DataTableColumn<T>[];
873
+ }) => {
874
+ readonly effectiveColumns: DataTableColumn<T>[];
875
+ readonly setColumnsOrder: (val: string[] | ((prevState: string[]) => string[])) => void;
876
+ readonly columnsOrder: string[];
877
+ readonly resetColumnsOrder: () => void;
878
+ readonly columnsToggle: DataTableColumnToggle[];
879
+ readonly setColumnsToggle: (val: DataTableColumnToggle[] | ((prevState: DataTableColumnToggle[]) => DataTableColumnToggle[])) => void;
880
+ readonly resetColumnsToggle: () => void;
881
+ readonly columnsWidth: DataTableColumnWidth[];
882
+ readonly setColumnsWidth: (val: DataTableColumnWidth[] | ((prevState: DataTableColumnWidth[]) => DataTableColumnWidth[])) => void;
883
+ readonly setColumnWidth: (accessor: string, width: string | number) => void;
884
+ readonly resetColumnsWidth: () => void;
885
+ };
784
886
 
785
887
  /**
786
888
  * Utility function that returns a humanized version of a string, e.g. "camelCase" -> "Camel Case"
@@ -803,4 +905,4 @@ declare function getValueAtPath<T>(obj: T, path: keyof T | (string & NonNullable
803
905
  */
804
906
  declare function getRecordId<T>(record: T, idAccessor: keyof T | (string & NonNullable<unknown>) | ((record: T) => React.Key)): unknown;
805
907
 
806
- export { DataTable, DataTableCellClickHandler, DataTableColumn, DataTableColumnGroup, DataTableColumnTextAlign, DataTableDefaultColumnProps, DataTableEmptyStateProps, DataTableOuterBorderProps, DataTablePaginationProps, DataTableProps, DataTableRowClickHandler, DataTableRowExpansionCollapseProps, DataTableRowExpansionProps, DataTableSelectionProps, DataTableSelectionTrigger, DataTableSortProps, DataTableSortStatus, DataTableVerticalAlign, WithOptionalProperty, WithRequiredProperty, differenceBy, getRecordId, getValueAtPath, humanize, uniqBy };
908
+ export { DataTable, type DataTableCellClickHandler, type DataTableColumn, type DataTableColumnGroup, type DataTableColumnTextAlign, type DataTableColumnToggle, type DataTableDefaultColumnProps, type DataTableEmptyStateProps, type DataTableOuterBorderProps, type DataTablePaginationProps, type DataTableProps, type DataTableRowClickHandler, type DataTableRowExpansionCollapseProps, type DataTableRowExpansionProps, type DataTableSelectionProps, type DataTableSelectionTrigger, type DataTableSortProps, type DataTableSortStatus, type DataTableVerticalAlign, type WithOptionalProperty, type WithRequiredProperty, differenceBy, getRecordId, getValueAtPath, humanize, uniqBy, useDataTableColumns, useDragToggleColumns };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var Ko=Object.create;var Be=Object.defineProperty;var Jo=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Yo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var jo=(e,t)=>{for(var a in t)Be(e,a,{get:t[a],enumerable:!0})},Ht=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zo(t))!qo.call(e,o)&&o!==a&&Be(e,o,{get:()=>t[o],enumerable:!(n=Jo(t,o))||n.enumerable});return e};var M=(e,t,a)=>(a=e!=null?Ko(Yo(e)):{},Ht(t||!e||!e.__esModule?Be(a,"default",{value:e,enumerable:!0}):a,e)),en=e=>Ht(Be({},"__esModule",{value:!0}),e);var on={};jo(on,{DataTable:()=>Xa,differenceBy:()=>mt,getRecordId:()=>S,getValueAtPath:()=>Ue,humanize:()=>Re,uniqBy:()=>ve});module.exports=en(on);var je=require("@mantine/core"),Qa=require("@mantine/hooks"),Ct=M(require("clsx")),I=require("react");var ct=require("react/jsx-runtime");function Ft(){return(0,ct.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,ct.jsx)("td",{})})}var Qe=require("@mantine/core");var Q=require("react/jsx-runtime");function Vt(){return(0,Q.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Q.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Q.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,Q.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,Q.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,Q.jsx)("path",{d:"M3 3l18 18"})]})}var z=require("react/jsx-runtime");function At({icon:e,text:t,pt:a,pb:n,active:o,children:l}){return(0,z.jsx)(Qe.Center,{pt:a,pb:n,className:"mantine-datatable-empty-state","data-active":o||void 0,children:l||(0,z.jsxs)(z.Fragment,{children:[e||(0,z.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,z.jsx)(Vt,{})}),(0,z.jsx)(Qe.Text,{size:"sm",c:"dimmed",children:t})]})})}var be=require("@mantine/core"),oa=M(require("clsx")),na=require("react");var Zt=require("@mantine/core"),Yt=M(require("clsx"));var _t=require("@mantine/hooks");function ce(){let[e]=(0,_t.useResizeObserver)(),{width:t,height:a}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:a}}var Xe=require("react"),Ot=typeof window<"u"?Xe.useLayoutEffect:Xe.useEffect;var $e=require("react");function zt(e){let[t,a]=(0,$e.useState)(null),n=e?.join(":")||"";return(0,$e.useEffect)(()=>{a(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:a}}var pe=require("react");function tn(e,t){let a=()=>{t(e.map(o=>o.matches))},n=e.map(o=>{try{return o.addEventListener("change",a),()=>o.removeEventListener("change",a)}catch{return o.addListener(a),()=>o.removeListener(a)}});return()=>{n.forEach(o=>o())}}function an(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(a=>window.matchMedia(a).matches):e.map(()=>!1))}function Wt(e,t,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[n,o]=(0,pe.useState)(a?t:an(e,t)),l=(0,pe.useRef)();return(0,pe.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(i=>window.matchMedia(i)),o(l.current.map(i=>i.matches)),tn(l.current,i=>{o(i)})},[e]),n}var Gt=require("@mantine/core"),pt=require("react");function Bt(e){let t=(0,Gt.useMantineTheme)(),a=(0,pt.useMemo)(()=>e.map(o=>(typeof o=="function"?o(t):o)??""),[e,t]),n=(0,pt.useMemo)(()=>e.map(()=>!0),[e]);return Wt(a,n)}var Qt=require("@mantine/core"),Xt=require("@mantine/hooks");function X(e){let t=(0,Qt.useMantineTheme)(),a=typeof e=="function"?e(t):e;return(0,Xt.useMediaQuery)(a||"",!0)}var $t=require("react");function Re(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 mt(e,t,a){return e.filter(n=>!t.map(a).includes(a(n)))}function ve(e,t){return e.filter((a,n,o)=>n===o.findIndex(l=>t(a)===t(l)))}function Ue(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,o)=>n&&n[o],e):void 0}function S(e,t){return typeof t=="string"?Ue(e,t):t(e)}function Ut({rowExpansion:e,records:t,idAccessor:a}){let n=[];if(e&&t){let{trigger:r,allowMultiple:d,initiallyExpanded:s}=e;t&&r==="always"?n=t.map(p=>S(p,a)):s&&(n=t.filter((p,u)=>s({record:p,index:u})).map(p=>S(p,a)),d||(n=[n[0]]))}let o,l,i=(0,$t.useState)(n);if(e){let{trigger:r,allowMultiple:d,collapseProps:s,content:p}=e;e.expanded?{recordIds:o,onRecordIdsChange:l}=e.expanded:[o,l]=i;let u=f=>l?.(o.filter(c=>c!==S(f,a)));return{expandOnClick:r!=="always"&&r!=="never",isRowExpanded:f=>r==="always"?!0:o.includes(S(f,a)),expandRow:f=>{let c=S(f,a);l?.(d?[...o,c]:[c])},collapseRow:u,collapseProps:s,content:({record:f,index:c})=>()=>p({record:f,index:c,collapse:()=>u(f)})}}}var ut=require("@mantine/hooks"),Ee=require("react");function Kt(e,t){let[a,n]=(0,Ee.useState)(e),[o,l]=(0,Ee.useState)(e),i=(0,ut.useTimeout)(()=>n(!0),0),r=(0,ut.useTimeout)(()=>l(!1),t||200);return(0,Ee.useEffect)(()=>{e?(r.clear(),l(!0),i.start()):(i.clear(),n(!1),r.start())},[i,r,e]),{expanded:a,visible:o}}var me="mantine-datatable-nowrap",ue="mantine-datatable-ellipsis",_="mantine-datatable-pointer-cursor",Jt="mantine-datatable-text-selection-disabled",$="mantine-datatable-text-align-left",U="mantine-datatable-text-align-center",K="mantine-datatable-text-align-right";var jt=require("react/jsx-runtime");function qt({className:e,style:t,visibleMediaQuery:a,title:n,noWrap:o,ellipsis:l,textAlign:i,width:r}){return X(a)?(0,jt.jsx)(Zt.TableTh,{className:(0,Yt.default)({[me]:o||l,[ue]:l,[$]:i==="left",[U]:i==="center",[K]:i==="right"},e),style:[{width:r,minWidth:r,maxWidth:r},t],children:n}):null}var ea=require("@mantine/core"),aa=require("react/jsx-runtime");function ta({shadowVisible:e}){return(0,aa.jsx)(ea.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var fe=require("react/jsx-runtime"),ra=(0,na.forwardRef)(function({className:t,style:a,columns:n,defaultColumnProps:o,selectionVisible:l,selectorCellShadowVisible:i,scrollDiff:r},d){let s=r<0;return(0,fe.jsx)(be.TableTfoot,{ref:d,className:(0,oa.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,be.rem)(s?r:0)},a],children:(0,fe.jsxs)(be.TableTr,{children:[l&&(0,fe.jsx)(ta,{shadowVisible:i}),n.map(({hidden:p,...u})=>{if(p)return null;let{accessor:f,visibleMediaQuery:c,textAlign:T,width:y,footer:b,footerClassName:w,footerStyle:g,noWrap:L,ellipsis:k}={...o,...u};return(0,fe.jsx)(qt,{className:w,style:g,visibleMediaQuery:c,textAlign:T,width:y,title:b,noWrap:L,ellipsis:k},f)})]})})});var Le=require("@mantine/core"),Ca=M(require("clsx")),ya=require("react");var la=require("@mantine/core"),ia=M(require("clsx")),ft=require("react");var da=require("react/jsx-runtime");function sa({group:{id:e,columns:t,title:a,textAlign:n,className:o,style:l}}){let i=(0,ft.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),r=Bt(i),d=(0,ft.useMemo)(()=>t.filter(({hidden:s},p)=>!s&&r?.[p]).length,[t,r]);return d>0?(0,da.jsx)(la.TableTh,{colSpan:d,className:(0,ia.default)("mantine-datatable-column-group-header-cell",{[$]:n==="left",[U]:n==="center",[K]:n==="right"},o),style:l,children:a??Re(e)}):null}var W=require("@mantine/core"),Ke=M(require("clsx"));var ne=require("@mantine/core"),ma=require("@mantine/hooks");var Ne=require("react/jsx-runtime");function ca(){return(0,Ne.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ne.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ne.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 Ie=require("react/jsx-runtime");function pa(){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:"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 oe=require("react/jsx-runtime");function ua({children:e,isActive:t}){let[a,{close:n,toggle:o}]=(0,ma.useDisclosure)(!1);return(0,oe.jsxs)(ne.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:a,onClose:n,trapFocus:!0,children:[(0,oe.jsx)(ne.PopoverTarget,{children:(0,oe.jsx)(ne.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:i=>{i.preventDefault(),o()},children:(0,oe.jsx)(t?pa:ca,{})})}),(0,oe.jsx)(ne.Popover.Dropdown,{onClick:i=>i.preventDefault(),children:typeof e=="function"?e({close:n}):e})]})}var re=require("react/jsx-runtime");function fa(){return(0,re.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,re.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,re.jsx)("path",{d:"M12 5l0 14"}),(0,re.jsx)("path",{d:"M16 9l-4 -4"}),(0,re.jsx)("path",{d:"M8 9l4 -4"})]})}var le=require("react/jsx-runtime");function ba(){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:"M8 7l4 -4l4 4"}),(0,le.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,le.jsx)("path",{d:"M12 3l0 18"})]})}var v=require("react/jsx-runtime");function Ta({className:e,style:t,accessor:a,visibleMediaQuery:n,title:o,sortable:l,sortIcons:i,textAlign:r,width:d,sortStatus:s,onSortStatusChange:p,filter:u,filtering:f}){if(!X(n))return null;let c=o??Re(a),T=typeof c=="string"?c:void 0,y=l&&p?b=>{b?.defaultPrevented||p({columnAccessor:a,direction:s?.columnAccessor===a?s.direction==="asc"?"desc":"asc":s?.direction??"asc"})}:void 0;return(0,v.jsx)(W.TableTh,{className:(0,Ke.default)({"mantine-datatable-header-cell-sortable":l},e),style:[{width:d,minWidth:d,maxWidth:d},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:y,onKeyDown:b=>b.key==="Enter"&&y?.(),children:(0,v.jsxs)(W.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,v.jsx)(W.Box,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-text",{[$]:r==="left",[U]:r==="center",[K]:r==="right"},me,ue),title:T,children:c}),l||s?.columnAccessor===a?(0,v.jsx)(v.Fragment,{children:s?.columnAccessor===a?(0,v.jsx)(W.Center,{className:(0,Ke.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":s.direction==="desc"}),role:"img","aria-label":`Sorted ${s.direction==="desc"?"descending":"ascending"}`,children:i?.sorted||(0,v.jsx)(fa,{})}):(0,v.jsx)(W.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:i?.unsorted||(0,v.jsx)(ba,{})})}):null,u?(0,v.jsx)(ua,{isActive:!!f,children:u}):null]})})}var Je=require("@mantine/core"),ha=M(require("clsx"));var bt=require("react/jsx-runtime");function ga({trigger:e,shadowVisible:t,checked:a,indeterminate:n,checkboxProps:o,onChange:l,rowSpan:i}){let r=!o.disabled;return(0,bt.jsx)(Je.TableTh,{className:(0,ha.default)("mantine-datatable-header-selector-cell",{[_]:e==="cell"&&r}),rowSpan:i,"data-shadow-visible":t||void 0,onClick:e==="cell"&&r?l:void 0,children:(0,bt.jsx)(Je.Checkbox,{classNames:r?{input:_}:void 0,checked:a,indeterminate:n,onChange:l,...o,disabled:!(l||o.onChange)||o.disabled})})}var J=require("react/jsx-runtime"),Sa=(0,ya.forwardRef)(function({className:t,style:a,sortStatus:n,sortIcons:o,onSortStatusChange:l,columns:i,defaultColumnProps:r,groups:d,selectionTrigger:s,selectionVisible:p,selectionChecked:u,selectionIndeterminate:f,onSelectionChange:c,selectionCheckboxProps:T,selectorCellShadowVisible:y},b){let w=p?(0,J.jsx)(ga,{trigger:s,shadowVisible:y,checked:u,indeterminate:f,checkboxProps:T,onChange:c,rowSpan:d?2:void 0}):null;return(0,J.jsxs)(Le.TableThead,{className:(0,Ca.default)("mantine-datatable-header",t),style:a,ref:b,children:[d&&(0,J.jsxs)(Le.TableTr,{children:[w,d.map(g=>(0,J.jsx)(sa,{group:g},g.id))]}),(0,J.jsxs)(Le.TableTr,{children:[!d&&w,i.map(({hidden:g,...L})=>{if(g)return null;let{accessor:k,visibleMediaQuery:q,textAlign:D,width:P,title:R,sortable:x,titleClassName:A,titleStyle:ge,filter:Ce,filtering:ye}={...r,...L};return(0,J.jsx)(Ta,{accessor:k,className:A,style:ge,visibleMediaQuery:q,textAlign:D,width:P,title:R,sortable:x,sortStatus:n,sortIcons:o,onSortStatusChange:l,filter:Ce,filtering:ye},k)})]})]})});var Ze=require("@mantine/core"),wa=M(require("clsx")),Tt=require("react/jsx-runtime");function Pa({pt:e,pb:t,fetching:a,customContent:n,backgroundBlur:o,size:l,type:i,color:r}){return(0,Tt.jsx)(Ze.Center,{pt:e,pb:t,className:(0,wa.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":a}),style:[{backdropFilter:o?`blur(${o}px)`:void 0}],children:a&&(n||(0,Tt.jsx)(Ze.Loader,{size:l,type:i,color:r}))})}var Z=require("@mantine/core"),ht=M(require("clsx")),Na=require("react");var h=require("@mantine/core"),va=M(require("clsx"));var xa=require("@mantine/core");function C(e,t,a){return e?(0,xa.parseThemeColor)({color:typeof e=="object"?e[a]:e,theme:t}).value:void 0}function Da({theme:e,c:t,backgroundColor:a,borderColor:n,rowBorderColor:o,stripedColor:l,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":C(t,e,"light"),"--mantine-datatable-color-dark":C(t,e,"dark"),"--mantine-datatable-background-color-light":C(a,e,"light"),"--mantine-datatable-background-color-dark":C(a,e,"dark"),"--mantine-datatable-border-color-light":C(n,e,"light"),"--mantine-datatable-border-color-dark":C(n,e,"dark"),"--mantine-datatable-row-border-color-light":C(o,e,"light"),"--mantine-datatable-row-border-color-dark":C(o,e,"dark"),"--mantine-datatable-striped-color-light":C(l,e,"light"),"--mantine-datatable-striped-color-dark":C(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":C(i,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":C(i,e,"dark")}}function Ye({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:a}){return{"--mantine-datatable-pagination-active-text-color-light":C(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":C(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":C(a,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":C(a,e,"dark")}}function Ma({theme:e,color:t,backgroundColor:a}){return{"--mantine-datatable-row-color-light":C(t,e,"light"),"--mantine-datatable-row-color-dark":C(t,e,"dark"),"--mantine-datatable-row-background-color-light":C(a,e,"light"),"--mantine-datatable-row-background-color-dark":C(a,e,"dark")}}var Te=require("react/jsx-runtime");function ka(){return(0,Te.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Te.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Te.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Te.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var V=require("react/jsx-runtime"),Ra={xs:(0,h.rem)(22),sm:(0,h.rem)(26),md:(0,h.rem)(32),lg:(0,h.rem)(38),xl:(0,h.rem)(44)};function Ea({size:e,label:t,values:a,value:n,activeTextColor:o,activeBackgroundColor:l,onChange:i}){return(0,V.jsxs)(h.Group,{gap:"xs",children:[(0,V.jsx)(h.Text,{size:e,children:t}),(0,V.jsxs)(h.Menu,{withinPortal:!0,withArrow:!0,children:[(0,V.jsx)(h.MenuTarget,{children:(0,V.jsx)(h.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,V.jsx)(ka,{}),style:[{fontWeight:"normal"},r=>({height:Ra[e],paddingLeft:r.spacing[e],paddingRight:r.spacing[e]})],children:n})}),(0,V.jsx)(h.MenuDropdown,{children:a.map(r=>{let d=r===n;return(0,V.jsx)(h.MenuItem,{className:(0,va.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:Ra[e]},d&&(o||l)?s=>Ye({theme:s,paginationActiveTextColor:o,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>i(r),children:(0,V.jsx)(h.Text,{size:e,children:r})},r)})})]})]})}var he=require("react/jsx-runtime"),Ia=(0,Na.forwardRef)(function({className:t,style:a,fetching:n,page:o,onPageChange:l,paginationWithEdges:i,paginationActiveTextColor:r,paginationActiveBackgroundColor:d,paginationSize:s,loadingText:p,noRecordsText:u,paginationText:f,totalRecords:c,recordsPerPage:T,onRecordsPerPageChange:y,recordsPerPageLabel:b,recordsPerPageOptions:w,recordsLength:g,horizontalSpacing:L,paginationWrapBreakpoint:k,getPaginationControlProps:q},D){let P;if(n)P=p;else if(!c)P=u;else{let x=(o-1)*T+1,A=x+g-1;P=f({from:x,to:A,totalRecords:c})}let R=X(({breakpoints:x})=>`(min-width: ${typeof k=="number"?`${(0,Z.rem)(k)}rem`:x[k]||k})`);return(0,he.jsxs)(Z.Box,{ref:D,px:L??"xs",py:"xs",className:(0,ht.default)("mantine-datatable-pagination",t),style:[{flexDirection:R?"row":"column"},a],children:[(0,he.jsx)(Z.Text,{className:"mantine-datatable-pagination-text",size:s,children:P}),w&&(0,he.jsx)(Ea,{activeTextColor:r,activeBackgroundColor:d,size:s,label:b,values:w,value:T,onChange:y}),(0,he.jsx)(Z.Pagination,{classNames:{root:(0,ht.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!g}),control:"mantine-datatable-pagination-pages-control"},style:r||d?x=>Ye({theme:x,paginationActiveTextColor:r,paginationActiveBackgroundColor:d}):void 0,withEdges:i,value:o,onChange:l,size:s,total:Math.ceil(c/T),getControlProps:q})]})});var za=require("@mantine/core"),Wa=M(require("clsx"));var La=require("@mantine/core"),Ha=M(require("clsx"));var Va=require("react/jsx-runtime");function Fa({className:e,style:t,visibleMediaQuery:a,record:n,index:o,onClick:l,onContextMenu:i,noWrap:r,ellipsis:d,textAlign:s,width:p,accessor:u,render:f,defaultRender:c,customCellAttributes:T}){return X(a)?(0,Va.jsx)(La.TableTd,{className:(0,Ha.default)({[me]:r||d,[ue]:d,[_]:l,[$]:s==="left",[U]:s==="center",[K]:s==="right"},e),style:[{width:p,minWidth:p,maxWidth:p},t],onClick:l,onContextMenu:i,...T?.(n,o),children:f?f(n,o):c?c(n,o,u):Ue(n,u)}):null}var ie=require("@mantine/core");var O=require("react/jsx-runtime");function Aa({open:e,colSpan:t,content:a,collapseProps:n}){let{expanded:o,visible:l}=Kt(e,n?.transitionDuration);return l?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(ie.TableTr,{}),(0,O.jsx)(ie.TableTr,{children:(0,O.jsx)(ie.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,O.jsx)(ie.Collapse,{in:o,...n,children:(0,O.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:a()})})})})]}):null}var qe=require("@mantine/core"),_a=M(require("clsx"));var gt=require("react/jsx-runtime");function Oa({record:e,index:t,trigger:a,onChange:n,withRightShadow:o,getCheckboxProps:l,...i}){let r=l(e,t),d=!i.disabled&&!r.disabled,s=p=>{p.stopPropagation(),a==="cell"&&d&&n?.(p)};return(0,gt.jsx)(qe.TableTd,{className:(0,_a.default)("mantine-datatable-row-selector-cell",{[_]:a==="cell"&&d}),"data-shadow-visible":o||void 0,onClick:s,children:(0,gt.jsx)(qe.Checkbox,{classNames:d?{input:_}:void 0,onChange:n,...i,...r})})}var G=require("react/jsx-runtime");function Ga({record:e,index:t,columns:a,defaultColumnProps:n,defaultColumnRender:o,selectionTrigger:l,selectionVisible:i,selectionChecked:r,onSelectionChange:d,isRecordSelectable:s,getSelectionCheckboxProps:p,onClick:u,onContextMenu:f,onCellClick:c,onCellContextMenu:T,expansion:y,customAttributes:b,color:w,backgroundColor:g,className:L,style:k,selectorCellShadowVisible:q}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(za.TableTr,{className:(0,Wa.default)("mantine-datatable-row",{[_]:u||y?.expandOnClick},typeof L=="function"?L(e,t):L),"data-selected":r||void 0,onClick:D=>{if(y){let{isRowExpanded:P,expandOnClick:R,expandRow:x,collapseRow:A}=y;R&&(P(e)?A(e):x(e))}u?.({event:D,record:e,index:t})},onContextMenu:f?D=>f({event:D,record:e,index:t}):void 0,style:[w||g?D=>{let P=w?.(e,t),R=g?.(e,t);return Ma({theme:D,color:P,backgroundColor:R})}:void 0,k?.(e,t)],...b?.(e,t),children:[i&&(0,G.jsx)(Oa,{record:e,index:t,trigger:l,withRightShadow:q,checked:r,disabled:!d||(s?!s(e,t):!1),onChange:d,getCheckboxProps:p}),a.map(({hidden:D,...P},R)=>{if(D)return null;let{accessor:x,visibleMediaQuery:A,textAlign:ge,noWrap:Ce,ellipsis:ye,width:et,render:tt,cellsClassName:Se,cellsStyle:at,customCellAttributes:ot}={...n,...P};return(0,G.jsx)(Fa,{className:typeof Se=="function"?Se(e,t):Se,style:at?.(e,t),visibleMediaQuery:A,record:e,index:t,onClick:c?we=>c({event:we,record:e,index:t,column:P,columnIndex:R}):void 0,onContextMenu:T?we=>T({event:we,record:e,index:t,column:P,columnIndex:R}):void 0,accessor:x,textAlign:ge,noWrap:Ce,ellipsis:ye,width:et,render:tt,defaultRender:o,customCellAttributes:ot},x)})]}),y&&(0,G.jsx)(Aa,{colSpan:a.filter(({hidden:D})=>!D).length+(i?1:0),open:y.isRowExpanded(e),content:y.content({record:e,index:t}),collapseProps:y.collapseProps})]})}var Y=require("@mantine/core"),He=M(require("clsx")),se=require("react/jsx-runtime");function Ba({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:a,rightShadowVisible:n,rightShadowBehind:o,bottomShadowVisible:l,headerHeight:i,footerHeight:r,onScrollPositionChange:d,children:s,viewportRef:p,scrollAreaProps:u}){return(0,se.jsxs)(Y.ScrollArea,{...u,viewportRef:p,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:[s,(0,se.jsx)(Y.Box,{className:(0,He.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:i?(0,Y.rem)(i):0}}),(0,se.jsx)("div",{className:(0,He.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":a})}),(0,se.jsx)("div",{className:(0,He.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":o})}),(0,se.jsx)(Y.Box,{className:(0,He.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:r?(0,Y.rem)(r+1):0}})]})}var E=require("react/jsx-runtime");function Xa({withTableBorder:e,borderRadius:t,textSelectionDisabled:a,height:n="100%",minHeight:o,shadow:l,verticalAlign:i="center",fetching:r,columns:d,groups:s,pinLastColumn:p,defaultColumnProps:u,defaultColumnRender:f,idAccessor:c="id",records:T,selectionTrigger:y="checkbox",selectedRecords:b,onSelectedRecordsChange:w,isRecordSelectable:g,allRecordsSelectionCheckboxProps:L={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:k=(N,j)=>({"aria-label":`Select record ${j+1}`}),sortStatus:q,sortIcons:D,onSortStatusChange:P,horizontalSpacing:R,page:x,onPageChange:A,totalRecords:ge,recordsPerPage:Ce,onRecordsPerPageChange:ye,recordsPerPageOptions:et,recordsPerPageLabel:tt="Records per page",paginationWithEdges:Se,paginationActiveTextColor:at,paginationActiveBackgroundColor:ot,paginationSize:we="sm",paginationText:$a=({from:N,to:j,totalRecords:ee})=>`${N} - ${j} / ${ee}`,paginationWrapBreakpoint:Ua="sm",getPaginationControlProps:Ka=N=>N==="previous"?{"aria-label":"Previous page"}:N==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Ja,customLoader:Za,loaderSize:Ya,loaderType:qa,loaderColor:ja,loadingText:eo="...",emptyState:to,noRecordsText:yt="No records",noRecordsIcon:ao,highlightOnHover:oo,striped:no,noHeader:ro,onRowClick:lo,onRowContextMenu:io,onCellClick:so,onCellContextMenu:co,onScroll:St,onScrollToTop:wt,onScrollToBottom:Pt,onScrollToLeft:xt,onScrollToRight:Dt,c:po,backgroundColor:mo,borderColor:uo,rowBorderColor:fo,stripedColor:bo,highlightOnHoverColor:To,rowColor:ho,rowBackgroundColor:go,rowExpansion:Co,rowClassName:yo,rowStyle:So,customRowAttributes:wo,scrollViewportRef:Po,scrollAreaProps:xo,bodyRef:Do,m:Mo,my:ko,mx:Ro,mt:vo,mb:Eo,ml:No,mr:Io,className:Lo,classNames:Pe,style:Ho,styles:xe,...Fo}){let{ref:N,width:j,height:ee}=ce(),Fe=(0,I.useMemo)(()=>s?.flatMap(m=>m.columns)??d,[d,s]),{ref:Vo,height:nt}=ce(),{ref:Ao,width:rt,height:De}=ce(),{ref:_o,height:Oo}=ce(),{ref:zo,height:Mt}=ce(),[lt,kt]=(0,I.useState)(!0),[it,Rt]=(0,I.useState)(!0),[Ve,vt]=(0,I.useState)(!0),[Ae,Et]=(0,I.useState)(!0),Wo=Ut({rowExpansion:Co,records:T,idAccessor:c}),_e=(0,I.useCallback)(()=>{let m=N.current?.scrollTop||0,B=N.current?.scrollLeft||0;if(r||De<=ee)kt(!0),Rt(!0);else{let H=m===0,F=De-m-ee<1;kt(H),Rt(F),H&&H!==lt&&wt?.(),F&&F!==it&&Pt?.()}if(r||rt===j)vt(!0),Et(!0);else{let H=B===0,F=rt-B-j<1;vt(H),Et(F),H&&H!==Ve&&xt?.(),F&&F!==Ae&&Dt?.()}},[r,Pt,xt,Dt,wt,ee,N,j,it,Ve,Ae,lt,De,rt]);Ot(_e,[_e]);let Go=(0,I.useCallback)(m=>{St?.(m),_e()},[_e,St]),Bo=(0,I.useCallback)(m=>{N.current?.scrollTo({top:0,left:0}),A(m)},[A,N]),Oe=T?.length,Nt=T?.map(m=>S(m,c)),Me=!!b,ke=b?.map(m=>S(m,c)),It=Nt!==void 0&&ke!==void 0&&ke.length>0,st=g?T?.filter(g):T,ze=st?.map(m=>S(m,c)),We=It&&ze.every(m=>ke.includes(m)),Qo=It&&ze.some(m=>ke.includes(m)),Xo=(0,I.useCallback)(()=>{b&&w&&w(We?b.filter(m=>!ze.includes(S(m,c))):ve([...b,...st],m=>S(m,c)))},[We,c,w,ze,st,b]),{lastSelectionChangeIndex:Ge,setLastSelectionChangeIndex:$o}=zt(Nt),dt=Me&&!Ve;return(0,E.jsxs)(je.Box,{...{m:Mo,my:ko,mx:Ro,mt:vo,mb:Eo,ml:No,mr:Io},className:(0,Ct.default)("mantine-datatable",{"mantine-datatable-with-border":e},Lo,Pe?.root),style:[m=>({...Da({theme:m,c:po,backgroundColor:mo,borderColor:uo,rowBorderColor:fo,stripedColor:bo,highlightOnHoverColor:To}),borderRadius:m.radius[t]||t,boxShadow:m.shadows[l]||l,height:n,minHeight:o}),Ho,xe?.root],children:[(0,E.jsx)(Ba,{viewportRef:(0,Qa.useMergedRef)(N,Po),topShadowVisible:!lt,leftShadowVisible:!Ve,leftShadowBehind:Me,rightShadowVisible:!Ae,rightShadowBehind:p,bottomShadowVisible:!it,headerHeight:nt,footerHeight:Oo,onScrollPositionChange:Go,scrollAreaProps:xo,children:(0,E.jsxs)(je.Table,{ref:Ao,horizontalSpacing:R,className:(0,Ct.default)("mantine-datatable-table",{[Jt]:a,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":De<ee,"mantine-datatable-pin-last-column":p,"mantine-datatable-pin-last-column-scrolled":!Ae&&p},Pe?.table),style:xe?.table,"data-striped":Oe&&no||void 0,"data-highlight-on-hover":oo||void 0,...Fo,children:[ro?null:(0,E.jsx)(Sa,{ref:Vo,className:Pe?.header,style:xe?.header,columns:Fe,defaultColumnProps:u,groups:s,sortStatus:q,sortIcons:D,onSortStatusChange:P,selectionTrigger:y,selectionVisible:Me,selectionChecked:We,selectionIndeterminate:Qo&&!We,onSelectionChange:Xo,selectionCheckboxProps:L,selectorCellShadowVisible:dt}),(0,E.jsx)("tbody",{ref:Do,children:Oe?T.map((m,B)=>{let H=S(m,c),F=ke?.includes(H)||!1,Lt;return w&&b&&(Lt=Uo=>{if(Uo.nativeEvent.shiftKey&&Ge!==null){let de=T.filter(B>Ge?(te,ae)=>ae>=Ge&&ae<=B&&(g?g(te,ae):!0):(te,ae)=>ae>=B&&ae<=Ge&&(g?g(te,ae):!0));w(F?mt(b,de,te=>S(te,c)):ve([...b,...de],te=>S(te,c)))}else w(F?b.filter(de=>S(de,c)!==H):ve([...b,m],de=>S(de,c)));$o(B)}),(0,E.jsx)(Ga,{record:m,index:B,columns:Fe,defaultColumnProps:u,defaultColumnRender:f,selectionTrigger:y,selectionVisible:Me,selectionChecked:F,onSelectionChange:Lt,isRecordSelectable:g,getSelectionCheckboxProps:k,onClick:lo,onCellClick:so,onContextMenu:io,onCellContextMenu:co,expansion:Wo,color:ho,backgroundColor:go,className:yo,style:So,customAttributes:wo,selectorCellShadowVisible:dt},H)}):(0,E.jsx)(Ft,{})}),Fe.some(({footer:m})=>m)&&(0,E.jsx)(ra,{ref:_o,className:Pe?.footer,style:xe?.footer,columns:Fe,defaultColumnProps:u,selectionVisible:Me,selectorCellShadowVisible:dt,scrollDiff:De-ee})]})}),x&&(0,E.jsx)(Ia,{ref:zo,className:Pe?.pagination,style:xe?.pagination,horizontalSpacing:R,fetching:r,page:x,onPageChange:Bo,totalRecords:ge,recordsPerPage:Ce,onRecordsPerPageChange:ye,recordsPerPageOptions:et,recordsPerPageLabel:tt,paginationWithEdges:Se,paginationActiveTextColor:at,paginationActiveBackgroundColor:ot,paginationSize:we,paginationText:$a,paginationWrapBreakpoint:Ua,getPaginationControlProps:Ka,noRecordsText:yt,loadingText:eo,recordsLength:Oe}),(0,E.jsx)(Pa,{pt:nt,pb:Mt,fetching:r,backgroundBlur:Ja,customContent:Za,size:Ya,type:qa,color:ja}),(0,E.jsx)(At,{pt:nt,pb:Mt,icon:ao,text:yt,active:!r&&!Oe,children:to})]})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy});
1
+ "use strict";"use client";var yn=Object.create;var et=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Sn=Object.getOwnPropertyNames;var wn=Object.getPrototypeOf,Pn=Object.prototype.hasOwnProperty;var vn=(e,t)=>{for(var o in t)et(e,o,{get:t[o],enumerable:!0})},Jt=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Sn(t))!Pn.call(e,a)&&a!==o&&et(e,a,{get:()=>t[a],enumerable:!(n=Dn(t,a))||n.enumerable});return e};var O=(e,t,o)=>(o=e!=null?yn(wn(e)):{},Jt(t||!e||!e.__esModule?et(o,"default",{value:e,enumerable:!0}):o,e)),xn=e=>Jt(et({},"__esModule",{value:!0}),e);var En={};vn(En,{DataTable:()=>Ta,differenceBy:()=>xt,getRecordId:()=>k,getValueAtPath:()=>it,humanize:()=>Ve,uniqBy:()=>ze,useDataTableColumns:()=>nt,useDragToggleColumns:()=>Mn});module.exports=xn(En);var ft=require("@mantine/core"),ba=require("@mantine/hooks"),Lt=O(require("clsx")),V=require("react");var St=require("react");var Zt=require("@mantine/core"),[Yt,tt]=(0,Zt.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var qt=require("react/jsx-runtime"),wt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:l,resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:s}=e,[u,m]=(0,St.useState)(""),[c,T]=(0,St.useState)("");return(0,qt.jsx)(Yt,{value:{sourceColumn:u,setSourceColumn:m,targetColumn:c,setTargetColumn:T,columnsToggle:a,setColumnsToggle:l,swapColumns:()=>{if(!o||!n||!u||!c)return;let S=o.indexOf(u),g=o.indexOf(c);if(S!==-1&&g!==-1){let p=o.splice(S,1)[0];o.splice(g,0,p),n([...o])}},resetColumnsOrder:r,resetColumnsToggle:i,setColumnWidth:d,resetColumnsWidth:s},children:t})};var Pt=require("react/jsx-runtime");function jt(){return(0,Pt.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Pt.jsx)("td",{})})}var ot=require("@mantine/core");var j=require("react/jsx-runtime");function eo(){return(0,j.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,j.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,j.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,j.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,j.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,j.jsx)("path",{d:"M3 3l18 18"})]})}var Z=require("react/jsx-runtime");function to({icon:e,text:t,pt:o,pb:n,active:a,children:l}){return(0,Z.jsx)(ot.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:l||(0,Z.jsxs)(Z.Fragment,{children:[e||(0,Z.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,Z.jsx)(eo,{})}),(0,Z.jsx)(ot.Text,{size:"sm",c:"dimmed",children:t})]})})}var ke=require("@mantine/core"),wo=O(require("clsx")),Po=require("react");var To=require("@mantine/core"),go=O(require("clsx"));var at=require("@mantine/hooks"),oo=require("react"),nt=({key:e,columns:t=[]})=>{let o=t&&t.map(g=>g.accessor)||[],n=t&&t.map(g=>({[g.accessor]:g.width??"auto"}))||[],a=t&&t.map(g=>({accessor:g.accessor,defaultToggle:g.defaultToggle||!0,toggleable:g.toggleable,toggled:g.defaultToggle||!0})),[l,r]=(0,at.useLocalStorage)({key:`${e}-columns-order`,defaultValue:o,getInitialValueInEffect:!0}),[i,d]=(0,at.useLocalStorage)({key:`${e}-columns-toggle`,defaultValue:a,getInitialValueInEffect:!0}),[s,u]=(0,at.useLocalStorage)({key:`${e}-columns-width`,defaultValue:n,getInitialValueInEffect:!0}),m=()=>r(o),c=()=>d(a),T=()=>u(n);return{effectiveColumns:(0,oo.useMemo)(()=>l?l.map(h=>t.find(w=>w.accessor===h)).filter(h=>i.find(w=>w.accessor===h?.accessor)?.toggled).map(h=>({...h,width:s.find(w=>w[h?.accessor])?.[h?.accessor]})):t,[t,l,i,s]),setColumnsOrder:r,columnsOrder:l,resetColumnsOrder:m,columnsToggle:i,setColumnsToggle:d,resetColumnsToggle:c,columnsWidth:s,setColumnsWidth:u,setColumnWidth:(g,p)=>{let h=s.map(w=>w[g]?{[g]:p}:w);u(h)},resetColumnsWidth:T}},Mn=nt;var ao=require("@mantine/hooks");function we(){let[e]=(0,ao.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var rt=require("react"),no=typeof window<"u"?rt.useLayoutEffect:rt.useEffect;var lt=require("react");function ro(e){let[t,o]=(0,lt.useState)(null),n=e?.join(":")||"";return(0,lt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var Pe=require("react");function kn(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 Rn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function lo(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,Pe.useState)(o?t:Rn(e,t)),l=(0,Pe.useRef)();return(0,Pe.useEffect)(()=>{if("matchMedia"in window)return l.current=e.map(r=>window.matchMedia(r)),a(l.current.map(r=>r.matches)),kn(l.current,r=>{a(r)})},[e]),n}var io=require("@mantine/core"),vt=require("react");function so(e){let t=(0,io.useMantineTheme)(),o=(0,vt.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,vt.useMemo)(()=>e.map(()=>!0),[e]);return lo(o,n)}var co=require("@mantine/core"),uo=require("@mantine/hooks");function ee(e){let t=(0,co.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,uo.useMediaQuery)(o||"",!0)}var mo=require("react");function Ve(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 xt(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function ze(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 k(e,t){return typeof t=="string"?it(e,t):t(e)}function po({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:d,initiallyExpanded:s}=e;t&&i==="always"?n=t.map(u=>k(u,o)):s&&(n=t.filter((u,m)=>s({record:u,index:m})).map(u=>k(u,o)),d||(n=[n[0]]))}let a,l,r=(0,mo.useState)(n);if(e){let{trigger:i,allowMultiple:d,collapseProps:s,content:u}=e;e.expanded?{recordIds:a,onRecordIdsChange:l}=e.expanded:[a,l]=r;let m=c=>l?.(a.filter(T=>T!==k(c,o)));return{expandOnClick:i!=="always"&&i!=="never",isRowExpanded:c=>i==="always"?!0:a.includes(k(c,o)),expandRow:c=>{let T=k(c,o);l?.(d?[...a,T]:[T])},collapseRow:m,collapseProps:s,content:({record:c,index:T})=>()=>u({record:c,index:T,collapse:()=>m(c)})}}}var Mt=require("@mantine/hooks"),Fe=require("react");function fo(e,t){let[o,n]=(0,Fe.useState)(e),[a,l]=(0,Fe.useState)(e),r=(0,Mt.useTimeout)(()=>n(!0),0),i=(0,Mt.useTimeout)(()=>l(!1),t||200);return(0,Fe.useEffect)(()=>{e?(i.clear(),l(!0),r.start()):(r.clear(),n(!1),i.start())},[r,i,e]),{expanded:o,visible:a}}var ve="mantine-datatable-nowrap",xe="mantine-datatable-ellipsis",X="mantine-datatable-pointer-cursor",st="mantine-datatable-context-menu-cursor",bo="mantine-datatable-text-selection-disabled",te="mantine-datatable-text-align-left",oe="mantine-datatable-text-align-center",ae="mantine-datatable-text-align-right";var Co=require("react/jsx-runtime");function ho({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:l,textAlign:r,width:i}){return ee(o)?(0,Co.jsx)(To.TableTh,{className:(0,go.default)({[ve]:a||l,[xe]:l,[te]:r==="left",[oe]:r==="center",[ae]:r==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}var yo=require("@mantine/core"),So=require("react/jsx-runtime");function Do({shadowVisible:e}){return(0,So.jsx)(yo.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Me=require("react/jsx-runtime"),vo=(0,Po.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:l,selectorCellShadowVisible:r,scrollDiff:i},d){let s=i<0;return(0,Me.jsx)(ke.TableTfoot,{ref:d,className:(0,wo.default)("mantine-datatable-footer",t),style:[{position:s?"relative":"sticky",bottom:(0,ke.rem)(s?i:0)},o],children:(0,Me.jsxs)(ke.TableTr,{children:[l&&(0,Me.jsx)(Do,{shadowVisible:r}),n.map(({hidden:u,...m})=>{if(u)return null;let{accessor:c,visibleMediaQuery:T,textAlign:f,width:S,footer:g,footerClassName:p,footerStyle:h,noWrap:w,ellipsis:x}={...a,...m};return(0,Me.jsx)(ho,{className:p,style:h,visibleMediaQuery:T,textAlign:f,width:S,title:g,noWrap:w,ellipsis:x},c)})]})})});var Qe=require("@mantine/core"),Xo=O(require("clsx")),Qo=require("react");var xo=require("@mantine/core"),Mo=O(require("clsx")),kt=require("react");var Ro=require("react/jsx-runtime");function ko({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:l}}){let r=(0,kt.useMemo)(()=>t.map(({visibleMediaQuery:s})=>s),[t]),i=so(r),d=(0,kt.useMemo)(()=>t.filter(({hidden:s},u)=>!s&&i?.[u]).length,[t,i]);return d>0?(0,Ro.jsx)(xo.TableTh,{colSpan:d,className:(0,Mo.default)("mantine-datatable-column-group-header-cell",{[te]:n==="left",[oe]:n==="center",[ae]:n==="right"},a),style:l,children:o??Ve(e)}):null}var y=require("@mantine/core"),Ge=O(require("clsx")),Xe=require("react");var ne=require("@mantine/core"),Io=require("@mantine/hooks");var _e=require("react/jsx-runtime");function Eo(){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:"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 Be=require("react/jsx-runtime");function No(){return(0,Be.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Be.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Be.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 ge=require("react/jsx-runtime");function Lo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,Io.useDisclosure)(!1);return(0,ge.jsxs)(ne.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,ge.jsx)(ne.PopoverTarget,{children:(0,ge.jsx)(ne.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,ge.jsx)(t?No:Eo,{})})}),(0,ge.jsx)(ne.PopoverDropdown,{onClick:r=>r.preventDefault(),children:typeof e=="function"?e({close:n}):e})]})}var Ho=require("@mantine/core"),dt=require("react");var Wo=require("react/jsx-runtime"),Oo=e=>{let{accessor:t,columnRef:o}=e,n=(0,dt.useRef)(null),[a,l]=(0,dt.useState)(0),{setColumnWidth:r}=tt(),i=m=>{m.preventDefault(),m.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",s),document.body.style.cursor="col-resize"},d=m=>{if(!o.current)return;let c=m.clientX-o.current.getBoundingClientRect().right,f=`${o.current.getBoundingClientRect().width+c}px`;o.current.style.width=f,r(t,o.current.style.width),l(-c)},s=()=>{o.current&&(document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",s),document.body.style.cursor="initial",r(t,o.current.style.width),l(0))};return(0,Wo.jsx)("div",{ref:n,onClick:m=>m.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,Ho.rem)(a)}})};var he=require("react/jsx-runtime");function Ao(){return(0,he.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,he.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,he.jsx)("path",{d:"M12 5l0 14"}),(0,he.jsx)("path",{d:"M16 9l-4 -4"}),(0,he.jsx)("path",{d:"M8 9l4 -4"})]})}var Ce=require("react/jsx-runtime");function Vo(){return(0,Ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ce.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ce.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,Ce.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,Ce.jsx)("path",{d:"M12 3l0 18"})]})}var Q=require("react/jsx-runtime");function zo(){return(0,Q.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Q.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Q.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Q.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Q.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Q.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Q.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Q.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Re=require("react/jsx-runtime");function Fo(){return(0,Re.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Re.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Re.jsx)("path",{d:"M18 6l-12 12"}),(0,Re.jsx)("path",{d:"M6 6l12 12"})]})}var C=require("react/jsx-runtime");function _o({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:l,draggable:r,toggleable:i,resizable:d,sortIcons:s,textAlign:u,width:m,sortStatus:c,onSortStatusChange:T,filter:f,filtering:S}){let{setSourceColumn:g,setTargetColumn:p,swapColumns:h,columnsToggle:w,setColumnsToggle:x}=tt(),[R,W]=(0,Xe.useState)(!1),H=(0,Xe.useRef)(null),[$,E]=(0,Xe.useState)(!1);if(!ee(n))return null;let P=a??Ve(o),N=typeof P=="string"?P:void 0,I=l&&T?D=>{D?.defaultPrevented||T({columnAccessor:o,direction:c?.columnAccessor===o?c.direction==="asc"?"desc":"asc":c?.direction??"asc"})}:void 0,z=D=>{D.stopPropagation(),g(o),W(!1)},K=D=>{D.preventDefault(),p(o),W(!0)},se=()=>{p(o),W(!1),h()},de=()=>{W(!0)},ce=()=>{W(!1)},ue=D=>{D.stopPropagation(),x(J=>J.map(F=>F.accessor===o?{...F,toggled:!1}:F))};return(0,C.jsxs)(y.TableTh,{className:(0,Ge.default)({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":d},e),style:[{width:m,...d?{minWidth:"1px"}:{minWidth:m,maxWidth:m}},t],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:I,onContextMenu:D=>{i&&(D.preventDefault(),E(!0))},onKeyDown:D=>D.key==="Enter"&&I?.(),ref:H,children:[(0,C.jsxs)(y.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,C.jsxs)(y.Popover,{width:200,position:"bottom",withArrow:!0,shadow:"md",opened:$,onChange:E,children:[(0,C.jsx)(y.PopoverTarget,{children:(0,C.jsxs)(y.Flex,{align:"center",w:"100%",className:(0,Ge.default)({"mantine-datatable-header-cell-draggable":r,"mantine-datatable-header-cell-drag-over":R}),draggable:r,onDragStart:r?z:void 0,onDragEnter:r?de:void 0,onDragOver:r?K:void 0,onDrop:r?se:void 0,onDragLeave:r?ce:void 0,children:[r?(0,C.jsx)(y.Center,{role:"img","aria-label":"Drag column",children:(0,C.jsx)(y.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:D=>{D.stopPropagation()},children:(0,C.jsx)(zo,{})})}):null,(0,C.jsx)(y.Box,{className:(0,Ge.default)("mantine-datatable-header-cell-sortable-text",{[te]:u==="left",[oe]:u==="center",[ae]:u==="right"},ve,xe),title:N,children:P})]})}),(0,C.jsx)(y.PopoverDropdown,{children:(0,C.jsx)(y.Stack,{children:w.filter(D=>D.toggleable).map(D=>(0,C.jsx)(y.Group,{children:(0,C.jsx)(y.Checkbox,{size:"xs",label:D.accessor,checked:D.toggled,onChange:J=>{x(w.map(F=>F.accessor===D.accessor?{...F,toggled:J.currentTarget.checked}:F))}})},D.accessor))})})]}),i?(0,C.jsx)(y.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,C.jsx)(y.ActionIcon,{size:"xs",variant:"light",onClick:ue,children:(0,C.jsx)(Fo,{})})}):null,l||c?.columnAccessor===o?(0,C.jsx)(C.Fragment,{children:c?.columnAccessor===o?(0,C.jsx)(y.Center,{className:(0,Ge.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":c.direction==="desc"}),role:"img","aria-label":`Sorted ${c.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||(0,C.jsx)(Ao,{})}):(0,C.jsx)(y.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:s?.unsorted||(0,C.jsx)(Vo,{})})}):null,f?(0,C.jsx)(Lo,{isActive:!!S,children:f}):null]}),d?(0,C.jsx)(Oo,{accessor:o,columnRef:H}):null]})}var ct=require("@mantine/core"),Bo=O(require("clsx"));var Rt=require("react/jsx-runtime");function Go({className:e,style:t,trigger:o,shadowVisible:n,checked:a,indeterminate:l,checkboxProps:r,onChange:i,rowSpan:d}){let s=!r.disabled;return(0,Rt.jsx)(ct.TableTh,{className:(0,Bo.default)("mantine-datatable-header-selector-cell",{[X]:o==="cell"&&s},e),style:t,rowSpan:d,"data-shadow-visible":n||void 0,onClick:o==="cell"&&s?i:void 0,children:(0,Rt.jsx)(ct.Checkbox,{classNames:s?{input:X}:void 0,checked:a,indeterminate:l,onChange:i,...r,disabled:!(i||r.onChange)||r.disabled})})}var re=require("react/jsx-runtime"),Uo=(0,Qo.forwardRef)(function({className:t,style:o,sortStatus:n,sortIcons:a,onSortStatusChange:l,columns:r,defaultColumnProps:i,groups:d,selectionTrigger:s,selectionVisible:u,selectionChecked:m,selectionIndeterminate:c,onSelectionChange:T,selectionCheckboxProps:f,selectorCellShadowVisible:S,selectionColumnClassName:g,selectionColumnStyle:p},h){let w=u?(0,re.jsx)(Go,{className:g,style:p,trigger:s,shadowVisible:S,checked:m,indeterminate:c,checkboxProps:f,onChange:T,rowSpan:d?2:void 0}):null;return(0,re.jsxs)(Qe.TableThead,{className:(0,Xo.default)("mantine-datatable-header",t),style:o,ref:h,children:[d&&(0,re.jsxs)(Qe.TableTr,{children:[w,d.map(x=>(0,re.jsx)(ko,{group:x},x.id))]}),(0,re.jsxs)(Qe.TableTr,{children:[!d&&w,r.map(({hidden:x,...R},W)=>{if(x)return null;let{accessor:H,visibleMediaQuery:$,textAlign:E,width:P,title:N,sortable:I,draggable:z,toggleable:K,resizable:se,titleClassName:de,titleStyle:ce,filter:ue,filtering:D}={...i,...R};return(0,re.jsx)(_o,{accessor:H,className:de,style:ce,visibleMediaQuery:$,textAlign:E,width:P,title:N,sortable:I,draggable:z,toggleable:K,resizable:se&&W<r.length-1,sortStatus:n,sortIcons:a,onSortStatusChange:l,filter:ue,filtering:D},H)})]})]})});var ut=require("@mantine/core"),$o=O(require("clsx")),Et=require("react/jsx-runtime");function Ko({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:l,type:r,color:i}){return(0,Et.jsx)(ut.Center,{pt:e,pb:t,className:(0,$o.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,Et.jsx)(ut.Loader,{size:l,type:r,color:i}))})}var le=require("@mantine/core"),Nt=O(require("clsx")),oa=require("react");var v=require("@mantine/core"),ea=O(require("clsx"));var Jo=require("@mantine/core");function M(e,t,o){return e?(0,Jo.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function Zo({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:l,highlightOnHoverColor:r}){return{"--mantine-datatable-color-light":M(t,e,"light"),"--mantine-datatable-color-dark":M(t,e,"dark"),"--mantine-datatable-background-color-light":M(o,e,"light"),"--mantine-datatable-background-color-dark":M(o,e,"dark"),"--mantine-datatable-border-color-light":M(n,e,"light"),"--mantine-datatable-border-color-dark":M(n,e,"dark"),"--mantine-datatable-row-border-color-light":M(a,e,"light"),"--mantine-datatable-row-border-color-dark":M(a,e,"dark"),"--mantine-datatable-striped-color-light":M(l,e,"light"),"--mantine-datatable-striped-color-dark":M(l,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":M(r,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":M(r,e,"dark")}}function mt({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":M(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":M(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":M(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":M(o,e,"dark")}}function Yo({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":M(t,e,"light"),"--mantine-datatable-row-color-dark":M(t,e,"dark"),"--mantine-datatable-row-background-color-light":M(o,e,"light"),"--mantine-datatable-row-background-color-dark":M(o,e,"dark")}}var Ee=require("react/jsx-runtime");function qo(){return(0,Ee.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ee.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Ee.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,Ee.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var G=require("react/jsx-runtime"),jo={xs:(0,v.rem)(22),sm:(0,v.rem)(26),md:(0,v.rem)(32),lg:(0,v.rem)(38),xl:(0,v.rem)(44)};function ta({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:l,onChange:r}){return(0,G.jsxs)(v.Group,{gap:"xs",children:[(0,G.jsx)(v.Text,{size:e,children:t}),(0,G.jsxs)(v.Menu,{withinPortal:!0,withArrow:!0,children:[(0,G.jsx)(v.MenuTarget,{children:(0,G.jsx)(v.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,G.jsx)(qo,{}),style:[{fontWeight:"normal"},i=>({height:jo[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),(0,G.jsx)(v.MenuDropdown,{children:o.map(i=>{let d=i===n;return(0,G.jsx)(v.MenuItem,{className:(0,ea.default)({"mantine-datatable-page-size-selector-active":d}),style:[{height:jo[e]},d&&(a||l)?s=>mt({theme:s,paginationActiveTextColor:a,paginationActiveBackgroundColor:l}):void 0],disabled:d,onClick:()=>r(i),children:(0,G.jsx)(v.Text,{size:e,children:i})},i)})})]})]})}var Ne=require("react/jsx-runtime"),aa=(0,oa.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:l,paginationWithEdges:r,paginationActiveTextColor:i,paginationActiveBackgroundColor:d,paginationSize:s,loadingText:u,noRecordsText:m,paginationText:c,totalRecords:T,recordsPerPage:f,onRecordsPerPageChange:S,recordsPerPageLabel:g,recordsPerPageOptions:p,recordsLength:h,horizontalSpacing:w,paginationWrapBreakpoint:x,getPaginationControlProps:R},W){let H;if(n)H=u;else if(!T)H=m;else{let E=(a-1)*f+1,P=E+h-1;H=c({from:E,to:P,totalRecords:T})}let $=ee(({breakpoints:E})=>`(min-width: ${typeof x=="number"?`${(0,le.rem)(x)}rem`:E[x]||x})`);return(0,Ne.jsxs)(le.Box,{ref:W,px:w??"xs",py:"xs",className:(0,Nt.default)("mantine-datatable-pagination",t),style:[{flexDirection:$?"row":"column"},o],children:[(0,Ne.jsx)(le.Text,{className:"mantine-datatable-pagination-text",size:s,children:H}),p&&(0,Ne.jsx)(ta,{activeTextColor:i,activeBackgroundColor:d,size:s,label:g,values:p,value:f,onChange:S}),(0,Ne.jsx)(le.Pagination,{classNames:{root:(0,Nt.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!h}),control:"mantine-datatable-pagination-pages-control"},style:i||d?E=>mt({theme:E,paginationActiveTextColor:i,paginationActiveBackgroundColor:d}):void 0,withEdges:r,value:a,onChange:l,size:s,total:Math.ceil(T/f),getControlProps:R})]})});var ua=require("@mantine/core"),ma=O(require("clsx"));var na=require("@mantine/core"),ra=O(require("clsx"));var ia=require("react/jsx-runtime");function la({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:l,onDoubleClick:r,onContextMenu:i,noWrap:d,ellipsis:s,textAlign:u,width:m,accessor:c,render:T,defaultRender:f,customCellAttributes:S}){return ee(o)?(0,ia.jsx)(na.TableTd,{className:(0,ra.default)({[ve]:d||s,[xe]:s,[X]:l||r,[st]:i,[te]:u==="left",[oe]:u==="center",[ae]:u==="right"},e),style:[{width:m,minWidth:m,maxWidth:m},t],onClick:l,onDoubleClick:r,onContextMenu:i,...S?.(n,a),children:T?T(n,a):f?f(n,a,c):it(n,c)}):null}var ye=require("@mantine/core");var U=require("react/jsx-runtime");function sa({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:l}=fo(e,n?.transitionDuration);return l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ye.TableTr,{}),(0,U.jsx)(ye.TableTr,{children:(0,U.jsx)(ye.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,U.jsx)(ye.Collapse,{in:a,...n,children:(0,U.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var pt=require("@mantine/core"),da=O(require("clsx"));var It=require("react/jsx-runtime");function ca({className:e,style:t,record:o,index:n,trigger:a,onChange:l,withRightShadow:r,getCheckboxProps:i,...d}){let s=i(o,n),u=!d.disabled&&!s.disabled,m=c=>{c.stopPropagation(),a==="cell"&&u&&l?.(c)};return(0,It.jsx)(pt.TableTd,{className:(0,da.default)("mantine-datatable-row-selector-cell",{[X]:a==="cell"&&u},e),style:t,"data-shadow-visible":r||void 0,onClick:m,children:(0,It.jsx)(pt.Checkbox,{classNames:u?{input:X}:void 0,onChange:l,...d,...s})})}var Y=require("react/jsx-runtime");function pa({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:l,selectionVisible:r,selectionChecked:i,onSelectionChange:d,isRecordSelectable:s,getSelectionCheckboxProps:u,onClick:m,onDoubleClick:c,onContextMenu:T,onCellClick:f,onCellDoubleClick:S,onCellContextMenu:g,expansion:p,customAttributes:h,color:w,backgroundColor:x,className:R,style:W,selectorCellShadowVisible:H,selectionColumnClassName:$,selectionColumnStyle:E}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(ua.TableTr,{className:(0,ma.default)("mantine-datatable-row",{[X]:m||c||p?.expandOnClick},{[st]:T},typeof R=="function"?R(e,t):R),"data-selected":i||void 0,onClick:P=>{if(p){let{isRowExpanded:N,expandOnClick:I,expandRow:z,collapseRow:K}=p;I&&(N(e)?K(e):z(e))}m?.({event:P,record:e,index:t})},onDoubleClick:c?P=>c({event:P,record:e,index:t}):void 0,onContextMenu:T?P=>T({event:P,record:e,index:t}):void 0,style:[w||x?P=>{let N=w?.(e,t),I=x?.(e,t);return Yo({theme:P,color:N,backgroundColor:I})}:void 0,W?.(e,t)],...h?.(e,t),children:[r&&(0,Y.jsx)(ca,{className:$,style:E,record:e,index:t,trigger:l,withRightShadow:H,checked:i,disabled:!d||(s?!s(e,t):!1),onChange:d,getCheckboxProps:u}),o.map(({hidden:P,...N},I)=>{if(P)return null;let{accessor:z,visibleMediaQuery:K,textAlign:se,noWrap:de,ellipsis:ce,width:ue,render:D,cellsClassName:J,cellsStyle:F,customCellAttributes:bt}={...n,...N};return(0,Y.jsx)(la,{className:typeof J=="function"?J(e,t):J,style:F?.(e,t),visibleMediaQuery:K,record:e,index:t,onClick:f?me=>f({event:me,record:e,index:t,column:N,columnIndex:I}):void 0,onDoubleClick:S?me=>S({event:me,record:e,index:t,column:N,columnIndex:I}):void 0,onContextMenu:g?me=>g({event:me,record:e,index:t,column:N,columnIndex:I}):void 0,accessor:z,textAlign:se,noWrap:de,ellipsis:ce,width:ue,render:D,defaultRender:a,customCellAttributes:bt},z)})]}),p&&(0,Y.jsx)(sa,{colSpan:o.filter(({hidden:P})=>!P).length+(r?1:0),open:p.isRowExpanded(e),content:p.content({record:e,index:t}),collapseProps:p.collapseProps})]})}var ie=require("@mantine/core"),Ue=O(require("clsx")),De=require("react/jsx-runtime");function fa({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:l,headerHeight:r,footerHeight:i,onScrollPositionChange:d,children:s,viewportRef:u,scrollAreaProps:m}){return(0,De.jsxs)(ie.ScrollArea,{...m,viewportRef:u,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:[s,(0,De.jsx)(ie.Box,{className:(0,Ue.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:r?(0,ie.rem)(r):0}}),(0,De.jsx)("div",{className:(0,Ue.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,De.jsx)("div",{className:(0,Ue.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,De.jsx)(ie.Box,{className:(0,Ue.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":l}),style:{bottom:i?(0,ie.rem)(i+1):0}})]})}var L=require("react/jsx-runtime");function Ta({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,shadow:l,verticalAlign:r="center",fetching:i,columns:d,storeColumnsKey:s,groups:u,pinLastColumn:m,defaultColumnProps:c,defaultColumnRender:T,idAccessor:f="id",records:S,selectionTrigger:g="checkbox",selectedRecords:p,onSelectedRecordsChange:h,selectionColumnClassName:w,selectionColumnStyle:x,isRecordSelectable:R,allRecordsSelectionCheckboxProps:W={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:H=(A,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:$,sortIcons:E,onSortStatusChange:P,horizontalSpacing:N,page:I,onPageChange:z,totalRecords:K,recordsPerPage:se,onRecordsPerPageChange:de,recordsPerPageOptions:ce,recordsPerPageLabel:ue="Records per page",paginationWithEdges:D,paginationActiveTextColor:J,paginationActiveBackgroundColor:F,paginationSize:bt="sm",paginationText:me=({from:A,to:pe,totalRecords:fe})=>`${A} - ${pe} / ${fe}`,paginationWrapBreakpoint:ga="sm",getPaginationControlProps:ha=A=>A==="previous"?{"aria-label":"Previous page"}:A==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Ca,customLoader:ya,loaderSize:Da,loaderType:Sa,loaderColor:wa,loadingText:Pa="...",emptyState:va,noRecordsText:Ht="No records",noRecordsIcon:xa,highlightOnHover:Ma,striped:ka,noHeader:Ra,onRowClick:Ea,onRowDoubleClick:Na,onRowContextMenu:Ia,onCellClick:La,onCellDoubleClick:Ha,onCellContextMenu:Oa,onScroll:Ot,onScrollToTop:Wt,onScrollToBottom:At,onScrollToLeft:Vt,onScrollToRight:zt,c:Wa,backgroundColor:Aa,borderColor:Va,rowBorderColor:za,stripedColor:Fa,highlightOnHoverColor:_a,rowColor:Ba,rowBackgroundColor:Ga,rowExpansion:Xa,rowClassName:Qa,rowStyle:Ua,customRowAttributes:$a,scrollViewportRef:Ka,scrollAreaProps:Ja,bodyRef:Za,m:Ya,my:qa,mx:ja,mt:en,mb:tn,ml:on,mr:an,className:nn,classNames:Ie,style:rn,styles:Le,...ln}){let{ref:A,width:pe,height:fe}=we(),He=(0,V.useMemo)(()=>u?.flatMap(b=>b.columns)??d,[d,u]),Ft=nt({key:s,columns:He}),{ref:sn,height:Tt}=we(),{ref:dn,width:gt,height:Oe}=we(),{ref:cn,height:un}=we(),{ref:mn,height:_t}=we(),[ht,Bt]=(0,V.useState)(!0),[Ct,Gt]=(0,V.useState)(!0),[$e,Xt]=(0,V.useState)(!0),[Ke,Qt]=(0,V.useState)(!0),pn=po({rowExpansion:Xa,records:S,idAccessor:f}),Je=(0,V.useCallback)(()=>{let b=A.current?.scrollTop||0,q=A.current?.scrollLeft||0;if(i||Oe<=fe)Bt(!0),Gt(!0);else{let _=b===0,B=Oe-b-fe<1;Bt(_),Gt(B),_&&_!==ht&&Wt?.(),B&&B!==Ct&&At?.()}if(i||gt===pe)Xt(!0),Qt(!0);else{let _=q===0,B=gt-q-pe<1;Xt(_),Qt(B),_&&_!==$e&&Vt?.(),B&&B!==Ke&&zt?.()}},[i,At,Vt,zt,Wt,fe,A,pe,Ct,$e,Ke,ht,Oe,gt]);no(Je,[Je]);let fn=(0,V.useCallback)(b=>{Ot?.(b),Je()},[Je,Ot]),bn=(0,V.useCallback)(b=>{A.current?.scrollTo({top:0,left:0}),z(b)},[z,A]),Ze=S?.length,Ut=S?.map(b=>k(b,f)),We=!!p,Ae=p?.map(b=>k(b,f)),$t=Ut!==void 0&&Ae!==void 0&&Ae.length>0,yt=R?S?.filter(R):S,Ye=yt?.map(b=>k(b,f)),qe=$t&&Ye.every(b=>Ae.includes(b)),Tn=$t&&Ye.some(b=>Ae.includes(b)),gn=(0,V.useCallback)(()=>{p&&h&&h(qe?p.filter(b=>!Ye.includes(k(b,f))):ze([...p,...yt],b=>k(b,f)))},[qe,f,h,Ye,yt,p]),{lastSelectionChangeIndex:je,setLastSelectionChangeIndex:hn}=ro(Ut),Dt=We&&!$e;return(0,L.jsx)(wt,{...Ft,children:(0,L.jsxs)(ft.Box,{...{m:Ya,my:qa,mx:ja,mt:en,mb:tn,ml:on,mr:an},className:(0,Lt.default)("mantine-datatable",{"mantine-datatable-with-border":e},nn,Ie?.root),style:[b=>({...Zo({theme:b,c:Wa,backgroundColor:Aa,borderColor:Va,rowBorderColor:za,stripedColor:Fa,highlightOnHoverColor:_a}),borderRadius:b.radius[t]||t,boxShadow:b.shadows[l]||l,height:n,minHeight:a}),rn,Le?.root],children:[(0,L.jsx)(fa,{viewportRef:(0,ba.useMergedRef)(A,Ka),topShadowVisible:!ht,leftShadowVisible:!$e,leftShadowBehind:We,rightShadowVisible:!Ke,rightShadowBehind:m,bottomShadowVisible:!Ct,headerHeight:Tt,footerHeight:un,onScrollPositionChange:fn,scrollAreaProps:Ja,children:(0,L.jsxs)(ft.Table,{ref:dn,horizontalSpacing:N,className:(0,Lt.default)("mantine-datatable-table",{[bo]:o,"mantine-datatable-vertical-align-top":r==="top","mantine-datatable-vertical-align-bottom":r==="bottom","mantine-datatable-last-row-border-bottom-visible":Oe<fe,"mantine-datatable-pin-last-column":m,"mantine-datatable-pin-last-column-scrolled":!Ke&&m},Ie?.table),style:Le?.table,"data-striped":Ze&&ka||void 0,"data-highlight-on-hover":Ma||void 0,...ln,children:[Ra?null:(0,L.jsx)(wt,{...Ft,children:(0,L.jsx)(Uo,{ref:sn,className:Ie?.header,style:Le?.header,columns:He,defaultColumnProps:c,groups:u,sortStatus:$,sortIcons:E,onSortStatusChange:P,selectionTrigger:g,selectionVisible:We,selectionChecked:qe,selectionIndeterminate:Tn&&!qe,onSelectionChange:gn,selectionCheckboxProps:W,selectorCellShadowVisible:Dt,selectionColumnClassName:w,selectionColumnStyle:x})}),(0,L.jsx)("tbody",{ref:Za,children:Ze?S.map((b,q)=>{let _=k(b,f),B=Ae?.includes(_)||!1,Kt;return h&&p&&(Kt=Cn=>{if(Cn.nativeEvent.shiftKey&&je!==null){let Se=S.filter(q>je?(be,Te)=>Te>=je&&Te<=q&&(R?R(be,Te):!0):(be,Te)=>Te>=q&&Te<=je&&(R?R(be,Te):!0));h(B?xt(p,Se,be=>k(be,f)):ze([...p,...Se],be=>k(be,f)))}else h(B?p.filter(Se=>k(Se,f)!==_):ze([...p,b],Se=>k(Se,f)));hn(q)}),(0,L.jsx)(pa,{record:b,index:q,columns:He,defaultColumnProps:c,defaultColumnRender:T,selectionTrigger:g,selectionVisible:We,selectionChecked:B,onSelectionChange:Kt,isRecordSelectable:R,getSelectionCheckboxProps:H,onClick:Ea,onDoubleClick:Na,onCellClick:La,onCellDoubleClick:Ha,onContextMenu:Ia,onCellContextMenu:Oa,expansion:pn,color:Ba,backgroundColor:Ga,className:Qa,style:Ua,customAttributes:$a,selectorCellShadowVisible:Dt,selectionColumnClassName:w,selectionColumnStyle:x},_)}):(0,L.jsx)(jt,{})}),He.some(({footer:b})=>b)&&(0,L.jsx)(vo,{ref:cn,className:Ie?.footer,style:Le?.footer,columns:He,defaultColumnProps:c,selectionVisible:We,selectorCellShadowVisible:Dt,scrollDiff:Oe-fe})]})}),I&&(0,L.jsx)(aa,{ref:mn,className:Ie?.pagination,style:Le?.pagination,horizontalSpacing:N,fetching:i,page:I,onPageChange:bn,totalRecords:K,recordsPerPage:se,onRecordsPerPageChange:de,recordsPerPageOptions:ce,recordsPerPageLabel:ue,paginationWithEdges:D,paginationActiveTextColor:J,paginationActiveBackgroundColor:F,paginationSize:bt,paginationText:me,paginationWrapBreakpoint:ga,getPaginationControlProps:ha,noRecordsText:Ht,loadingText:Pa,recordsLength:Ze}),(0,L.jsx)(Ko,{pt:Tt,pb:_t,fetching:i,backgroundBlur:Ca,customContent:ya,size:Da,type:Sa,color:wa}),(0,L.jsx)(to,{pt:Tt,pb:_t,icon:xa,text:Ht,active:!i&&!Ze,children:va})]})})}0&&(module.exports={DataTable,differenceBy,getRecordId,getValueAtPath,humanize,uniqBy,useDataTableColumns,useDragToggleColumns});
2
2
  //# sourceMappingURL=index.js.map