simple-table-core 0.7.73 → 0.7.75

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.
@@ -37,7 +37,6 @@ interface SimpleTableProps {
37
37
  sortUpIcon?: ReactNode;
38
38
  tableRef?: RefObject<TableRefType | null>;
39
39
  theme?: Theme;
40
- totalPages?: number;
41
40
  }
42
41
  declare const SimpleTable: (props: SimpleTableProps) => import("react/jsx-runtime").JSX.Element | null;
43
42
  export default SimpleTable;
@@ -1,8 +1,8 @@
1
1
  import { RefObject } from "react";
2
- declare const TableHorizontalScrollbar: ({ mainBodyRef, pinnedLeftRef, pinnedRightRef, tableContentWidth, }: {
2
+ declare const TableHorizontalScrollbar: ({ mainBodyRef, pinnedLeftRef, pinnedRightRef, tableBodyContainerRef, }: {
3
3
  mainBodyRef: RefObject<HTMLDivElement | null>;
4
4
  pinnedLeftRef: RefObject<HTMLDivElement | null>;
5
5
  pinnedRightRef: RefObject<HTMLDivElement | null>;
6
- tableContentWidth: number;
6
+ tableBodyContainerRef: RefObject<HTMLDivElement | null>;
7
7
  }) => import("react/jsx-runtime").JSX.Element | null;
8
8
  export default TableHorizontalScrollbar;
@@ -1,17 +1,17 @@
1
1
  import { Dispatch, SetStateAction } from "react";
2
2
  import HeaderObject from "../../../types/HeaderObject";
3
3
  type TableColumnEditorProps = {
4
- headers: HeaderObject[];
5
4
  columnEditorText: string;
6
5
  editColumns: boolean;
7
6
  editColumnsInitOpen: boolean;
7
+ headers: HeaderObject[];
8
+ hiddenColumns: {
9
+ [key: string]: boolean;
10
+ };
8
11
  position: "left" | "right";
9
12
  setHiddenColumns: Dispatch<SetStateAction<{
10
13
  [key: string]: boolean;
11
14
  }>>;
12
- hiddenColumns: {
13
- [key: string]: boolean;
14
- };
15
15
  };
16
- declare const TableColumnEditor: ({ columnEditorText, editColumns, editColumnsInitOpen, headers, position, setHiddenColumns, hiddenColumns, }: TableColumnEditorProps) => import("react/jsx-runtime").JSX.Element | null;
16
+ declare const TableColumnEditor: ({ columnEditorText, editColumns, editColumnsInitOpen, headers, hiddenColumns, position, setHiddenColumns, }: TableColumnEditorProps) => import("react/jsx-runtime").JSX.Element | null;
17
17
  export default TableColumnEditor;
@@ -2,3 +2,5 @@ export declare const DRAG_THROTTLE_LIMIT = 50;
2
2
  export declare const ROW_SEPARATOR_WIDTH = 1;
3
3
  export declare const PAGE_SIZE = 20;
4
4
  export declare const BUFFER_ROW_COUNT = 5;
5
+ export declare const COLUMN_EDIT_WIDTH = 28;
6
+ export declare const TABLE_HEADER_CELL_WIDTH_DEFAULT = 150;
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as l,createContext as c,useContext as d,forwardRef as s,useLayoutEffect as u,Fragment as h,useReducer as f,createRef as v}from"react";var g=function(){return g=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},g.apply(this,arguments)};function w(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function l(e){try{c(t.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,l)}c((t=t.apply(e,n||[])).next())}))}function m(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&l[0]?t.return:l[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,l[1])).done)return o;switch(t=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,t=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],t=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function p(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},I=function(r){var o=r.currentPage,i=r.hideFooter,a=r.nextIcon,l=r.onPageChange,c=r.onNextPage,d=r.prevIcon,s=r.shouldPaginate,u=r.totalPages,h=t(!0),f=h[0],v=h[1],p=!(o>1),C=!(o<u)&&!c||!f&&o===u;return i||!s?null:e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){var e=o-1;e>=1&&l(e)},disabled:p},{children:d})),n("button",g({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,(function(){var e,n;return m(this,(function(r){switch(r.label){case 0:return e=o===u,n=o+1,c&&e?[4,c(o)]:[3,2];case 1:if(!r.sent())return v(!1),[2];r.label=2;case 2:return(n<=u||c)&&l(n),[2]}}))}))},disabled:C},{children:a})),Array.from({length:u},(function(e,r){return n("button",g({onClick:function(){var e;(e=r+1)>=1&&e<=u&&l(e)},className:"st-page-btn ".concat(o===r+1?"active":"")},{children:r+1}),r)}))]}))},x=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},b=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},R=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},y=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},M=function(e){return e.position*(e.rowHeight+1)-1},S=function(e){return e.position*(e.rowHeight+1)},E=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},D=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},H=function(e){var n=e.rowId,r=e.accessor;return"".concat(n,"-").concat(r)},k=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",g({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",g({value:"true"},{children:"True"})),n("option",g({value:"false"},{children:"False"}))]}))},N=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},T=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},L=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},l=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(N,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(k,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(T,{defaultValue:i,onBlur:l,onChange:a}):null})},O=0,W=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===O||o-O>=t)&&(O=o,n(r))}},B=Date.now(),P={screenX:0,screenY:0},F=function(e,n,r){void 0===r&&(r=[]);for(var t=0;t<e.length;t++){var o=e[t];if(o.accessor===n)return p(p([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=F(o.children,n,p(p([],r,!0),[t],!1));if(i)return i}}return null};var A=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,c=e.onColumnOrderChange,d=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){JSON.stringify(r.current)!==JSON.stringify(n)&&(r.current=n)}),[n]),r.current);return{handleDragStart:function(e){t.current=e,B=Date.now()},handleDragOver:function(e){var n,r,o=e.event,a=e.hoveredHeader;if(o.preventDefault(),i.current){var c=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=o.screenX,h=o.screenY,f=Math.sqrt(Math.pow(u-P.screenX,2)+Math.pow(h-P.screenY,2));l.current=a;var v=i.current,g=F(v,(null===(n=t.current)||void 0===n?void 0:n.accessor)||""),w=F(v,a.accessor);if(g&&w){var m=g.length,p=w.length,C=w;if(m!==p){var I=p-m;I>0&&(C=w.slice(0,-I))}var x=function(e,n,r){var t=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;i<n.length-1;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var l=i(t,n);return a(t,n,i(t,r)),a(t,r,l),{newHeaders:t,emergencyBreak:o}}(v,g,C),b=x.newHeaders,R=x.emergencyBreak;if(!(c||a.accessor===(null===(r=t.current)||void 0===r?void 0:r.accessor)||null===t.current||f<10||0===g.length||0===C.length||JSON.stringify(b)===JSON.stringify(i.current)||R)){var y=Date.now();JSON.stringify(b)===JSON.stringify(s)&&(y-B<1500||f<40)||(B=y,P={screenX:u,screenY:h},d(b))}}}},handleDragEnd:function(){t.current=null,l.current=null,null==c||c(i.current)}}},z=c(void 0),j=function(e){var r=e.children,t=e.value;return n(z.Provider,g({value:t},{children:r}))},U=function(){var e=d(z);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},J=s((function(r,l){var c,d,s=r.borderClass,u=r.colIndex,h=r.header,f=r.isHighlighted,v=r.isInitialFocused,w=r.onExpandRowClick,m=r.rowIndex,p=r.visibleRow,C=U(),I=C.cellRegistry,x=C.cellUpdateFlash,b=C.collapseIcon,R=C.draggedHeaderRef,y=C.expandIcon,M=C.handleMouseDown,S=C.handleMouseOver,D=C.headersRef,k=C.hoveredHeaderRef,N=C.onCellEdit,T=C.onTableHeaderDragEnd,O=p.depth,B=p.row,P=t(B.rowData[h.accessor]),F=P[0],z=P[1],j=t(!1),J=j[0],V=j[1],K=t(!1),X=K[0],q=K[1],Y=o(null),G=A({draggedHeaderRef:R,headersRef:D,hoveredHeaderRef:k,onTableHeaderDragEnd:T}).handleDragOver,$=W(),_="cell-".concat(m,"-").concat(u),Q=H({rowId:B.rowMeta.rowId,accessor:h.accessor});a((function(){if(I){var e="".concat(B.rowMeta.rowId,"-").concat(h.accessor);return I.set(e,{updateContent:function(e){F!==e?(z(e),x&&(q(!0),Y.current&&clearTimeout(Y.current),Y.current=setTimeout((function(){q(!1)}),800))):z(e)}}),function(){I.delete(e),Y.current&&clearTimeout(Y.current)}}}),[I,x,B.rowMeta.rowId,h.accessor,F]),a((function(){if(X){var e=setTimeout((function(){q(!1)}),850);return function(){return clearTimeout(e)}}}),[X]),a((function(){z(B.rowData[h.accessor])}),[B.rowData,h.accessor]);var Z=Boolean(null===(d=null===(c=B.rowMeta)||void 0===c?void 0:c.children)||void 0===d?void 0:d.length),ee=Boolean(null==h?void 0:h.isEditable),ne="st-cell ".concat(O>0&&h.expandable?"st-cell-depth-".concat(O):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(ee?"clickable":""," ").concat(X?"st-cell-updating":""),re=i((function(e){z(e),null==N||N({accessor:h.accessor,newValue:e,row:B})}),[h.accessor,N,B]);return J?n("div",g({className:"st-cell-editing",id:E({accessor:h.accessor,rowIndex:m+1})},{children:n(L,{onChange:re,setIsEditing:V,value:F})})):e("div",g({className:ne,id:_,onDoubleClick:function(){return h.isEditable&&V(!0)},onMouseDown:function(){return M({rowIndex:m,colIndex:u,rowId:B.rowMeta.rowId})},onMouseOver:function(){return S({rowIndex:m,colIndex:u,rowId:B.rowMeta.rowId})},onDragOver:function(e){return $({callback:G,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||J||(e.preventDefault(),V(!0))},ref:l,"data-row-index":m,"data-col-index":u,"data-row-id":B.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&Z?B.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return w(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):n("div",g({className:"st-sort-icon-container",onClick:function(){return w(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,n("span",g({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"")},{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:B}):F}))]}),Q)})),V=function(e){var t=e.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(e,["children"]);return U().allowAnimations?n(K,g({},o,{children:t})):n(r,{children:t})},K=function(e){var i=e.children,l=e.isBody,c=e.pauseAnimation,d=e.rowIndex,s=o(!1),h=U(),f=h.draggedHeaderRef,v=h.headersRef,g=h.mainBodyRef,w=h.shouldPaginate,m=t({}),p=m[0],C=m[1],I=o({}),x=v.current;return u((function(){if(x){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(E({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:x,draggedHeaderRef:f,rowIndex:d});JSON.stringify(e)!==JSON.stringify(p)&&(I.current=p,C(e))}}),[p,x,f,l,d]),u((function(){var e=g.current,n=function(){s.current=!0},r=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[f,g]),a((function(){c||s.current||Object.keys(I.current).length&&x&&x.forEach((function(e){var n=document.getElementById(E({accessor:e.accessor,rowIndex:d}));if(n){var r=I.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=w?0:r.top-t.top,a=Math.abs(o),l=Math.abs(i);(a>10||l>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[p,x,l,c,I,d,w]),n(r,{children:i})},X=function(e){var r=e.columnIndices,t=e.headers,o=e.hiddenColumns,i=e.isWidthDragging,a=e.onExpandRowClick,l=e.pinned,c=e.rowIndex,d=e.rowIndices,s=e.visibleRow,u=t.filter((function(e){return D({hiddenColumns:o,header:e,pinned:l})}));return n(V,g({isBody:!0,pauseAnimation:i,rowIndex:c+1},{children:u.map((function(e){return n(q,{columnIndices:r,header:e,headers:t,hiddenColumns:o,onExpandRowClick:a,pinned:l,rowIndex:c,rowIndices:d,visibleRow:s},E({accessor:e.accessor,rowIndex:c+1}))}))}))},q=function(e){var r=e.columnIndices,t=e.header,o=e.headers,i=e.hiddenColumns,a=e.onExpandRowClick,l=e.pinned,c=e.rowIndex,d=e.rowIndices,s=e.visibleRow,u=r[t.accessor],f=U(),v=f.getBorderClass,g=f.isSelected,w=f.isInitialFocusedCell;if(t.children){var m=t.children.filter((function(e){return D({hiddenColumns:i,header:e,pinned:l})}));return n(h,{children:m.map((function(e){return n(q,{columnIndices:r,header:e,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:l,rowIndex:c,rowIndices:d,visibleRow:s},E({accessor:e.accessor,rowIndex:c+1}))}))})}var p={rowIndex:c,colIndex:u,rowId:s.row.rowMeta.rowId},C=v(p),I=g(p),x=w(p);return n(J,{borderClass:C,colIndex:u,header:t,isHighlighted:I,isInitialFocused:x,onExpandRowClick:a,rowIndex:c,visibleRow:s},E({accessor:t.accessor,rowIndex:c+1}))},Y=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.headers,i=e.hiddenColumns,a=e.index,l=e.isWidthDragging,c=e.onExpandRowClick,d=e.pinned,s=e.rowHeight,u=e.rowIndices,h=e.visibleRow,f=h.position;return n("div",g({className:"st-row ".concat(f%2==0?"even":"odd"),style:{gridTemplateColumns:t,top:S({position:f,rowHeight:s}),height:"".concat(s,"px")}},{children:n(X,{columnIndices:r,headers:o,hiddenColumns:i,isWidthDragging:l,onExpandRowClick:c,pinned:d,rowIndex:a,rowIndices:u,visibleRow:h},a)}))},G=function(e){var r=e.displayStrongBorder,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",g({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:M({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},$=function(r){var t=r.columnIndices,o=r.headers,i=r.hiddenColumns,a=r.isWidthDragging,l=r.onExpandRowClick,c=r.pinned,d=r.rowHeight,s=r.rowIndices,u=r.sectionRef,f=r.templateColumns,v=r.totalHeight,w=r.visibleRows,m=r.width,p=c?"st-body-pinned-".concat(c):"st-body-main";return n("div",g({className:p,ref:u,style:{position:"relative",height:"".concat(v,"px"),width:m}},{children:w.map((function(r,u){var v,g,m,p,C=Boolean(null===(g=null===(v=r.row.rowMeta)||void 0===v?void 0:v.children)||void 0===g?void 0:g.length),I=null===(p=null===(m=w[u-1])||void 0===m?void 0:m.row.rowMeta)||void 0===p?void 0:p.isExpanded;return e(h,{children:[n(Y,{columnIndices:t,gridTemplateColumns:f,headers:o,hiddenColumns:i,index:u,isWidthDragging:a,onExpandRowClick:l,pinned:c,rowHeight:d,rowIndices:s,visibleRow:r}),0!==u&&n(G,{displayStrongBorder:C&&I,position:r.position,rowHeight:d,templateColumns:f})]},r.position)}))}))};function _(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return D({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&D({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var Q=function(r){var i,c,d,s,u,h=r.centerHeaderRef,f=r.flattenedRows,v=r.headerContainerRef,w=r.isWidthDragging,m=r.mainTemplateColumns,p=r.pinnedLeftColumns,C=r.pinnedLeftHeaderRef,I=r.pinnedLeftTemplateColumns,x=r.pinnedRightColumns,b=r.pinnedRightHeaderRef,R=r.pinnedRightTemplateColumns,y=r.setFlattenedRows,M=r.setScrollTop,S=r.visibleRows,E=U(),D=E.rowHeight,H=E.scrollbarWidth,k=E.mainBodyRef,N=E.pinnedLeftRef,T=E.pinnedRightRef,L=E.tableBodyContainerRef,O=E.hiddenColumns,W=E.headersRef;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],c=i[1];a((function(){var e=null==n?void 0:n.current;if(l&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,l,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:v,mainSectionRef:L,scrollbarWidth:H});var B,P,F=o(null),A=(B=0,(P=function(e){e.forEach((function(e){B+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&P(e.rowMeta.children)}))})(f),B)*(D+1)-1,z=l((function(){return _({headersRef:W,hiddenColumns:O,pinnedLeftColumns:p,pinnedRightColumns:x})}),[W,O,p,x]),j=l((function(){var e={};return S.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[S]),J=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};y((function(e){return e.map(n)}))},V=(null===(i=C.current)||void 0===i?void 0:i.clientWidth)?(null===(c=C.current)||void 0===c?void 0:c.clientWidth)+1:0,K=null===(d=h.current)||void 0===d?void 0:d.clientWidth,X=(null===(s=b.current)||void 0===s?void 0:s.clientWidth)?(null===(u=b.current)||void 0===u?void 0:u.clientWidth)+1:0,q={headerContainerRef:v,headers:W.current,hiddenColumns:O,isWidthDragging:w,rowHeight:D,visibleRows:S,columnIndices:z,rowIndices:j};return e("div",g({className:"st-body-container",ref:L,onScroll:function(e){var n=e.currentTarget.scrollTop;F.current&&cancelAnimationFrame(F.current),F.current=requestAnimationFrame((function(){M(n)}))}},{children:[p.length>0&&n($,g({},q,{onExpandRowClick:J,pinned:"left",sectionRef:N,templateColumns:I,totalHeight:A,width:V})),n($,g({},q,{onExpandRowClick:J,sectionRef:k,templateColumns:m,totalHeight:A,width:K})),x.length>0&&n($,g({},q,{onExpandRowClick:J,pinned:"right",sectionRef:T,templateColumns:R,totalHeight:A,width:X}))]}))},Z=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},ee=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.gridColumnEnd,i=e.gridColumnStart,a=e.setIsWidthDragging,l=e.startWidth;a(!0),n.preventDefault();var c=n.clientX;if(t){var d="number"==typeof t.minWidth?t.minWidth:40,s=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return s(e)})):[e]},u=o-i>1,h=u?s(t):[t],f=function(e){var n=e.clientX-c;if(u&&h.length>1){var o=h.reduce((function(e,n){return Math.min(e,"number"==typeof n.minWidth?n.minWidth:40)}),40),i=h.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),a=Math.max(l+n,o)-i;h.forEach((function(e,n){var r="number"==typeof e.width?e.width:150,t=a*(r/i),o=Math.max(r+t,d);e.width=o}))}else{var s=Math.max(l+n,d);t.width=s}r()},v=function(){document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",v),a(!1)};document.addEventListener("mousemove",f),document.addEventListener("mouseup",v)}},ne=s((function(r,t){var o,i,l=r.colIndex,c=r.forceHeadersUpdate,d=r.gridColumnEnd,s=r.gridColumnStart,u=r.gridRowEnd,h=r.gridRowStart,f=r.header,v=r.reverse,w=r.sort,m=U(),C=m.columnReordering,I=m.columnResizing,x=m.draggedHeaderRef,b=m.forceUpdate,R=m.headersRef,y=m.hoveredHeaderRef,M=m.onColumnOrderChange,S=m.onSort,D=m.onTableHeaderDragEnd,H=m.rowHeight,k=m.selectColumns,N=m.selectableColumns,T=m.setInitialFocusedCell,L=m.setIsWidthDragging,O=m.setSelectedCells,B=m.setSelectedColumns,P=m.sortDownIcon,F=m.sortUpIcon,z=Boolean(null==f?void 0:f.isSortable),j="st-header-cell ".concat(f.accessor===(null===(o=y.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=x.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(z?"clickable":""," ").concat(C&&!z?"columnReordering":""," ").concat("right"===(null==f?void 0:f.align)?"right-aligned":"center"===(null==f?void 0:f.align)?"center-aligned":""),J=A({draggedHeaderRef:x,headersRef:R,hoveredHeaderRef:y,onColumnOrderChange:M,onTableHeaderDragEnd:D}),V=J.handleDragStart,K=J.handleDragEnd,X=J.handleDragOver,q=W(),Y=function(e){var n=e.event,r=e.header;if(N){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,l);return n.shiftKey&&k?B((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],i=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<i&&(i=r,o=e)}));var a,l,c,d,s=p(p([],(a=o,l=n,c=Math.min(a,l),d=Math.max(a,l),Array.from({length:d-c+1},(function(e,n){return c+n}))),!0),t,!0);return new Set(p(p([],Array.from(e),!0),s,!0))})):k&&k(t),O(new Set),void T(null)}r.isSortable&&S(l,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!f)return null;var G=I&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;q({callback:ee,callbackProps:{event:e.nativeEvent,forceUpdate:b,header:f,gridColumnEnd:d,gridColumnStart:s,setIsWidthDragging:L,startWidth:"object"==typeof t&&null!==t&&"current"in t?null===(n=t.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),$=w&&w.key.accessor===f.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return Y({event:e,header:f})}},{children:["ascending"===w.direction&&F&&F,"descending"===w.direction&&P&&P]}));return e("div",g({className:j,id:E({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){q({callback:X,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:t,style:g(g({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:d},d-s>1?{}:{width:f.width}),u-h>1?{}:{height:H})},{children:[v&&G,e("div",g({className:"st-header-label ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":""),draggable:C&&!f.disableReorder,onClick:function(e){return Y({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),K(),c()},onDragStart:function(e){C&&f&&function(e){V(e)}(f)}},{children:["right"===f.align&&$,null==f?void 0:f.label,"right"!==f.align&&$]})),!v&&G]}))})),re=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.handleScroll,i=e.headersRef,a=e.hiddenColumns,c=e.maxDepth,d=e.pinned,s=e.sectionRef,u=e.sort,h=f((function(e){return e+1}),0)[1],w=l((function(){var e=[],n=1,t=function(o,i,l){var s,u;if(void 0===l&&(l=!1),!D({hiddenColumns:a,header:o,pinned:d}))return 0;l||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return D({hiddenColumns:a,header:e,pinned:d})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,g=i,w=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children){var m=!0;o.children.forEach((function(e){D({hiddenColumns:a,header:e,pinned:d})&&(t(e,i+1,m),m=!1)}))}return v-f},o=i.current.filter((function(e){return D({hiddenColumns:a,header:e,pinned:d})})),l=!0;return o.forEach((function(e){t(e,1,l),l=!1})),e}),[i,a,c,d,r]);return n("div",g({className:"st-header-".concat(d?"pinned-".concat(d):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:t,display:"grid",position:"relative"}},{children:n(V,g({rowIndex:0},{children:w.map((function(e){return n(ne,{colIndex:e.colIndex,forceHeadersUpdate:h,gridColumnEnd:e.gridColumnEnd,gridColumnStart:e.gridColumnStart,gridRowEnd:e.gridRowEnd,gridRowStart:e.gridRowStart,header:e.header,ref:v(),reverse:"right"===d,sort:u},e.header.accessor)}))}))}))},te=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(te)):1},oe=function(r){var t=r.centerHeaderRef,o=r.headerContainerRef,i=r.headersRef,a=r.hiddenColumns,c=r.mainTemplateColumns,d=r.pinnedLeftColumns,s=r.pinnedLeftHeaderRef,u=r.pinnedLeftTemplateColumns,h=r.pinnedRightColumns,f=r.pinnedRightHeaderRef,v=r.pinnedRightTemplateColumns,w=r.sort,m=U().mainBodyRef;Z(m,t);var p=l((function(){return _({headersRef:i,hiddenColumns:a,pinnedLeftColumns:d,pinnedRightColumns:h})}),[i,a,d,h]),C=l((function(){var e=i.current,n=0;return e.forEach((function(e){if(D({hiddenColumns:a,header:e})){var r=te(e);n=Math.max(n,r)}})),{maxDepth:n}}),[i,a]).maxDepth;return e("div",g({className:"st-header-container",ref:o},{children:[d.length>0&&n(re,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"left",sectionRef:s,sort:w}),n(re,{columnIndices:p,gridTemplateColumns:c,handleScroll:function(e){var n,r,o=null===(n=t.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(r=m.current)||void 0===r||r.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:C,sectionRef:t,sort:w}),h.length>0&&n(re,{columnIndices:p,gridTemplateColumns:v,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"right",sectionRef:f,sort:w})]}))},ie=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},ae=function(r){var t=r.flattenedRows,i=r.isWidthDragging,a=r.setFlattenedRows,c=r.setScrollTop,d=r.sort,s=r.visibleRows,u=U(),h=u.editColumns,f=u.headersRef,v=u.hiddenColumns,w=o(null),m=o(null),p=o(null),C=o(null),I=f.current.filter((function(e){return!e.pinned})),x=f.current.filter((function(e){return"left"===e.pinned})),b=f.current.filter((function(e){return"right"===e.pinned})),R=l((function(){return ie({headers:x,hiddenColumns:v})}),[x,v]),y=l((function(){return ie({headers:I,hiddenColumns:v})}),[I,v]),M=l((function(){return ie({headers:b,hiddenColumns:v})}),[b,v]),S={centerHeaderRef:p,flattenedRows:t,headerContainerRef:w,isWidthDragging:i,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,setFlattenedRows:a,setScrollTop:c,visibleRows:s};return e("div",g({className:"st-content",style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[n(oe,g({},{centerHeaderRef:p,headerContainerRef:w,headersRef:f,hiddenColumns:v,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,sort:d})),n(Q,g({},S))]}))},le=function(e){var n=e.callback,r=e.ref,t=e.widthAttribute;a((function(){var e=r.current;if(e){var o=function(){n(e[t]||0)};o();var i=new ResizeObserver((function(){o()}));return i.observe(e),function(){return i.disconnect()}}}),[n,r,t])},ce=function(r){var i,l,c=r.mainBodyRef,d=r.pinnedLeftRef,s=r.pinnedRightRef,u=r.tableContentWidth,h=t(0),f=h[0],v=h[1],w=t(0),m=w[0],p=w[1],C=t(0),I=C[0],x=C[1],b=t(!1),R=b[0],y=b[1],M=o(null);return le({widthAttribute:"offsetWidth",callback:v,ref:d}),le({widthAttribute:"offsetWidth",callback:p,ref:s}),Z(c,M),a((function(){setTimeout((function(){!function(){if(c.current){var e=c.current.scrollWidth,n=c.current.clientWidth;x(e),y(e>n)}}()}),1)}),[c]),R?e("div",g({className:"st-horizontal-scrollbar-container",style:{width:u}},{children:[f>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:f,height:null===(i=M.current)||void 0===i?void 0:i.offsetHeight}}),I>0&&n("div",g({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&c.current&&c.current.scrollTo({left:n,behavior:"auto"})},ref:M},{children:n("div",{style:{width:I,height:".3px"}})})),m>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:m,height:null===(l=M.current)||void 0===l?void 0:l.offsetHeight}})]})):null},de={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return de.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?de.string(e,n,r):"number"==typeof e&&"number"==typeof n?de.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?de.boolean(e,n,r):de.string(String(e),String(n),r)}},se=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return de.number(i,a,t)}return"date"===r?de.date(String(e),String(n),t):"boolean"===r?de.boolean(Boolean(e),Boolean(n),t):"enum"===r?de.enum(String(e),String(n),t):de.string(String(e),String(n),t)},ue=function(e,n,r){var t,o=(null===(t=n.key)||void 0===t?void 0:t.type)||"string",i=n.direction,a=new Map,l=new Map,c="";e.forEach((function(e){var r;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var t=(e.rowData.sector||"group_".concat(a.size)).toString();c=t,l.set(c,e),a.has(c)||a.set(c,[])}else if(c){var o=a.get(c)||[];o.push(e),a.set(c,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var d=[];return a.forEach((function(e,t){if(l.has(t)){var a=l.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=he(a.rowMeta.children,n,r)),d.push(a)}var c=p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return se(a,l,o,i)}));d.push.apply(d,c.map((function(e){var t=g({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=he(t.rowMeta.children,n,r);t.rowMeta=g(g({},t.rowMeta),{children:o})}return t})))})),d},he=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return se(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:he(e.rowMeta.children,n,r)})}):e}))},fe=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],c=l((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),d=t(c),s=d[0],u=d[1],h=l((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:ue(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,r){var t=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===r)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(n);o&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},ve=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,c=t(i),d=c[0],s=c[1];return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:d,className:"st-checkbox-input",onChange:function(){var e=!d;s(e),l&&l(e)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(d?"st-checked":"")},{children:d&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},ge=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var i=e.setHiddenColumns,a=e.hiddenColumns,l="left"===o?"left":"";return n("div",g({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",g({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(ve,g({checked:a[e.accessor],onChange:function(n){var r;return i(g(g({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},we=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,c=r.position,d=void 0===c?"right":c,s=r.setHiddenColumns,u=r.hiddenColumns,h=t(a),f=h[0],v=h[1];return i?e("div",g({className:"st-column-editor ".concat(f?"open":""," ").concat(d),onClick:function(){return function(e){v(e)}(!f)}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(ge,{headers:l,open:f,position:d,setOpen:v,setHiddenColumns:s,hiddenColumns:u})]})):null},me=function(e){var r=t(!1),o=r[0],i=r[1];return a((function(){i(!0)}),[]),o?n(pe,g({},e)):null},pe=function(r){var c=r.allowAnimations,d=void 0!==c&&c,s=r.cellUpdateFlash,h=void 0!==s&&s,v=r.collapseIcon,w=void 0===v?n(y,{className:"st-sort-icon"}):v,m=r.columnEditorPosition,p=void 0===m?"right":m,M=r.columnEditorText,S=void 0===M?"Columns":M,E=r.columnReordering,D=void 0!==E&&E,k=r.columnResizing,N=void 0!==k&&k,T=r.defaultHeaders,L=r.editColumns,O=void 0!==L&&L,W=r.editColumnsInitOpen,B=void 0!==W&&W,P=r.expandIcon,F=void 0===P?n(b,{className:"st-sort-icon"}):P,A=r.height,z=r.hideFooter,U=void 0!==z&&z,J=r.nextIcon,V=void 0===J?n(b,{className:"st-next-prev-icon"}):J,K=r.onCellEdit,X=r.onColumnOrderChange,q=r.onGridReady,Y=r.onNextPage,G=r.prevIcon,$=void 0===G?n(x,{className:"st-next-prev-icon"}):G,_=r.rowHeight,Q=void 0===_?40:_,Z=r.rows,ee=r.rowsPerPage,ne=void 0===ee?10:ee,re=r.selectableCells,te=void 0!==re&&re,oe=r.selectableColumns,ie=void 0!==oe&&oe,le=r.shouldPaginate,de=void 0!==le&&le,se=r.sortDownIcon,ue=void 0===se?n(y,{className:"st-sort-icon"}):se,he=r.sortUpIcon,ve=void 0===he?n(R,{className:"st-sort-icon"}):he,ge=r.tableRef,me=r.theme,pe=void 0===me?"light":me,Ce=r.totalPages,Ie=o(null),xe=o(T),be=o(null),Re=o(null),ye=o(null),Me=o(null),Se=o(null),Ee=t(!1),De=Ee[0],He=Ee[1],ke=t(1),Ne=ke[0],Te=ke[1],Le=t(0),Oe=Le[0],We=Le[1],Be=t(0),Pe=Be[0],Fe=Be[1],Ae=t(0),ze=Ae[0],je=Ae[1],Ue=fe({headers:xe.current,tableRows:Z}),Je=Ue.sort,Ve=Ue.sortedRows,Ke=Ue.hiddenColumns,Xe=Ue.setHiddenColumns,qe=Ue.updateSort;a((function(){null==q||q()}),[q]);var Ye=l((function(){if(!de)return Ve;var e=(Ne-1)*ne,n=e+ne;return Ve.slice(e,n)}),[Ne,ne,de,Ve]),Ge=t(Ye),$e=Ge[0],_e=Ge[1];a((function(){_e(Ye)}),[Ye]);var Qe=l((function(){var e;if(!A)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),r=0;if(A.endsWith("px"))r=parseInt(A,10);else if(A.endsWith("vh")){var t=parseInt(A,10);r=window.innerHeight*t/100}else if(A.endsWith("%")){var o=parseInt(A,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-Q)}),[A,Q]),Ze=l((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=[],c=0,d=Math.max(0,i-a*n),s=i+r+a*n,u=function(e,n){for(var r,t=0,o=e;t<o.length;t++){var i=o[t],h=c*a;if(h>=s)break;h+a>d&&l.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(r=i.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(t,0),l}({bufferRowCount:5,contentHeight:Qe,flattenedRows:$e,rowHeight:Q,scrollTop:ze})}),[Qe,Q,$e,ze]),en=f((function(e){return e+1}),0)[1],nn=function(e){var n=e.selectableCells,r=e.headers,c=e.visibleRows,d=t(new Set),s=d[0],u=d[1],h=t(new Set),f=h[0],v=h[1],g=t(null),w=g[0],m=g[1],p=t(null),I=p[0],x=p[1],b=o(!1),R=o(null),y=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=c[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,c]),M=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),l=t;l<=o;l++)for(var d=i;d<=a;d++)if(l>=0&&l<c.length){var s=c[l].row.rowMeta.rowId;r.add(C({colIndex:d,rowIndex:l,rowId:s}))}v(new Set),m(null),u(r)}),[c,v,m,u]),S=i((function(e){if(e.rowIndex>=0&&e.rowIndex<c.length&&e.colIndex>=0&&e.colIndex<r.length){var n=C(e);v(new Set),m(null),u(new Set([n])),x(e)}}),[r.length,c.length,v,m,u,x]),E=i((function(e,n){void 0===n&&(n=!1),u(new Set),x(null),v((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&m(e[e.length-1])}),[u,x,v,m]);a((function(){var e=function(e){if(n&&I){var t=I.rowIndex,o=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(c[t].row.rowMeta.rowId!==i){var a=c.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var l={rowIndex:t-1,colIndex:o,rowId:c[t-1].row.rowMeta.rowId};S(l)}}else"ArrowDown"===e.key?(e.preventDefault(),t<c.length-1&&(l={rowIndex:t+1,colIndex:o,rowId:c[t+1].row.rowMeta.rowId},S(l))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(l={rowIndex:t,colIndex:o-1,rowId:c[t].row.rowMeta.rowId},S(l))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(l={rowIndex:t,colIndex:o+1,rowId:c[t].row.rowMeta.rowId},S(l))):"Escape"===e.key&&(u(new Set),v(new Set),m(null),R.current=null,x(null))}else y()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[y,r.length,I,M,S,n,c]);var D=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=C({colIndex:n,rowIndex:r,rowId:t}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),H=i((function(e){var n,r,t,o,i,a,l=e.colIndex,d=e.rowIndex,s=e.rowId,u=[],h=null===(t=null===(r=null===(n=c[d-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:l,rowIndex:d+1,rowId:null===(a=null===(i=null===(o=c[d+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},g={colIndex:l-1,rowIndex:d,rowId:s},w={colIndex:l+1,rowIndex:d,rowId:s};return(!D({colIndex:l,rowIndex:d-1,rowId:h})||f.has(l)&&0===d)&&u.push("st-selected-top-border"),(!D(v)||f.has(l)&&d===c.length-1)&&u.push("st-selected-bottom-border"),D(g)||u.push("st-selected-left-border"),D(w)||u.push("st-selected-right-border"),u.join(" ")}),[D,c,f]),k=l((function(){return I?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===I.rowIndex&&r===I.colIndex&&t===I.rowId}:function(){return!1}}),[I]);return{getBorderClass:H,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){b.current=!0,R.current={rowIndex:t,colIndex:r,rowId:o},v(new Set),m(null);var i=C({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),x({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&b.current&&R.current){for(var o=new Set,i=Math.min(R.current.rowIndex,t),a=Math.max(R.current.rowIndex,t),l=Math.min(R.current.colIndex,r),d=Math.max(R.current.colIndex,r),s=i;s<=a;s++)for(var h=l;h<=d;h++)if(s>=0&&s<c.length){var f=c[s].row.rowMeta.rowId;o.add(C({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){b.current=!1},isInitialFocusedCell:k,isSelected:D,lastSelectedColumnIndex:w,selectColumns:E,selectedCells:s,selectedColumns:f,setInitialFocusedCell:x,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:te,headers:xe.current,visibleRows:Ze}),rn=nn.handleMouseDown,tn=nn.handleMouseOver,on=nn.handleMouseUp,an=nn.isSelected,ln=nn.getBorderClass,cn=nn.isInitialFocusedCell,dn=nn.setSelectedCells,sn=nn.setSelectedColumns,un=nn.selectColumns,hn=nn.setInitialFocusedCell,fn=i((function(e,n){qe(e,n)}),[qe]),vn=i((function(e){xe.current=e,en()}),[]);a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(dn(new Set),ie&&sn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,dn,sn]),u((function(){if(Se.current){var e=Se.current.offsetWidth-Se.current.clientWidth,n=Se.current.clientWidth;We(e),Fe(n)}}),[]),u((function(){var e=function(){if(en(),Se.current){var e=Se.current.offsetWidth-Se.current.clientWidth,n=Se.current.clientWidth;We(e),Fe(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var gn=o(new Map);return a((function(){ge&&(ge.current={updateData:function(e){var n,r,t,o,i=e.accessor,a=e.rowIndex,l=e.newValue,c=null===(r=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===r?void 0:r.rowId;if(void 0!==c){var d=H({rowId:c,accessor:i}),s=gn.current.get(d);s&&s.updateContent(l),void 0!==(null===(o=null===(t=null==Z?void 0:Z[a])||void 0===t?void 0:t.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=l)}}})}),[ge,Z]),n(j,g({value:{allowAnimations:d,cellUpdateFlash:h,collapseIcon:w,columnReordering:D,columnResizing:N,draggedHeaderRef:Ie,editColumns:O,expandIcon:F,forceUpdate:en,getBorderClass:ln,handleMouseDown:rn,handleMouseOver:tn,headersRef:xe,hiddenColumns:Ke,hoveredHeaderRef:be,isInitialFocusedCell:cn,isSelected:an,mainBodyRef:Re,onCellEdit:K,onColumnOrderChange:X,onSort:fn,onTableHeaderDragEnd:vn,pinnedLeftRef:ye,pinnedRightRef:Me,rowHeight:Q,scrollbarWidth:Oe,selectColumns:un,selectableColumns:ie,setInitialFocusedCell:hn,setIsWidthDragging:He,setSelectedCells:dn,setSelectedColumns:sn,shouldPaginate:de,sortDownIcon:ue,sortUpIcon:ve,tableBodyContainerRef:Se,cellRegistry:gn.current}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(pe),style:A?{height:A}:{}},{children:[e("div",g({className:"st-wrapper-container"},{children:[e("div",g({className:"st-content-wrapper",onMouseUp:on,onMouseLeave:on},{children:[n(ae,{flattenedRows:$e,isWidthDragging:De,setFlattenedRows:_e,setScrollTop:je,sort:Je,visibleRows:Ze}),n(we,{columnEditorText:S,editColumns:O,editColumnsInitOpen:B,headers:xe.current,hiddenColumns:Ke,position:p,setHiddenColumns:Xe})]})),n(ce,{mainBodyRef:Re,pinnedLeftRef:ye,pinnedRightRef:Me,tableContentWidth:Pe})]})),n(I,{currentPage:Ne,hideFooter:U,nextIcon:V,onPageChange:Te,onNextPage:Y,prevIcon:$,shouldPaginate:de,totalPages:Ce||Math.ceil(Ve.length/ne)})]}))}))};export{me as SimpleTable};
1
+ import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as l,createContext as c,useContext as d,forwardRef as s,useLayoutEffect as u,Fragment as f,useReducer as h,createRef as v}from"react";var g=function(){return g=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},g.apply(this,arguments)};function w(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function l(e){try{c(t.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,l)}c((t=t.apply(e,n||[])).next())}))}function m(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&l[0]?t.return:l[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,l[1])).done)return o;switch(t=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,t=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],t=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function p(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},I=function(r){var o=r.currentPage,i=r.hideFooter,a=r.nextIcon,l=r.onPageChange,c=r.onNextPage,d=r.prevIcon,s=r.shouldPaginate,u=r.totalPages,f=t(!0),h=f[0],v=f[1],p=!(o>1),C=!(o<u)&&!c||!h&&o===u;return i||!s?null:e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){var e=o-1;e>=1&&l(e)},disabled:p},{children:d})),n("button",g({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,(function(){var e,n;return m(this,(function(r){switch(r.label){case 0:return e=o===u,n=o+1,c&&e?[4,c(o)]:[3,2];case 1:if(!r.sent())return v(!1),[2];r.label=2;case 2:return(n<=u||c)&&l(n),[2]}}))}))},disabled:C},{children:a})),Array.from({length:u},(function(e,r){return n("button",g({onClick:function(){var e;(e=r+1)>=1&&e<=u&&l(e)},className:"st-page-btn ".concat(o===r+1?"active":"")},{children:r+1}),r)}))]}))},x=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},b=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},R=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},y=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},M=function(e){return e.position*(e.rowHeight+1)-1},E=function(e){return e.position*(e.rowHeight+1)},S=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},H=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},D=function(e){var n=e.rowId,r=e.accessor;return"".concat(n,"-").concat(r)},k=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",g({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",g({value:"true"},{children:"True"})),n("option",g({value:"false"},{children:"False"}))]}))},N=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},T=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},L=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},l=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(N,{defaultValue:i,onBlur:l,onChange:a}):"boolean"==typeof i?n(k,{onBlur:l,onChange:a,value:i}):"number"==typeof i?n(T,{defaultValue:i,onBlur:l,onChange:a}):null})},O=0,W=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===O||o-O>=t)&&(O=o,n(r))}},B=Date.now(),P={screenX:0,screenY:0},F=function(e,n,r){void 0===r&&(r=[]);for(var t=0;t<e.length;t++){var o=e[t];if(o.accessor===n)return p(p([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=F(o.children,n,p(p([],r,!0),[t],!1));if(i)return i}}return null};var A=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,l=e.hoveredHeaderRef,c=e.onColumnOrderChange,d=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){JSON.stringify(r.current)!==JSON.stringify(n)&&(r.current=n)}),[n]),r.current);return{handleDragStart:function(e){t.current=e,B=Date.now()},handleDragOver:function(e){var n,r,o=e.event,a=e.hoveredHeader;if(o.preventDefault(),i.current){var c=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=o.screenX,f=o.screenY,h=Math.sqrt(Math.pow(u-P.screenX,2)+Math.pow(f-P.screenY,2));l.current=a;var v=i.current,g=F(v,(null===(n=t.current)||void 0===n?void 0:n.accessor)||""),w=F(v,a.accessor);if(g&&w){var m=g.length,p=w.length,C=w;if(m!==p){var I=p-m;I>0&&(C=w.slice(0,-I))}var x=function(e,n,r){var t=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;i<n.length-1;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var l=i(t,n);return a(t,n,i(t,r)),a(t,r,l),{newHeaders:t,emergencyBreak:o}}(v,g,C),b=x.newHeaders,R=x.emergencyBreak;if(!(c||a.accessor===(null===(r=t.current)||void 0===r?void 0:r.accessor)||null===t.current||h<10||0===g.length||0===C.length||JSON.stringify(b)===JSON.stringify(i.current)||R)){var y=Date.now();JSON.stringify(b)===JSON.stringify(s)&&(y-B<1500||h<40)||(B=y,P={screenX:u,screenY:f},d(b))}}}},handleDragEnd:function(){t.current=null,l.current=null,null==c||c(i.current)}}},z=c(void 0),j=function(e){var r=e.children,t=e.value;return n(z.Provider,g({value:t},{children:r}))},U=function(){var e=d(z);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},J=s((function(r,l){var c,d,s=r.borderClass,u=r.colIndex,f=r.header,h=r.isHighlighted,v=r.isInitialFocused,w=r.onExpandRowClick,m=r.rowIndex,p=r.visibleRow,C=U(),I=C.cellRegistry,x=C.cellUpdateFlash,b=C.collapseIcon,R=C.draggedHeaderRef,y=C.expandIcon,M=C.handleMouseDown,E=C.handleMouseOver,H=C.headersRef,k=C.hoveredHeaderRef,N=C.onCellEdit,T=C.onTableHeaderDragEnd,O=p.depth,B=p.row,P=t(B.rowData[f.accessor]),F=P[0],z=P[1],j=t(!1),J=j[0],V=j[1],K=t(!1),X=K[0],q=K[1],G=o(null),Y=A({draggedHeaderRef:R,headersRef:H,hoveredHeaderRef:k,onTableHeaderDragEnd:T}).handleDragOver,$=W(),_="cell-".concat(m,"-").concat(u),Q=D({rowId:B.rowMeta.rowId,accessor:f.accessor});a((function(){if(I){var e="".concat(B.rowMeta.rowId,"-").concat(f.accessor);return I.set(e,{updateContent:function(e){F!==e?(z(e),x&&(q(!0),G.current&&clearTimeout(G.current),G.current=setTimeout((function(){q(!1)}),800))):z(e)}}),function(){I.delete(e),G.current&&clearTimeout(G.current)}}}),[I,x,B.rowMeta.rowId,f.accessor,F]),a((function(){if(X){var e=setTimeout((function(){q(!1)}),850);return function(){return clearTimeout(e)}}}),[X]),a((function(){z(B.rowData[f.accessor])}),[B.rowData,f.accessor]);var Z=Boolean(null===(d=null===(c=B.rowMeta)||void 0===c?void 0:c.children)||void 0===d?void 0:d.length),ee=Boolean(null==f?void 0:f.isEditable),ne="st-cell ".concat(O>0&&f.expandable?"st-cell-depth-".concat(O):""," ").concat(h?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(ee?"clickable":""," ").concat(X?"st-cell-updating":""),re=i((function(e){z(e),null==N||N({accessor:f.accessor,newValue:e,row:B})}),[f.accessor,N,B]);return J?n("div",g({className:"st-cell-editing",id:S({accessor:f.accessor,rowIndex:m+1})},{children:n(L,{onChange:re,setIsEditing:V,value:F})})):e("div",g({className:ne,id:_,onDoubleClick:function(){return f.isEditable&&V(!0)},onMouseDown:function(){return M({rowIndex:m,colIndex:u,rowId:B.rowMeta.rowId})},onMouseOver:function(){return E({rowIndex:m,colIndex:u,rowId:B.rowMeta.rowId})},onDragOver:function(e){return $({callback:Y,callbackProps:{event:e,hoveredHeader:f},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!f.isEditable||J||(e.preventDefault(),V(!0))},ref:l,"data-row-index":m,"data-col-index":u,"data-row-id":B.rowMeta.rowId,"data-accessor":f.accessor},{children:[f.expandable&&Z?B.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return w(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):n("div",g({className:"st-sort-icon-container",onClick:function(){return w(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,n("span",g({className:"st-cell-content ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"")},{children:f.cellRenderer?f.cellRenderer({accessor:f.accessor,colIndex:u,row:B}):F}))]}),Q)})),V=function(e){var t=e.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(e,["children"]);return U().allowAnimations?n(K,g({},o,{children:t})):n(r,{children:t})},K=function(e){var i=e.children,l=e.isBody,c=e.pauseAnimation,d=e.rowIndex,s=o(!1),f=U(),h=f.draggedHeaderRef,v=f.headersRef,g=f.mainBodyRef,w=f.shouldPaginate,m=t({}),p=m[0],C=m[1],I=o({}),x=v.current;return u((function(){if(x){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(S({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:x,draggedHeaderRef:h,rowIndex:d});JSON.stringify(e)!==JSON.stringify(p)&&(I.current=p,C(e))}}),[p,x,h,l,d]),u((function(){var e=g.current,n=function(){s.current=!0},r=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[h,g]),a((function(){c||s.current||Object.keys(I.current).length&&x&&x.forEach((function(e){var n=document.getElementById(S({accessor:e.accessor,rowIndex:d}));if(n){var r=I.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=w?0:r.top-t.top,a=Math.abs(o),l=Math.abs(i);(a>10||l>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[p,x,l,c,I,d,w]),n(r,{children:i})},X=function(e){var r=e.columnIndices,t=e.headers,o=e.hiddenColumns,i=e.isWidthDragging,a=e.onExpandRowClick,l=e.pinned,c=e.rowIndex,d=e.rowIndices,s=e.visibleRow,u=t.filter((function(e){return H({hiddenColumns:o,header:e,pinned:l})}));return n(V,g({isBody:!0,pauseAnimation:i,rowIndex:c+1},{children:u.map((function(e){return n(q,{columnIndices:r,header:e,headers:t,hiddenColumns:o,onExpandRowClick:a,pinned:l,rowIndex:c,rowIndices:d,visibleRow:s},S({accessor:e.accessor,rowIndex:c+1}))}))}))},q=function(e){var r=e.columnIndices,t=e.header,o=e.headers,i=e.hiddenColumns,a=e.onExpandRowClick,l=e.pinned,c=e.rowIndex,d=e.rowIndices,s=e.visibleRow,u=r[t.accessor],h=U(),v=h.getBorderClass,g=h.isSelected,w=h.isInitialFocusedCell;if(t.children){var m=t.children.filter((function(e){return H({hiddenColumns:i,header:e,pinned:l})}));return n(f,{children:m.map((function(e){return n(q,{columnIndices:r,header:e,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:l,rowIndex:c,rowIndices:d,visibleRow:s},S({accessor:e.accessor,rowIndex:c+1}))}))})}var p={rowIndex:c,colIndex:u,rowId:s.row.rowMeta.rowId},C=v(p),I=g(p),x=w(p);return n(J,{borderClass:C,colIndex:u,header:t,isHighlighted:I,isInitialFocused:x,onExpandRowClick:a,rowIndex:c,visibleRow:s},S({accessor:t.accessor,rowIndex:c+1}))},G=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.headers,i=e.hiddenColumns,a=e.index,l=e.isWidthDragging,c=e.onExpandRowClick,d=e.pinned,s=e.rowHeight,u=e.rowIndices,f=e.visibleRow,h=f.position;return n("div",g({className:"st-row ".concat(h%2==0?"even":"odd"),style:{gridTemplateColumns:t,top:E({position:h,rowHeight:s}),height:"".concat(s,"px")}},{children:n(X,{columnIndices:r,headers:o,hiddenColumns:i,isWidthDragging:l,onExpandRowClick:c,pinned:d,rowIndex:a,rowIndices:u,visibleRow:f},a)}))},Y=function(e){var r=e.displayStrongBorder,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",g({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:M({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},$=function(r){var t=r.columnIndices,o=r.headers,i=r.hiddenColumns,a=r.isWidthDragging,l=r.onExpandRowClick,c=r.pinned,d=r.rowHeight,s=r.rowIndices,u=r.sectionRef,h=r.templateColumns,v=r.totalHeight,w=r.visibleRows,m=r.width,p=c?"st-body-pinned-".concat(c):"st-body-main";return n("div",g({className:p,ref:u,style:{position:"relative",height:"".concat(v,"px"),width:m}},{children:w.map((function(r,u){var v,g,m,p,C=Boolean(null===(g=null===(v=r.row.rowMeta)||void 0===v?void 0:v.children)||void 0===g?void 0:g.length),I=null===(p=null===(m=w[u-1])||void 0===m?void 0:m.row.rowMeta)||void 0===p?void 0:p.isExpanded;return e(f,{children:[n(G,{columnIndices:t,gridTemplateColumns:h,headers:o,hiddenColumns:i,index:u,isWidthDragging:a,onExpandRowClick:l,pinned:c,rowHeight:d,rowIndices:s,visibleRow:r}),0!==u&&n(Y,{displayStrongBorder:C&&I,position:r.position,rowHeight:d,templateColumns:h})]},r.position)}))}))};function _(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return H({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&H({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var Q=function(r){var i=r.centerHeaderRef,c=r.flattenedRows,d=r.headerContainerRef,s=r.isWidthDragging,u=r.mainTemplateColumns,f=r.pinnedLeftColumns,h=r.pinnedLeftHeaderRef,v=r.pinnedLeftTemplateColumns,w=r.pinnedRightColumns,m=r.pinnedRightHeaderRef,p=r.pinnedRightTemplateColumns,C=r.setFlattenedRows,I=r.setScrollTop,x=r.visibleRows,b=U(),R=b.rowHeight,y=b.scrollbarWidth,M=b.mainBodyRef,E=b.pinnedLeftRef,S=b.pinnedRightRef,H=b.tableBodyContainerRef,D=b.hiddenColumns,k=b.headersRef,N=t(0),T=N[0],L=N[1],O=t(void 0),W=O[0],B=O[1],P=t(0),F=P[0],A=P[1];a((function(){var e=function(){var e,n,r;L((null===(e=h.current)||void 0===e?void 0:e.clientWidth)?h.current.clientWidth+1:0),B(null===(n=i.current)||void 0===n?void 0:n.clientWidth),A((null===(r=m.current)||void 0===r?void 0:r.clientWidth)?m.current.clientWidth+1:0)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[h,i,m,s]),function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),l=i[0],c=i[1];a((function(){var e=null==n?void 0:n.current;if(l&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,l,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:d,mainSectionRef:H,scrollbarWidth:y});var z,j,J=o(null),V=(z=0,(j=function(e){e.forEach((function(e){z+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&j(e.rowMeta.children)}))})(c),z)*(R+1)-1,K=l((function(){return _({headersRef:k,hiddenColumns:D,pinnedLeftColumns:f,pinnedRightColumns:w})}),[k,D,f,w]),X=l((function(){var e={};return x.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[x]),q=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};C((function(e){return e.map(n)}))},G={headerContainerRef:d,headers:k.current,hiddenColumns:D,isWidthDragging:s,rowHeight:R,visibleRows:x,columnIndices:K,rowIndices:X};return e("div",g({className:"st-body-container",ref:H,onScroll:function(e){var n=e.currentTarget.scrollTop;J.current&&cancelAnimationFrame(J.current),J.current=requestAnimationFrame((function(){I(n)}))}},{children:[f.length>0&&n($,g({},G,{onExpandRowClick:q,pinned:"left",sectionRef:E,templateColumns:v,totalHeight:V,width:T})),n($,g({},G,{onExpandRowClick:q,sectionRef:M,templateColumns:u,totalHeight:V,width:W})),w.length>0&&n($,g({},G,{onExpandRowClick:q,pinned:"right",sectionRef:S,templateColumns:p,totalHeight:V,width:F}))]}))},Z=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},ee=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.headersRef,i=e.gridColumnEnd,a=e.gridColumnStart,l=e.setIsWidthDragging,c=e.startWidth;l(!0),n.preventDefault();var d=n.clientX;if(t){var s="number"==typeof t.minWidth?t.minWidth:40,u=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return u(e)})):[e]},f=i-a>1,h=f?u(t):[t],v=function(e){var n="right"===t.pinned?d-e.clientX:e.clientX-d;if(f&&h.length>1){var i=h.reduce((function(e,n){return Math.min(e,"number"==typeof n.minWidth?n.minWidth:40)}),40),a=h.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),l=Math.max(c+n,i)-a;h.forEach((function(e){var n="number"==typeof e.width?e.width:150,r=l*(n/a),t=Math.max(n+r,s);e.width=t}))}else{var u=Math.max(c+n,s);t.width=u}var v=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(S({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){v(e)}))};o.current.forEach((function(e){v(e)})),r()},g=function(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",g),l(!1)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",g)}},ne=s((function(r,t){var o,i,l=r.colIndex,c=r.forceHeadersUpdate,d=r.gridColumnEnd,s=r.gridColumnStart,u=r.gridRowEnd,f=r.gridRowStart,h=r.header,v=r.reverse,w=r.sort,m=U(),C=m.columnReordering,I=m.columnResizing,x=m.draggedHeaderRef,b=m.forceUpdate,R=m.headersRef,y=m.hoveredHeaderRef,M=m.onColumnOrderChange,E=m.onSort,H=m.onTableHeaderDragEnd,D=m.rowHeight,k=m.selectColumns,N=m.selectableColumns,T=m.setInitialFocusedCell,L=m.setIsWidthDragging,O=m.setSelectedCells,B=m.setSelectedColumns,P=m.sortDownIcon,F=m.sortUpIcon,z=Boolean(null==h?void 0:h.isSortable),j="st-header-cell ".concat(h.accessor===(null===(o=y.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=x.current)||void 0===i?void 0:i.accessor)===h.accessor?"st-dragging":""," ").concat(z?"clickable":""," ").concat(C&&!z?"columnReordering":""," ").concat("right"===(null==h?void 0:h.align)?"right-aligned":"center"===(null==h?void 0:h.align)?"center-aligned":""),J=A({draggedHeaderRef:x,headersRef:R,hoveredHeaderRef:y,onColumnOrderChange:M,onTableHeaderDragEnd:H}),V=J.handleDragStart,K=J.handleDragEnd,X=J.handleDragOver,q=W(),G=function(e){var n=e.event,r=e.header;if(N){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,l);return n.shiftKey&&k?B((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],i=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<i&&(i=r,o=e)}));var a,l,c,d,s=p(p([],(a=o,l=n,c=Math.min(a,l),d=Math.max(a,l),Array.from({length:d-c+1},(function(e,n){return c+n}))),!0),t,!0);return new Set(p(p([],Array.from(e),!0),s,!0))})):k&&k(t),O(new Set),void T(null)}r.isSortable&&E(l,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!h)return null;var Y=I&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;q({callback:ee,callbackProps:{event:e.nativeEvent,forceUpdate:b,header:h,headersRef:R,gridColumnEnd:d,gridColumnStart:s,setIsWidthDragging:L,startWidth:"object"==typeof t&&null!==t&&"current"in t?null===(n=t.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),$=w&&w.key.accessor===h.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return G({event:e,header:h})}},{children:["ascending"===w.direction&&F&&F,"descending"===w.direction&&P&&P]}));return e("div",g({className:j,id:S({accessor:h.accessor,rowIndex:0}),onDragOver:function(e){q({callback:X,callbackProps:{event:e,hoveredHeader:h},limit:50})},ref:t,style:g(g({gridRowStart:f,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:d},d-s>1?{}:{width:h.width}),u-f>1?{}:{height:D})},{children:[v&&Y,e("div",g({className:"st-header-label ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":""),draggable:C&&!h.disableReorder,onClick:function(e){return G({event:e,header:h})},onDragEnd:function(e){e.preventDefault(),K(),c()},onDragStart:function(e){C&&h&&function(e){V(e)}(h)}},{children:["right"===h.align&&$,null==h?void 0:h.label,"right"!==h.align&&$]})),!v&&Y]}))})),re=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.handleScroll,i=e.headersRef,a=e.hiddenColumns,c=e.maxDepth,d=e.pinned,s=e.sectionRef,u=e.sort,f=h((function(e){return e+1}),0)[1],w=l((function(){var e=[],n=1,t=function(o,i,l){var s,u;if(void 0===l&&(l=!1),!H({hiddenColumns:a,header:o,pinned:d}))return 0;l||n++;var f=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return H({hiddenColumns:a,header:e,pinned:d})})).length)&&void 0!==u?u:0,h=n,v=f>0?h+f:h+1,g=i,w=f>0?i+1:c+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:v,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children){var m=!0;o.children.forEach((function(e){H({hiddenColumns:a,header:e,pinned:d})&&(t(e,i+1,m),m=!1)}))}return v-h},o=i.current.filter((function(e){return H({hiddenColumns:a,header:e,pinned:d})})),l=!0;return o.forEach((function(e){t(e,1,l),l=!1})),e}),[i,a,c,d,r]);return n("div",g({className:"st-header-".concat(d?"pinned-".concat(d):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:t,display:"grid",position:"relative"}},{children:n(V,g({rowIndex:0},{children:w.map((function(e){return n(ne,{colIndex:e.colIndex,forceHeadersUpdate:f,gridColumnEnd:e.gridColumnEnd,gridColumnStart:e.gridColumnStart,gridRowEnd:e.gridRowEnd,gridRowStart:e.gridRowStart,header:e.header,ref:v(),reverse:"right"===d,sort:u},e.header.accessor)}))}))}))},te=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(te)):1},oe=function(r){var t=r.centerHeaderRef,o=r.headerContainerRef,i=r.headersRef,a=r.hiddenColumns,c=r.mainTemplateColumns,d=r.pinnedLeftColumns,s=r.pinnedLeftHeaderRef,u=r.pinnedLeftTemplateColumns,f=r.pinnedRightColumns,h=r.pinnedRightHeaderRef,v=r.pinnedRightTemplateColumns,w=r.sort,m=U().mainBodyRef;Z(m,t);var p=l((function(){return _({headersRef:i,hiddenColumns:a,pinnedLeftColumns:d,pinnedRightColumns:f})}),[i,a,d,f]),C=l((function(){var e=i.current,n=0;return e.forEach((function(e){if(H({hiddenColumns:a,header:e})){var r=te(e);n=Math.max(n,r)}})),{maxDepth:n}}),[i,a]).maxDepth;return e("div",g({className:"st-header-container",ref:o},{children:[d.length>0&&n(re,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"left",sectionRef:s,sort:w}),n(re,{columnIndices:p,gridTemplateColumns:c,handleScroll:function(e){var n,r,o=null===(n=t.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(r=m.current)||void 0===r||r.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:C,sectionRef:t,sort:w}),f.length>0&&n(re,{columnIndices:p,gridTemplateColumns:v,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:C,pinned:"right",sectionRef:h,sort:w})]}))},ie=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},ae=function(r){var t=r.flattenedRows,i=r.isWidthDragging,a=r.setFlattenedRows,c=r.setScrollTop,d=r.sort,s=r.visibleRows,u=U(),f=u.editColumns,h=u.headersRef,v=u.hiddenColumns,w=o(null),m=o(null),p=o(null),C=o(null),I=h.current.filter((function(e){return!e.pinned})),x=h.current.filter((function(e){return"left"===e.pinned})),b=h.current.filter((function(e){return"right"===e.pinned})),R=l((function(){return ie({headers:x,hiddenColumns:v})}),[x,v]),y=l((function(){return ie({headers:I,hiddenColumns:v})}),[I,v]),M=l((function(){return ie({headers:b,hiddenColumns:v})}),[b,v]),E={centerHeaderRef:p,flattenedRows:t,headerContainerRef:w,isWidthDragging:i,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,setFlattenedRows:a,setScrollTop:c,visibleRows:s};return e("div",g({className:"st-content",style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[n(oe,g({},{centerHeaderRef:p,headerContainerRef:w,headersRef:h,hiddenColumns:v,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightHeaderRef:C,pinnedRightTemplateColumns:M,sort:d})),n(Q,g({},E))]}))},le=function(e){var n=e.callback,r=e.ref,t=e.widthAttribute;a((function(){var e=r.current;if(e){var o=function(){n(e[t]||0)};o();var i=new ResizeObserver((function(){o()}));return i.observe(e),function(){return i.disconnect()}}}),[n,r,t])},ce=function(r){var i,l,c=r.mainBodyRef,d=r.pinnedLeftRef,s=r.pinnedRightRef,u=r.tableBodyContainerRef,f=U().editColumns,h=t(0),v=h[0],w=h[1],m=t(0),p=m[0],C=m[1],I=t(0),x=I[0],b=I[1],R=t(!1),y=R[0],M=R[1],E=o(null),S=u.current&&u.current.scrollHeight>u.current.clientHeight,H=p+(f?28:0)+(u.current&&S?u.current.offsetWidth-u.current.clientWidth:0)-.6;return le({widthAttribute:"offsetWidth",callback:w,ref:d}),le({widthAttribute:"offsetWidth",callback:C,ref:s}),Z(c,E),a((function(){setTimeout((function(){!function(){if(c.current){var e=c.current.scrollWidth,n=c.current.clientWidth;console.log(e,n),b(e),M(e>n)}}()}),1)}),[c]),y?e("div",g({className:"st-horizontal-scrollbar-container"},{children:[v>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:v,height:null===(i=E.current)||void 0===i?void 0:i.offsetHeight}}),x>0&&n("div",g({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&c.current&&c.current.scrollTo({left:n,behavior:"auto"})},ref:E,style:{flexGrow:1}},{children:n("div",{style:{width:x,height:".3px"}})})),p>0&&n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:H,height:null===(l=E.current)||void 0===l?void 0:l.offsetHeight}})]})):null},de={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return de.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?de.string(e,n,r):"number"==typeof e&&"number"==typeof n?de.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?de.boolean(e,n,r):de.string(String(e),String(n),r)}},se=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return de.number(i,a,t)}return"date"===r?de.date(String(e),String(n),t):"boolean"===r?de.boolean(Boolean(e),Boolean(n),t):"enum"===r?de.enum(String(e),String(n),t):de.string(String(e),String(n),t)},ue=function(e,n,r){var t,o=(null===(t=n.key)||void 0===t?void 0:t.type)||"string",i=n.direction,a=new Map,l=new Map,c="";e.forEach((function(e){var r;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var t=(e.rowData.sector||"group_".concat(a.size)).toString();c=t,l.set(c,e),a.has(c)||a.set(c,[])}else if(c){var o=a.get(c)||[];o.push(e),a.set(c,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var d=[];return a.forEach((function(e,t){if(l.has(t)){var a=l.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=fe(a.rowMeta.children,n,r)),d.push(a)}var c=p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return se(a,l,o,i)}));d.push.apply(d,c.map((function(e){var t=g({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=fe(t.rowMeta.children,n,r);t.rowMeta=g(g({},t.rowMeta),{children:o})}return t})))})),d},fe=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],l=r.rowData[t];return se(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:fe(e.rowMeta.children,n,r)})}):e}))},he=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],c=l((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),d=t(c),s=d[0],u=d[1],f=l((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:ue(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:f,updateSort:function(e,r){var t=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===r)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(n);o&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},ve=function(r){var o=r.checked,i=void 0!==o&&o,a=r.children,l=r.onChange,c=t(i),d=c[0],s=c[1];return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:d,className:"st-checkbox-input",onChange:function(){var e=!d;s(e),l&&l(e)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(d?"st-checked":"")},{children:d&&n("span",{className:"st-checkbox-checkmark"})})),a]}))},ge=function(e){var r=e.headers,t=e.open,o=e.position;e.setOpen;var i=e.setHiddenColumns,a=e.hiddenColumns,l="left"===o?"left":"";return n("div",g({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:n("div",g({className:"st-column-editor-popout-content"},{children:r.map((function(e,r){return n(ve,g({checked:a[e.accessor],onChange:function(n){var r;return i(g(g({},a),((r={})[e.accessor]=n,r)))}},{children:e.label}),r)}))}))}))},we=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,l=r.headers,c=r.hiddenColumns,d=r.position,s=void 0===d?"right":d,u=r.setHiddenColumns,f=t(a),h=f[0],v=f[1];return i?e("div",g({className:"st-column-editor ".concat(h?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!h)},style:{width:28}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(ge,{headers:l,open:h,position:s,setOpen:v,setHiddenColumns:u,hiddenColumns:c})]})):null},me=function(e){var r=t(!1),o=r[0],i=r[1];return a((function(){i(!0)}),[]),o?n(pe,g({},e)):null},pe=function(r){var c=r.allowAnimations,d=void 0!==c&&c,s=r.cellUpdateFlash,f=void 0!==s&&s,v=r.collapseIcon,w=void 0===v?n(y,{className:"st-sort-icon"}):v,m=r.columnEditorPosition,p=void 0===m?"right":m,M=r.columnEditorText,E=void 0===M?"Columns":M,S=r.columnReordering,H=void 0!==S&&S,k=r.columnResizing,N=void 0!==k&&k,T=r.defaultHeaders,L=r.editColumns,O=void 0!==L&&L,W=r.editColumnsInitOpen,B=void 0!==W&&W,P=r.expandIcon,F=void 0===P?n(b,{className:"st-sort-icon"}):P,A=r.height,z=r.hideFooter,U=void 0!==z&&z,J=r.nextIcon,V=void 0===J?n(b,{className:"st-next-prev-icon"}):J,K=r.onCellEdit,X=r.onColumnOrderChange,q=r.onGridReady,G=r.onNextPage,Y=r.prevIcon,$=void 0===Y?n(x,{className:"st-next-prev-icon"}):Y,_=r.rowHeight,Q=void 0===_?40:_,Z=r.rows,ee=r.rowsPerPage,ne=void 0===ee?10:ee,re=r.selectableCells,te=void 0!==re&&re,oe=r.selectableColumns,ie=void 0!==oe&&oe,le=r.shouldPaginate,de=void 0!==le&&le,se=r.sortDownIcon,ue=void 0===se?n(y,{className:"st-sort-icon"}):se,fe=r.sortUpIcon,ve=void 0===fe?n(R,{className:"st-sort-icon"}):fe,ge=r.tableRef,me=r.theme,pe=void 0===me?"light":me,Ce=o(null),Ie=o(T),xe=o(null),be=o(null),Re=o(null),ye=o(null),Me=o(null),Ee=t(!1),Se=Ee[0],He=Ee[1],De=t(1),ke=De[0],Ne=De[1],Te=t(0),Le=Te[0],Oe=Te[1],We=t(0),Be=We[0],Pe=We[1],Fe=he({headers:Ie.current,tableRows:Z}),Ae=Fe.sort,ze=Fe.sortedRows,je=Fe.hiddenColumns,Ue=Fe.setHiddenColumns,Je=Fe.updateSort;a((function(){null==q||q()}),[q]);var Ve=l((function(){if(!de)return ze;var e=(ke-1)*ne,n=e+ne;return ze.slice(e,n)}),[ke,ne,de,ze]),Ke=t(Ve),Xe=Ke[0],qe=Ke[1];a((function(){qe(Ve)}),[Ve]);var Ge=l((function(){var e;if(!A)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),r=0;if(A.endsWith("px"))r=parseInt(A,10);else if(A.endsWith("vh")){var t=parseInt(A,10);r=window.innerHeight*t/100}else if(A.endsWith("%")){var o=parseInt(A,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-Q)}),[A,Q]),Ye=l((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=[],c=0,d=Math.max(0,i-a*n),s=i+r+a*n,u=function(e,n){for(var r,t=0,o=e;t<o.length;t++){var i=o[t],f=c*a;if(f>=s)break;f+a>d&&l.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(r=i.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(t,0),l}({bufferRowCount:5,contentHeight:Ge,flattenedRows:Xe,rowHeight:Q,scrollTop:Be})}),[Ge,Q,Xe,Be]),$e=h((function(e){return e+1}),0)[1],_e=function(e){var n=e.selectableCells,r=e.headers,c=e.visibleRows,d=t(new Set),s=d[0],u=d[1],f=t(new Set),h=f[0],v=f[1],g=t(null),w=g[0],m=g[1],p=t(null),I=p[0],x=p[1],b=o(!1),R=o(null),y=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=c[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,c]),M=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),l=t;l<=o;l++)for(var d=i;d<=a;d++)if(l>=0&&l<c.length){var s=c[l].row.rowMeta.rowId;r.add(C({colIndex:d,rowIndex:l,rowId:s}))}v(new Set),m(null),u(r)}),[c,v,m,u]),E=i((function(e){if(e.rowIndex>=0&&e.rowIndex<c.length&&e.colIndex>=0&&e.colIndex<r.length){var n=C(e);v(new Set),m(null),u(new Set([n])),x(e)}}),[r.length,c.length,v,m,u,x]),S=i((function(e,n){void 0===n&&(n=!1),u(new Set),x(null),v((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&m(e[e.length-1])}),[u,x,v,m]);a((function(){var e=function(e){if(n&&I){var t=I.rowIndex,o=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(c[t].row.rowMeta.rowId!==i){var a=c.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var l={rowIndex:t-1,colIndex:o,rowId:c[t-1].row.rowMeta.rowId};E(l)}}else"ArrowDown"===e.key?(e.preventDefault(),t<c.length-1&&(l={rowIndex:t+1,colIndex:o,rowId:c[t+1].row.rowMeta.rowId},E(l))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(l={rowIndex:t,colIndex:o-1,rowId:c[t].row.rowMeta.rowId},E(l))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(l={rowIndex:t,colIndex:o+1,rowId:c[t].row.rowMeta.rowId},E(l))):"Escape"===e.key&&(u(new Set),v(new Set),m(null),R.current=null,x(null))}else y()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[y,r.length,I,M,E,n,c]);var H=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=C({colIndex:n,rowIndex:r,rowId:t}),i=s.has(o),a=h.has(n);return i||a}),[s,h]),D=i((function(e){var n,r,t,o,i,a,l=e.colIndex,d=e.rowIndex,s=e.rowId,u=[],f=null===(t=null===(r=null===(n=c[d-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:l,rowIndex:d+1,rowId:null===(a=null===(i=null===(o=c[d+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},g={colIndex:l-1,rowIndex:d,rowId:s},w={colIndex:l+1,rowIndex:d,rowId:s};return(!H({colIndex:l,rowIndex:d-1,rowId:f})||h.has(l)&&0===d)&&u.push("st-selected-top-border"),(!H(v)||h.has(l)&&d===c.length-1)&&u.push("st-selected-bottom-border"),H(g)||u.push("st-selected-left-border"),H(w)||u.push("st-selected-right-border"),u.join(" ")}),[H,c,h]),k=l((function(){return I?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===I.rowIndex&&r===I.colIndex&&t===I.rowId}:function(){return!1}}),[I]);return{getBorderClass:D,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){b.current=!0,R.current={rowIndex:t,colIndex:r,rowId:o},v(new Set),m(null);var i=C({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),x({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&b.current&&R.current){for(var o=new Set,i=Math.min(R.current.rowIndex,t),a=Math.max(R.current.rowIndex,t),l=Math.min(R.current.colIndex,r),d=Math.max(R.current.colIndex,r),s=i;s<=a;s++)for(var f=l;f<=d;f++)if(s>=0&&s<c.length){var h=c[s].row.rowMeta.rowId;o.add(C({colIndex:f,rowIndex:s,rowId:h}))}u(o)}},handleMouseUp:function(){b.current=!1},isInitialFocusedCell:k,isSelected:H,lastSelectedColumnIndex:w,selectColumns:S,selectedCells:s,selectedColumns:h,setInitialFocusedCell:x,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:te,headers:Ie.current,visibleRows:Ye}),Qe=_e.handleMouseDown,Ze=_e.handleMouseOver,en=_e.handleMouseUp,nn=_e.isSelected,rn=_e.getBorderClass,tn=_e.isInitialFocusedCell,on=_e.setSelectedCells,an=_e.setSelectedColumns,ln=_e.selectColumns,cn=_e.setInitialFocusedCell,dn=i((function(e,n){Je(e,n)}),[Je]),sn=i((function(e){Ie.current=e,$e()}),[]);a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(on(new Set),ie&&an(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,on,an]),u((function(){if(Me.current){var e=Me.current.offsetWidth-Me.current.clientWidth;Oe(e)}}),[]),u((function(){var e=function(){if($e(),Me.current){var e=Me.current.offsetWidth-Me.current.clientWidth;Oe(e)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var un=o(new Map);return a((function(){ge&&(ge.current={updateData:function(e){var n,r,t,o,i=e.accessor,a=e.rowIndex,l=e.newValue,c=null===(r=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===r?void 0:r.rowId;if(void 0!==c){var d=D({rowId:c,accessor:i}),s=un.current.get(d);s&&s.updateContent(l),void 0!==(null===(o=null===(t=null==Z?void 0:Z[a])||void 0===t?void 0:t.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=l)}}})}),[ge,Z]),n(j,g({value:{allowAnimations:d,cellUpdateFlash:f,collapseIcon:w,columnReordering:H,columnResizing:N,draggedHeaderRef:Ce,editColumns:O,expandIcon:F,forceUpdate:$e,getBorderClass:rn,handleMouseDown:Qe,handleMouseOver:Ze,headersRef:Ie,hiddenColumns:je,hoveredHeaderRef:xe,isInitialFocusedCell:tn,isSelected:nn,mainBodyRef:be,onCellEdit:K,onColumnOrderChange:X,onSort:dn,onTableHeaderDragEnd:sn,pinnedLeftRef:Re,pinnedRightRef:ye,rowHeight:Q,scrollbarWidth:Le,selectColumns:ln,selectableColumns:ie,setInitialFocusedCell:cn,setIsWidthDragging:He,setSelectedCells:on,setSelectedColumns:an,shouldPaginate:de,sortDownIcon:ue,sortUpIcon:ve,tableBodyContainerRef:Me,cellRegistry:un.current}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(pe),style:A?{height:A}:{}},{children:[e("div",g({className:"st-wrapper-container"},{children:[e("div",g({className:"st-content-wrapper",onMouseUp:en,onMouseLeave:en},{children:[n(ae,{flattenedRows:Xe,isWidthDragging:Se,setFlattenedRows:qe,setScrollTop:Pe,sort:Ae,visibleRows:Ye}),n(we,{columnEditorText:E,editColumns:O,editColumnsInitOpen:B,headers:Ie.current,hiddenColumns:je,position:p,setHiddenColumns:Ue})]})),n(ce,{mainBodyRef:be,pinnedLeftRef:Re,pinnedRightRef:ye,tableBodyContainerRef:Me})]})),n(I,{currentPage:ke,hideFooter:U,nextIcon:V,onPageChange:Ne,onNextPage:G,prevIcon:$,shouldPaginate:de,totalPages:Math.ceil(Z.length/ne)})]}))}))};export{me as SimpleTable};
2
2
  //# sourceMappingURL=index.es.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=function(){return r=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function t(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function l(e){try{c(t.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,l)}c((t=t.apply(e,n||[])).next())}))}function o(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&l[0]?t.return:l[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,l[1])).done)return o;switch(t=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,t=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],t=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function i(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var a=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},l=function(i){var a=i.currentPage,l=i.hideFooter,c=i.nextIcon,s=i.onPageChange,d=i.onNextPage,u=i.prevIcon,f=i.shouldPaginate,h=i.totalPages,v=n.useState(!0),m=v[0],g=v[1],w=!(a>1),p=!(a<h)&&!d||!m&&a===h;return l||!f?null:e.jsxs("div",r({className:"st-footer"},{children:[e.jsx("button",r({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=a-1;e>=1&&s(e)},disabled:w},{children:u})),e.jsx("button",r({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return e=a===h,n=a+1,d&&e?[4,d(a)]:[3,2];case 1:if(!r.sent())return g(!1),[2];r.label=2;case 2:return(n<=h||d)&&s(n),[2]}}))}))},disabled:p},{children:c})),Array.from({length:h},(function(n,t){return e.jsx("button",r({onClick:function(){var e;(e=t+1)>=1&&e<=h&&s(e)},className:"st-page-btn ".concat(a===t+1?"active":"")},{children:t+1}),t)}))]}))},c=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},s=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},d=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},u=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},f=function(e){return e.position*(e.rowHeight+1)-1},h=function(e){return e.position*(e.rowHeight+1)},v=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},m=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},g=function(e){var n=e.rowId,r=e.accessor;return"".concat(n,"-").concat(r)},w=function(n){var t=n.value,o=n.onBlur,i=n.onChange;return e.jsxs("select",r({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[e.jsx("option",r({value:"true"},{children:"True"})),e.jsx("option",r({value:"false"},{children:"False"}))]}))},p=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},x=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},C=function(n){var r=n.onChange,t=n.setIsEditing,o=n.value,i=function(e){null==r||r(e)},a=function(){t(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(p,{defaultValue:o,onBlur:a,onChange:i}):"boolean"==typeof o?e.jsx(w,{onBlur:a,onChange:i,value:o}):"number"==typeof o?e.jsx(x,{defaultValue:o,onBlur:a,onChange:i}):null})},I=0,R=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===I||o-I>=t)&&(I=o,n(r))}},b=Date.now(),y={screenX:0,screenY:0},S=function(e,n,r){void 0===r&&(r=[]);for(var t=0;t<e.length;t++){var o=e[t];if(o.accessor===n)return i(i([],r,!0),[t],!1);if(o.children&&o.children.length>0){var a=S(o.children,n,i(i([],r,!0),[t],!1));if(a)return a}}return null};var M=function(e){var r,t,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,l=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(r=i.current,t=n.useRef(r),n.useEffect((function(){JSON.stringify(t.current)!==JSON.stringify(r)&&(t.current=r)}),[r]),t.current);return{handleDragStart:function(e){o.current=e,b=Date.now()},handleDragOver:function(e){var n,r,t=e.event,l=e.hoveredHeader;if(t.preventDefault(),i.current){var d=t.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=t.screenX,f=t.screenY,h=Math.sqrt(Math.pow(u-y.screenX,2)+Math.pow(f-y.screenY,2));a.current=l;var v=i.current,m=S(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),g=S(v,l.accessor);if(m&&g){var w=m.length,p=g.length,x=g;if(w!==p){var C=p-w;C>0&&(x=g.slice(0,-C))}var I=function(e,n,r){var t=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;i<n.length-1;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var l=i(t,n);return a(t,n,i(t,r)),a(t,r,l),{newHeaders:t,emergencyBreak:o}}(v,m,x),R=I.newHeaders,M=I.emergencyBreak;if(!(d||l.accessor===(null===(r=o.current)||void 0===r?void 0:r.accessor)||null===o.current||h<10||0===m.length||0===x.length||JSON.stringify(R)===JSON.stringify(i.current)||M)){var E=Date.now();JSON.stringify(R)===JSON.stringify(s)&&(E-b<1500||h<40)||(b=E,y={screenX:u,screenY:f},c(R))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==l||l(i.current)}}},E=n.createContext(void 0),j=function(n){var t=n.children,o=n.value;return e.jsx(E.Provider,r({value:o},{children:t}))},k=function(){var e=n.useContext(E);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},D=n.forwardRef((function(t,o){var i,a,l=t.borderClass,c=t.colIndex,s=t.header,d=t.isHighlighted,u=t.isInitialFocused,f=t.onExpandRowClick,h=t.rowIndex,m=t.visibleRow,w=k(),p=w.cellRegistry,x=w.cellUpdateFlash,I=w.collapseIcon,b=w.draggedHeaderRef,y=w.expandIcon,S=w.handleMouseDown,E=w.handleMouseOver,j=w.headersRef,D=w.hoveredHeaderRef,H=w.onCellEdit,N=w.onTableHeaderDragEnd,T=m.depth,L=m.row,O=n.useState(L.rowData[s.accessor]),W=O[0],B=O[1],F=n.useState(!1),P=F[0],A=F[1],z=n.useState(!1),U=z[0],J=z[1],V=n.useRef(null),q=M({draggedHeaderRef:b,headersRef:j,hoveredHeaderRef:D,onTableHeaderDragEnd:N}).handleDragOver,K=R(),X="cell-".concat(h,"-").concat(c),Y=g({rowId:L.rowMeta.rowId,accessor:s.accessor});n.useEffect((function(){if(p){var e="".concat(L.rowMeta.rowId,"-").concat(s.accessor);return p.set(e,{updateContent:function(e){W!==e?(B(e),x&&(J(!0),V.current&&clearTimeout(V.current),V.current=setTimeout((function(){J(!1)}),800))):B(e)}}),function(){p.delete(e),V.current&&clearTimeout(V.current)}}}),[p,x,L.rowMeta.rowId,s.accessor,W]),n.useEffect((function(){if(U){var e=setTimeout((function(){J(!1)}),850);return function(){return clearTimeout(e)}}}),[U]),n.useEffect((function(){B(L.rowData[s.accessor])}),[L.rowData,s.accessor]);var G=Boolean(null===(a=null===(i=L.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),_=Boolean(null==s?void 0:s.isEditable),$="st-cell ".concat(T>0&&s.expandable?"st-cell-depth-".concat(T):""," ").concat(d?u?"st-cell-selected-first ".concat(l):"st-cell-selected ".concat(l):""," ").concat(_?"clickable":""," ").concat(U?"st-cell-updating":""),Q=n.useCallback((function(e){B(e),null==H||H({accessor:s.accessor,newValue:e,row:L})}),[s.accessor,H,L]);return P?e.jsx("div",r({className:"st-cell-editing",id:v({accessor:s.accessor,rowIndex:h+1})},{children:e.jsx(C,{onChange:Q,setIsEditing:A,value:W})})):e.jsxs("div",r({className:$,id:X,onDoubleClick:function(){return s.isEditable&&A(!0)},onMouseDown:function(){return S({rowIndex:h,colIndex:c,rowId:L.rowMeta.rowId})},onMouseOver:function(){return E({rowIndex:h,colIndex:c,rowId:L.rowMeta.rowId})},onDragOver:function(e){return K({callback:q,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||P||(e.preventDefault(),A(!0))},ref:o,"data-row-index":h,"data-col-index":c,"data-row-id":L.rowMeta.rowId,"data-accessor":s.accessor},{children:[s.expandable&&G?L.rowMeta.isExpanded?e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return f(L.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:I})):e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return f(L.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,e.jsx("span",r({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"")},{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:c,row:L}):W}))]}),Y)})),H=function(n){var t=n.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(n,["children"]);return k().allowAnimations?e.jsx(N,r({},o,{children:t})):e.jsx(e.Fragment,{children:t})},N=function(r){var t=r.children,o=r.isBody,i=r.pauseAnimation,a=r.rowIndex,l=n.useRef(!1),c=k(),s=c.draggedHeaderRef,d=c.headersRef,u=c.mainBodyRef,f=c.shouldPaginate,h=n.useState({}),m=h[0],g=h[1],w=n.useRef({}),p=d.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(v({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:p,draggedHeaderRef:s,rowIndex:a});JSON.stringify(e)!==JSON.stringify(m)&&(w.current=m,g(e))}}),[m,p,s,o,a]),n.useLayoutEffect((function(){var e=u.current,n=function(){l.current=!0},r=function(){l.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[s,u]),n.useEffect((function(){i||l.current||Object.keys(w.current).length&&p&&p.forEach((function(e){var n=document.getElementById(v({accessor:e.accessor,rowIndex:a}));if(n){var r=w.current[e.accessor],t=m[e.accessor];if(r&&t){var o=r.left-t.left,i=f?0:r.top-t.top,l=Math.abs(o),c=Math.abs(i);(l>10||c>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[m,p,o,i,w,a,f]),e.jsx(e.Fragment,{children:t})},T=function(n){var t=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,l=n.onExpandRowClick,c=n.pinned,s=n.rowIndex,d=n.rowIndices,u=n.visibleRow,f=o.filter((function(e){return m({hiddenColumns:i,header:e,pinned:c})}));return e.jsx(H,r({isBody:!0,pauseAnimation:a,rowIndex:s+1},{children:f.map((function(n){return e.jsx(L,{columnIndices:t,header:n,headers:o,hiddenColumns:i,onExpandRowClick:l,pinned:c,rowIndex:s,rowIndices:d,visibleRow:u},v({accessor:n.accessor,rowIndex:s+1}))}))}))},L=function(r){var t=r.columnIndices,o=r.header,i=r.headers,a=r.hiddenColumns,l=r.onExpandRowClick,c=r.pinned,s=r.rowIndex,d=r.rowIndices,u=r.visibleRow,f=t[o.accessor],h=k(),g=h.getBorderClass,w=h.isSelected,p=h.isInitialFocusedCell;if(o.children){var x=o.children.filter((function(e){return m({hiddenColumns:a,header:e,pinned:c})}));return e.jsx(n.Fragment,{children:x.map((function(n){return e.jsx(L,{columnIndices:t,header:n,headers:i,hiddenColumns:a,onExpandRowClick:l,pinned:c,rowIndex:s,rowIndices:d,visibleRow:u},v({accessor:n.accessor,rowIndex:s+1}))}))})}var C={rowIndex:s,colIndex:f,rowId:u.row.rowMeta.rowId},I=g(C),R=w(C),b=p(C);return e.jsx(D,{borderClass:I,colIndex:f,header:o,isHighlighted:R,isInitialFocused:b,onExpandRowClick:l,rowIndex:s,visibleRow:u},v({accessor:o.accessor,rowIndex:s+1}))},O=function(n){var t=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,l=n.index,c=n.isWidthDragging,s=n.onExpandRowClick,d=n.pinned,u=n.rowHeight,f=n.rowIndices,v=n.visibleRow,m=v.position,g=m%2==0;return e.jsx("div",r({className:"st-row ".concat(g?"even":"odd"),style:{gridTemplateColumns:o,top:h({position:m,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(T,{columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:c,onExpandRowClick:s,pinned:d,rowIndex:l,rowIndices:f,visibleRow:v},l)}))},W=function(n){var t=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",r({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:f({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},B=function(t){var o=t.columnIndices,i=t.headers,a=t.hiddenColumns,l=t.isWidthDragging,c=t.onExpandRowClick,s=t.pinned,d=t.rowHeight,u=t.rowIndices,f=t.sectionRef,h=t.templateColumns,v=t.totalHeight,m=t.visibleRows,g=t.width,w=s?"st-body-pinned-".concat(s):"st-body-main";return e.jsx("div",r({className:w,ref:f,style:{position:"relative",height:"".concat(v,"px"),width:g}},{children:m.map((function(r,t){var f,v,g,w,p=Boolean(null===(v=null===(f=r.row.rowMeta)||void 0===f?void 0:f.children)||void 0===v?void 0:v.length),x=null===(w=null===(g=m[t-1])||void 0===g?void 0:g.row.rowMeta)||void 0===w?void 0:w.isExpanded;return e.jsxs(n.Fragment,{children:[e.jsx(O,{columnIndices:o,gridTemplateColumns:h,headers:i,hiddenColumns:a,index:t,isWidthDragging:l,onExpandRowClick:c,pinned:s,rowHeight:d,rowIndices:u,visibleRow:r}),0!==t&&e.jsx(W,{displayStrongBorder:p&&x,position:r.position,rowHeight:d,templateColumns:h})]},r.position)}))}))};function F(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return m({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&m({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var P=function(t){var o,i,a,l,c,s=t.centerHeaderRef,d=t.flattenedRows,u=t.headerContainerRef,f=t.isWidthDragging,h=t.mainTemplateColumns,v=t.pinnedLeftColumns,m=t.pinnedLeftHeaderRef,g=t.pinnedLeftTemplateColumns,w=t.pinnedRightColumns,p=t.pinnedRightHeaderRef,x=t.pinnedRightTemplateColumns,C=t.setFlattenedRows,I=t.setScrollTop,R=t.visibleRows,b=k(),y=b.rowHeight,S=b.scrollbarWidth,M=b.mainBodyRef,E=b.pinnedLeftRef,j=b.pinnedRightRef,D=b.tableBodyContainerRef,H=b.hiddenColumns,N=b.headersRef;!function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],l=i[1];n.useEffect((function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[r,a,o]),n.useEffect((function(){var e=null==r?void 0:r.current,n=null==t?void 0:t.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;l(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[r,t])}({headerContainerRef:u,mainSectionRef:D,scrollbarWidth:S});var T,L,O=n.useRef(null),W=(T=0,(L=function(e){e.forEach((function(e){T+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&L(e.rowMeta.children)}))})(d),T)*(y+1)-1,P=n.useMemo((function(){return F({headersRef:N,hiddenColumns:H,pinnedLeftColumns:v,pinnedRightColumns:w})}),[N,H,v,w]),A=n.useMemo((function(){var e={};return R.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[R]),z=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};C((function(e){return e.map(n)}))},U=(null===(o=m.current)||void 0===o?void 0:o.clientWidth)?(null===(i=m.current)||void 0===i?void 0:i.clientWidth)+1:0,J=null===(a=s.current)||void 0===a?void 0:a.clientWidth,V=(null===(l=p.current)||void 0===l?void 0:l.clientWidth)?(null===(c=p.current)||void 0===c?void 0:c.clientWidth)+1:0,q={headerContainerRef:u,headers:N.current,hiddenColumns:H,isWidthDragging:f,rowHeight:y,visibleRows:R,columnIndices:P,rowIndices:A};return e.jsxs("div",r({className:"st-body-container",ref:D,onScroll:function(e){var n=e.currentTarget.scrollTop;O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame((function(){I(n)}))}},{children:[v.length>0&&e.jsx(B,r({},q,{onExpandRowClick:z,pinned:"left",sectionRef:E,templateColumns:g,totalHeight:W,width:U})),e.jsx(B,r({},q,{onExpandRowClick:z,sectionRef:M,templateColumns:h,totalHeight:W,width:J})),w.length>0&&e.jsx(B,r({},q,{onExpandRowClick:z,pinned:"right",sectionRef:j,templateColumns:x,totalHeight:W,width:V}))]}))},A=function(e,r){n.useEffect((function(){if(e.current){var n=e.current,t=function(){var e,t=null==n?void 0:n.scrollLeft;void 0!==t&&(null===(e=r.current)||void 0===e||e.scrollTo(t,0))};return n.addEventListener("scroll",t),function(){null==n||n.removeEventListener("scroll",t)}}}),[e,r])},z=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.gridColumnEnd,i=e.gridColumnStart,a=e.setIsWidthDragging,l=e.startWidth;a(!0),n.preventDefault();var c=n.clientX;if(t){var s="number"==typeof t.minWidth?t.minWidth:40,d=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return d(e)})):[e]},u=o-i>1,f=u?d(t):[t],h=function(e){var n=e.clientX-c;if(u&&f.length>1){var o=f.reduce((function(e,n){return Math.min(e,"number"==typeof n.minWidth?n.minWidth:40)}),40),i=f.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),a=Math.max(l+n,o)-i;f.forEach((function(e,n){var r="number"==typeof e.width?e.width:150,t=a*(r/i),o=Math.max(r+t,s);e.width=o}))}else{var d=Math.max(l+n,s);t.width=d}r()},v=function(){document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",v),a(!1)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",v)}},U=n.forwardRef((function(t,o){var a,l,c=t.colIndex,s=t.forceHeadersUpdate,d=t.gridColumnEnd,u=t.gridColumnStart,f=t.gridRowEnd,h=t.gridRowStart,m=t.header,g=t.reverse,w=t.sort,p=k(),x=p.columnReordering,C=p.columnResizing,I=p.draggedHeaderRef,b=p.forceUpdate,y=p.headersRef,S=p.hoveredHeaderRef,E=p.onColumnOrderChange,j=p.onSort,D=p.onTableHeaderDragEnd,H=p.rowHeight,N=p.selectColumns,T=p.selectableColumns,L=p.setInitialFocusedCell,O=p.setIsWidthDragging,W=p.setSelectedCells,B=p.setSelectedColumns,F=p.sortDownIcon,P=p.sortUpIcon,A=Boolean(null==m?void 0:m.isSortable),U="st-header-cell ".concat(m.accessor===(null===(a=S.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(l=I.current)||void 0===l?void 0:l.accessor)===m.accessor?"st-dragging":""," ").concat(A?"clickable":""," ").concat(x&&!A?"columnReordering":""," ").concat("right"===(null==m?void 0:m.align)?"right-aligned":"center"===(null==m?void 0:m.align)?"center-aligned":""),J=M({draggedHeaderRef:I,headersRef:y,hoveredHeaderRef:S,onColumnOrderChange:E,onTableHeaderDragEnd:D}),V=J.handleDragStart,q=J.handleDragEnd,K=J.handleDragOver,X=R(),Y=function(e){var n=e.event,r=e.header;if(T){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,c);return n.shiftKey&&N?B((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],a=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<a&&(a=r,o=e)}));var l,c,s,d,u=i(i([],(l=o,c=n,s=Math.min(l,c),d=Math.max(l,c),Array.from({length:d-s+1},(function(e,n){return s+n}))),!0),t,!0);return new Set(i(i([],Array.from(e),!0),u,!0))})):N&&N(t),W(new Set),void L(null)}r.isSortable&&j(c,r.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!m)return null;var G=C&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;X({callback:z,callbackProps:{event:e.nativeEvent,forceUpdate:b,header:m,gridColumnEnd:d,gridColumnStart:u,setIsWidthDragging:O,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),_=w&&w.key.accessor===m.accessor&&e.jsxs("div",r({className:"st-sort-icon-container",onClick:function(e){return Y({event:e,header:m})}},{children:["ascending"===w.direction&&P&&P,"descending"===w.direction&&F&&F]}));return e.jsxs("div",r({className:U,id:v({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){X({callback:K,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:o,style:r(r({gridRowStart:h,gridRowEnd:f,gridColumnStart:u,gridColumnEnd:d},d-u>1?{}:{width:m.width}),f-h>1?{}:{height:H})},{children:[g&&G,e.jsxs("div",r({className:"st-header-label ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":""),draggable:x&&!m.disableReorder,onClick:function(e){return Y({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),q(),s()},onDragStart:function(e){x&&m&&function(e){V(e)}(m)}},{children:["right"===m.align&&_,null==m?void 0:m.label,"right"!==m.align&&_]})),!g&&G]}))})),J=function(t){var o=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,l=t.headersRef,c=t.hiddenColumns,s=t.maxDepth,d=t.pinned,u=t.sectionRef,f=t.sort,h=n.useReducer((function(e){return e+1}),0)[1],v=n.useMemo((function(){var e=[],n=1,r=function(t,i,a){var l,u;if(void 0===a&&(a=!1),!m({hiddenColumns:c,header:t,pinned:d}))return 0;a||n++;var f=null!==(u=null===(l=t.children)||void 0===l?void 0:l.filter((function(e){return m({hiddenColumns:c,header:e,pinned:d})})).length)&&void 0!==u?u:0,h=n,v=f>0?h+f:h+1,g=i,w=f>0?i+1:s+1;if(e.push({header:t,gridColumnStart:h,gridColumnEnd:v,gridRowStart:g,gridRowEnd:w,colIndex:o[t.accessor]}),t.children){var p=!0;t.children.forEach((function(e){m({hiddenColumns:c,header:e,pinned:d})&&(r(e,i+1,p),p=!1)}))}return v-h},t=l.current.filter((function(e){return m({hiddenColumns:c,header:e,pinned:d})})),i=!0;return t.forEach((function(e){r(e,1,i),i=!1})),e}),[l,c,s,d,o]);return e.jsx("div",r({className:"st-header-".concat(d?"pinned-".concat(d):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(H,r({rowIndex:0},{children:v.map((function(r){return e.jsx(U,{colIndex:r.colIndex,forceHeadersUpdate:h,gridColumnEnd:r.gridColumnEnd,gridColumnStart:r.gridColumnStart,gridRowEnd:r.gridRowEnd,gridRowStart:r.gridRowStart,header:r.header,ref:n.createRef(),reverse:"right"===d,sort:f},r.header.accessor)}))}))}))},V=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(V)):1},q=function(t){var o=t.centerHeaderRef,i=t.headerContainerRef,a=t.headersRef,l=t.hiddenColumns,c=t.mainTemplateColumns,s=t.pinnedLeftColumns,d=t.pinnedLeftHeaderRef,u=t.pinnedLeftTemplateColumns,f=t.pinnedRightColumns,h=t.pinnedRightHeaderRef,v=t.pinnedRightTemplateColumns,g=t.sort,w=k().mainBodyRef;A(w,o);var p=n.useMemo((function(){return F({headersRef:a,hiddenColumns:l,pinnedLeftColumns:s,pinnedRightColumns:f})}),[a,l,s,f]),x=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(m({hiddenColumns:l,header:e})){var r=V(e);n=Math.max(n,r)}})),{maxDepth:n}}),[a,l]).maxDepth;return e.jsxs("div",r({className:"st-header-container",ref:i},{children:[s.length>0&&e.jsx(J,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"left",sectionRef:d,sort:g}),e.jsx(J,{columnIndices:p,gridTemplateColumns:c,handleScroll:function(e){var n,r,t=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=w.current)||void 0===r||r.scrollTo(t,0))},headersRef:a,hiddenColumns:l,maxDepth:x,sectionRef:o,sort:g}),f.length>0&&e.jsx(J,{columnIndices:p,gridTemplateColumns:v,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"right",sectionRef:h,sort:g})]}))},K=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},X=function(t){var o=t.flattenedRows,i=t.isWidthDragging,a=t.setFlattenedRows,l=t.setScrollTop,c=t.sort,s=t.visibleRows,d=k(),u=d.editColumns,f=d.headersRef,h=d.hiddenColumns,v=n.useRef(null),m=n.useRef(null),g=n.useRef(null),w=n.useRef(null),p=f.current.filter((function(e){return!e.pinned})),x=f.current.filter((function(e){return"left"===e.pinned})),C=f.current.filter((function(e){return"right"===e.pinned})),I=n.useMemo((function(){return K({headers:x,hiddenColumns:h})}),[x,h]),R=n.useMemo((function(){return K({headers:p,hiddenColumns:h})}),[p,h]),b=n.useMemo((function(){return K({headers:C,hiddenColumns:h})}),[C,h]),y={centerHeaderRef:g,headerContainerRef:v,headersRef:f,hiddenColumns:h,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,sort:c},S={centerHeaderRef:g,flattenedRows:o,headerContainerRef:v,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,setFlattenedRows:a,setScrollTop:l,visibleRows:s};return e.jsxs("div",r({className:"st-content",style:{width:u?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(q,r({},y)),e.jsx(P,r({},S))]}))},Y=function(e){var r=e.callback,t=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=t.current;if(e){var n=function(){r(e[o]||0)};n();var i=new ResizeObserver((function(){n()}));return i.observe(e),function(){return i.disconnect()}}}),[r,t,o])},G=function(t){var o,i,a=t.mainBodyRef,l=t.pinnedLeftRef,c=t.pinnedRightRef,s=t.tableContentWidth,d=n.useState(0),u=d[0],f=d[1],h=n.useState(0),v=h[0],m=h[1],g=n.useState(0),w=g[0],p=g[1],x=n.useState(!1),C=x[0],I=x[1],R=n.useRef(null);return Y({widthAttribute:"offsetWidth",callback:f,ref:l}),Y({widthAttribute:"offsetWidth",callback:m,ref:c}),A(a,R),n.useEffect((function(){setTimeout((function(){!function(){if(a.current){var e=a.current.scrollWidth,n=a.current.clientWidth;p(e),I(e>n)}}()}),1)}),[a]),C?e.jsxs("div",r({className:"st-horizontal-scrollbar-container",style:{width:s}},{children:[u>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(o=R.current)||void 0===o?void 0:o.offsetHeight}}),w>0&&e.jsx("div",r({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&a.current&&a.current.scrollTo({left:n,behavior:"auto"})},ref:R},{children:e.jsx("div",{style:{width:w,height:".3px"}})})),v>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:v,height:null===(i=R.current)||void 0===i?void 0:i.offsetHeight}})]})):null},_={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return _.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?_.string(e,n,r):"number"==typeof e&&"number"==typeof n?_.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?_.boolean(e,n,r):_.string(String(e),String(n),r)}},$=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return _.number(i,a,t)}return"date"===r?_.date(String(e),String(n),t):"boolean"===r?_.boolean(Boolean(e),Boolean(n),t):"enum"===r?_.enum(String(e),String(n),t):_.string(String(e),String(n),t)},Q=function(e,n,t){var o,a=(null===(o=n.key)||void 0===o?void 0:o.type)||"string",l=n.direction,c=new Map,s=new Map,d="";e.forEach((function(e){var r;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var t=(e.rowData.sector||"group_".concat(c.size)).toString();d=t,s.set(d,e),c.has(d)||c.set(d,[])}else if(d){var o=c.get(d)||[];o.push(e),c.set(d,o)}else{var i="default";c.has(i)||c.set(i,[]),null===(r=c.get(i))||void 0===r||r.push(e)}}));var u=[];return c.forEach((function(e,o){if(s.has(o)){var c=s.get(o);c.rowMeta.children&&c.rowMeta.children.length>0&&(c.rowMeta.children=Z(c.rowMeta.children,n,t)),u.push(c)}var d=i([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return $(o,i,a,l)}));u.push.apply(u,d.map((function(e){var o=r({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var i=Z(o.rowMeta.children,n,t);o.rowMeta=r(r({},o.rowMeta),{children:i})}return o})))})),u},Z=function(e,n,t){var o=t.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",l=n.direction;return i([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return $(o,i,a,l)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?r(r({},e),{rowMeta:r(r({},e.rowMeta),{children:Z(e.rowMeta.children,n,t)})}):e}))},ee=function(e){var r=e.headers,t=e.tableRows,o=n.useState(null),i=o[0],a=o[1],l=n.useMemo((function(){var e={};return r.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[r]),c=n.useState(l),s=c[0],d=c[1],u=n.useMemo((function(){if(!i)return t;var e=function(e,n,r){return{sortedData:Q(n,r,e),newSortConfig:r}}(r,t,i).sortedData;return e}),[t,i,r]);return{hiddenColumns:s,setHiddenColumns:d,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(r);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},ne=function(t){var o=t.checked,i=void 0!==o&&o,a=t.children,l=t.onChange,c=n.useState(i),s=c[0],d=c[1];return e.jsxs("label",r({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:s,className:"st-checkbox-input",onChange:function(){var e=!s;d(e),l&&l(e)},type:"checkbox"}),e.jsx("span",r({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&e.jsx("span",{className:"st-checkbox-checkmark"})})),a]}))},re=function(n){var t=n.headers,o=n.open,i=n.position;n.setOpen;var a=n.setHiddenColumns,l=n.hiddenColumns,c="left"===i?"left":"";return e.jsx("div",r({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(c),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",r({className:"st-column-editor-popout-content"},{children:t.map((function(n,t){return e.jsx(ne,r({checked:l[n.accessor],onChange:function(e){var t;return a(r(r({},l),((t={})[n.accessor]=e,t)))}},{children:n.label}),t)}))}))}))},te=function(t){var o=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,d=t.setHiddenColumns,u=t.hiddenColumns,f=n.useState(a),h=f[0],v=f[1];return i?e.jsxs("div",r({className:"st-column-editor ".concat(h?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!h)}},{children:[e.jsx("div",r({className:"st-column-editor-text"},{children:o})),e.jsx(re,{headers:l,open:h,position:s,setOpen:v,setHiddenColumns:d,hiddenColumns:u})]})):null},oe=function(t){var o=t.allowAnimations,i=void 0!==o&&o,f=t.cellUpdateFlash,h=void 0!==f&&f,v=t.collapseIcon,m=void 0===v?e.jsx(u,{className:"st-sort-icon"}):v,w=t.columnEditorPosition,p=void 0===w?"right":w,x=t.columnEditorText,C=void 0===x?"Columns":x,I=t.columnReordering,R=void 0!==I&&I,b=t.columnResizing,y=void 0!==b&&b,S=t.defaultHeaders,M=t.editColumns,E=void 0!==M&&M,k=t.editColumnsInitOpen,D=void 0!==k&&k,H=t.expandIcon,N=void 0===H?e.jsx(s,{className:"st-sort-icon"}):H,T=t.height,L=t.hideFooter,O=void 0!==L&&L,W=t.nextIcon,B=void 0===W?e.jsx(s,{className:"st-next-prev-icon"}):W,F=t.onCellEdit,P=t.onColumnOrderChange,A=t.onGridReady,z=t.onNextPage,U=t.prevIcon,J=void 0===U?e.jsx(c,{className:"st-next-prev-icon"}):U,V=t.rowHeight,q=void 0===V?40:V,K=t.rows,Y=t.rowsPerPage,_=void 0===Y?10:Y,$=t.selectableCells,Q=void 0!==$&&$,Z=t.selectableColumns,ne=void 0!==Z&&Z,re=t.shouldPaginate,oe=void 0!==re&&re,ie=t.sortDownIcon,ae=void 0===ie?e.jsx(u,{className:"st-sort-icon"}):ie,le=t.sortUpIcon,ce=void 0===le?e.jsx(d,{className:"st-sort-icon"}):le,se=t.tableRef,de=t.theme,ue=void 0===de?"light":de,fe=t.totalPages,he=n.useRef(null),ve=n.useRef(S),me=n.useRef(null),ge=n.useRef(null),we=n.useRef(null),pe=n.useRef(null),xe=n.useRef(null),Ce=n.useState(!1),Ie=Ce[0],Re=Ce[1],be=n.useState(1),ye=be[0],Se=be[1],Me=n.useState(0),Ee=Me[0],je=Me[1],ke=n.useState(0),De=ke[0],He=ke[1],Ne=n.useState(0),Te=Ne[0],Le=Ne[1],Oe=ee({headers:ve.current,tableRows:K}),We=Oe.sort,Be=Oe.sortedRows,Fe=Oe.hiddenColumns,Pe=Oe.setHiddenColumns,Ae=Oe.updateSort;n.useEffect((function(){null==A||A()}),[A]);var ze=n.useMemo((function(){if(!oe)return Be;var e=(ye-1)*_,n=e+_;return Be.slice(e,n)}),[ye,_,oe,Be]),Ue=n.useState(ze),Je=Ue[0],Ve=Ue[1];n.useEffect((function(){Ve(ze)}),[ze]);var qe=n.useMemo((function(){var e;if(!T)return window.innerHeight-q;var n=document.querySelector(".simple-table-root"),r=0;if(T.endsWith("px"))r=parseInt(T,10);else if(T.endsWith("vh")){var t=parseInt(T,10);r=window.innerHeight*t/100}else if(T.endsWith("%")){var o=parseInt(T,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-q)}),[T,q]),Ke=n.useMemo((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=[],c=0,s=Math.max(0,i-a*n),d=i+r+a*n,u=function(e,n){for(var r,t=0,o=e;t<o.length;t++){var i=o[t],f=c*a;if(f>=d)break;f+a>s&&l.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(r=i.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(t,0),l}({bufferRowCount:5,contentHeight:qe,flattenedRows:Je,rowHeight:q,scrollTop:Te})}),[qe,q,Je,Te]),Xe=n.useReducer((function(e){return e+1}),0)[1],Ye=function(e){var r=e.selectableCells,t=e.headers,o=e.visibleRows,i=n.useState(new Set),l=i[0],c=i[1],s=n.useState(new Set),d=s[0],u=s[1],f=n.useState(null),h=f[0],v=f[1],m=n.useState(null),g=m[0],w=m[1],p=n.useRef(!1),x=n.useRef(null),C=n.useCallback((function(){var e=Array.from(l).reduce((function(e,n){var r=n.split("-").map(Number),i=r[0],a=r[1];return e[i]||(e[i]=[]),e[i][a]=o[i].row.rowData[t[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");l.size>0&&navigator.clipboard.writeText(n)}),[t,l,o]),I=n.useCallback((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),l=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),d=t;d<=i;d++)for(var f=l;f<=s;f++)if(d>=0&&d<o.length){var h=o[d].row.rowMeta.rowId;r.add(a({colIndex:f,rowIndex:d,rowId:h}))}u(new Set),v(null),c(r)}),[o,u,v,c]),R=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<t.length){var n=a(e);u(new Set),v(null),c(new Set([n])),w(e)}}),[t.length,o.length,u,v,c,w]),b=n.useCallback((function(e,n){void 0===n&&(n=!1),c(new Set),w(null),u((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&v(e[e.length-1])}),[c,w,u,v]);n.useEffect((function(){var e=function(e){if(r&&g){var n=g.rowIndex,i=g.colIndex,a=g.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var l=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===l)return;n=l}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};R(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(s={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},R(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(s={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},R(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<t.length-1&&(s={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},R(s))):"Escape"===e.key&&(c(new Set),u(new Set),v(null),x.current=null,w(null))}else C()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[C,t.length,g,I,R,r,o]);var y=n.useCallback((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=a({colIndex:n,rowIndex:r,rowId:t}),i=l.has(o),c=d.has(n);return i||c}),[l,d]),S=n.useCallback((function(e){var n,r,t,i,a,l,c=e.colIndex,s=e.rowIndex,u=e.rowId,f=[],h=null===(t=null===(r=null===(n=o[s-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:c,rowIndex:s+1,rowId:null===(l=null===(a=null===(i=o[s+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===l?void 0:l.rowId},m={colIndex:c-1,rowIndex:s,rowId:u},g={colIndex:c+1,rowIndex:s,rowId:u};return(!y({colIndex:c,rowIndex:s-1,rowId:h})||d.has(c)&&0===s)&&f.push("st-selected-top-border"),(!y(v)||d.has(c)&&s===o.length-1)&&f.push("st-selected-bottom-border"),y(m)||f.push("st-selected-left-border"),y(g)||f.push("st-selected-right-border"),f.join(" ")}),[y,o,d]),M=n.useMemo((function(){return g?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===g.rowIndex&&r===g.colIndex&&t===g.rowId}:function(){return!1}}),[g]);return{getBorderClass:S,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){p.current=!0,x.current={rowIndex:t,colIndex:n,rowId:o},u(new Set),v(null);var i=a({colIndex:n,rowIndex:t,rowId:o});c(new Set([i])),w({rowIndex:t,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,t=e.rowIndex;if(e.rowId,r&&p.current&&x.current){for(var i=new Set,l=Math.min(x.current.rowIndex,t),s=Math.max(x.current.rowIndex,t),d=Math.min(x.current.colIndex,n),u=Math.max(x.current.colIndex,n),f=l;f<=s;f++)for(var h=d;h<=u;h++)if(f>=0&&f<o.length){var v=o[f].row.rowMeta.rowId;i.add(a({colIndex:h,rowIndex:f,rowId:v}))}c(i)}},handleMouseUp:function(){p.current=!1},isInitialFocusedCell:M,isSelected:y,lastSelectedColumnIndex:h,selectColumns:b,selectedCells:l,selectedColumns:d,setInitialFocusedCell:w,setSelectedCells:c,setSelectedColumns:u}}({selectableCells:Q,headers:ve.current,visibleRows:Ke}),Ge=Ye.handleMouseDown,_e=Ye.handleMouseOver,$e=Ye.handleMouseUp,Qe=Ye.isSelected,Ze=Ye.getBorderClass,en=Ye.isInitialFocusedCell,nn=Ye.setSelectedCells,rn=Ye.setSelectedColumns,tn=Ye.selectColumns,on=Ye.setInitialFocusedCell,an=n.useCallback((function(e,n){Ae(e,n)}),[Ae]),ln=n.useCallback((function(e){ve.current=e,Xe()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ne&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(nn(new Set),ne&&rn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ne,nn,rn]),n.useLayoutEffect((function(){if(xe.current){var e=xe.current.offsetWidth-xe.current.clientWidth,n=xe.current.clientWidth;je(e),He(n)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Xe(),xe.current){var e=xe.current.offsetWidth-xe.current.clientWidth,n=xe.current.clientWidth;je(e),He(n)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var cn=n.useRef(new Map);return n.useEffect((function(){se&&(se.current={updateData:function(e){var n,r,t,o,i=e.accessor,a=e.rowIndex,l=e.newValue,c=null===(r=null===(n=null==K?void 0:K[a])||void 0===n?void 0:n.rowMeta)||void 0===r?void 0:r.rowId;if(void 0!==c){var s=g({rowId:c,accessor:i}),d=cn.current.get(s);d&&d.updateContent(l),void 0!==(null===(o=null===(t=null==K?void 0:K[a])||void 0===t?void 0:t.rowData)||void 0===o?void 0:o[i])&&(K[a].rowData[i]=l)}}})}),[se,K]),e.jsx(j,r({value:{allowAnimations:i,cellUpdateFlash:h,collapseIcon:m,columnReordering:R,columnResizing:y,draggedHeaderRef:he,editColumns:E,expandIcon:N,forceUpdate:Xe,getBorderClass:Ze,handleMouseDown:Ge,handleMouseOver:_e,headersRef:ve,hiddenColumns:Fe,hoveredHeaderRef:me,isInitialFocusedCell:en,isSelected:Qe,mainBodyRef:ge,onCellEdit:F,onColumnOrderChange:P,onSort:an,onTableHeaderDragEnd:ln,pinnedLeftRef:we,pinnedRightRef:pe,rowHeight:q,scrollbarWidth:Ee,selectColumns:tn,selectableColumns:ne,setInitialFocusedCell:on,setIsWidthDragging:Re,setSelectedCells:nn,setSelectedColumns:rn,shouldPaginate:oe,sortDownIcon:ae,sortUpIcon:ce,tableBodyContainerRef:xe,cellRegistry:cn.current}},{children:e.jsxs("div",r({className:"simple-table-root st-wrapper theme-".concat(ue),style:T?{height:T}:{}},{children:[e.jsxs("div",r({className:"st-wrapper-container"},{children:[e.jsxs("div",r({className:"st-content-wrapper",onMouseUp:$e,onMouseLeave:$e},{children:[e.jsx(X,{flattenedRows:Je,isWidthDragging:Ie,setFlattenedRows:Ve,setScrollTop:Le,sort:We,visibleRows:Ke}),e.jsx(te,{columnEditorText:C,editColumns:E,editColumnsInitOpen:D,headers:ve.current,hiddenColumns:Fe,position:p,setHiddenColumns:Pe})]})),e.jsx(G,{mainBodyRef:ge,pinnedLeftRef:we,pinnedRightRef:pe,tableContentWidth:De})]})),e.jsx(l,{currentPage:ye,hideFooter:O,nextIcon:B,onPageChange:Se,onNextPage:z,prevIcon:J,shouldPaginate:oe,totalPages:fe||Math.ceil(Be.length/_)})]}))}))};exports.SimpleTable=function(t){var o=n.useState(!1),i=o[0],a=o[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(oe,r({},t)):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=function(){return r=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function t(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function l(e){try{c(t.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,l)}c((t=t.apply(e,n||[])).next())}))}function o(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&l[0]?t.return:l[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,l[1])).done)return o;switch(t=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,t=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],t=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function i(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var a=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},l=function(i){var a=i.currentPage,l=i.hideFooter,c=i.nextIcon,s=i.onPageChange,d=i.onNextPage,u=i.prevIcon,f=i.shouldPaginate,h=i.totalPages,v=n.useState(!0),m=v[0],g=v[1],w=!(a>1),p=!(a<h)&&!d||!m&&a===h;return l||!f?null:e.jsxs("div",r({className:"st-footer"},{children:[e.jsx("button",r({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=a-1;e>=1&&s(e)},disabled:w},{children:u})),e.jsx("button",r({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return e=a===h,n=a+1,d&&e?[4,d(a)]:[3,2];case 1:if(!r.sent())return g(!1),[2];r.label=2;case 2:return(n<=h||d)&&s(n),[2]}}))}))},disabled:p},{children:c})),Array.from({length:h},(function(n,t){return e.jsx("button",r({onClick:function(){var e;(e=t+1)>=1&&e<=h&&s(e)},className:"st-page-btn ".concat(a===t+1?"active":"")},{children:t+1}),t)}))]}))},c=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},s=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},d=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},u=function(n){var t=n.className;return e.jsx("svg",r({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},f=function(e){return e.position*(e.rowHeight+1)-1},h=function(e){return e.position*(e.rowHeight+1)},v=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},m=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},g=function(e){var n=e.rowId,r=e.accessor;return"".concat(n,"-").concat(r)},w=function(n){var t=n.value,o=n.onBlur,i=n.onChange;return e.jsxs("select",r({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[e.jsx("option",r({value:"true"},{children:"True"})),e.jsx("option",r({value:"false"},{children:"False"}))]}))},p=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},x=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},C=function(n){var r=n.onChange,t=n.setIsEditing,o=n.value,i=function(e){null==r||r(e)},a=function(){t(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(p,{defaultValue:o,onBlur:a,onChange:i}):"boolean"==typeof o?e.jsx(w,{onBlur:a,onChange:i,value:o}):"number"==typeof o?e.jsx(x,{defaultValue:o,onBlur:a,onChange:i}):null})},I=0,R=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===I||o-I>=t)&&(I=o,n(r))}},b=Date.now(),y={screenX:0,screenY:0},S=function(e,n,r){void 0===r&&(r=[]);for(var t=0;t<e.length;t++){var o=e[t];if(o.accessor===n)return i(i([],r,!0),[t],!1);if(o.children&&o.children.length>0){var a=S(o.children,n,i(i([],r,!0),[t],!1));if(a)return a}}return null};var E=function(e){var r,t,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,l=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(r=i.current,t=n.useRef(r),n.useEffect((function(){JSON.stringify(t.current)!==JSON.stringify(r)&&(t.current=r)}),[r]),t.current);return{handleDragStart:function(e){o.current=e,b=Date.now()},handleDragOver:function(e){var n,r,t=e.event,l=e.hoveredHeader;if(t.preventDefault(),i.current){var d=t.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=t.screenX,f=t.screenY,h=Math.sqrt(Math.pow(u-y.screenX,2)+Math.pow(f-y.screenY,2));a.current=l;var v=i.current,m=S(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),g=S(v,l.accessor);if(m&&g){var w=m.length,p=g.length,x=g;if(w!==p){var C=p-w;C>0&&(x=g.slice(0,-C))}var I=function(e,n,r){var t=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;i<n.length-1;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var l=i(t,n);return a(t,n,i(t,r)),a(t,r,l),{newHeaders:t,emergencyBreak:o}}(v,m,x),R=I.newHeaders,E=I.emergencyBreak;if(!(d||l.accessor===(null===(r=o.current)||void 0===r?void 0:r.accessor)||null===o.current||h<10||0===m.length||0===x.length||JSON.stringify(R)===JSON.stringify(i.current)||E)){var M=Date.now();JSON.stringify(R)===JSON.stringify(s)&&(M-b<1500||h<40)||(b=M,y={screenX:u,screenY:f},c(R))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==l||l(i.current)}}},M=n.createContext(void 0),j=function(n){var t=n.children,o=n.value;return e.jsx(M.Provider,r({value:o},{children:t}))},k=function(){var e=n.useContext(M);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},H=n.forwardRef((function(t,o){var i,a,l=t.borderClass,c=t.colIndex,s=t.header,d=t.isHighlighted,u=t.isInitialFocused,f=t.onExpandRowClick,h=t.rowIndex,m=t.visibleRow,w=k(),p=w.cellRegistry,x=w.cellUpdateFlash,I=w.collapseIcon,b=w.draggedHeaderRef,y=w.expandIcon,S=w.handleMouseDown,M=w.handleMouseOver,j=w.headersRef,H=w.hoveredHeaderRef,D=w.onCellEdit,N=w.onTableHeaderDragEnd,T=m.depth,L=m.row,O=n.useState(L.rowData[s.accessor]),W=O[0],B=O[1],F=n.useState(!1),P=F[0],A=F[1],z=n.useState(!1),U=z[0],J=z[1],V=n.useRef(null),q=E({draggedHeaderRef:b,headersRef:j,hoveredHeaderRef:H,onTableHeaderDragEnd:N}).handleDragOver,K=R(),X="cell-".concat(h,"-").concat(c),G=g({rowId:L.rowMeta.rowId,accessor:s.accessor});n.useEffect((function(){if(p){var e="".concat(L.rowMeta.rowId,"-").concat(s.accessor);return p.set(e,{updateContent:function(e){W!==e?(B(e),x&&(J(!0),V.current&&clearTimeout(V.current),V.current=setTimeout((function(){J(!1)}),800))):B(e)}}),function(){p.delete(e),V.current&&clearTimeout(V.current)}}}),[p,x,L.rowMeta.rowId,s.accessor,W]),n.useEffect((function(){if(U){var e=setTimeout((function(){J(!1)}),850);return function(){return clearTimeout(e)}}}),[U]),n.useEffect((function(){B(L.rowData[s.accessor])}),[L.rowData,s.accessor]);var Y=Boolean(null===(a=null===(i=L.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),_=Boolean(null==s?void 0:s.isEditable),$="st-cell ".concat(T>0&&s.expandable?"st-cell-depth-".concat(T):""," ").concat(d?u?"st-cell-selected-first ".concat(l):"st-cell-selected ".concat(l):""," ").concat(_?"clickable":""," ").concat(U?"st-cell-updating":""),Q=n.useCallback((function(e){B(e),null==D||D({accessor:s.accessor,newValue:e,row:L})}),[s.accessor,D,L]);return P?e.jsx("div",r({className:"st-cell-editing",id:v({accessor:s.accessor,rowIndex:h+1})},{children:e.jsx(C,{onChange:Q,setIsEditing:A,value:W})})):e.jsxs("div",r({className:$,id:X,onDoubleClick:function(){return s.isEditable&&A(!0)},onMouseDown:function(){return S({rowIndex:h,colIndex:c,rowId:L.rowMeta.rowId})},onMouseOver:function(){return M({rowIndex:h,colIndex:c,rowId:L.rowMeta.rowId})},onDragOver:function(e){return K({callback:q,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||P||(e.preventDefault(),A(!0))},ref:o,"data-row-index":h,"data-col-index":c,"data-row-id":L.rowMeta.rowId,"data-accessor":s.accessor},{children:[s.expandable&&Y?L.rowMeta.isExpanded?e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return f(L.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:I})):e.jsx("div",r({className:"st-sort-icon-container",onClick:function(){return f(L.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,e.jsx("span",r({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"")},{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:c,row:L}):W}))]}),G)})),D=function(n){var t=n.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(n,["children"]);return k().allowAnimations?e.jsx(N,r({},o,{children:t})):e.jsx(e.Fragment,{children:t})},N=function(r){var t=r.children,o=r.isBody,i=r.pauseAnimation,a=r.rowIndex,l=n.useRef(!1),c=k(),s=c.draggedHeaderRef,d=c.headersRef,u=c.mainBodyRef,f=c.shouldPaginate,h=n.useState({}),m=h[0],g=h[1],w=n.useRef({}),p=d.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(v({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:p,draggedHeaderRef:s,rowIndex:a});JSON.stringify(e)!==JSON.stringify(m)&&(w.current=m,g(e))}}),[m,p,s,o,a]),n.useLayoutEffect((function(){var e=u.current,n=function(){l.current=!0},r=function(){l.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[s,u]),n.useEffect((function(){i||l.current||Object.keys(w.current).length&&p&&p.forEach((function(e){var n=document.getElementById(v({accessor:e.accessor,rowIndex:a}));if(n){var r=w.current[e.accessor],t=m[e.accessor];if(r&&t){var o=r.left-t.left,i=f?0:r.top-t.top,l=Math.abs(o),c=Math.abs(i);(l>10||c>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[m,p,o,i,w,a,f]),e.jsx(e.Fragment,{children:t})},T=function(n){var t=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,l=n.onExpandRowClick,c=n.pinned,s=n.rowIndex,d=n.rowIndices,u=n.visibleRow,f=o.filter((function(e){return m({hiddenColumns:i,header:e,pinned:c})}));return e.jsx(D,r({isBody:!0,pauseAnimation:a,rowIndex:s+1},{children:f.map((function(n){return e.jsx(L,{columnIndices:t,header:n,headers:o,hiddenColumns:i,onExpandRowClick:l,pinned:c,rowIndex:s,rowIndices:d,visibleRow:u},v({accessor:n.accessor,rowIndex:s+1}))}))}))},L=function(r){var t=r.columnIndices,o=r.header,i=r.headers,a=r.hiddenColumns,l=r.onExpandRowClick,c=r.pinned,s=r.rowIndex,d=r.rowIndices,u=r.visibleRow,f=t[o.accessor],h=k(),g=h.getBorderClass,w=h.isSelected,p=h.isInitialFocusedCell;if(o.children){var x=o.children.filter((function(e){return m({hiddenColumns:a,header:e,pinned:c})}));return e.jsx(n.Fragment,{children:x.map((function(n){return e.jsx(L,{columnIndices:t,header:n,headers:i,hiddenColumns:a,onExpandRowClick:l,pinned:c,rowIndex:s,rowIndices:d,visibleRow:u},v({accessor:n.accessor,rowIndex:s+1}))}))})}var C={rowIndex:s,colIndex:f,rowId:u.row.rowMeta.rowId},I=g(C),R=w(C),b=p(C);return e.jsx(H,{borderClass:I,colIndex:f,header:o,isHighlighted:R,isInitialFocused:b,onExpandRowClick:l,rowIndex:s,visibleRow:u},v({accessor:o.accessor,rowIndex:s+1}))},O=function(n){var t=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,l=n.index,c=n.isWidthDragging,s=n.onExpandRowClick,d=n.pinned,u=n.rowHeight,f=n.rowIndices,v=n.visibleRow,m=v.position,g=m%2==0;return e.jsx("div",r({className:"st-row ".concat(g?"even":"odd"),style:{gridTemplateColumns:o,top:h({position:m,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(T,{columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:c,onExpandRowClick:s,pinned:d,rowIndex:l,rowIndices:f,visibleRow:v},l)}))},W=function(n){var t=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",r({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:f({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},B=function(t){var o=t.columnIndices,i=t.headers,a=t.hiddenColumns,l=t.isWidthDragging,c=t.onExpandRowClick,s=t.pinned,d=t.rowHeight,u=t.rowIndices,f=t.sectionRef,h=t.templateColumns,v=t.totalHeight,m=t.visibleRows,g=t.width,w=s?"st-body-pinned-".concat(s):"st-body-main";return e.jsx("div",r({className:w,ref:f,style:{position:"relative",height:"".concat(v,"px"),width:g}},{children:m.map((function(r,t){var f,v,g,w,p=Boolean(null===(v=null===(f=r.row.rowMeta)||void 0===f?void 0:f.children)||void 0===v?void 0:v.length),x=null===(w=null===(g=m[t-1])||void 0===g?void 0:g.row.rowMeta)||void 0===w?void 0:w.isExpanded;return e.jsxs(n.Fragment,{children:[e.jsx(O,{columnIndices:o,gridTemplateColumns:h,headers:i,hiddenColumns:a,index:t,isWidthDragging:l,onExpandRowClick:c,pinned:s,rowHeight:d,rowIndices:u,visibleRow:r}),0!==t&&e.jsx(W,{displayStrongBorder:p&&x,position:r.position,rowHeight:d,templateColumns:h})]},r.position)}))}))};function F(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return m({hiddenColumns:r,header:e})})).forEach((function(e,n){l(e,0===n)}))};return t.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&m({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;l(e,r)})),o.forEach((function(e){l(e,!1)})),i}var P=function(t){var o=t.centerHeaderRef,i=t.flattenedRows,a=t.headerContainerRef,l=t.isWidthDragging,c=t.mainTemplateColumns,s=t.pinnedLeftColumns,d=t.pinnedLeftHeaderRef,u=t.pinnedLeftTemplateColumns,f=t.pinnedRightColumns,h=t.pinnedRightHeaderRef,v=t.pinnedRightTemplateColumns,m=t.setFlattenedRows,g=t.setScrollTop,w=t.visibleRows,p=k(),x=p.rowHeight,C=p.scrollbarWidth,I=p.mainBodyRef,R=p.pinnedLeftRef,b=p.pinnedRightRef,y=p.tableBodyContainerRef,S=p.hiddenColumns,E=p.headersRef,M=n.useState(0),j=M[0],H=M[1],D=n.useState(void 0),N=D[0],T=D[1],L=n.useState(0),O=L[0],W=L[1];n.useEffect((function(){var e=function(){var e,n,r;H((null===(e=d.current)||void 0===e?void 0:e.clientWidth)?d.current.clientWidth+1:0),T(null===(n=o.current)||void 0===n?void 0:n.clientWidth),W((null===(r=h.current)||void 0===r?void 0:r.clientWidth)?h.current.clientWidth+1:0)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[d,o,h,l]),function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],l=i[1];n.useEffect((function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[r,a,o]),n.useEffect((function(){var e=null==r?void 0:r.current,n=null==t?void 0:t.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;l(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[r,t])}({headerContainerRef:a,mainSectionRef:y,scrollbarWidth:C});var P,A,z=n.useRef(null),U=(P=0,(A=function(e){e.forEach((function(e){P+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&A(e.rowMeta.children)}))})(i),P)*(x+1)-1,J=n.useMemo((function(){return F({headersRef:E,hiddenColumns:S,pinnedLeftColumns:s,pinnedRightColumns:f})}),[E,S,s,f]),V=n.useMemo((function(){var e={};return w.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[w]),q=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?r(r({},t),{rowMeta:r(r({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};m((function(e){return e.map(n)}))},K={headerContainerRef:a,headers:E.current,hiddenColumns:S,isWidthDragging:l,rowHeight:x,visibleRows:w,columnIndices:J,rowIndices:V};return e.jsxs("div",r({className:"st-body-container",ref:y,onScroll:function(e){var n=e.currentTarget.scrollTop;z.current&&cancelAnimationFrame(z.current),z.current=requestAnimationFrame((function(){g(n)}))}},{children:[s.length>0&&e.jsx(B,r({},K,{onExpandRowClick:q,pinned:"left",sectionRef:R,templateColumns:u,totalHeight:U,width:j})),e.jsx(B,r({},K,{onExpandRowClick:q,sectionRef:I,templateColumns:c,totalHeight:U,width:N})),f.length>0&&e.jsx(B,r({},K,{onExpandRowClick:q,pinned:"right",sectionRef:b,templateColumns:v,totalHeight:U,width:O}))]}))},A=function(e,r){n.useEffect((function(){if(e.current){var n=e.current,t=function(){var e,t=null==n?void 0:n.scrollLeft;void 0!==t&&(null===(e=r.current)||void 0===e||e.scrollTo(t,0))};return n.addEventListener("scroll",t),function(){null==n||n.removeEventListener("scroll",t)}}}),[e,r])},z=function(e){var n=e.event,r=e.forceUpdate,t=e.header,o=e.headersRef,i=e.gridColumnEnd,a=e.gridColumnStart,l=e.setIsWidthDragging,c=e.startWidth;l(!0),n.preventDefault();var s=n.clientX;if(t){var d="number"==typeof t.minWidth?t.minWidth:40,u=function(e){return e.children&&0!==e.children.length?e.children.flatMap((function(e){return u(e)})):[e]},f=i-a>1,h=f?u(t):[t],m=function(e){var n="right"===t.pinned?s-e.clientX:e.clientX-s;if(f&&h.length>1){var i=h.reduce((function(e,n){return Math.min(e,"number"==typeof n.minWidth?n.minWidth:40)}),40),a=h.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),l=Math.max(c+n,i)-a;h.forEach((function(e){var n="number"==typeof e.width?e.width:150,r=l*(n/a),t=Math.max(n+r,d);e.width=t}))}else{var u=Math.max(c+n,d);t.width=u}var m=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(v({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){m(e)}))};o.current.forEach((function(e){m(e)})),r()},g=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g),l(!1)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)}},U=n.forwardRef((function(t,o){var a,l,c=t.colIndex,s=t.forceHeadersUpdate,d=t.gridColumnEnd,u=t.gridColumnStart,f=t.gridRowEnd,h=t.gridRowStart,m=t.header,g=t.reverse,w=t.sort,p=k(),x=p.columnReordering,C=p.columnResizing,I=p.draggedHeaderRef,b=p.forceUpdate,y=p.headersRef,S=p.hoveredHeaderRef,M=p.onColumnOrderChange,j=p.onSort,H=p.onTableHeaderDragEnd,D=p.rowHeight,N=p.selectColumns,T=p.selectableColumns,L=p.setInitialFocusedCell,O=p.setIsWidthDragging,W=p.setSelectedCells,B=p.setSelectedColumns,F=p.sortDownIcon,P=p.sortUpIcon,A=Boolean(null==m?void 0:m.isSortable),U="st-header-cell ".concat(m.accessor===(null===(a=S.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(l=I.current)||void 0===l?void 0:l.accessor)===m.accessor?"st-dragging":""," ").concat(A?"clickable":""," ").concat(x&&!A?"columnReordering":""," ").concat("right"===(null==m?void 0:m.align)?"right-aligned":"center"===(null==m?void 0:m.align)?"center-aligned":""),J=E({draggedHeaderRef:I,headersRef:y,hoveredHeaderRef:S,onColumnOrderChange:M,onTableHeaderDragEnd:H}),V=J.handleDragStart,q=J.handleDragEnd,K=J.handleDragOver,X=R(),G=function(e){var n=e.event,r=e.header;if(T){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=t(l,o)}return o};return t(e,n),r}(r,c);return n.shiftKey&&N?B((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],a=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<a&&(a=r,o=e)}));var l,c,s,d,u=i(i([],(l=o,c=n,s=Math.min(l,c),d=Math.max(l,c),Array.from({length:d-s+1},(function(e,n){return s+n}))),!0),t,!0);return new Set(i(i([],Array.from(e),!0),u,!0))})):N&&N(t),W(new Set),void L(null)}r.isSortable&&j(c,r.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!m)return null;var Y=C&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;X({callback:z,callbackProps:{event:e.nativeEvent,forceUpdate:b,header:m,headersRef:y,gridColumnEnd:d,gridColumnStart:u,setIsWidthDragging:O,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),_=w&&w.key.accessor===m.accessor&&e.jsxs("div",r({className:"st-sort-icon-container",onClick:function(e){return G({event:e,header:m})}},{children:["ascending"===w.direction&&P&&P,"descending"===w.direction&&F&&F]}));return e.jsxs("div",r({className:U,id:v({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){X({callback:K,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:o,style:r(r({gridRowStart:h,gridRowEnd:f,gridColumnStart:u,gridColumnEnd:d},d-u>1?{}:{width:m.width}),f-h>1?{}:{height:D})},{children:[g&&Y,e.jsxs("div",r({className:"st-header-label ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":""),draggable:x&&!m.disableReorder,onClick:function(e){return G({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),q(),s()},onDragStart:function(e){x&&m&&function(e){V(e)}(m)}},{children:["right"===m.align&&_,null==m?void 0:m.label,"right"!==m.align&&_]})),!g&&Y]}))})),J=function(t){var o=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,l=t.headersRef,c=t.hiddenColumns,s=t.maxDepth,d=t.pinned,u=t.sectionRef,f=t.sort,h=n.useReducer((function(e){return e+1}),0)[1],v=n.useMemo((function(){var e=[],n=1,r=function(t,i,a){var l,u;if(void 0===a&&(a=!1),!m({hiddenColumns:c,header:t,pinned:d}))return 0;a||n++;var f=null!==(u=null===(l=t.children)||void 0===l?void 0:l.filter((function(e){return m({hiddenColumns:c,header:e,pinned:d})})).length)&&void 0!==u?u:0,h=n,v=f>0?h+f:h+1,g=i,w=f>0?i+1:s+1;if(e.push({header:t,gridColumnStart:h,gridColumnEnd:v,gridRowStart:g,gridRowEnd:w,colIndex:o[t.accessor]}),t.children){var p=!0;t.children.forEach((function(e){m({hiddenColumns:c,header:e,pinned:d})&&(r(e,i+1,p),p=!1)}))}return v-h},t=l.current.filter((function(e){return m({hiddenColumns:c,header:e,pinned:d})})),i=!0;return t.forEach((function(e){r(e,1,i),i=!1})),e}),[l,c,s,d,o]);return e.jsx("div",r({className:"st-header-".concat(d?"pinned-".concat(d):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(D,r({rowIndex:0},{children:v.map((function(r){return e.jsx(U,{colIndex:r.colIndex,forceHeadersUpdate:h,gridColumnEnd:r.gridColumnEnd,gridColumnStart:r.gridColumnStart,gridRowEnd:r.gridRowEnd,gridRowStart:r.gridRowStart,header:r.header,ref:n.createRef(),reverse:"right"===d,sort:f},r.header.accessor)}))}))}))},V=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(V)):1},q=function(t){var o=t.centerHeaderRef,i=t.headerContainerRef,a=t.headersRef,l=t.hiddenColumns,c=t.mainTemplateColumns,s=t.pinnedLeftColumns,d=t.pinnedLeftHeaderRef,u=t.pinnedLeftTemplateColumns,f=t.pinnedRightColumns,h=t.pinnedRightHeaderRef,v=t.pinnedRightTemplateColumns,g=t.sort,w=k().mainBodyRef;A(w,o);var p=n.useMemo((function(){return F({headersRef:a,hiddenColumns:l,pinnedLeftColumns:s,pinnedRightColumns:f})}),[a,l,s,f]),x=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(m({hiddenColumns:l,header:e})){var r=V(e);n=Math.max(n,r)}})),{maxDepth:n}}),[a,l]).maxDepth;return e.jsxs("div",r({className:"st-header-container",ref:i},{children:[s.length>0&&e.jsx(J,{columnIndices:p,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"left",sectionRef:d,sort:g}),e.jsx(J,{columnIndices:p,gridTemplateColumns:c,handleScroll:function(e){var n,r,t=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==t&&(null===(r=w.current)||void 0===r||r.scrollTo(t,0))},headersRef:a,hiddenColumns:l,maxDepth:x,sectionRef:o,sort:g}),f.length>0&&e.jsx(J,{columnIndices:p,gridTemplateColumns:v,handleScroll:void 0,headersRef:a,hiddenColumns:l,maxDepth:x,pinned:"right",sectionRef:h,sort:g})]}))},K=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},X=function(t){var o=t.flattenedRows,i=t.isWidthDragging,a=t.setFlattenedRows,l=t.setScrollTop,c=t.sort,s=t.visibleRows,d=k(),u=d.editColumns,f=d.headersRef,h=d.hiddenColumns,v=n.useRef(null),m=n.useRef(null),g=n.useRef(null),w=n.useRef(null),p=f.current.filter((function(e){return!e.pinned})),x=f.current.filter((function(e){return"left"===e.pinned})),C=f.current.filter((function(e){return"right"===e.pinned})),I=n.useMemo((function(){return K({headers:x,hiddenColumns:h})}),[x,h]),R=n.useMemo((function(){return K({headers:p,hiddenColumns:h})}),[p,h]),b=n.useMemo((function(){return K({headers:C,hiddenColumns:h})}),[C,h]),y={centerHeaderRef:g,headerContainerRef:v,headersRef:f,hiddenColumns:h,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,sort:c},S={centerHeaderRef:g,flattenedRows:o,headerContainerRef:v,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftHeaderRef:m,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightHeaderRef:w,pinnedRightTemplateColumns:b,setFlattenedRows:a,setScrollTop:l,visibleRows:s};return e.jsxs("div",r({className:"st-content",style:{width:u?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(q,r({},y)),e.jsx(P,r({},S))]}))},G=function(e){var r=e.callback,t=e.ref,o=e.widthAttribute;n.useEffect((function(){var e=t.current;if(e){var n=function(){r(e[o]||0)};n();var i=new ResizeObserver((function(){n()}));return i.observe(e),function(){return i.disconnect()}}}),[r,t,o])},Y=function(t){var o,i,a=t.mainBodyRef,l=t.pinnedLeftRef,c=t.pinnedRightRef,s=t.tableBodyContainerRef,d=k().editColumns,u=n.useState(0),f=u[0],h=u[1],v=n.useState(0),m=v[0],g=v[1],w=n.useState(0),p=w[0],x=w[1],C=n.useState(!1),I=C[0],R=C[1],b=n.useRef(null),y=s.current&&s.current.scrollHeight>s.current.clientHeight,S=m+(d?28:0)+(s.current&&y?s.current.offsetWidth-s.current.clientWidth:0)-.6;return G({widthAttribute:"offsetWidth",callback:h,ref:l}),G({widthAttribute:"offsetWidth",callback:g,ref:c}),A(a,b),n.useEffect((function(){setTimeout((function(){!function(){if(a.current){var e=a.current.scrollWidth,n=a.current.clientWidth;console.log(e,n),x(e),R(e>n)}}()}),1)}),[a]),I?e.jsxs("div",r({className:"st-horizontal-scrollbar-container"},{children:[f>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:f,height:null===(o=b.current)||void 0===o?void 0:o.offsetHeight}}),p>0&&e.jsx("div",r({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&a.current&&a.current.scrollTo({left:n,behavior:"auto"})},ref:b,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:p,height:".3px"}})})),m>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:S,height:null===(i=b.current)||void 0===i?void 0:i.offsetHeight}})]})):null},_={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return _.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?_.string(e,n,r):"number"==typeof e&&"number"==typeof n?_.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?_.boolean(e,n,r):_.string(String(e),String(n),r)}},$=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return _.number(i,a,t)}return"date"===r?_.date(String(e),String(n),t):"boolean"===r?_.boolean(Boolean(e),Boolean(n),t):"enum"===r?_.enum(String(e),String(n),t):_.string(String(e),String(n),t)},Q=function(e,n,t){var o,a=(null===(o=n.key)||void 0===o?void 0:o.type)||"string",l=n.direction,c=new Map,s=new Map,d="";e.forEach((function(e){var r;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var t=(e.rowData.sector||"group_".concat(c.size)).toString();d=t,s.set(d,e),c.has(d)||c.set(d,[])}else if(d){var o=c.get(d)||[];o.push(e),c.set(d,o)}else{var i="default";c.has(i)||c.set(i,[]),null===(r=c.get(i))||void 0===r||r.push(e)}}));var u=[];return c.forEach((function(e,o){if(s.has(o)){var c=s.get(o);c.rowMeta.children&&c.rowMeta.children.length>0&&(c.rowMeta.children=Z(c.rowMeta.children,n,t)),u.push(c)}var d=i([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return $(o,i,a,l)}));u.push.apply(u,d.map((function(e){var o=r({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var i=Z(o.rowMeta.children,n,t);o.rowMeta=r(r({},o.rowMeta),{children:i})}return o})))})),u},Z=function(e,n,t){var o=t.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",l=n.direction;return i([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,o=e.rowData[t],i=r.rowData[t];return $(o,i,a,l)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?r(r({},e),{rowMeta:r(r({},e.rowMeta),{children:Z(e.rowMeta.children,n,t)})}):e}))},ee=function(e){var r=e.headers,t=e.tableRows,o=n.useState(null),i=o[0],a=o[1],l=n.useMemo((function(){var e={};return r.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[r]),c=n.useState(l),s=c[0],d=c[1],u=n.useMemo((function(){if(!i)return t;var e=function(e,n,r){return{sortedData:Q(n,r,e),newSortConfig:r}}(r,t,i).sortedData;return e}),[t,i,r]);return{hiddenColumns:s,setHiddenColumns:d,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(r);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},ne=function(t){var o=t.checked,i=void 0!==o&&o,a=t.children,l=t.onChange,c=n.useState(i),s=c[0],d=c[1];return e.jsxs("label",r({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:s,className:"st-checkbox-input",onChange:function(){var e=!s;d(e),l&&l(e)},type:"checkbox"}),e.jsx("span",r({className:"st-checkbox-custom ".concat(s?"st-checked":"")},{children:s&&e.jsx("span",{className:"st-checkbox-checkmark"})})),a]}))},re=function(n){var t=n.headers,o=n.open,i=n.position;n.setOpen;var a=n.setHiddenColumns,l=n.hiddenColumns,c="left"===i?"left":"";return e.jsx("div",r({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(c),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",r({className:"st-column-editor-popout-content"},{children:t.map((function(n,t){return e.jsx(ne,r({checked:l[n.accessor],onChange:function(e){var t;return a(r(r({},l),((t={})[n.accessor]=e,t)))}},{children:n.label}),t)}))}))}))},te=function(t){var o=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.hiddenColumns,s=t.position,d=void 0===s?"right":s,u=t.setHiddenColumns,f=n.useState(a),h=f[0],v=f[1];return i?e.jsxs("div",r({className:"st-column-editor ".concat(h?"open":""," ").concat(d),onClick:function(){return function(e){v(e)}(!h)},style:{width:28}},{children:[e.jsx("div",r({className:"st-column-editor-text"},{children:o})),e.jsx(re,{headers:l,open:h,position:d,setOpen:v,setHiddenColumns:u,hiddenColumns:c})]})):null},oe=function(t){var o=t.allowAnimations,i=void 0!==o&&o,f=t.cellUpdateFlash,h=void 0!==f&&f,v=t.collapseIcon,m=void 0===v?e.jsx(u,{className:"st-sort-icon"}):v,w=t.columnEditorPosition,p=void 0===w?"right":w,x=t.columnEditorText,C=void 0===x?"Columns":x,I=t.columnReordering,R=void 0!==I&&I,b=t.columnResizing,y=void 0!==b&&b,S=t.defaultHeaders,E=t.editColumns,M=void 0!==E&&E,k=t.editColumnsInitOpen,H=void 0!==k&&k,D=t.expandIcon,N=void 0===D?e.jsx(s,{className:"st-sort-icon"}):D,T=t.height,L=t.hideFooter,O=void 0!==L&&L,W=t.nextIcon,B=void 0===W?e.jsx(s,{className:"st-next-prev-icon"}):W,F=t.onCellEdit,P=t.onColumnOrderChange,A=t.onGridReady,z=t.onNextPage,U=t.prevIcon,J=void 0===U?e.jsx(c,{className:"st-next-prev-icon"}):U,V=t.rowHeight,q=void 0===V?40:V,K=t.rows,G=t.rowsPerPage,_=void 0===G?10:G,$=t.selectableCells,Q=void 0!==$&&$,Z=t.selectableColumns,ne=void 0!==Z&&Z,re=t.shouldPaginate,oe=void 0!==re&&re,ie=t.sortDownIcon,ae=void 0===ie?e.jsx(u,{className:"st-sort-icon"}):ie,le=t.sortUpIcon,ce=void 0===le?e.jsx(d,{className:"st-sort-icon"}):le,se=t.tableRef,de=t.theme,ue=void 0===de?"light":de,fe=n.useRef(null),he=n.useRef(S),ve=n.useRef(null),me=n.useRef(null),ge=n.useRef(null),we=n.useRef(null),pe=n.useRef(null),xe=n.useState(!1),Ce=xe[0],Ie=xe[1],Re=n.useState(1),be=Re[0],ye=Re[1],Se=n.useState(0),Ee=Se[0],Me=Se[1],je=n.useState(0),ke=je[0],He=je[1],De=ee({headers:he.current,tableRows:K}),Ne=De.sort,Te=De.sortedRows,Le=De.hiddenColumns,Oe=De.setHiddenColumns,We=De.updateSort;n.useEffect((function(){null==A||A()}),[A]);var Be=n.useMemo((function(){if(!oe)return Te;var e=(be-1)*_,n=e+_;return Te.slice(e,n)}),[be,_,oe,Te]),Fe=n.useState(Be),Pe=Fe[0],Ae=Fe[1];n.useEffect((function(){Ae(Be)}),[Be]);var ze=n.useMemo((function(){var e;if(!T)return window.innerHeight-q;var n=document.querySelector(".simple-table-root"),r=0;if(T.endsWith("px"))r=parseInt(T,10);else if(T.endsWith("vh")){var t=parseInt(T,10);r=window.innerHeight*t/100}else if(T.endsWith("%")){var o=parseInt(T,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-q)}),[T,q]),Ue=n.useMemo((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=[],c=0,s=Math.max(0,i-a*n),d=i+r+a*n,u=function(e,n){for(var r,t=0,o=e;t<o.length;t++){var i=o[t],f=c*a;if(f>=d)break;f+a>s&&l.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(r=i.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(t,0),l}({bufferRowCount:5,contentHeight:ze,flattenedRows:Pe,rowHeight:q,scrollTop:ke})}),[ze,q,Pe,ke]),Je=n.useReducer((function(e){return e+1}),0)[1],Ve=function(e){var r=e.selectableCells,t=e.headers,o=e.visibleRows,i=n.useState(new Set),l=i[0],c=i[1],s=n.useState(new Set),d=s[0],u=s[1],f=n.useState(null),h=f[0],v=f[1],m=n.useState(null),g=m[0],w=m[1],p=n.useRef(!1),x=n.useRef(null),C=n.useCallback((function(){var e=Array.from(l).reduce((function(e,n){var r=n.split("-").map(Number),i=r[0],a=r[1];return e[i]||(e[i]=[]),e[i][a]=o[i].row.rowData[t[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");l.size>0&&navigator.clipboard.writeText(n)}),[t,l,o]),I=n.useCallback((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),l=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),d=t;d<=i;d++)for(var f=l;f<=s;f++)if(d>=0&&d<o.length){var h=o[d].row.rowMeta.rowId;r.add(a({colIndex:f,rowIndex:d,rowId:h}))}u(new Set),v(null),c(r)}),[o,u,v,c]),R=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<t.length){var n=a(e);u(new Set),v(null),c(new Set([n])),w(e)}}),[t.length,o.length,u,v,c,w]),b=n.useCallback((function(e,n){void 0===n&&(n=!1),c(new Set),w(null),u((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&v(e[e.length-1])}),[c,w,u,v]);n.useEffect((function(){var e=function(e){if(r&&g){var n=g.rowIndex,i=g.colIndex,a=g.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var l=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===l)return;n=l}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};R(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(s={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},R(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(s={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},R(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<t.length-1&&(s={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},R(s))):"Escape"===e.key&&(c(new Set),u(new Set),v(null),x.current=null,w(null))}else C()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[C,t.length,g,I,R,r,o]);var y=n.useCallback((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=a({colIndex:n,rowIndex:r,rowId:t}),i=l.has(o),c=d.has(n);return i||c}),[l,d]),S=n.useCallback((function(e){var n,r,t,i,a,l,c=e.colIndex,s=e.rowIndex,u=e.rowId,f=[],h=null===(t=null===(r=null===(n=o[s-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:c,rowIndex:s+1,rowId:null===(l=null===(a=null===(i=o[s+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===l?void 0:l.rowId},m={colIndex:c-1,rowIndex:s,rowId:u},g={colIndex:c+1,rowIndex:s,rowId:u};return(!y({colIndex:c,rowIndex:s-1,rowId:h})||d.has(c)&&0===s)&&f.push("st-selected-top-border"),(!y(v)||d.has(c)&&s===o.length-1)&&f.push("st-selected-bottom-border"),y(m)||f.push("st-selected-left-border"),y(g)||f.push("st-selected-right-border"),f.join(" ")}),[y,o,d]),E=n.useMemo((function(){return g?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===g.rowIndex&&r===g.colIndex&&t===g.rowId}:function(){return!1}}),[g]);return{getBorderClass:S,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){p.current=!0,x.current={rowIndex:t,colIndex:n,rowId:o},u(new Set),v(null);var i=a({colIndex:n,rowIndex:t,rowId:o});c(new Set([i])),w({rowIndex:t,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,t=e.rowIndex;if(e.rowId,r&&p.current&&x.current){for(var i=new Set,l=Math.min(x.current.rowIndex,t),s=Math.max(x.current.rowIndex,t),d=Math.min(x.current.colIndex,n),u=Math.max(x.current.colIndex,n),f=l;f<=s;f++)for(var h=d;h<=u;h++)if(f>=0&&f<o.length){var v=o[f].row.rowMeta.rowId;i.add(a({colIndex:h,rowIndex:f,rowId:v}))}c(i)}},handleMouseUp:function(){p.current=!1},isInitialFocusedCell:E,isSelected:y,lastSelectedColumnIndex:h,selectColumns:b,selectedCells:l,selectedColumns:d,setInitialFocusedCell:w,setSelectedCells:c,setSelectedColumns:u}}({selectableCells:Q,headers:he.current,visibleRows:Ue}),qe=Ve.handleMouseDown,Ke=Ve.handleMouseOver,Xe=Ve.handleMouseUp,Ge=Ve.isSelected,Ye=Ve.getBorderClass,_e=Ve.isInitialFocusedCell,$e=Ve.setSelectedCells,Qe=Ve.setSelectedColumns,Ze=Ve.selectColumns,en=Ve.setInitialFocusedCell,nn=n.useCallback((function(e,n){We(e,n)}),[We]),rn=n.useCallback((function(e){he.current=e,Je()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ne&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||($e(new Set),ne&&Qe(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ne,$e,Qe]),n.useLayoutEffect((function(){if(pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Me(e)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Je(),pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Me(e)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var tn=n.useRef(new Map);return n.useEffect((function(){se&&(se.current={updateData:function(e){var n,r,t,o,i=e.accessor,a=e.rowIndex,l=e.newValue,c=null===(r=null===(n=null==K?void 0:K[a])||void 0===n?void 0:n.rowMeta)||void 0===r?void 0:r.rowId;if(void 0!==c){var s=g({rowId:c,accessor:i}),d=tn.current.get(s);d&&d.updateContent(l),void 0!==(null===(o=null===(t=null==K?void 0:K[a])||void 0===t?void 0:t.rowData)||void 0===o?void 0:o[i])&&(K[a].rowData[i]=l)}}})}),[se,K]),e.jsx(j,r({value:{allowAnimations:i,cellUpdateFlash:h,collapseIcon:m,columnReordering:R,columnResizing:y,draggedHeaderRef:fe,editColumns:M,expandIcon:N,forceUpdate:Je,getBorderClass:Ye,handleMouseDown:qe,handleMouseOver:Ke,headersRef:he,hiddenColumns:Le,hoveredHeaderRef:ve,isInitialFocusedCell:_e,isSelected:Ge,mainBodyRef:me,onCellEdit:F,onColumnOrderChange:P,onSort:nn,onTableHeaderDragEnd:rn,pinnedLeftRef:ge,pinnedRightRef:we,rowHeight:q,scrollbarWidth:Ee,selectColumns:Ze,selectableColumns:ne,setInitialFocusedCell:en,setIsWidthDragging:Ie,setSelectedCells:$e,setSelectedColumns:Qe,shouldPaginate:oe,sortDownIcon:ae,sortUpIcon:ce,tableBodyContainerRef:pe,cellRegistry:tn.current}},{children:e.jsxs("div",r({className:"simple-table-root st-wrapper theme-".concat(ue),style:T?{height:T}:{}},{children:[e.jsxs("div",r({className:"st-wrapper-container"},{children:[e.jsxs("div",r({className:"st-content-wrapper",onMouseUp:Xe,onMouseLeave:Xe},{children:[e.jsx(X,{flattenedRows:Pe,isWidthDragging:Ce,setFlattenedRows:Ae,setScrollTop:He,sort:Ne,visibleRows:Ue}),e.jsx(te,{columnEditorText:C,editColumns:M,editColumnsInitOpen:H,headers:he.current,hiddenColumns:Le,position:p,setHiddenColumns:Oe})]})),e.jsx(Y,{mainBodyRef:me,pinnedLeftRef:ge,pinnedRightRef:we,tableBodyContainerRef:pe})]})),e.jsx(l,{currentPage:be,hideFooter:O,nextIcon:B,onPageChange:ye,onNextPage:z,prevIcon:J,shouldPaginate:oe,totalPages:Math.ceil(K.length/_)})]}))}))};exports.SimpleTable=function(t){var o=n.useState(!1),i=o[0],a=o[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(oe,r({},t)):null};
2
2
  //# sourceMappingURL=index.js.map
package/dist/styles.css CHANGED
@@ -1,6 +1,6 @@
1
1
  @import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:1rem;--st-font-weight-normal:400;--st-font-weight-bold:700;--st-transition-duration:0.3s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:#0000;--st-scrollbar-thumb-color:var(--st-slate-200);--st-cell-flash-color:var(--st-slate-300);--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09}.theme-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-slate-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-slate-50);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(
2
2
  --st-slate-900
3
- );--st-dragging-background-color:var(--st-slate-200);--st-selected-cell-background-color:var(--st-blue-100);--st-selected-first-cell-background-color:var(--st-blue-50);--st-footer-background-color:var(--st-slate-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-slate-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-top-color:var(--st-blue-500);--st-selected-border-bottom-color:var(--st-blue-500);--st-selected-border-left-color:var(--st-blue-500);--st-selected-border-right-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-slate-100);--st-button-active-background-color:var(--st-blue-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-500);--st-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-gray-900);--st-scrollbar-thumb-color:var(--st-gray-600);--st-border-color:var(--st-gray-700);--st-odd-row-background-color:var(--st-gray-800);--st-even-row-background-color:var(--st-gray-900);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(
3
+ );--st-dragging-background-color:var(--st-slate-200);--st-selected-cell-background-color:var(--st-blue-100);--st-selected-first-cell-background-color:var(--st-blue-50);--st-footer-background-color:var(--st-slate-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-slate-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-top-color:var(--st-blue-500);--st-selected-border-bottom-color:var(--st-blue-500);--st-selected-border-left-color:var(--st-blue-500);--st-selected-border-right-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-slate-100);--st-button-active-background-color:var(--st-blue-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-500);--st-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-gray-900);--st-scrollbar-thumb-color:var(--st-gray-600);--st-border-color:var(--st-gray-700);--st-odd-row-background-color:var(--st-gray-800);--st-even-row-background-color:var(--st-gray-900);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(
4
4
  --st-gray-100
5
5
  );--st-dragging-background-color:var(--st-gray-600);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-gray-900);--st-cell-color:var(--st-gray-100);--st-cell-odd-row-color:var(--st-gray-200);--st-edit-cell-shadow:0 1px 3px 0 #ffffff1a;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-gray-500);--st-separator-border-color:var(--st-gray-600);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-top-color:var(--st-blue-400);--st-selected-border-bottom-color:var(--st-blue-400);--st-selected-border-left-color:var(--st-blue-400);--st-selected-border-right-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-500);--st-checkbox-checked-border-color:var(--st-blue-500);--st-column-editor-background-color:var(--st-gray-800);--st-column-editor-popout-background-color:var(--st-gray-800);--st-button-hover-background-color:var(--st-gray-700);--st-button-active-background-color:var(--st-blue-500);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-400);--st-cell-flash-color:var(--st-gray-600)}.theme-neutral{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-spacing-large:16px;--st-scrollbar-bg-color:var(--st-neutral-100);--st-scrollbar-thumb-color:var(--st-neutral-400);--st-border-color:var(--st-neutral-300);--st-odd-row-background-color:var(--st-neutral-50);--st-even-row-background-color:var(--st-neutral-100);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(
6
6
  --st-neutral-900
@@ -8,4 +8,4 @@
8
8
  --st-blue-900
9
9
  );--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-blue-300);--st-footer-background-color:var(--st-blue-50);--st-cell-color:var(--st-blue-900);--st-cell-odd-row-color:var(--st-blue-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-blue-900);--st-selected-first-cell-color:var(--st-blue-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-blue-200);--st-last-group-row-separator-border-color:var(--st-blue-400);--st-selected-border-top-color:var(--st-blue-600);--st-selected-border-bottom-color:var(--st-blue-600);--st-selected-border-left-color:var(--st-blue-600);--st-selected-border-right-color:var(--st-blue-600);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-blue-50);--st-column-editor-popout-background-color:var(--st-blue-50);--st-button-hover-background-color:var(--st-blue-200);--st-button-active-background-color:var(--st-blue-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-blue-500);--st-cell-flash-color:var(--st-blue-300)}.theme-funky{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:12px;--st-font-size:0.95rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.25s;--st-transition-ease:cubic-bezier(0.4,0,0.2,1);--st-opacity-disabled:0.6;--st-spacing-small:6px;--st-spacing-medium:10px;--st-spacing-large:20px;--st-scrollbar-bg-color:var(--st-stone-100);--st-scrollbar-thumb-color:var(--st-violet-500);--st-border-color:var(--st-stone-200);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(
10
10
  --st-white
11
- );--st-dragging-background-color:var(--st-violet-50);--st-selected-cell-background-color:var(--st-violet-50);--st-selected-first-cell-background-color:var(--st-violet-100);--st-footer-background-color:var(--st-stone-100);--st-cell-color:var(--st-stone-700);--st-cell-odd-row-color:var(--st-stone-700);--st-edit-cell-shadow:0 4px 6px -1px #7c3aed1a,0 2px 4px -1px #7c3aed0f;--st-selected-cell-color:var(--st-violet-800);--st-selected-first-cell-color:var(--st-violet-800);--st-resize-handle-color:var(--st-violet-400);--st-separator-border-color:var(--st-stone-200);--st-last-group-row-separator-border-color:var(--st-stone-300);--st-selected-border-top-color:var(--st-violet-500);--st-selected-border-bottom-color:var(--st-violet-500);--st-selected-border-left-color:var(--st-violet-500);--st-selected-border-right-color:var(--st-violet-500);--st-checkbox-checked-background-color:var(--st-violet-500);--st-checkbox-checked-border-color:var(--st-violet-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-violet-50);--st-button-active-background-color:var(--st-violet-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-violet-500);--st-cell-flash-color:var(--st-violet-200)}.simple-table-root,.st-body-container,.st-body-main,.st-body-pinned-left,.st-body-pinned-right,.st-cell,.st-column-editor,.st-column-editor-popout,.st-content,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-wrapper,.st-wrapper-container{-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:sans-serif;font-family:var(--st-font-family,sans-serif)}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{overflow:auto;scrollbar-width:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color);color:var(--st-cell-odd-row-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-label.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-header-label.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-header-label.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell-content,.st-header-label{-webkit-box-flex:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label{color:var(--st-header-label-color);padding-right:var(--st-cell-padding)}.st-cell-content{color:var(--st-cell-color);padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color);border-left:var(--st-border-width) solid var(--st-selected-border-left-color);border-right:var(--st-border-width) solid var(--st-selected-border-right-color);color:var(--st-selected-first-cell-color)}.st-cell-selected-first,.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-top-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-left-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-right-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color);height:100%}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{background-color:var(--st-scrollbar-bg-color)}.st-horizontal-scrollbar-middle{min-height:11px;overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);-webkit-box-sizing:border-box;box-sizing:border-box;font-size:var(--st-font-size);height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-small);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-column-editor-popout.open{width:200px}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium)}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}
11
+ );--st-dragging-background-color:var(--st-violet-50);--st-selected-cell-background-color:var(--st-violet-50);--st-selected-first-cell-background-color:var(--st-violet-100);--st-footer-background-color:var(--st-stone-100);--st-cell-color:var(--st-stone-700);--st-cell-odd-row-color:var(--st-stone-700);--st-edit-cell-shadow:0 4px 6px -1px #7c3aed1a,0 2px 4px -1px #7c3aed0f;--st-selected-cell-color:var(--st-violet-800);--st-selected-first-cell-color:var(--st-violet-800);--st-resize-handle-color:var(--st-violet-400);--st-separator-border-color:var(--st-stone-200);--st-last-group-row-separator-border-color:var(--st-stone-300);--st-selected-border-top-color:var(--st-violet-500);--st-selected-border-bottom-color:var(--st-violet-500);--st-selected-border-left-color:var(--st-violet-500);--st-selected-border-right-color:var(--st-violet-500);--st-checkbox-checked-background-color:var(--st-violet-500);--st-checkbox-checked-border-color:var(--st-violet-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-violet-50);--st-button-active-background-color:var(--st-violet-600);--st-font-family:"Inter",sans-serif;--st-editable-cell-focus-border-color:var(--st-violet-500);--st-cell-flash-color:var(--st-violet-200)}.simple-table-root,.st-body-container,.st-body-main,.st-body-pinned-left,.st-body-pinned-right,.st-cell,.st-column-editor,.st-column-editor-popout,.st-content,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-wrapper,.st-wrapper-container{-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:sans-serif;font-family:var(--st-font-family,sans-serif)}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{overflow:auto;scrollbar-width:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color);color:var(--st-cell-odd-row-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-label.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-header-label.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-header-label.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell-content,.st-header-label{-webkit-box-flex:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label{color:var(--st-header-label-color);padding-right:var(--st-cell-padding)}.st-cell-content{color:var(--st-cell-color);padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color);border-left:var(--st-border-width) solid var(--st-selected-border-left-color);border-right:var(--st-border-width) solid var(--st-selected-border-right-color);color:var(--st-selected-first-cell-color)}.st-cell-selected-first,.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-top-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-bottom-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-left-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-right-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-scrollbar-bg-color);border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px;width:100%}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{height:100%}.st-horizontal-scrollbar-middle{min-height:11px;overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);-webkit-box-sizing:border-box;box-sizing:border-box;font-size:var(--st-font-size);height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-small);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-column-editor-popout.open{width:200px}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}
@@ -1,9 +1,10 @@
1
- import { Dispatch, SetStateAction } from "react";
1
+ import { Dispatch, RefObject, SetStateAction } from "react";
2
2
  import { HeaderObject } from "..";
3
3
  export type HandleResizeStartProps = {
4
4
  event: MouseEvent;
5
5
  forceUpdate: () => void;
6
6
  header: HeaderObject;
7
+ headersRef: RefObject<HeaderObject[]>;
7
8
  gridColumnEnd: number;
8
9
  gridColumnStart: number;
9
10
  setIsWidthDragging: Dispatch<SetStateAction<boolean>>;
@@ -1,2 +1,2 @@
1
1
  import { HandleResizeStartProps } from "../types/HandleResizeStartProps";
2
- export declare const handleResizeStart: ({ event, forceUpdate, header, gridColumnEnd, gridColumnStart, setIsWidthDragging, startWidth, }: HandleResizeStartProps) => void;
2
+ export declare const handleResizeStart: ({ event, forceUpdate, header, headersRef, gridColumnEnd, gridColumnStart, setIsWidthDragging, startWidth, }: HandleResizeStartProps) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "0.7.73",
3
+ "version": "0.7.75",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",