simple-table-core 1.4.3 → 1.4.5

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.
@@ -8,7 +8,6 @@ interface TableRowProps {
8
8
  columnIndices: ColumnIndices;
9
9
  gridTemplateColumns: string;
10
10
  headers: HeaderObject[];
11
- hoveredIndex: number | null;
12
11
  index: number;
13
12
  pinned?: Pinned;
14
13
  rowHeight: number;
@@ -16,5 +15,5 @@ interface TableRowProps {
16
15
  setHoveredIndex: (index: number | null) => void;
17
16
  tableRow: TableRowType;
18
17
  }
19
- declare const TableRow: ({ columnIndices, columnIndexStart, gridTemplateColumns, headers, hoveredIndex, index, pinned, rowHeight, rowIndices, setHoveredIndex, tableRow, }: TableRowProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const TableRow: ({ columnIndices, columnIndexStart, gridTemplateColumns, headers, index, pinned, rowHeight, rowIndices, setHoveredIndex, tableRow, }: TableRowProps) => import("react/jsx-runtime").JSX.Element;
20
19
  export default TableRow;
@@ -8,7 +8,6 @@ interface TableSectionProps {
8
8
  columnIndexStart?: number;
9
9
  columnIndices: ColumnIndices;
10
10
  headers: HeaderObject[];
11
- hoveredIndex: number | null;
12
11
  pinned?: Pinned;
13
12
  rowHeight: number;
14
13
  rowIndices: RowIndices;
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as f,cloneElement as h,forwardRef as v,useImperativeHandle as p,useReducer as g}from"react";var m=function(){return m=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},m.apply(this,arguments)};function w(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(e,n){var t,r,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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=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++,r=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],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=r(l,o)}return o};return r(e,n),t},I=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,I(e.children)),n})},S=function(e){return void 0===e&&(e=0),e?e+1:0},x=function(e,n,t){var r=function(e,n){for(var t=0,r=I(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?!e.summaryColumn:!0===e.summaryColumn)},R=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},E=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&x(n,r,o))||null},N=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},H=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return e.summaryColumn}).flatMap(function(e){return H(e,n)}):e.children.filter(function(e){return!e.summaryColumn}).flatMap(function(e){return H(e,n)}):[e]},k=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(R({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},A=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(R({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){A(e)})},F=function(e){return"number"==typeof e.minWidth?e.minWidth:40},D=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},T=function(e){return e.row[e.rowIdAccessor]},M=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=T({row:t,rowIdAccessor:c}),f=l[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return D(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},W=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},B=s(void 0),L=function(n){var t=n.children,r=n.value;return e(B.Provider,m({value:r},{children:t}))},O=function(){var e=u(B);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},P=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=O(),d=u.nextIcon,f=u.prevIcon,h=o(!0),v=h[0],p=h[1],g=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<s-1&&(t.push(-1),t.push(s)),t}();return n("div",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:f})),e("button",m({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",m({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",m({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},q=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},z=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},Y=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},j=function(e){return e.position*(e.rowHeight+1)-1},G=function(e){return e.position*(e.rowHeight+1)},K=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,f=n.containerRef,h=n.positioning,v=void 0===h?"fixed":h,p=O().mainBodyRef,g=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],I=o({}),S=I[0],x=I[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!w.current&&g.current.parentElement&&(w.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&w.current){var e,n=g.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==f?void 0:f.current)?f.current.getBoundingClientRect():(null==p?void 0:p.current)?p.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,f,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",m({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:m(m({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},S),{overflow:s})},{children:t})):null},U=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},V=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],f=function(e){d(e),i(e),l(!1),r()};return n(K,m({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(U,m({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(U,m({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},J=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},X=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},_=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=O(),d=u.nextIcon,f=u.prevIcon,h=o(s||new Date),v=h[0],p=h[1],g=o("days"),w=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",m({className:"st-datepicker"},{children:[n("div",m({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:f})),n("div",m({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",m({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",m({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var f=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(s).getDate()&&r===new Date(s).getMonth()&&t===new Date(s).getFullYear();n.push(e("div",m({className:"st-datepicker-day ".concat(i?"today":""," ").concat(a?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);p(n),l(n),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},h=1;h<=o;h++)f(h);var g=35-(i+o),w=function(t){n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(h=1;h<=g;h++)w(h);return n}(),"months"===w&&(i=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var r=t===v.getMonth();i.push(e("div",m({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",m({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",m({className:"st-datepicker-footer"},{children:e("button",m({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;p(e),l(e),null==c||c()}},{children:"Today"}))}))]}))},$=function(e){if(!e)return new Date;var n=e.toString().split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setFullYear(t),i.setMonth(r-1),i.setDate(o),isNaN(i.getTime())?new Date:i},Q=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(K,m({open:o,onClose:l,setOpen:i,width:280},{children:e(_,{value:$(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},Z=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(K,m({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(U,m({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},ee=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(V,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(Q,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(Z,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(X,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(J,{defaultValue:u,onBlur:s,onChange:o})},ne=0,te=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===ne||o-ne>=r)&&(ne=o,n(t))}},re=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},oe=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(oe);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=oe(e[t]));return n},ie=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ae=Date.now(),le={screenX:0,screenY:0},ce=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=ce(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},se=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ue(e,n,t){var r,o,i=oe(e),a=!1;try{var l=se(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=m({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),f=s;i.splice(f,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var de=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=O().setHeaders,l=re(t);return{handleDragStart:function(e){n.current=e,ae=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-le.screenX,2)+Math.pow(u-le.screenY,2));r.current=a;var f,h=n.current,v=!1;if(se(h)!==se(a)){f=(I=ue(t,h,a)).newHeaders,v=I.emergencyBreak}else{var p=t,g=ce(p,h.accessor),m=ce(p,a.accessor);if(!g||!m)return;var w=g.length,y=m.length,b=m;if(w!==y){var C=y-w;C>0&&(b=m.slice(0,-C))}var I=function(e,n,t){var r=oe(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);f=I.newHeaders,v=I.emergencyBreak}if(!(c||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-ae<1500||d<40)||(ae=S,le={screenX:s,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return b([],e,!0)}),null==o||o(t)},10)}}},fe=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},he={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ve={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},pe={duration:150,easing:"ease-out",delay:0},ge=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},me=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){ge(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},we=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return w(void 0,void 0,void 0,function(){var e,i,a;return y(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:fe()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),fe()?m(m({},pe),e):m(m({},"column"===n?he:ve),e)}(t,i?"column":"row"),ge(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,me(n,a,t)]);case 1:return l.sent(),[2]}})})},ye=function(e){var n=e.element,t=e.options;return w(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,f,h,v,p,g,m;return y(this,function(w){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,f=t.respectReducedMotion,h=void 0===f||f,fe()&&h?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,m=r-p,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(m,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},be=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children","id","parentRef","tableRow"]),c=O(),s=c.allowAnimations,u=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=i(null),p=i(null),g=re(f),w=re(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!w||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=m(m({},ve),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,I=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==I){var S=5*h,x=b-S,R=b+C+S,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,H=i.y<b,k=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,F=.6*h,D=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&k){var T=b+C+D(i.y,b,b+C)+A%15*F*2.5+A%7*(.4*h);return void ye({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&H){T=b-D(i.y,b,b+C)-A%15*F*2.5-A%7*(.4*h);return void ye({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var M=b+C+D(l.y,b,b+C)+A%10*F*1;return void ye({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){M=b-D(l.y,b,b+C)-A%10*F*1;return void ye({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}we({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,f,o,g,w,h,null==a?void 0:a.position,a]),e("div",m({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};be.displayName="Animate";var Ce=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:m({height:"10px"},r)},{children:e("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},Ie=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",m({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",m({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(Ce,{className:"st-checkbox-checkmark"})})),i]}))},Se=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},xe=function(t){var r=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,f=t.isInitialFocused,h=t.nestedIndex,v=t.rowIndex,p=t.tableRow,g=O(),w=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,C=g.draggedHeaderRef,I=g.enableRowSelection,S=g.expandIcon,x=g.handleMouseDown,E=g.handleMouseOver,H=g.handleRowSelect,k=g.headers,A=g.hoveredHeaderRef,F=g.isCopyFlashing,M=g.isRowSelected,W=g.isWarningFlashing,B=g.onCellEdit,L=g.onCellClick,P=g.onTableHeaderDragEnd,q=g.rowButtons,z=g.rowGrouping,Y=g.rowIdAccessor,j=g.rowsWithSelectedCells,G=g.selectedColumns,K=g.setUnexpandedRows,U=g.tableBodyContainerRef,V=g.theme,J=g.unexpandedRows,X=g.useOddColumnBackground,_=p.depth,$=p.row,Q=o($[u.accessor]),Z=Q[0],ne=Q[1],re=o(!1),oe=re[0],ie=re[1],ae=o(!1),le=ae[0],ce=ae[1],se=o(!1),ue=se[0],fe=se[1],he=i(null),ve=T({row:$,rowIdAccessor:Y}),pe=z&&z[_],ge=!!pe&&function(e,n){if(!n)return!1;var t=e[n];return D(t)}($,pe),me=!J.has(String(ve)),we=F({rowIndex:v,colIndex:s,rowId:ve}),ye=W({rowIndex:v,colIndex:s,rowId:ve}),Ce=a(function(){var e,n,t;if(!b)return!1;var r=k.filter(function(e){return"left"===e.pinned}),o=k.filter(function(e){return!e.pinned}),i=k.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,k,u.accessor,u.pinned]),xe=de({draggedHeaderRef:C,headers:k,hoveredHeaderRef:A,onTableHeaderDragEnd:P}).handleDragOver,Re=te(),Ee=R({accessor:u.accessor,rowId:ve}),Ne=N({rowId:ve,accessor:u.accessor}),He=u.isSelectionColumn&&I;c(function(){if(w){var e="".concat(ve,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){Z!==e?(ne(e),y&&(ce(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){ce(!1)},800))):ne(e)}}),function(){w.delete(e),he.current&&clearTimeout(he.current)}}},[w,y,ve,u.accessor,Z]),c(function(){if(le){var e=setTimeout(function(){ce(!1)},850);return function(){return clearTimeout(e)}}},[le]),c(function(){ne($[u.accessor])},[$,u.accessor]);var ke="boolean"===u.type||"date"===u.type||"enum"===u.type,Ae=Boolean(null==u?void 0:u.isEditable),Fe=G.has(s),De=d&&!Fe,Te=a(function(){return!!He&&j.has(String(ve))},[He,j,ve]),Me="st-cell ".concat(_>0&&u.expandable?"st-cell-depth-".concat(_):""," ").concat(De?f?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Fe?f?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ae?"clickable":""," ").concat(le?f?"st-cell-updating-first":"st-cell-updating":""," ").concat(we?f?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ye?f?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(X?h%2==0?"even-column":"odd-column":""," ").concat(He?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(Ce?"st-last-column":""),We=l(function(e){ne(e),$[u.accessor]=e,null==B||B({accessor:u.accessor,newValue:e,row:$,rowIndex:v})},[u.accessor,B,$,v]),Be=l(function(){K(function(e){var n=new Set(e),t=String(ve);return n.has(t)?n.delete(t):n.add(t),n})},[ve,K]);return!oe||ke||He?n(be,m({className:Me,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":ve,"data-row-index":v,id:Ee,onClick:function(){L&&!He&&L({accessor:u.accessor,colIndex:s,row:$,rowId:ve,rowIndex:v,value:Z})},onDoubleClick:function(){return u.isEditable&&!He&&ie(!0)},onDragOver:function(e){He||Re({callback:xe,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){oe||He||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||oe||(e.preventDefault(),ie(!0))},onMouseDown:function(){oe||He||x({rowIndex:v,colIndex:s,rowId:ve})},onMouseEnter:function(){fe(!0)},onMouseLeave:function(){fe(!1)},onMouseOver:function(){oe||He||E({rowIndex:v,colIndex:s,rowId:ve})},parentRef:U,tableRow:p},{children:[u.expandable&&ge?e("div",m({className:"st-icon-container st-expand-icon-container ".concat(me?"expanded":"collapsed"),onClick:Be},{children:S})):null,e("span",m({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:He?n("div",m({className:"st-selection-cell-content"},{children:[e("div",m({className:"st-selection-control"},{children:ue||M&&M(String(ve))?e(Ie,{checked:!!M&&M(String(ve)),onChange:function(e){H&&H(String(ve),e)}}):e("span",m({className:"st-row-number"},{children:v+1}))})),function(){if(!q||!He||0===q.length)return null;if(!(ue||M&&M(String(ve))))return null;var n={row:$};return e("div",m({className:"st-row-buttons"},{children:q.map(function(t,r){return e("span",m({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:$,theme:V}):Se({content:Z,header:u})})})),oe&&ke&&!He&&e(ee,{enumOptions:u.enumOptions,onChange:We,setIsEditing:ie,type:u.type,value:Z})]}),Ne):e("div",m({className:"st-cell-editing",id:R({accessor:u.accessor,rowId:ve}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(ee,{enumOptions:u.enumOptions,onChange:We,setIsEditing:ie,type:u.type,value:Z})}))},Re=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=O(),d=u.rowIdAccessor,f=u.collapsedHeaders,h=i.filter(function(e){return E({header:e,pinned:a,headers:i,collapsedHeaders:f})});return e(t,{children:h.map(function(n,t){var u=T({row:s.row,rowIdAccessor:d}),f=R({accessor:n.accessor,rowId:u});return e(Ee,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},f)})})},Ee=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=O(),h=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,m=d.collapsedHeaders,w=T({row:s.row,rowIdAccessor:g});if(r.children&&r.children.length>0){var y=r.children.filter(function(e){return E({header:e,pinned:a,headers:o,collapsedHeaders:m})});return e(f,{children:y.map(function(n){var r=R({accessor:n.accessor,rowId:w});return e(Ee,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var b={rowIndex:l,colIndex:u,rowId:w},C=h(b),I=v(b),S=p(b),x=R({accessor:r.accessor,rowId:w});return e(xe,{borderClass:C,colIndex:u,header:r,isHighlighted:I,isInitialFocused:S,nestedIndex:i,rowIndex:l,tableRow:s},x)},Ne=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hoveredIndex,l=n.index,c=n.pinned,s=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,h=O(),v=h.useHoverRowBackground,p=h.rowIdAccessor,g=h.isAnimating,w=h.isRowSelected,y=h.useOddEvenRowBackground,b=f.position,C=b%2==0,I=T({row:f.row,rowIdAccessor:p}),S=!!w&&w(String(I));return e("div",m({className:"st-row ".concat(y?C?"even":"odd":""," ").concat(a===l&&v?"hovered":""," ").concat(S?"selected":""),onMouseEnter:function(){g||d(l)},style:{gridTemplateColumns:o,top:G({position:b,rowHeight:s}),height:"".concat(s,"px")}},{children:e(Re,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:b,rowIndices:u,tableRow:f},I)}))},He=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:j({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},ke=s(void 0),Ae=["default"],Fe=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(ke);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return c(function(){return n.current&&o(n.current,Ae),function(){n.current&&i(n.current,Ae)}},[n,o,i]),h(t,{ref:function(e){n.current=e}})},De=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},Te=v(function(t,r){var o=t.columnIndexStart,l=t.columnIndices,c=t.headers,s=t.hoveredIndex,u=t.pinned,d=t.rowHeight,h=t.rowIndices,v=t.setHoveredIndex,g=t.templateColumns,w=t.totalHeight,y=t.rowsToRender,b=t.width,C=u?"st-body-pinned-".concat(u):"st-body-main",I=O().rowIdAccessor,S=i(null);return p(r,function(){return S.current},[]),a(function(){return ie(c,u)},[c,u])?e(De,m({condition:!u,wrapper:function(n){return e(Fe,m({childRef:S},{children:n}))}},{children:e("div",m({className:C,ref:S,style:m({position:"relative",height:"".concat(w,"px"),width:b},!u&&{flexGrow:1})},{children:y.map(function(t,r){var i=T({row:t.row,rowIdAccessor:I});return n(f,{children:[0!==r&&e(He,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:d,templateColumns:g,rowIndex:r-1}),e(Ne,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:g,headers:c,hoveredIndex:s,index:r,pinned:u,rowHeight:d,rowIndices:h,setHoveredIndex:v,tableRow:t},i)]},i)})}))})):null});function Me(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=b(b(b([],t,!0),n,!0),r,!0),c=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 E({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&E({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Te.displayName="TableSection";var We=function(t){var r=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,f=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.rowsToRender,g=t.setScrollTop,w=t.tableRows,y=O(),b=y.collapsedHeaders,C=y.headerContainerRef,I=y.headers,S=y.isAnimating,x=y.mainBodyRef,R=y.onLoadMore,E=y.rowHeight,N=y.rowIdAccessor,H=y.scrollbarWidth,k=y.setIsScrolling,A=y.shouldPaginate,F=y.tableBodyContainerRef,D=o(null),M=D[0],W=D[1],B=o(!1),L=B[0],P=B[1];c(function(){S&&null!==M&&W(null)},[S,M]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:C,mainSectionRef:F,scrollbarWidth:H}),c(function(){return function(){z.current&&clearTimeout(z.current)}},[]);var q=i(null),z=i(null),Y=i(0),j=function(e){return e.length}(w),G=j*(E+1)-1,K=a(function(){return Me({headers:I,pinnedLeftColumns:s,pinnedRightColumns:f,collapsedHeaders:b})},[I,s,f,b]),U=a(function(){var e={};return p.forEach(function(n,t){var r=String(T({row:n.row,rowIdAccessor:N}));e[r]=t}),e},[p,N]),V=l(function(e,n){if(R&&!A&&!L){e.scrollHeight-(n+e.clientHeight)<=200&&n>Y.current&&(P(!0),R(),setTimeout(function(){P(!1)},1e3))}},[R,A,L]),J={columnIndices:K,headerContainerRef:C,headers:I,hoveredIndex:M,rowHeight:E,rowIndices:U,rowsToRender:p,setHoveredIndex:W};return n("div",m({className:"st-body-container",onMouseLeave:function(){return W(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),z.current&&clearTimeout(z.current),z.current=setTimeout(function(){k(!1)},150),q.current&&cancelAnimationFrame(q.current),q.current=requestAnimationFrame(function(){g(t),V(n,t),Y.current=t})},ref:F},{children:[e(Te,m({},J,{pinned:"left",templateColumns:u,totalHeight:G,width:d})),e(Te,m({},J,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:G})),e(Te,m({},J,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:h,totalHeight:G,width:v}))]}))},Be=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(t&&!t.hide){i(!0);var u,d=F(t);if(t.children&&t.children.length>0){var f=H(t,l);u=f.length>0?f:[t]}else u=[t];var h=function(e){var n="right"===t.pinned?c-e:e-c,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=.8*i;if(!n.pinned)return Math.max(.6*i,600);var l=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+H(n,r).reduce(function(e,n){return e+k(n)},0)},0),c=F(n);return l<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):l}({header:t,headers:r,collapsedHeaders:l});if(u.length>1)Le({delta:n,leafHeaders:u,minWidth:d,startWidth:a,maxWidth:i});else{var s=Math.max(Math.min(a+n,i),d);u[0].width=s}r.forEach(function(e){A(e)});var f=b([],r,!0);o(f)};if(s){var v=function(e){var n=e.touches[0];h(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p),i(!1)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var g=function(e){h(e.clientX)},m=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m),i(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",m)}}},Le=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,F(n))},40),l=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),c=Math.max(Math.min(o+n,i),a)-l;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=c*(n/l),o=Math.max(n+t,r);e.width=o})},Oe=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:m({height:"1em"},r)},{children:e("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Pe={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},qe=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},ze=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ye=function(e){return["between","notBetween","in","notIn"].includes(e)},je=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ge=function(n){var t=n.children;return e("div",m({className:"st-filter-container"},{children:t}))},Ke=function(){return e("svg",m({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Ue=function(t){var r=t.value,a=t.onChange,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,f=void 0===d?"":d,h=t.disabled,v=void 0!==h&&h,p=o(!1),g=p[0],w=p[1],y=o(-1),b=y[0],C=y[1],I=i(null),S=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",m({ref:I,className:"st-custom-select ".concat(f," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",m({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",m({className:"st-custom-select-value"},{children:S?S.label:u})),e(Ke,{})]})),e(K,m({open:g,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",m({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",m({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),t)})}))}))]}))},Ve=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Pe[e]}});return e("div",m({className:"st-filter-section"},{children:e(Ue,{value:t,onChange:function(e){r(e)},options:o})}))},Je=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},Xe=function(n){var t=n.children,r=n.className;return e("div",m({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},_e=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",m({className:"st-filter-actions"},{children:[e("button",m({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",m({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},$e=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],f=o(String((null==i?void 0:i.value)||"")),h=f[0],v=f[1],p=qe("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=m({accessor:r.accessor,operator:u},ze(u)&&{value:h});a(e)},w=je(u)||h.trim();return n(Ge,{children:[e(Ve,{value:u,onChange:d,operators:p}),ze(u)&&e(Xe,{children:e(Je,{type:"text",value:h,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(_e,{onApply:g,onClear:l,canApply:!!w,showClear:!!i})]})},Qe=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),f=d[0],h=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],m=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),w=m[0],y=m[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],I=b[1],S=qe("number");c(function(){var e,n;l?(h(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),I(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(h("equals"),g(""),y(""),I(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:f};ze(f)?e.value=parseFloat(p):Ye(f)&&(e.values=[parseFloat(w.toString()),parseFloat(C.toString())]),s(e)};return n(Ge,{children:[e(Ve,{value:f,onChange:h,operators:S}),ze(f)&&e(Xe,{children:e(Je,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),Ye(f)&&n(Xe,{children:[e(Je,{type:"number",value:w,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e(Je,{type:"number",value:C,onChange:I,placeholder:"To...",onEnterPress:x})]}),e(_e,{onApply:x,onClear:u,canApply:!!je(f)||(ze(f)?""!==p.trim():!!Ye(f)&&""!==String(w).trim()&&""!==String(C).trim()),showClear:!!l})]})},Ze=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(Ue,{value:t,onChange:r,options:o,className:a,placeholder:l})},en=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],f=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),h=f[0],v=f[1],p=qe("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=je(u)||""!==h;return n(Ge,{children:[e(Ve,{value:u,onChange:d,operators:p}),ze(u)&&e(Xe,{children:e(Ze,{value:h,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(_e,{onApply:function(){var e={accessor:r.accessor,operator:u};ze(u)&&(e.value="true"===h),a(e)},onClear:l,canApply:g,showClear:!!i})]})},nn=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,f=o((null==s?void 0:s.operator)||"equals"),h=f[0],v=f[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],w=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],I=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),S=I[0],x=I[1],R=qe("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),x(""))},[s]);var E=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),f=d[0],h=d[1],v=o(""),p=v[0],g=v[1],w=i(null);c(function(){if(r){var e=new Date(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?new Date(r):new Date;return n("div",m({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:p,placeholder:l,onClick:function(){h(!f)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),h(!f)):"Escape"===e.key&&h(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(K,m({open:f,setOpen:h,onClose:function(){h(!1)},positioning:"absolute",overflow:"visible"},{children:e(_,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),h(!1)},onClose:function(){return h(!1)}})}))]}))};return n(Ge,{children:[e(Ve,{value:h,onChange:v,operators:R}),ze(h)&&e(Xe,{children:e(E,{value:g,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Ye(h)&&n(Xe,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:S,onChange:x,placeholder:"To date..."})]}),e(_e,{onApply:function(){var e={accessor:l.accessor,operator:h};ze(h)?e.value=g:Ye(h)&&(e.values=[b,S]),u(e)},onClear:d,canApply:!!je(h)||(ze(h)?""!==g.trim():!!Ye(h)&&""!==b.trim()&&""!==S.trim()),showClear:!!s})]})},tn=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),f=o((null==i?void 0:i.values)?i.values.map(String):d),h=f[0],v=f[1],p=o(""),g=p[0],w=p[1],y=a(function(){if(!g)return u;var e=g.toLowerCase();return u.filter(function(n){return n.label.toLowerCase().includes(e)})},[u,g]);c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var C=h.length===d.length,I=u.length>10;return n(Ge,{children:[e(Xe,{children:n("div",m({className:"st-enum-filter-options"},{children:[e("div",m({className:"st-enum-select-all"},{children:e(Ie,m({checked:C,onChange:function(e){v(e?d:[])}},{children:e("span",m({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),I&&e("div",m({className:"st-enum-search"},{children:e(Je,{type:"text",value:g,onChange:w,placeholder:"Search..."})})),y.map(function(n,t){return e(Ie,m({checked:h.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",m({className:"st-enum-option-label"},{children:n.label}))}),t)}),g&&0===y.length&&e("div",m({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e(_e,{onApply:function(){if(h.length!==d.length){var e={accessor:r.accessor,operator:"in",values:h};l(e)}else s()},onClear:s,canApply:0!==h.length&&h.length!==d.length,showClear:!!i})]})},rn=function(n){var r=n.header,o=n.currentFilter,i=n.onApplyFilter,a=n.onClearFilter;return e(t,{children:function(){switch(r.type){case"number":return e(Qe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(nn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(tn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e($e,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},on=function(t){var r,s,u=t.colIndex,d=t.gridColumnEnd,f=t.gridColumnStart,h=t.gridRowEnd,v=t.gridRowStart,p=t.header,g=t.reverse,w=t.sort,y=o(!1),I=y[0],S=y[1],x=o(!1),E=x[0],N=x[1],H=o(p.label||""),k=H[0],A=H[1],F=O(),D=F.activeHeaderDropdown,T=F.areAllRowsSelected,M=F.collapsedHeaders,W=F.columnBorders,B=F.columnReordering,L=F.columnResizing,P=F.columnsWithSelectedCells,q=F.draggedHeaderRef,z=F.enableHeaderEditing,Y=F.enableRowSelection,j=F.filters,G=F.handleApplyFilter,U=F.handleClearFilter,V=F.handleSelectAll,X=F.headerCollapseIcon,_=F.headerDropdown,$=F.headerExpandIcon,Q=F.headerRegistry,Z=F.headers,ee=F.hoveredHeaderRef,ne=F.onColumnOrderChange,re=F.onColumnSelect,oe=F.onHeaderEdit,ie=F.onSort,ae=F.onTableHeaderDragEnd,le=F.rowHeight,ce=F.selectColumns,se=F.selectableColumns,ue=F.selectedColumns,fe=F.setActiveHeaderDropdown,he=F.setCollapsedHeaders,ve=F.setHeaders,pe=F.setInitialFocusedCell,ge=F.setIsResizing,me=F.setSelectedCells,we=F.setSelectedColumns,ye=F.sortDownIcon,Ce=F.sortUpIcon,Se=Boolean(null==p?void 0:p.isSortable),xe=Boolean(null==p?void 0:p.filterable),Re=j[p.accessor],Ee=(null==D?void 0:D.accessor)===p.accessor,Ne=p.isSelectionColumn&&Y,He=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(p),ke=M.has(p.accessor),Ae=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),f=o({}),h=f[0],v=f[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:h}}({isOpen:Ee,estimatedHeight:200,estimatedWidth:250,margin:4}),Fe=Ae.triggerRef,De=Ae.position,Te=a(function(){var e,n,t;if(!W)return!1;var r=Z.filter(function(e){return"left"===e.pinned}),o=Z.filter(function(e){return!e.pinned}),i=Z.filter(function(e){return"right"===e.pinned});return"left"===p.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===p.accessor:"right"===p.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===p.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===p.accessor},[W,Z,p.accessor,p.pinned]),Me=a(function(){return!(!se||Ne)&&C(p,u).some(function(e){return ue.has(e)})},[se,Ne,p,u,ue]),We=a(function(){return!Ne&&P.has(u)},[Ne,P,u]),Le=a(function(){return!(!p.children||0===p.children.length)&&(!ke||p.children.some(function(e){return e.summaryColumn}))},[p.children,ke]),Pe="st-header-cell ".concat(p.accessor===(null===(r=ee.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=q.current)||void 0===s?void 0:s.accessor)===p.accessor?"st-dragging":""," ").concat(Se?"clickable":""," ").concat(B&&!Se?"columnReordering":""," ").concat(Le?"parent":""," ").concat(Te?"st-last-column":""," ").concat(z&&!Ne?"st-header-editable":""," ").concat(Me?"st-header-selected":""," ").concat(We&&!Me?"st-header-has-highlighted-cell":""),qe=de({draggedHeaderRef:q,headers:Z,hoveredHeaderRef:ee,onColumnOrderChange:ne,onTableHeaderDragEnd:ae}),ze=qe.handleDragStart,Ye=qe.handleDragEnd,je=qe.handleDragOver,Ge=te();c(function(){if(Q&&!p.isSelectionColumn){var e=String(p.accessor);return Q.set(e,{setEditing:function(e){N(e)}}),function(){Q.delete(e)}}},[Q,p.accessor,p.isSelectionColumn]),c(function(){A(p.label||"")},[p.label]);var Ke=l(function(e){A(e);var n=Z.map(function(n){return n.accessor===p.accessor?m(m({},n),{label:e}):n});ve(n),oe&&oe(p,e)},[Z,ve,oe,p]),Ue=l(function(){fe&&fe(null)},[fe]),Ve=l(function(e){e.stopPropagation(),he(function(e){var n=new Set(e);return ke?n.delete(p.accessor):n.add(p.accessor),n})},[he,ke,p.accessor]),Je=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(se){var r=C(t,u),o=r.some(function(e){return ue.has(e)});if(z&&o&&!n.shiftKey)return _&&Ee&&Ue(),void N(!0);n.shiftKey&&ce?we(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):ce&&ce(r),me(new Set),pe(null)}re&&re(t),!se&&t.isSortable&&ie(t.accessor)}};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!p)return null;var Xe=L&&!Ne&&e("div",m({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(R({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Be,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:f,header:p,headers:Z,setHeaders:ve,setIsResizing:ge,startWidth:t,collapsedHeaders:M},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(R({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Be,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:f,header:p,headers:Z,setHeaders:ve,setIsResizing:ge,startWidth:t,collapsedHeaders:M},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),_e=w&&w.key.accessor===p.accessor&&n("div",m({className:"st-icon-container",onClick:function(e){return Je({event:e,header:p})}},{children:["ascending"===w.direction&&Ce&&Ce,"descending"===w.direction&&ye&&ye]})),$e=xe&&n("div",m({className:"st-icon-container",onClick:function(e){e.stopPropagation(),S(!I)}},{children:[e(Oe,{className:"st-header-icon",style:{fill:Re?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(K,m({open:I,overflow:"visible",setOpen:S,onClose:function(){return S(!1)}},{children:e(rn,{header:p,currentFilter:Re,onApplyFilter:function(e){G(e),S(!1)},onClearFilter:function(){U(p.accessor),S(!1)}})}))]})),Qe=He&&!Ne&&e("div",m({className:"st-icon-container st-collapse-icon-container",onClick:Ve},{children:ke?X:$}));return n(be,m({className:Pe,id:R({accessor:p.accessor,rowId:"header"}),onDragOver:function(e){Ne||Ge({callback:je,callbackProps:{event:e,hoveredHeader:p},limit:50})},style:m({gridRowStart:v,gridRowEnd:h,gridColumnStart:f,gridColumnEnd:d},h-v>1?{}:{height:le})},{children:[g&&Xe,"right"===p.align&&Qe,"right"===p.align&&$e,"right"===p.align&&_e,e("div",m({ref:Fe,className:"st-header-label",draggable:B&&!p.disableReorder&&!Ne,onClick:function(e){Ne||Je({event:e,header:p})},onDoubleClick:function(e){Ne||function(e){e.event;var n=e.header;n.isSelectionColumn||se&&n.isSortable&&ie(n.accessor)}({event:e,header:p})},onDragEnd:Ne?void 0:function(e){e.preventDefault(),Ye()},onDragStart:Ne?void 0:function(e){B&&p&&function(e){ze(e)}(p)}},{children:e("span",m({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:Ne?e(Ie,{checked:!!T&&T(),onChange:function(e){V&&V(e)}}):E?e(J,{defaultValue:k,onBlur:function(){return N(!1)},onChange:Ke}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:u,header:p}):k||(null==p?void 0:p.label)}))})),"right"!==p.align&&_e,"right"!==p.align&&$e,"right"!==p.align&&Qe,!g&&Xe,_&&!Ne&&e("div",m({className:"st-header-dropdown-container"},{children:_({accessor:p.accessor,colIndex:u,header:p,isOpen:Ee,onClose:Ue,position:De})}))]}))},an=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,f=n.width,h=O().collapsedHeaders,v=a(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!E({header:o,pinned:s,headers:l,collapsedHeaders:h}))return 0;a||n++;var f=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return E({header:e,pinned:s,headers:l,collapsedHeaders:h})}).length)&&void 0!==d?d:0,v=n,p=f>0?v+f:v+1,g=i,m=f>0?i+1:c+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:p,gridRowStart:g,gridRowEnd:m,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var w=!0;o.children.forEach(function(e){E({header:e,pinned:s,headers:l,collapsedHeaders:h})&&(t(e,i+1,w),w=!1)})}return p-v},o=l.filter(function(e){return E({header:e,pinned:s,headers:l,collapsedHeaders:h})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r,h]);return e(De,m({condition:!s,wrapper:function(n){return e(Fe,m({childRef:u},{children:n}))}},{children:e("div",m({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,display:"grid",position:"relative",width:f}},{children:e(t,{children:v.map(function(n){return e(on,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},ln=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(ln)):1},cn=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.sort,f=t.pinnedLeftWidth,h=t.pinnedRightWidth,v=O(),p=v.headerContainerRef,g=v.pinnedLeftRef,w=v.pinnedRightRef,y=v.collapsedHeaders,C=a(function(){return Me({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s,collapsedHeaders:y})},[o,l,s,y]),I=a(function(){var e=0,n=b(b(b([],l,!0),o,!0),s,!0);return o.forEach(function(t){if(E({header:t,headers:n,collapsedHeaders:y})){var r=ln(t);e=Math.max(e,r)}}),{maxDepth:e}},[o,l,s,y]).maxDepth;return n("div",m({className:"st-header-container",ref:p},{children:[ie(o,"left")&&e(an,{columnIndices:C,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:I,pinned:"left",sectionRef:g,sort:d,width:f}),e(an,{columnIndices:C,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:I,sectionRef:r,sort:d}),ie(o,"right")&&e(an,{columnIndices:C,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:I,pinned:"right",sectionRef:w,sort:d,width:h})]}))},sn=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return e.summaryColumn});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return!e.summaryColumn});r({headers:i,flattenedHeaders:o})}else o.push(e)}),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},un=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=O(),f=d.columnResizing,h=d.editColumns,v=d.headers,p=d.collapsedHeaders,g=i(null),w=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return sn({headers:y,collapsedHeaders:p})},[y,p]),I=a(function(){return sn({headers:w,collapsedHeaders:p})},[w,p]),S=a(function(){return sn({headers:b,collapsedHeaders:p})},[b,p]),x={centerHeaderRef:g,headers:v,mainTemplateColumns:I,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:S,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},R={tableRows:s,mainTemplateColumns:I,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:S,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",m({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[e(cn,m({},x)),e(We,m({},R))]}))},dn=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,f=t.tableBodyContainerRef,h=O().editColumns,v=o(!1),p=v[0],g=v[1],w=i(null),y=f.current&&f.current.scrollHeight>f.current.clientHeight,b=h?28:0,C=(h?d+1:d)+(f.current&&y?f.current.offsetWidth-f.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;g(l>e)}}()},1)},[s,l]),p?n("div",m({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(r=w.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(Fe,m({childRef:w},{children:e("div",m({className:"st-horizontal-scrollbar-middle",ref:w,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=w.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},fn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return fn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?fn.string(e,n,t):"number"==typeof e&&"number"==typeof n?fn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?fn.boolean(e,n,t):fn.string(String(e),String(n),t)}},hn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return b([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return fn.number(i,a,r)}return"date"===t?fn.date(String(e),String(n),r):"boolean"===t?fn.boolean(Boolean(e),Boolean(n),r):"enum"===t?fn.enum(String(e),String(n),r):fn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},vn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return hn({rows:t,sortColumn:r,headers:n})},pn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):vn({headers:i,rows:t,sortColumn:r}):t},gn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(gn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},mn=function(e){return e.every(function(e){return e.hide})},wn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(wn(e.children),mn(e.children)&&(e.hide=!0))})},yn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),f=d[0],h=d[1],v=O(),p=v.expandIcon,g=v.headers,w=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,I=null!=u?u:s.hide||C&&s.children&&mn(s.children);return n(t,{children:[n("div",m({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",m({className:"st-header-icon-container"},{children:C?e("div",m({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e(Ie,m({checked:I,onChange:function(e){(s.hide=e,e)?wn(i):(gn(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,gn(i,s.children[0].accessor)));w(b([],g,!0))}},{children:s.label}))]})),C&&f&&s.children&&e("div",m({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(yn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!I||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},bn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(yn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},Cn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],f=u[1];return i?n("div",m({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:r})),e(bn,{headers:l,open:d,position:s})]})):null},In=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Sn=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},xn=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),f=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(ke.Provider,m({value:{registerPane:d,unregisterPane:f}},{children:r.Children.only(t)}))},Rn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Pe[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},En=function(){var t=O(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",m({className:"st-filter-bar"},{children:e("div",m({className:"st-filter-bar-content"},{children:e("div",m({className:"st-filter-chips"},{children:a.map(function(t){return n("div",m({className:"st-filter-chip"},{children:[e("span",m({className:"st-filter-chip-text"},{children:Rn(t,i)})),e("button",m({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},Nn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},Hn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=Nn(h),g=Nn(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var m=o.map(function(e){return Nn(new Date(String(e||"")))}),w=m[0],y=m[1];return p>=w&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return Nn(new Date(String(e||"")))});return w=b[0],y=b[1],p<w||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var I=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=I}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),x=o.includes(S);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},kn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return I(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&D(l)){var c=i(l,t+1),s=m({},n);return s[o]=c,e.forEach(function(e){var n=An(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},An=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&D(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Fn=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],f=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),h=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),m=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),w=l(function(e){if(c){var n=f(e);g(e,!n)}},[f,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:f,areAllRowsSelected:h,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:m,handleToggleRow:w,clearSelection:y}},Dn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(Tn,m({},n)):null},Tn=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.className,v=t.columnBorders,p=void 0!==v&&v,C=t.columnEditorPosition,I=void 0===C?"right":C,x=t.columnEditorText,R=void 0===x?"Columns":x,E=t.columnReordering,A=void 0!==E&&E,F=t.columnResizing,B=void 0!==F&&F,O=t.defaultHeaders,j=t.editColumns,G=void 0!==j&&j,K=t.editColumnsInitOpen,U=void 0!==K&&K,V=t.enableHeaderEditing,J=void 0!==V&&V,X=t.enableRowSelection,_=void 0!==X&&X,$=t.expandAll,Q=void 0===$||$,Z=t.expandIcon,ee=void 0===Z?e(z,{className:"st-expand-icon"}):Z,ne=t.externalFilterHandling,te=void 0!==ne&&ne,oe=t.externalSortHandling,ie=void 0!==oe&&oe,ae=t.headerCollapseIcon,le=void 0===ae?e(z,{className:"st-header-icon"}):ae,ce=t.headerExpandIcon,se=void 0===ce?e(q,{className:"st-header-icon"}):ce,ue=t.headerDropdown,de=t.height,fe=t.hideFooter,he=void 0!==fe&&fe,pe=t.nextIcon,ge=void 0===pe?e(z,{className:"st-next-prev-icon"}):pe,me=t.onCellEdit,we=t.onCellClick,ye=t.onColumnOrderChange,be=t.onColumnSelect,Ce=t.onFilterChange,Ie=t.onGridReady,Se=t.onHeaderEdit,xe=t.onLoadMore,Re=t.onNextPage,Ee=t.onRowSelectionChange,Ne=t.onSortChange,He=t.prevIcon,ke=void 0===He?e(q,{className:"st-next-prev-icon"}):He,Ae=t.rowButtons,Fe=t.rowGrouping,De=t.rowHeight,Te=void 0===De?32:De,Me=t.rowIdAccessor,We=t.rows,Be=t.selectionColumnWidth,Le=void 0===Be?42:Be,Oe=t.rowsPerPage,Pe=void 0===Oe?10:Oe,qe=t.selectableCells,ze=void 0!==qe&&qe,Ye=t.selectableColumns,je=void 0!==Ye&&Ye,Ge=t.shouldPaginate,Ke=void 0!==Ge&&Ge,Ue=t.sortDownIcon,Ve=void 0===Ue?e(In,{className:"st-header-icon"}):Ue,Je=t.sortUpIcon,Xe=void 0===Je?e(Sn,{className:"st-header-icon"}):Je,_e=t.tableRef,$e=t.theme,Qe=void 0===$e?"light":$e,Ze=t.useHoverRowBackground,en=void 0===Ze||Ze,nn=t.useOddEvenRowBackground,tn=void 0!==nn&&nn,rn=t.useOddColumnBackground,on=void 0!==rn&&rn;on&&(tn=!1),p&&(en=!1);var an=g(function(e){return e+1},0)[1],ln=i(null),cn=i(null),sn=i(null),fn=i(null),hn=i(null),gn=i(null),mn=i(null),wn=o(1),yn=wn[0],bn=wn[1],Rn=o(O),Nn=Rn[0],An=Rn[1],Dn=o(!1),Tn=Dn[0],Mn=Dn[1],Wn=o(!1),Bn=Wn[0],Ln=Wn[1],On=o(null),Pn=On[0],qn=On[1],zn=o(new Set),Yn=zn[0],jn=zn[1];c(function(){An(O)},[O]);var Gn=Fn({rows:We,rowIdAccessor:Me,onRowSelectionChange:Ee,enableRowSelection:_}),Kn=Gn.selectedRows,Un=Gn.setSelectedRows,Vn=Gn.isRowSelected,Jn=Gn.areAllRowsSelected,Xn=Gn.selectedRowCount,_n=Gn.selectedRowsData,$n=Gn.handleRowSelect,Qn=Gn.handleSelectAll,Zn=Gn.handleToggleRow,et=Gn.clearSelection,nt=a(function(){var e,n=b([],Nn,!0);_&&!(null===(e=null==Nn?void 0:Nn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=b([{accessor:"__row_selection__",label:"",width:Le,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[_,Nn,Le]),tt=o(0),rt=tt[0],ot=tt[1],it=o(new Set),at=it[0],lt=it[1],ct=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:gn}),st=ct.scrollbarWidth,ut=ct.setScrollbarWidth,dt=o(0),ft=dt[0],ht=dt[1];d(function(){var e=function(){gn.current&&ht(gn.current.clientWidth)};e();var n=null;return gn.current&&(n=new ResizeObserver(e)).observe(gn.current),function(){n&&n.disconnect()}},[]);var vt=a(function(){var e=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,l=0,c=0;if(n.forEach(function(e){if(!e.hide){var n=H(e,i).reduce(function(e,n){return e+k(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?l+=n:c+=n}}),t&&t>0){var s=t*o;a>s&&(a=s),l>s&&(l=s)}return{leftWidth:S(a),rightWidth:S(l),mainWidth:c}}({headers:nt,containerWidth:ft,collapsedHeaders:Yn});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[nt,ft,Yn]),pt=vt.mainBodyWidth,gt=vt.pinnedLeftWidth,mt=vt.pinnedRightWidth,wt=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-t)},[n,t])}({height:de,rowHeight:Te}),yt=kn({rows:We,headers:Nn,rowGrouping:Fe}),bt=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return Hn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=m(m({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),f=l(function(e){var n=m({},c);delete n[e],s(n),null==r||r(n)},[c,r]),h=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=m(m({},c),((r={})[e.accessor]=e,r));return Hn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:f,clearAllFilters:h,filters:c,computeFilteredRowsPreview:v}}({rows:yt,externalFilterHandling:te,onFilterChange:Ce}),Ct=bt.filters,It=bt.filteredRows,St=bt.updateFilter,xt=bt.clearFilter,Rt=bt.clearAllFilters,Et=bt.computeFilteredRowsPreview,Nt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],f=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=vn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(D(a)){var l=f({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return m(m({},e),((r={})[i]=l,r))}return e}):i},[]),h=a(function(){return pn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:f})},[t,u,n,r,c,f]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},pn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:f})},[u,n,t,r,c,f]);return{sort:u,sortedRows:h,updateSort:v,computeSortedRowsPreview:p}}({headers:Nn,tableRows:It,externalSortHandling:ie,onSortChange:Ne,rowGrouping:Fe}),Ht=Nt.sort,kt=Nt.sortedRows,At=Nt.updateSort,Ft=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,f=e.rowGrouping,h=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,w=e.rowHeight,y=e.scrollTop,C=e.computeFilteredRowsPreview,I=e.computeSortedRowsPreview,S=o(!1),x=S[0],R=S[1],E=o([]),N=E[0],H=E[1],k=i([]),A=i([]),F=i(new Map),D=i(null),W=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return f&&0!==f.length?M({rows:n,rowGrouping:f,rowIdAccessor:h,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,f,h,v,p]);a(function(){if(0===F.current.size){var e=W(r),n=new Map;e.forEach(function(e){var t=String(T({row:e.row,rowIdAccessor:h}));n.set(t,e.position)}),F.current=n}},[r,W,h]);var B=a(function(){return W(t)},[t,W]),L=a(function(){return Y({bufferRowCount:5,contentHeight:g,tableRows:B,rowHeight:w,scrollTop:y})},[B,g,w,y]),O=l(function(e,n){var t=new Set(e.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))})),r=new Set(n.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))}));return{staying:n.filter(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return t.has(n)}),entering:n.filter(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return!r.has(n)})}},[h]),P=a(function(){if(0===k.current.length)return!1;var e=B.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))}),n=k.current.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[B,h]);d(function(){if(!x){if(!n||u)return H([]),k.current=B,void(A.current=L);if(0===k.current.length)return H([]),k.current=B,void(A.current=L);if(!P)return H([]),k.current=B,void(A.current=L);D.current={tableRows:B,visibleRows:L},R(!0)}},[n,B,P,x,u,L]),d(function(){if(x&&D.current&&N.length>0){var e=setTimeout(function(){var e=D.current;R(!1),H([]),k.current=e.tableRows,A.current=e.visibleRows,D.current=null},ve.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var q=a(function(){if(!n||u)return L;if(N.length>0){var e=new Map;return B.forEach(function(n){var t=String(T({row:n.row,rowIdAccessor:h}));e.set(t,n.position)}),N.map(function(n){var t=String(T({row:n.row,rowIdAccessor:h})),r=e.get(t);return void 0!==r?m(m({},n),{position:r}):n})}return L},[L,N,B,n,u,h]),z=l(function(e){if(n&&!u){var t=C(e),r=W(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(L,o).entering.map(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return B.find(function(e){return String(T({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],L,!0),i,!0))}},[n,u,C,W,g,w,y,O,B,L,h]),j=l(function(e){if(n&&!u){var t=I(e),r=W(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(L,o).entering.map(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return B.find(function(e){return String(T({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],L,!0),i,!0))}},[n,u,I,W,g,w,y,O,B,L,h]);return{currentTableRows:B,currentVisibleRows:L,isAnimating:x,prepareForFilterChange:z,prepareForSortChange:j,rowsToRender:q}}({allowAnimations:s,sortedRows:kt,originalRows:yt,currentPage:yn,rowsPerPage:Pe,shouldPaginate:Ke,rowGrouping:Fe,rowIdAccessor:Me,unexpandedRows:at,expandAll:Q,contentHeight:wt,rowHeight:Te,scrollTop:rt,computeFilteredRowsPreview:Et,computeSortedRowsPreview:Nt.computeSortedRowsPreview}),Dt=Ft.currentTableRows,Tt=Ft.rowsToRender,Mt=Ft.prepareForFilterChange,Wt=Ft.prepareForSortChange,Bt=Ft.isAnimating,Lt=i(new Map),Ot=i(new Map),Pt=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,f=e.collapsedHeaders,h=o(new Set),v=h[0],p=h[1],g=o(new Set),m=g[0],b=g[1],C=o(null),I=C[0],S=C[1],x=o(null),R=x[0],E=x[1],N=o(new Set),k=N[0],A=N[1],F=o(new Set),D=F[0],M=F[1],B=i(!1),L=i(null),O=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),m.forEach(function(n){e.add(n)}),e},[v,m]),P=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),m.size>0&&r.forEach(function(n){var t=T({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[v,m,r,s]),q=a(function(){return t.flatMap(function(e){return H(e,f)})},[t,f]),z=l(function(){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(v).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");v.size>0&&(navigator.clipboard.writeText(o),A(new Set(v)),setTimeout(function(){A(new Set)},800))},[q,v,r]),Y=l(function(){return w(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(f){switch(f.label){case 0:if(!R)return[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=f.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=q.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var f=a+n,h=l+c;if(!(f>=r.length||h>=t.length)){var v=r[f],p=t[h],g=T({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var w=Number(e);isNaN(w)||(m=w)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(m=y)}if(v.row[p.accessor]=m,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(m)}null==u||u({accessor:p.accessor,newValue:m,row:v.row,rowIndex:f});var I=W({colIndex:h,rowIndex:f,rowId:g});o.add(I)}else{var S=W({colIndex:h,rowIndex:f,rowId:g});i.add(S)}}})}),o.size>0&&(A(o),setTimeout(function(){A(new Set)},800)),i.size>0&&(M(i),setTimeout(function(){M(new Set)},800)),[3,4]):[2];case 3:return c=f.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,q,r,s,u,d]),j=l(function(){if(0!==v.size){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(v).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],f=e[l],h=T({row:c.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(c.row[f.accessor])?[]:""),c.row[f.accessor]=v,d){var p="".concat(h,"-").concat(f.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:f.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(A(t),setTimeout(function(){A(new Set)},800)),o.size>0&&(M(o),setTimeout(function(){M(new Set)},800))}},[v,q,r,s,u,d]),G=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=T({row:r[c].row,rowIdAccessor:s});t.add(W({colIndex:u,rowIndex:c,rowId:d}))}b(new Set),S(null),p(t)},[r,s,b,S,p]),K=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<q.length){var n=W(e);b(new Set),S(null),p(new Set([n])),E(e)}},[q.length,r.length,b,S,p,E]),U=l(function(e,n){void 0===n&&(n=!1),p(new Set),E(null),b(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&S(e[e.length-1])},[p,E,b,S]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void Y();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void j();if(T({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return T({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=T({row:r[o-1].row,rowIdAccessor:s});K({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=T({row:r[o+1].row,rowIdAccessor:s}),K({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=T({row:r[o].row,rowIdAccessor:s}),K({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<q.length-1&&(c=T({row:r[o].row,rowIdAccessor:s}),K({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(p(new Set),b(new Set),S(null),L.current=null,E(null))}else z()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[z,q.length,R,s,G,K,n,r,Y,j]);var V=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=W({colIndex:n,rowIndex:t,rowId:r}),i=v.has(o),a=m.has(n);return i||a},[v,m]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?T({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?T({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},f={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!V(c)||m.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!V(u)||m.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),V(d)||i.push("st-selected-left-border"),V(f)||i.push("st-selected-right-border"),i.join(" ")},[V,r,m,s]),X=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=W({colIndex:n,rowIndex:t,rowId:r});return k.has(o)},[k]),$=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=W({colIndex:n,rowIndex:t,rowId:r});return D.has(o)},[D]);return{getBorderClass:J,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(B.current=!0,L.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){b(new Set),S(null);var e=W({colIndex:t,rowIndex:r,rowId:o});p(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&B.current&&L.current){for(var i=new Set,a=Math.min(L.current.rowIndex,o),l=Math.max(L.current.rowIndex,o),c=Math.min(L.current.colIndex,t),u=Math.max(L.current.colIndex,t),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<r.length){var h=T({row:r[d].row,rowIdAccessor:s});i.add(W({colIndex:f,rowIndex:d,rowId:h}))}p(i)}},handleMouseUp:function(){B.current=!1},isCopyFlashing:_,isWarningFlashing:$,isInitialFocusedCell:X,isSelected:V,lastSelectedColumnIndex:I,pasteFromClipboard:Y,selectColumns:U,selectedCells:v,selectedColumns:m,setInitialFocusedCell:E,setSelectedCells:p,setSelectedColumns:b,deleteSelectedCells:j,columnsWithSelectedCells:O,rowsWithSelectedCells:P}}({selectableCells:ze,headers:Nn,tableRows:Dt,rowIdAccessor:Me,onCellEdit:me,cellRegistry:Lt.current,collapsedHeaders:Yn}),qt=Pt.getBorderClass,zt=Pt.handleMouseDown,Yt=Pt.handleMouseOver,jt=Pt.handleMouseUp,Gt=Pt.isCopyFlashing,Kt=Pt.isInitialFocusedCell,Ut=Pt.isSelected,Vt=Pt.isWarningFlashing,Jt=Pt.selectColumns,Xt=Pt.selectedCells,_t=Pt.selectedColumns,$t=Pt.setInitialFocusedCell,Qt=Pt.setSelectedCells,Zt=Pt.setSelectedColumns,er=Pt.columnsWithSelectedCells,nr=Pt.rowsWithSelectedCells,tr=l(function(e){Wt(e),setTimeout(function(){At(e)},0)},[Wt,At]),rr=l(function(e){An(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:je,selectedCells:Xt,selectedColumns:_t,setSelectedCells:Qt,setSelectedColumns:Zt,activeHeaderDropdown:Pn,setActiveHeaderDropdown:qn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:an,tableBodyContainerRef:gn,setScrollbarWidth:ut}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:Ie}),function(e){var n=e.tableRef,t=e.rows,r=e.rowIdAccessor,o=e.cellRegistryRef,i=e.headerRegistryRef,a=e.visibleRows;c(function(){n&&(n.current={updateData:function(e){var n=e.accessor,i=e.rowIndex,a=e.newValue,l=null==t?void 0:t[i];if(l){var c=T({row:l,rowIdAccessor:r}),s=N({rowId:c,accessor:n}),u=o.current.get(s);u&&u.updateContent(a),void 0!==l[n]&&(l[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=i.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return a}})},[o,i,t,r,n,a])}({cellRegistryRef:Lt,headerRegistryRef:Ot,rowIdAccessor:Me,rows:We,tableRef:_e,visibleRows:Tt}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:Ct,onFilterChange:Ce}),function(e){var n=e.sort,t=e.onSortChange,r=re(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:Ht,onSortChange:Ne});var or=l(function(e){Mt(e),setTimeout(function(){St(e)},0)},[Mt,St]);return e(L,m({value:{allowAnimations:s,areAllRowsSelected:Jn,cellRegistry:Lt.current,cellUpdateFlash:f,clearSelection:et,collapsedHeaders:Yn,columnBorders:p,columnReordering:A,columnResizing:B,draggedHeaderRef:ln,editColumns:G,enableHeaderEditing:J,enableRowSelection:_,expandIcon:ee,filters:Ct,forceUpdate:an,getBorderClass:qt,handleApplyFilter:or,handleClearAllFilters:Rt,handleClearFilter:xt,handleMouseDown:zt,handleMouseOver:Yt,handleRowSelect:$n,handleSelectAll:Qn,handleToggleRow:Zn,headerCollapseIcon:le,headerContainerRef:mn,headerDropdown:ue,headerExpandIcon:se,headerRegistry:Ot.current,headers:nt,hoveredHeaderRef:cn,isAnimating:Bt,isCopyFlashing:Gt,isInitialFocusedCell:Kt,isResizing:Tn,isRowSelected:Vn,isScrolling:Bn,isSelected:Ut,isWarningFlashing:Vt,mainBodyRef:sn,nextIcon:ge,onCellEdit:me,onCellClick:we,onColumnOrderChange:ye,onColumnSelect:be,onLoadMore:xe,onSort:tr,onTableHeaderDragEnd:rr,pinnedLeftRef:fn,pinnedRightRef:hn,prevIcon:ke,rowButtons:Ae,rowGrouping:Fe,rowHeight:Te,rowIdAccessor:Me,scrollbarWidth:st,selectColumns:Jt,selectableColumns:je,selectedColumns:_t,columnsWithSelectedCells:er,rowsWithSelectedCells:nr,selectedRows:Kn,selectedRowCount:Xn,selectedRowsData:_n,setCollapsedHeaders:jn,setHeaders:An,setInitialFocusedCell:$t,setIsResizing:Mn,setIsScrolling:Ln,setSelectedCells:Qt,setSelectedColumns:Zt,setSelectedRows:Un,setUnexpandedRows:lt,shouldPaginate:Ke,sortDownIcon:Ve,sortUpIcon:Xe,tableBodyContainerRef:gn,tableRows:Dt,theme:Qe,unexpandedRows:at,useHoverRowBackground:en,useOddColumnBackground:on,useOddEvenRowBackground:tn,activeHeaderDropdown:Pn,setActiveHeaderDropdown:qn,onHeaderEdit:Se}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(Qe," ").concat(null!=h?h:""," ").concat(p?"st-column-borders":""),style:de?{height:de}:{}},{children:e(xn,{children:n("div",m({className:"st-wrapper-container"},{children:[e(En,{}),n("div",m({className:"st-content-wrapper",onMouseUp:jt,onMouseLeave:jt},{children:[e(un,{pinnedLeftWidth:gt,pinnedRightWidth:mt,setScrollTop:ot,sort:Ht,tableRows:Dt,rowsToRender:Tt}),e(Cn,{columnEditorText:R,editColumns:G,editColumnsInitOpen:U,headers:Nn,position:I})]})),e(dn,{mainBodyRef:sn,mainBodyWidth:pt,pinnedLeftWidth:gt,pinnedRightWidth:mt,tableBodyContainerRef:gn}),e(P,{currentPage:yn,hideFooter:he,onPageChange:bn,onNextPage:Re,shouldPaginate:Ke,totalPages:Math.ceil(kt.length/Pe)})]}))})}))}))};export{Dn as SimpleTable};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as f,cloneElement as h,forwardRef as v,useImperativeHandle as p,useReducer as g}from"react";var m=function(){return m=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},m.apply(this,arguments)};function w(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(e,n){var t,r,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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=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++,r=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],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=r(l,o)}return o};return r(e,n),t},S=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,S(e.children)),n})},I=function(e){return void 0===e&&(e=0),e?e+1:0},x=function(e,n,t){var r=function(e,n){for(var t=0,r=S(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?!e.summaryColumn:!0===e.summaryColumn)},R=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},E=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&x(n,r,o))||null},N=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},H=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return e.summaryColumn}).flatMap(function(e){return H(e,n)}):e.children.filter(function(e){return!e.summaryColumn}).flatMap(function(e){return H(e,n)}):[e]},k=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(R({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},A=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(R({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){A(e)})},F=function(e){return"number"==typeof e.minWidth?e.minWidth:40},D=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},T=function(e){return e.row[e.rowIdAccessor]},M=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=T({row:t,rowIdAccessor:c}),f=l[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return D(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},W=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},L=s(void 0),B=function(n){var t=n.children,r=n.value;return e(L.Provider,m({value:r},{children:t}))},O=function(){var e=u(L);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},P=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=O(),d=u.nextIcon,f=u.prevIcon,h=o(!0),v=h[0],p=h[1],g=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<s-1&&(t.push(-1),t.push(s)),t}();return n("div",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:f})),e("button",m({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",m({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",m({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},q=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},z=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},Y=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},j=function(e){return e.position*(e.rowHeight+1)-1},G=function(e){return e.position*(e.rowHeight+1)},K=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,f=n.containerRef,h=n.positioning,v=void 0===h?"fixed":h,p=O().mainBodyRef,g=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],S=o({}),I=S[0],x=S[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!w.current&&g.current.parentElement&&(w.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&w.current){var e,n=g.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==f?void 0:f.current)?f.current.getBoundingClientRect():(null==p?void 0:p.current)?p.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,f,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",m({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:m(m({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},I),{overflow:s})},{children:t})):null},U=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},V=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],f=function(e){d(e),i(e),l(!1),r()};return n(K,m({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(U,m({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(U,m({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},J=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},X=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},_=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=O(),d=u.nextIcon,f=u.prevIcon,h=o(s||new Date),v=h[0],p=h[1],g=o("days"),w=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",m({className:"st-datepicker"},{children:[n("div",m({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:f})),n("div",m({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",m({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",m({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e,12,0,0);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var f=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=new Date(s),u=o===a.getDate()&&r===a.getMonth()&&t===a.getFullYear();n.push(e("div",m({className:"st-datepicker-day ".concat(i?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=v.getFullYear(),t=v.getMonth(),r=new Date(n,t,e,12,0,0);p(r),l(r),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},h=1;h<=o;h++)f(h);var g=35-(i+o),w=function(t){n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e,12,0,0);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(h=1;h<=g;h++)w(h);return n}(),"months"===w&&(i=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var r=t===v.getMonth();i.push(e("div",m({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",m({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",m({className:"st-datepicker-footer"},{children:e("button",m({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);p(n),l(n),null==c||c()}},{children:"Today"}))}))]}))},$=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},Q=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},Z=function(e){if(!e)return new Date;if("string"==typeof e)return $(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:Q(n)}return e instanceof Date?Q(e):new Date},ee=function(e){return e?$(e.toString()):new Date},ne=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(K,m({open:o,onClose:l,setOpen:i,width:280},{children:e(_,{value:ee(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},te=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(K,m({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(U,m({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},re=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(V,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(ne,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(te,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(X,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(J,{defaultValue:u,onBlur:s,onChange:o})},oe=0,ie=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===oe||o-oe>=r)&&(oe=o,n(t))}},ae=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},le=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(le);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=le(e[t]));return n},ce=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},se=Date.now(),ue={screenX:0,screenY:0},de=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=de(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},fe=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function he(e,n,t){var r,o,i=le(e),a=!1;try{var l=fe(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=m({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),f=s;i.splice(f,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var ve=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=O().setHeaders,l=ae(t);return{handleDragStart:function(e){n.current=e,se=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-ue.screenX,2)+Math.pow(u-ue.screenY,2));r.current=a;var f,h=n.current,v=!1;if(fe(h)!==fe(a)){f=(S=he(t,h,a)).newHeaders,v=S.emergencyBreak}else{var p=t,g=de(p,h.accessor),m=de(p,a.accessor);if(!g||!m)return;var w=g.length,y=m.length,b=m;if(w!==y){var C=y-w;C>0&&(b=m.slice(0,-C))}var S=function(e,n,t){var r=le(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);f=S.newHeaders,v=S.emergencyBreak}if(!(c||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var I=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(I-se<1500||d<40)||(se=I,ue={screenX:s,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return b([],e,!0)}),null==o||o(t)},10)}}},pe=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},ge={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},me={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},we={duration:150,easing:"ease-out",delay:0},ye=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},be=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){ye(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Ce=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return w(void 0,void 0,void 0,function(){var e,i,a;return y(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:pe()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),pe()?m(m({},we),e):m(m({},"column"===n?ge:me),e)}(t,i?"column":"row"),ye(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,be(n,a,t)]);case 1:return l.sent(),[2]}})})},Se=function(e){var n=e.element,t=e.options;return w(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,f,h,v,p,g,m;return y(this,function(w){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,f=t.respectReducedMotion,h=void 0===f||f,pe()&&h?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,m=r-p,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(m,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},Ie=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children","id","parentRef","tableRow"]),c=O(),s=c.allowAnimations,u=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=i(null),p=i(null),g=ae(f),w=ae(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!w||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=m(m({},me),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,S=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==S){var I=5*h,x=b-I,R=b+C+I,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,H=i.y<b,k=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,F=.6*h,D=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&k){var T=b+C+D(i.y,b,b+C)+A%15*F*2.5+A%7*(.4*h);return void Se({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&H){T=b-D(i.y,b,b+C)-A%15*F*2.5-A%7*(.4*h);return void Se({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var M=b+C+D(l.y,b,b+C)+A%10*F*1;return void Se({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){M=b-D(l.y,b,b+C)-A%10*F*1;return void Se({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}Ce({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,f,o,g,w,h,null==a?void 0:a.position,a]),e("div",m({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};Ie.displayName="Animate";var xe=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:m({height:"10px"},r)},{children:e("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},Re=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",m({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",m({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(xe,{className:"st-checkbox-checkmark"})})),i]}))},Ee=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?Z(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},Ne=function(t){var r=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,f=t.isInitialFocused,h=t.nestedIndex,v=t.rowIndex,p=t.tableRow,g=O(),w=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,C=g.draggedHeaderRef,S=g.enableRowSelection,I=g.expandIcon,x=g.handleMouseDown,E=g.handleMouseOver,H=g.handleRowSelect,k=g.headers,A=g.hoveredHeaderRef,F=g.isCopyFlashing,M=g.isRowSelected,W=g.isWarningFlashing,L=g.onCellEdit,B=g.onCellClick,P=g.onTableHeaderDragEnd,q=g.rowButtons,z=g.rowGrouping,Y=g.rowIdAccessor,j=g.rowsWithSelectedCells,G=g.selectedColumns,K=g.setUnexpandedRows,U=g.tableBodyContainerRef,V=g.theme,J=g.unexpandedRows,X=g.useOddColumnBackground,_=p.depth,$=p.row,Q=o($[u.accessor]),Z=Q[0],ee=Q[1],ne=o(!1),te=ne[0],oe=ne[1],ae=o(!1),le=ae[0],ce=ae[1],se=o(!1),ue=se[0],de=se[1],fe=i(null),he=T({row:$,rowIdAccessor:Y}),pe=z&&z[_],ge=!!pe&&function(e,n){if(!n)return!1;var t=e[n];return D(t)}($,pe),me=!J.has(String(he)),we=F({rowIndex:v,colIndex:s,rowId:he}),ye=W({rowIndex:v,colIndex:s,rowId:he}),be=a(function(){var e,n,t;if(!b)return!1;var r=k.filter(function(e){return"left"===e.pinned}),o=k.filter(function(e){return!e.pinned}),i=k.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,k,u.accessor,u.pinned]),Ce=ve({draggedHeaderRef:C,headers:k,hoveredHeaderRef:A,onTableHeaderDragEnd:P}).handleDragOver,Se=ie(),xe=R({accessor:u.accessor,rowId:he}),Ne=N({rowId:he,accessor:u.accessor}),He=u.isSelectionColumn&&S;c(function(){if(w){var e="".concat(he,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){Z!==e?(ee(e),y&&(ce(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){ce(!1)},800))):ee(e)}}),function(){w.delete(e),fe.current&&clearTimeout(fe.current)}}},[w,y,he,u.accessor,Z]),c(function(){if(le){var e=setTimeout(function(){ce(!1)},850);return function(){return clearTimeout(e)}}},[le]),c(function(){ee($[u.accessor])},[$,u.accessor]);var ke="boolean"===u.type||"date"===u.type||"enum"===u.type,Ae=Boolean(null==u?void 0:u.isEditable),Fe=G.has(s),De=d&&!Fe,Te=a(function(){return!!He&&j.has(String(he))},[He,j,he]),Me="st-cell ".concat(_>0&&u.expandable?"st-cell-depth-".concat(_):""," ").concat(De?f?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Fe?f?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ae?"clickable":""," ").concat(le?f?"st-cell-updating-first":"st-cell-updating":""," ").concat(we?f?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ye?f?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(X?h%2==0?"even-column":"odd-column":""," ").concat(He?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(be?"st-last-column":""),We=l(function(e){ee(e),$[u.accessor]=e,null==L||L({accessor:u.accessor,newValue:e,row:$,rowIndex:v})},[u.accessor,L,$,v]),Le=l(function(){K(function(e){var n=new Set(e),t=String(he);return n.has(t)?n.delete(t):n.add(t),n})},[he,K]);return!te||ke||He?n(Ie,m({className:Me,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":he,"data-row-index":v,id:xe,onClick:function(){B&&!He&&B({accessor:u.accessor,colIndex:s,row:$,rowId:he,rowIndex:v,value:Z})},onDoubleClick:function(){return u.isEditable&&!He&&oe(!0)},onDragOver:function(e){He||Se({callback:Ce,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){te||He||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||te||(e.preventDefault(),oe(!0))},onMouseDown:function(){te||He||x({rowIndex:v,colIndex:s,rowId:he})},onMouseEnter:function(){de(!0)},onMouseLeave:function(){de(!1)},onMouseOver:function(){te||He||E({rowIndex:v,colIndex:s,rowId:he})},parentRef:U,tableRow:p},{children:[u.expandable&&ge?e("div",m({className:"st-icon-container st-expand-icon-container ".concat(me?"expanded":"collapsed"),onClick:Le},{children:I})):null,e("span",m({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:He?n("div",m({className:"st-selection-cell-content"},{children:[e("div",m({className:"st-selection-control"},{children:ue||M&&M(String(he))?e(Re,{checked:!!M&&M(String(he)),onChange:function(e){H&&H(String(he),e)}}):e("span",m({className:"st-row-number"},{children:v+1}))})),function(){if(!q||!He||0===q.length)return null;if(!(ue||M&&M(String(he))))return null;var n={row:$};return e("div",m({className:"st-row-buttons"},{children:q.map(function(t,r){return e("span",m({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:$,theme:V}):Ee({content:Z,header:u})})})),te&&ke&&!He&&e(re,{enumOptions:u.enumOptions,onChange:We,setIsEditing:oe,type:u.type,value:Z})]}),Ne):e("div",m({className:"st-cell-editing",id:R({accessor:u.accessor,rowId:he}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(re,{enumOptions:u.enumOptions,onChange:We,setIsEditing:oe,type:u.type,value:Z})}))},He=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=O(),d=u.rowIdAccessor,f=u.collapsedHeaders,h=i.filter(function(e){return E({header:e,pinned:a,headers:i,collapsedHeaders:f})});return e(t,{children:h.map(function(n,t){var u=T({row:s.row,rowIdAccessor:d}),f=R({accessor:n.accessor,rowId:u});return e(ke,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},f)})})},ke=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=O(),h=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,m=d.collapsedHeaders,w=T({row:s.row,rowIdAccessor:g});if(r.children&&r.children.length>0){var y=r.children.filter(function(e){return E({header:e,pinned:a,headers:o,collapsedHeaders:m})});return e(f,{children:y.map(function(n){var r=R({accessor:n.accessor,rowId:w});return e(ke,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var b={rowIndex:l,colIndex:u,rowId:w},C=h(b),S=v(b),I=p(b),x=R({accessor:r.accessor,rowId:w});return e(Ne,{borderClass:C,colIndex:u,header:r,isHighlighted:S,isInitialFocused:I,nestedIndex:i,rowIndex:l,tableRow:s},x)},Ae=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,l=n.pinned,c=n.rowHeight,s=n.rowIndices,u=n.setHoveredIndex,d=n.tableRow,f=O(),h=f.useHoverRowBackground,v=f.rowIdAccessor,p=f.isAnimating,g=f.isRowSelected,w=f.useOddEvenRowBackground,y=d.position,b=y%2==0,C=T({row:d.row,rowIdAccessor:v}),S=!!g&&g(String(C));return e("div",m({className:"st-row ".concat(w?b?"even":"odd":""," ").concat(S?"selected":""),"data-index":a,onMouseEnter:function(){!p&&h&&u(a)},style:{gridTemplateColumns:o,top:G({position:y,rowHeight:c}),height:"".concat(c,"px")}},{children:e(He,{columnIndexStart:r,columnIndices:t,headers:i,pinned:l,rowIndex:y,rowIndices:s,tableRow:d},C)}))},Fe=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:j({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},De=s(void 0),Te=["default"],Me=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(De);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return c(function(){return n.current&&o(n.current,Te),function(){n.current&&i(n.current,Te)}},[n,o,i]),h(t,{ref:function(e){n.current=e}})},We=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},Le=v(function(t,r){var o=t.columnIndexStart,l=t.columnIndices,c=t.headers,s=t.pinned,u=t.rowHeight,d=t.rowIndices,h=t.setHoveredIndex,v=t.templateColumns,g=t.totalHeight,w=t.rowsToRender,y=t.width,b=s?"st-body-pinned-".concat(s):"st-body-main",C=O().rowIdAccessor,S=i(null);return p(r,function(){return S.current},[]),a(function(){return ce(c,s)},[c,s])?e(We,m({condition:!s,wrapper:function(n){return e(Me,m({childRef:S},{children:n}))}},{children:e("div",m({className:b,ref:S,style:m({position:"relative",height:"".concat(g,"px"),width:y},!s&&{flexGrow:1})},{children:w.map(function(t,r){var i=T({row:t.row,rowIdAccessor:C});return n(f,{children:[0!==r&&e(Fe,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:v,rowIndex:r-1}),e(Ae,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:v,headers:c,index:r,pinned:s,rowHeight:u,rowIndices:d,setHoveredIndex:h,tableRow:t},i)]},i)})}))})):null});function Be(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=b(b(b([],t,!0),n,!0),r,!0),c=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 E({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&E({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Le.displayName="TableSection";var Oe=function(t){var r=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,f=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.rowsToRender,g=t.setScrollTop,w=t.tableRows,y=O(),b=y.collapsedHeaders,C=y.headerContainerRef,S=y.headers,I=y.isAnimating,x=y.mainBodyRef,R=y.onLoadMore,E=y.rowHeight,N=y.rowIdAccessor,H=y.scrollbarWidth,k=y.setIsScrolling,A=y.shouldPaginate,F=y.tableBodyContainerRef,D=o(!1),M=D[0],W=D[1],L=i(new Set),B=l(function(e){(L.current.forEach(function(e){return e.classList.remove("hovered")}),L.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),L.current.add(e)})},[]);c(function(){I&&B(null)},[I,B]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:C,mainSectionRef:F,scrollbarWidth:H}),c(function(){return function(){q.current&&clearTimeout(q.current)}},[]);var P=i(null),q=i(null),z=i(0),Y=function(e){return e.length}(w),j=Y*(E+1)-1,G=a(function(){return Be({headers:S,pinnedLeftColumns:s,pinnedRightColumns:f,collapsedHeaders:b})},[S,s,f,b]),K=a(function(){var e={};return p.forEach(function(n,t){var r=String(T({row:n.row,rowIdAccessor:N}));e[r]=t}),e},[p,N]),U=l(function(e,n){if(R&&!A&&!M){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(W(!0),R(),setTimeout(function(){W(!1)},1e3))}},[R,A,M]),V={columnIndices:G,headerContainerRef:C,headers:S,rowHeight:E,rowIndices:K,rowsToRender:p,setHoveredIndex:B};return n("div",m({className:"st-body-container",onMouseLeave:function(){return B(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(function(){k(!1)},150),P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(function(){g(t),U(n,t),z.current=t})},ref:F},{children:[e(Le,m({},V,{pinned:"left",templateColumns:u,totalHeight:j,width:d})),e(Le,m({},V,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:j})),e(Le,m({},V,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:h,totalHeight:j,width:v}))]}))},Pe=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(t&&!t.hide){i(!0);var u,d=F(t);if(t.children&&t.children.length>0){var f=H(t,l);u=f.length>0?f:[t]}else u=[t];var h=function(e){var n="right"===t.pinned?c-e:e-c,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=.8*i;if(!n.pinned)return Math.max(.6*i,600);var l=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+H(n,r).reduce(function(e,n){return e+k(n)},0)},0),c=F(n);return l<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):l}({header:t,headers:r,collapsedHeaders:l});if(u.length>1)qe({delta:n,leafHeaders:u,minWidth:d,startWidth:a,maxWidth:i});else{var s=Math.max(Math.min(a+n,i),d);u[0].width=s}r.forEach(function(e){A(e)});var f=b([],r,!0);o(f)};if(s){var v=function(e){var n=e.touches[0];h(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p),i(!1)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var g=function(e){h(e.clientX)},m=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m),i(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",m)}}},qe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,F(n))},40),l=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),c=Math.max(Math.min(o+n,i),a)-l;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=c*(n/l),o=Math.max(n+t,r);e.width=o})},ze=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:m({height:"1em"},r)},{children:e("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Ye={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},je=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Ge=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ke=function(e){return["between","notBetween","in","notIn"].includes(e)},Ue=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ve=function(n){var t=n.children;return e("div",m({className:"st-filter-container"},{children:t}))},Je=function(){return e("svg",m({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Xe=function(t){var r=t.value,a=t.onChange,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,f=void 0===d?"":d,h=t.disabled,v=void 0!==h&&h,p=o(!1),g=p[0],w=p[1],y=o(-1),b=y[0],C=y[1],S=i(null),I=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",m({ref:S,className:"st-custom-select ".concat(f," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",m({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",m({className:"st-custom-select-value"},{children:I?I.label:u})),e(Je,{})]})),e(K,m({open:g,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",m({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",m({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),t)})}))}))]}))},_e=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Ye[e]}});return e("div",m({className:"st-filter-section"},{children:e(Xe,{value:t,onChange:function(e){r(e)},options:o})}))},$e=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},Qe=function(n){var t=n.children,r=n.className;return e("div",m({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Ze=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",m({className:"st-filter-actions"},{children:[e("button",m({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",m({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},en=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],f=o(String((null==i?void 0:i.value)||"")),h=f[0],v=f[1],p=je("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=m({accessor:r.accessor,operator:u},Ge(u)&&{value:h});a(e)},w=Ue(u)||h.trim();return n(Ve,{children:[e(_e,{value:u,onChange:d,operators:p}),Ge(u)&&e(Qe,{children:e($e,{type:"text",value:h,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Ze,{onApply:g,onClear:l,canApply:!!w,showClear:!!i})]})},nn=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),f=d[0],h=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],m=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),w=m[0],y=m[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],S=b[1],I=je("number");c(function(){var e,n;l?(h(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(h("equals"),g(""),y(""),S(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:f};Ge(f)?e.value=parseFloat(p):Ke(f)&&(e.values=[parseFloat(w.toString()),parseFloat(C.toString())]),s(e)};return n(Ve,{children:[e(_e,{value:f,onChange:h,operators:I}),Ge(f)&&e(Qe,{children:e($e,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),Ke(f)&&n(Qe,{children:[e($e,{type:"number",value:w,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e($e,{type:"number",value:C,onChange:S,placeholder:"To...",onEnterPress:x})]}),e(Ze,{onApply:x,onClear:u,canApply:!!Ue(f)||(Ge(f)?""!==p.trim():!!Ke(f)&&""!==String(w).trim()&&""!==String(C).trim()),showClear:!!l})]})},tn=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(Xe,{value:t,onChange:r,options:o,className:a,placeholder:l})},rn=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],f=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),h=f[0],v=f[1],p=je("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Ue(u)||""!==h;return n(Ve,{children:[e(_e,{value:u,onChange:d,operators:p}),Ge(u)&&e(Qe,{children:e(tn,{value:h,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Ze,{onApply:function(){var e={accessor:r.accessor,operator:u};Ge(u)&&(e.value="true"===h),a(e)},onClear:l,canApply:g,showClear:!!i})]})},on=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,f=o((null==s?void 0:s.operator)||"equals"),h=f[0],v=f[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],w=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],S=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),I=S[0],x=S[1],R=je("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),x(""))},[s]);var E=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),f=d[0],h=d[1],v=o(""),p=v[0],g=v[1],w=i(null);c(function(){if(r){var e=Z(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?Z(r):new Date;return n("div",m({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:p,placeholder:l,onClick:function(){h(!f)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),h(!f)):"Escape"===e.key&&h(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(K,m({open:f,setOpen:h,onClose:function(){h(!1)},positioning:"absolute",overflow:"visible"},{children:e(_,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),h(!1)},onClose:function(){return h(!1)}})}))]}))};return n(Ve,{children:[e(_e,{value:h,onChange:v,operators:R}),Ge(h)&&e(Qe,{children:e(E,{value:g,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Ke(h)&&n(Qe,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:I,onChange:x,placeholder:"To date..."})]}),e(Ze,{onApply:function(){var e={accessor:l.accessor,operator:h};Ge(h)?e.value=g:Ke(h)&&(e.values=[b,I]),u(e)},onClear:d,canApply:!!Ue(h)||(Ge(h)?""!==g.trim():!!Ke(h)&&""!==b.trim()&&""!==I.trim()),showClear:!!s})]})},an=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),f=o((null==i?void 0:i.values)?i.values.map(String):d),h=f[0],v=f[1],p=o(""),g=p[0],w=p[1],y=a(function(){if(!g)return u;var e=g.toLowerCase();return u.filter(function(n){return n.label.toLowerCase().includes(e)})},[u,g]);c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var C=h.length===d.length,S=u.length>10;return n(Ve,{children:[e(Qe,{children:n("div",m({className:"st-enum-filter-options"},{children:[e("div",m({className:"st-enum-select-all"},{children:e(Re,m({checked:C,onChange:function(e){v(e?d:[])}},{children:e("span",m({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),S&&e("div",m({className:"st-enum-search"},{children:e($e,{type:"text",value:g,onChange:w,placeholder:"Search..."})})),y.map(function(n,t){return e(Re,m({checked:h.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",m({className:"st-enum-option-label"},{children:n.label}))}),t)}),g&&0===y.length&&e("div",m({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e(Ze,{onApply:function(){if(h.length!==d.length){var e={accessor:r.accessor,operator:"in",values:h};l(e)}else s()},onClear:s,canApply:0!==h.length&&h.length!==d.length,showClear:!!i})]})},ln=function(n){var r=n.header,o=n.currentFilter,i=n.onApplyFilter,a=n.onClearFilter;return e(t,{children:function(){switch(r.type){case"number":return e(nn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(rn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(on,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(an,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},cn=function(t){var r,s,u=t.colIndex,d=t.gridColumnEnd,f=t.gridColumnStart,h=t.gridRowEnd,v=t.gridRowStart,p=t.header,g=t.reverse,w=t.sort,y=o(!1),S=y[0],I=y[1],x=o(!1),E=x[0],N=x[1],H=o(p.label||""),k=H[0],A=H[1],F=O(),D=F.activeHeaderDropdown,T=F.areAllRowsSelected,M=F.collapsedHeaders,W=F.columnBorders,L=F.columnReordering,B=F.columnResizing,P=F.columnsWithSelectedCells,q=F.draggedHeaderRef,z=F.enableHeaderEditing,Y=F.enableRowSelection,j=F.filters,G=F.handleApplyFilter,U=F.handleClearFilter,V=F.handleSelectAll,X=F.headerCollapseIcon,_=F.headerDropdown,$=F.headerExpandIcon,Q=F.headerRegistry,Z=F.headers,ee=F.hoveredHeaderRef,ne=F.onColumnOrderChange,te=F.onColumnSelect,re=F.onHeaderEdit,oe=F.onSort,ae=F.onTableHeaderDragEnd,le=F.rowHeight,ce=F.selectColumns,se=F.selectableColumns,ue=F.selectedColumns,de=F.setActiveHeaderDropdown,fe=F.setCollapsedHeaders,he=F.setHeaders,pe=F.setInitialFocusedCell,ge=F.setIsResizing,me=F.setSelectedCells,we=F.setSelectedColumns,ye=F.sortDownIcon,be=F.sortUpIcon,Ce=Boolean(null==p?void 0:p.isSortable),Se=Boolean(null==p?void 0:p.filterable),xe=j[p.accessor],Ee=(null==D?void 0:D.accessor)===p.accessor,Ne=p.isSelectionColumn&&Y,He=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(p),ke=M.has(p.accessor),Ae=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),f=o({}),h=f[0],v=f[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:h}}({isOpen:Ee,estimatedHeight:200,estimatedWidth:250,margin:4}),Fe=Ae.triggerRef,De=Ae.position,Te=a(function(){var e,n,t;if(!W)return!1;var r=Z.filter(function(e){return"left"===e.pinned}),o=Z.filter(function(e){return!e.pinned}),i=Z.filter(function(e){return"right"===e.pinned});return"left"===p.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===p.accessor:"right"===p.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===p.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===p.accessor},[W,Z,p.accessor,p.pinned]),Me=a(function(){return!(!se||Ne)&&C(p,u).some(function(e){return ue.has(e)})},[se,Ne,p,u,ue]),We=a(function(){return!Ne&&P.has(u)},[Ne,P,u]),Le=a(function(){return!(!p.children||0===p.children.length)&&(!ke||p.children.some(function(e){return e.summaryColumn}))},[p.children,ke]),Be="st-header-cell ".concat(p.accessor===(null===(r=ee.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=q.current)||void 0===s?void 0:s.accessor)===p.accessor?"st-dragging":""," ").concat(Ce?"clickable":""," ").concat(L&&!Ce?"columnReordering":""," ").concat(Le?"parent":""," ").concat(Te?"st-last-column":""," ").concat(z&&!Ne?"st-header-editable":""," ").concat(Me?"st-header-selected":""," ").concat(We&&!Me?"st-header-has-highlighted-cell":""),Oe=ve({draggedHeaderRef:q,headers:Z,hoveredHeaderRef:ee,onColumnOrderChange:ne,onTableHeaderDragEnd:ae}),qe=Oe.handleDragStart,Ye=Oe.handleDragEnd,je=Oe.handleDragOver,Ge=ie();c(function(){if(Q&&!p.isSelectionColumn){var e=String(p.accessor);return Q.set(e,{setEditing:function(e){N(e)}}),function(){Q.delete(e)}}},[Q,p.accessor,p.isSelectionColumn]),c(function(){A(p.label||"")},[p.label]);var Ke=l(function(e){A(e);var n=Z.map(function(n){return n.accessor===p.accessor?m(m({},n),{label:e}):n});he(n),re&&re(p,e)},[Z,he,re,p]),Ue=l(function(){de&&de(null)},[de]),Ve=l(function(e){e.stopPropagation(),fe(function(e){var n=new Set(e);return ke?n.delete(p.accessor):n.add(p.accessor),n})},[fe,ke,p.accessor]),Je=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(se){var r=C(t,u),o=r.some(function(e){return ue.has(e)});if(z&&o&&!n.shiftKey)return _&&Ee&&Ue(),void N(!0);n.shiftKey&&ce?we(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):ce&&ce(r),me(new Set),pe(null)}te&&te(t),!se&&t.isSortable&&oe(t.accessor)}};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!p)return null;var Xe=B&&!Ne&&e("div",m({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(R({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Pe,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:f,header:p,headers:Z,setHeaders:he,setIsResizing:ge,startWidth:t,collapsedHeaders:M},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(R({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Pe,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:f,header:p,headers:Z,setHeaders:he,setIsResizing:ge,startWidth:t,collapsedHeaders:M},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),_e=w&&w.key.accessor===p.accessor&&n("div",m({className:"st-icon-container",onClick:function(e){return Je({event:e,header:p})}},{children:["ascending"===w.direction&&be&&be,"descending"===w.direction&&ye&&ye]})),$e=Se&&n("div",m({className:"st-icon-container",onClick:function(e){e.stopPropagation(),I(!S)}},{children:[e(ze,{className:"st-header-icon",style:{fill:xe?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(K,m({open:S,overflow:"visible",setOpen:I,onClose:function(){return I(!1)}},{children:e(ln,{header:p,currentFilter:xe,onApplyFilter:function(e){G(e),I(!1)},onClearFilter:function(){U(p.accessor),I(!1)}})}))]})),Qe=He&&!Ne&&e("div",m({className:"st-icon-container st-collapse-icon-container",onClick:Ve},{children:ke?X:$}));return n(Ie,m({className:Be,id:R({accessor:p.accessor,rowId:"header"}),onDragOver:function(e){Ne||Ge({callback:je,callbackProps:{event:e,hoveredHeader:p},limit:50})},style:m({gridRowStart:v,gridRowEnd:h,gridColumnStart:f,gridColumnEnd:d},h-v>1?{}:{height:le})},{children:[g&&Xe,"right"===p.align&&Qe,"right"===p.align&&$e,"right"===p.align&&_e,e("div",m({ref:Fe,className:"st-header-label",draggable:L&&!p.disableReorder&&!Ne,onClick:function(e){Ne||Je({event:e,header:p})},onDoubleClick:function(e){Ne||function(e){e.event;var n=e.header;n.isSelectionColumn||se&&n.isSortable&&oe(n.accessor)}({event:e,header:p})},onDragEnd:Ne?void 0:function(e){e.preventDefault(),Ye()},onDragStart:Ne?void 0:function(e){L&&p&&function(e){qe(e)}(p)}},{children:e("span",m({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:Ne?e(Re,{checked:!!T&&T(),onChange:function(e){V&&V(e)}}):E?e(J,{defaultValue:k,onBlur:function(){return N(!1)},onChange:Ke}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:u,header:p}):k||(null==p?void 0:p.label)}))})),"right"!==p.align&&_e,"right"!==p.align&&$e,"right"!==p.align&&Qe,!g&&Xe,_&&!Ne&&e("div",m({className:"st-header-dropdown-container"},{children:_({accessor:p.accessor,colIndex:u,header:p,isOpen:Ee,onClose:Ue,position:De})}))]}))},sn=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,f=n.width,h=O().collapsedHeaders,v=a(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!E({header:o,pinned:s,headers:l,collapsedHeaders:h}))return 0;a||n++;var f=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return E({header:e,pinned:s,headers:l,collapsedHeaders:h})}).length)&&void 0!==d?d:0,v=n,p=f>0?v+f:v+1,g=i,m=f>0?i+1:c+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:p,gridRowStart:g,gridRowEnd:m,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var w=!0;o.children.forEach(function(e){E({header:e,pinned:s,headers:l,collapsedHeaders:h})&&(t(e,i+1,w),w=!1)})}return p-v},o=l.filter(function(e){return E({header:e,pinned:s,headers:l,collapsedHeaders:h})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r,h]);return e(We,m({condition:!s,wrapper:function(n){return e(Me,m({childRef:u},{children:n}))}},{children:e("div",m({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,display:"grid",position:"relative",width:f}},{children:e(t,{children:v.map(function(n){return e(cn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},un=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(un)):1},dn=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.sort,f=t.pinnedLeftWidth,h=t.pinnedRightWidth,v=O(),p=v.headerContainerRef,g=v.pinnedLeftRef,w=v.pinnedRightRef,y=v.collapsedHeaders,C=a(function(){return Be({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s,collapsedHeaders:y})},[o,l,s,y]),S=a(function(){var e=0,n=b(b(b([],l,!0),o,!0),s,!0);return o.forEach(function(t){if(E({header:t,headers:n,collapsedHeaders:y})){var r=un(t);e=Math.max(e,r)}}),{maxDepth:e}},[o,l,s,y]).maxDepth;return n("div",m({className:"st-header-container",ref:p},{children:[ce(o,"left")&&e(sn,{columnIndices:C,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:S,pinned:"left",sectionRef:g,sort:d,width:f}),e(sn,{columnIndices:C,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:S,sectionRef:r,sort:d}),ce(o,"right")&&e(sn,{columnIndices:C,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:S,pinned:"right",sectionRef:w,sort:d,width:h})]}))},fn=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return e.summaryColumn});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return!e.summaryColumn});r({headers:i,flattenedHeaders:o})}else o.push(e)}),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},hn=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=O(),f=d.columnResizing,h=d.editColumns,v=d.headers,p=d.collapsedHeaders,g=i(null),w=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return fn({headers:y,collapsedHeaders:p})},[y,p]),S=a(function(){return fn({headers:w,collapsedHeaders:p})},[w,p]),I=a(function(){return fn({headers:b,collapsedHeaders:p})},[b,p]),x={centerHeaderRef:g,headers:v,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},R={tableRows:s,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",m({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[e(dn,m({},x)),e(Oe,m({},R))]}))},vn=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,f=t.tableBodyContainerRef,h=O().editColumns,v=o(!1),p=v[0],g=v[1],w=i(null),y=f.current&&f.current.scrollHeight>f.current.clientHeight,b=h?28:0,C=(h?d+1:d)+(f.current&&y?f.current.offsetWidth-f.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;g(l>e)}}()},1)},[s,l]),p?n("div",m({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(r=w.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(Me,m({childRef:w},{children:e("div",m({className:"st-horizontal-scrollbar-middle",ref:w,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=w.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},pn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return pn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?pn.string(e,n,t):"number"==typeof e&&"number"==typeof n?pn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?pn.boolean(e,n,t):pn.string(String(e),String(n),t)}},gn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return b([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return pn.number(i,a,r)}return"date"===t?pn.date(String(e),String(n),r):"boolean"===t?pn.boolean(Boolean(e),Boolean(n),r):"enum"===t?pn.enum(String(e),String(n),r):pn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},mn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return gn({rows:t,sortColumn:r,headers:n})},wn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):mn({headers:i,rows:t,sortColumn:r}):t},yn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(yn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},bn=function(e){return e.every(function(e){return e.hide})},Cn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Cn(e.children),bn(e.children)&&(e.hide=!0))})},Sn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),f=d[0],h=d[1],v=O(),p=v.expandIcon,g=v.headers,w=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,S=null!=u?u:s.hide||C&&s.children&&bn(s.children);return n(t,{children:[n("div",m({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",m({className:"st-header-icon-container"},{children:C?e("div",m({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e(Re,m({checked:S,onChange:function(e){(s.hide=e,e)?Cn(i):(yn(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,yn(i,s.children[0].accessor)));w(b([],g,!0))}},{children:s.label}))]})),C&&f&&s.children&&e("div",m({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(Sn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!S||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},In=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(Sn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},xn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],f=u[1];return i?n("div",m({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:r})),e(In,{headers:l,open:d,position:s})]})):null},Rn=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},En=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},Nn=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),f=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(De.Provider,m({value:{registerPane:d,unregisterPane:f}},{children:r.Children.only(t)}))},Hn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Ye[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},kn=function(){var t=O(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",m({className:"st-filter-bar"},{children:e("div",m({className:"st-filter-bar-content"},{children:e("div",m({className:"st-filter-chips"},{children:a.map(function(t){return n("div",m({className:"st-filter-chip"},{children:[e("span",m({className:"st-filter-chip-text"},{children:Hn(t,i)})),e("button",m({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},An=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=Z(e),v=Z(String(r||"")),p=Q(h),g=Q(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var m=o.map(function(e){return Q(Z(String(e||"")))}),w=m[0],y=m[1];return p>=w&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return Q(Z(String(e||"")))});return w=b[0],y=b[1],p<w||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var S=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=S}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var I=String(e),x=o.includes(I);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},Fn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return S(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&D(l)){var c=i(l,t+1),s=m({},n);return s[o]=c,e.forEach(function(e){var n=Dn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},Dn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&D(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Tn=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],f=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),h=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),m=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),w=l(function(e){if(c){var n=f(e);g(e,!n)}},[f,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:f,areAllRowsSelected:h,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:m,handleToggleRow:w,clearSelection:y}},Mn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(Wn,m({},n)):null},Wn=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.className,v=t.columnBorders,p=void 0!==v&&v,C=t.columnEditorPosition,S=void 0===C?"right":C,x=t.columnEditorText,R=void 0===x?"Columns":x,E=t.columnReordering,A=void 0!==E&&E,F=t.columnResizing,L=void 0!==F&&F,O=t.defaultHeaders,j=t.editColumns,G=void 0!==j&&j,K=t.editColumnsInitOpen,U=void 0!==K&&K,V=t.enableHeaderEditing,J=void 0!==V&&V,X=t.enableRowSelection,_=void 0!==X&&X,$=t.expandAll,Q=void 0===$||$,Z=t.expandIcon,ee=void 0===Z?e(z,{className:"st-expand-icon"}):Z,ne=t.externalFilterHandling,te=void 0!==ne&&ne,re=t.externalSortHandling,oe=void 0!==re&&re,ie=t.headerCollapseIcon,le=void 0===ie?e(z,{className:"st-header-icon"}):ie,ce=t.headerExpandIcon,se=void 0===ce?e(q,{className:"st-header-icon"}):ce,ue=t.headerDropdown,de=t.height,fe=t.hideFooter,he=void 0!==fe&&fe,ve=t.nextIcon,pe=void 0===ve?e(z,{className:"st-next-prev-icon"}):ve,ge=t.onCellEdit,we=t.onCellClick,ye=t.onColumnOrderChange,be=t.onColumnSelect,Ce=t.onFilterChange,Se=t.onGridReady,Ie=t.onHeaderEdit,xe=t.onLoadMore,Re=t.onNextPage,Ee=t.onRowSelectionChange,Ne=t.onSortChange,He=t.prevIcon,ke=void 0===He?e(q,{className:"st-next-prev-icon"}):He,Ae=t.rowButtons,Fe=t.rowGrouping,De=t.rowHeight,Te=void 0===De?32:De,Me=t.rowIdAccessor,We=t.rows,Le=t.selectionColumnWidth,Be=void 0===Le?42:Le,Oe=t.rowsPerPage,Pe=void 0===Oe?10:Oe,qe=t.selectableCells,ze=void 0!==qe&&qe,Ye=t.selectableColumns,je=void 0!==Ye&&Ye,Ge=t.shouldPaginate,Ke=void 0!==Ge&&Ge,Ue=t.sortDownIcon,Ve=void 0===Ue?e(Rn,{className:"st-header-icon"}):Ue,Je=t.sortUpIcon,Xe=void 0===Je?e(En,{className:"st-header-icon"}):Je,_e=t.tableRef,$e=t.theme,Qe=void 0===$e?"light":$e,Ze=t.useHoverRowBackground,en=void 0===Ze||Ze,nn=t.useOddEvenRowBackground,tn=void 0!==nn&&nn,rn=t.useOddColumnBackground,on=void 0!==rn&&rn;on&&(tn=!1),p&&(en=!1);var an=g(function(e){return e+1},0)[1],ln=i(null),cn=i(null),sn=i(null),un=i(null),dn=i(null),fn=i(null),pn=i(null),gn=o(1),yn=gn[0],bn=gn[1],Cn=o(O),Sn=Cn[0],In=Cn[1],Hn=o(!1),Dn=Hn[0],Mn=Hn[1],Wn=o(!1),Ln=Wn[0],Bn=Wn[1],On=o(null),Pn=On[0],qn=On[1],zn=o(new Set),Yn=zn[0],jn=zn[1];c(function(){In(O)},[O]);var Gn=Tn({rows:We,rowIdAccessor:Me,onRowSelectionChange:Ee,enableRowSelection:_}),Kn=Gn.selectedRows,Un=Gn.setSelectedRows,Vn=Gn.isRowSelected,Jn=Gn.areAllRowsSelected,Xn=Gn.selectedRowCount,_n=Gn.selectedRowsData,$n=Gn.handleRowSelect,Qn=Gn.handleSelectAll,Zn=Gn.handleToggleRow,et=Gn.clearSelection,nt=a(function(){var e,n=b([],Sn,!0);_&&!(null===(e=null==Sn?void 0:Sn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=b([{accessor:"__row_selection__",label:"",width:Be,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[_,Sn,Be]),tt=o(0),rt=tt[0],ot=tt[1],it=o(new Set),at=it[0],lt=it[1],ct=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:fn}),st=ct.scrollbarWidth,ut=ct.setScrollbarWidth,dt=o(0),ft=dt[0],ht=dt[1];d(function(){var e=function(){fn.current&&ht(fn.current.clientWidth)};e();var n=null;return fn.current&&(n=new ResizeObserver(e)).observe(fn.current),function(){n&&n.disconnect()}},[]);var vt=a(function(){var e=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,l=0,c=0;if(n.forEach(function(e){if(!e.hide){var n=H(e,i).reduce(function(e,n){return e+k(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?l+=n:c+=n}}),t&&t>0){var s=t*o;a>s&&(a=s),l>s&&(l=s)}return{leftWidth:I(a),rightWidth:I(l),mainWidth:c}}({headers:nt,containerWidth:ft,collapsedHeaders:Yn});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[nt,ft,Yn]),pt=vt.mainBodyWidth,gt=vt.pinnedLeftWidth,mt=vt.pinnedRightWidth,wt=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-t)},[n,t])}({height:de,rowHeight:Te}),yt=Fn({rows:We,headers:Sn,rowGrouping:Fe}),bt=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return An({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=m(m({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),f=l(function(e){var n=m({},c);delete n[e],s(n),null==r||r(n)},[c,r]),h=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=m(m({},c),((r={})[e.accessor]=e,r));return An({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:f,clearAllFilters:h,filters:c,computeFilteredRowsPreview:v}}({rows:yt,externalFilterHandling:te,onFilterChange:Ce}),Ct=bt.filters,St=bt.filteredRows,It=bt.updateFilter,xt=bt.clearFilter,Rt=bt.clearAllFilters,Et=bt.computeFilteredRowsPreview,Nt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],f=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=mn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(D(a)){var l=f({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return m(m({},e),((r={})[i]=l,r))}return e}):i},[]),h=a(function(){return wn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:f})},[t,u,n,r,c,f]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},wn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:f})},[u,n,t,r,c,f]);return{sort:u,sortedRows:h,updateSort:v,computeSortedRowsPreview:p}}({headers:Sn,tableRows:St,externalSortHandling:oe,onSortChange:Ne,rowGrouping:Fe}),Ht=Nt.sort,kt=Nt.sortedRows,At=Nt.updateSort,Ft=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,f=e.rowGrouping,h=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,w=e.rowHeight,y=e.scrollTop,C=e.computeFilteredRowsPreview,S=e.computeSortedRowsPreview,I=o(!1),x=I[0],R=I[1],E=o([]),N=E[0],H=E[1],k=i([]),A=i([]),F=i(new Map),D=i(null),W=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return f&&0!==f.length?M({rows:n,rowGrouping:f,rowIdAccessor:h,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,f,h,v,p]);a(function(){if(0===F.current.size){var e=W(r),n=new Map;e.forEach(function(e){var t=String(T({row:e.row,rowIdAccessor:h}));n.set(t,e.position)}),F.current=n}},[r,W,h]);var L=a(function(){return W(t)},[t,W]),B=a(function(){return Y({bufferRowCount:5,contentHeight:g,tableRows:L,rowHeight:w,scrollTop:y})},[L,g,w,y]),O=l(function(e,n){var t=new Set(e.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))})),r=new Set(n.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))}));return{staying:n.filter(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return t.has(n)}),entering:n.filter(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return!r.has(n)})}},[h]),P=a(function(){if(0===k.current.length)return!1;var e=L.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))}),n=k.current.map(function(e){return String(T({row:e.row,rowIdAccessor:h}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L,h]);d(function(){if(!x){if(!n||u)return H([]),k.current=L,void(A.current=B);if(0===k.current.length)return H([]),k.current=L,void(A.current=B);if(!P)return H([]),k.current=L,void(A.current=B);D.current={tableRows:L,visibleRows:B},R(!0)}},[n,L,P,x,u,B]),d(function(){if(x&&D.current&&N.length>0){var e=setTimeout(function(){var e=D.current;R(!1),H([]),k.current=e.tableRows,A.current=e.visibleRows,D.current=null},me.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var q=a(function(){if(!n||u)return B;if(N.length>0){var e=new Map;return L.forEach(function(n){var t=String(T({row:n.row,rowIdAccessor:h}));e.set(t,n.position)}),N.map(function(n){var t=String(T({row:n.row,rowIdAccessor:h})),r=e.get(t);return void 0!==r?m(m({},n),{position:r}):n})}return B},[B,N,L,n,u,h]),z=l(function(e){if(n&&!u){var t=C(e),r=W(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return L.find(function(e){return String(T({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],B,!0),i,!0))}},[n,u,C,W,g,w,y,O,L,B,h]),j=l(function(e){if(n&&!u){var t=S(e),r=W(t),o=Y({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(T({row:e.row,rowIdAccessor:h}));return L.find(function(e){return String(T({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&H(b(b([],B,!0),i,!0))}},[n,u,S,W,g,w,y,O,L,B,h]);return{currentTableRows:L,currentVisibleRows:B,isAnimating:x,prepareForFilterChange:z,prepareForSortChange:j,rowsToRender:q}}({allowAnimations:s,sortedRows:kt,originalRows:yt,currentPage:yn,rowsPerPage:Pe,shouldPaginate:Ke,rowGrouping:Fe,rowIdAccessor:Me,unexpandedRows:at,expandAll:Q,contentHeight:wt,rowHeight:Te,scrollTop:rt,computeFilteredRowsPreview:Et,computeSortedRowsPreview:Nt.computeSortedRowsPreview}),Dt=Ft.currentTableRows,Tt=Ft.rowsToRender,Mt=Ft.prepareForFilterChange,Wt=Ft.prepareForSortChange,Lt=Ft.isAnimating,Bt=i(new Map),Ot=i(new Map),Pt=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,f=e.collapsedHeaders,h=o(new Set),v=h[0],p=h[1],g=o(new Set),m=g[0],b=g[1],C=o(null),S=C[0],I=C[1],x=o(null),R=x[0],E=x[1],N=o(new Set),k=N[0],A=N[1],F=o(new Set),D=F[0],M=F[1],L=i(!1),B=i(null),O=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),m.forEach(function(n){e.add(n)}),e},[v,m]),P=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),m.size>0&&r.forEach(function(n){var t=T({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[v,m,r,s]),q=a(function(){return t.flatMap(function(e){return H(e,f)})},[t,f]),z=l(function(){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(v).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");v.size>0&&(navigator.clipboard.writeText(o),A(new Set(v)),setTimeout(function(){A(new Set)},800))},[q,v,r]),Y=l(function(){return w(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(f){switch(f.label){case 0:if(!R)return[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=f.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=q.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var f=a+n,h=l+c;if(!(f>=r.length||h>=t.length)){var v=r[f],p=t[h],g=T({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var w=Number(e);isNaN(w)||(m=w)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(m=y)}if(v.row[p.accessor]=m,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(m)}null==u||u({accessor:p.accessor,newValue:m,row:v.row,rowIndex:f});var S=W({colIndex:h,rowIndex:f,rowId:g});o.add(S)}else{var I=W({colIndex:h,rowIndex:f,rowId:g});i.add(I)}}})}),o.size>0&&(A(o),setTimeout(function(){A(new Set)},800)),i.size>0&&(M(i),setTimeout(function(){M(new Set)},800)),[3,4]):[2];case 3:return c=f.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,q,r,s,u,d]),j=l(function(){if(0!==v.size){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(v).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],f=e[l],h=T({row:c.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(c.row[f.accessor])?[]:""),c.row[f.accessor]=v,d){var p="".concat(h,"-").concat(f.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:f.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(A(t),setTimeout(function(){A(new Set)},800)),o.size>0&&(M(o),setTimeout(function(){M(new Set)},800))}},[v,q,r,s,u,d]),G=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=T({row:r[c].row,rowIdAccessor:s});t.add(W({colIndex:u,rowIndex:c,rowId:d}))}b(new Set),I(null),p(t)},[r,s,b,I,p]),K=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<q.length){var n=W(e);b(new Set),I(null),p(new Set([n])),E(e)}},[q.length,r.length,b,I,p,E]),U=l(function(e,n){void 0===n&&(n=!1),p(new Set),E(null),b(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&I(e[e.length-1])},[p,E,b,I]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void Y();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void j();if(T({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return T({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=T({row:r[o-1].row,rowIdAccessor:s});K({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=T({row:r[o+1].row,rowIdAccessor:s}),K({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=T({row:r[o].row,rowIdAccessor:s}),K({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<q.length-1&&(c=T({row:r[o].row,rowIdAccessor:s}),K({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(p(new Set),b(new Set),I(null),B.current=null,E(null))}else z()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[z,q.length,R,s,G,K,n,r,Y,j]);var V=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=W({colIndex:n,rowIndex:t,rowId:r}),i=v.has(o),a=m.has(n);return i||a},[v,m]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?T({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?T({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},f={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!V(c)||m.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!V(u)||m.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),V(d)||i.push("st-selected-left-border"),V(f)||i.push("st-selected-right-border"),i.join(" ")},[V,r,m,s]),X=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=W({colIndex:n,rowIndex:t,rowId:r});return k.has(o)},[k]),$=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=W({colIndex:n,rowIndex:t,rowId:r});return D.has(o)},[D]);return{getBorderClass:J,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(L.current=!0,B.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){b(new Set),I(null);var e=W({colIndex:t,rowIndex:r,rowId:o});p(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&L.current&&B.current){for(var i=new Set,a=Math.min(B.current.rowIndex,o),l=Math.max(B.current.rowIndex,o),c=Math.min(B.current.colIndex,t),u=Math.max(B.current.colIndex,t),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<r.length){var h=T({row:r[d].row,rowIdAccessor:s});i.add(W({colIndex:f,rowIndex:d,rowId:h}))}p(i)}},handleMouseUp:function(){L.current=!1},isCopyFlashing:_,isWarningFlashing:$,isInitialFocusedCell:X,isSelected:V,lastSelectedColumnIndex:S,pasteFromClipboard:Y,selectColumns:U,selectedCells:v,selectedColumns:m,setInitialFocusedCell:E,setSelectedCells:p,setSelectedColumns:b,deleteSelectedCells:j,columnsWithSelectedCells:O,rowsWithSelectedCells:P}}({selectableCells:ze,headers:Sn,tableRows:Dt,rowIdAccessor:Me,onCellEdit:ge,cellRegistry:Bt.current,collapsedHeaders:Yn}),qt=Pt.getBorderClass,zt=Pt.handleMouseDown,Yt=Pt.handleMouseOver,jt=Pt.handleMouseUp,Gt=Pt.isCopyFlashing,Kt=Pt.isInitialFocusedCell,Ut=Pt.isSelected,Vt=Pt.isWarningFlashing,Jt=Pt.selectColumns,Xt=Pt.selectedCells,_t=Pt.selectedColumns,$t=Pt.setInitialFocusedCell,Qt=Pt.setSelectedCells,Zt=Pt.setSelectedColumns,er=Pt.columnsWithSelectedCells,nr=Pt.rowsWithSelectedCells,tr=l(function(e){Wt(e),setTimeout(function(){At(e)},0)},[Wt,At]),rr=l(function(e){In(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:je,selectedCells:Xt,selectedColumns:_t,setSelectedCells:Qt,setSelectedColumns:Zt,activeHeaderDropdown:Pn,setActiveHeaderDropdown:qn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:an,tableBodyContainerRef:fn,setScrollbarWidth:ut}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:Se}),function(e){var n=e.tableRef,t=e.rows,r=e.rowIdAccessor,o=e.cellRegistryRef,i=e.headerRegistryRef,a=e.visibleRows;c(function(){n&&(n.current={updateData:function(e){var n=e.accessor,i=e.rowIndex,a=e.newValue,l=null==t?void 0:t[i];if(l){var c=T({row:l,rowIdAccessor:r}),s=N({rowId:c,accessor:n}),u=o.current.get(s);u&&u.updateContent(a),void 0!==l[n]&&(l[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=i.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return a}})},[o,i,t,r,n,a])}({cellRegistryRef:Bt,headerRegistryRef:Ot,rowIdAccessor:Me,rows:We,tableRef:_e,visibleRows:Tt}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:Ct,onFilterChange:Ce}),function(e){var n=e.sort,t=e.onSortChange,r=ae(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:Ht,onSortChange:Ne});var or=l(function(e){Mt(e),setTimeout(function(){It(e)},0)},[Mt,It]);return e(B,m({value:{allowAnimations:s,areAllRowsSelected:Jn,cellRegistry:Bt.current,cellUpdateFlash:f,clearSelection:et,collapsedHeaders:Yn,columnBorders:p,columnReordering:A,columnResizing:L,draggedHeaderRef:ln,editColumns:G,enableHeaderEditing:J,enableRowSelection:_,expandIcon:ee,filters:Ct,forceUpdate:an,getBorderClass:qt,handleApplyFilter:or,handleClearAllFilters:Rt,handleClearFilter:xt,handleMouseDown:zt,handleMouseOver:Yt,handleRowSelect:$n,handleSelectAll:Qn,handleToggleRow:Zn,headerCollapseIcon:le,headerContainerRef:pn,headerDropdown:ue,headerExpandIcon:se,headerRegistry:Ot.current,headers:nt,hoveredHeaderRef:cn,isAnimating:Lt,isCopyFlashing:Gt,isInitialFocusedCell:Kt,isResizing:Dn,isRowSelected:Vn,isScrolling:Ln,isSelected:Ut,isWarningFlashing:Vt,mainBodyRef:sn,nextIcon:pe,onCellEdit:ge,onCellClick:we,onColumnOrderChange:ye,onColumnSelect:be,onLoadMore:xe,onSort:tr,onTableHeaderDragEnd:rr,pinnedLeftRef:un,pinnedRightRef:dn,prevIcon:ke,rowButtons:Ae,rowGrouping:Fe,rowHeight:Te,rowIdAccessor:Me,scrollbarWidth:st,selectColumns:Jt,selectableColumns:je,selectedColumns:_t,columnsWithSelectedCells:er,rowsWithSelectedCells:nr,selectedRows:Kn,selectedRowCount:Xn,selectedRowsData:_n,setCollapsedHeaders:jn,setHeaders:In,setInitialFocusedCell:$t,setIsResizing:Mn,setIsScrolling:Bn,setSelectedCells:Qt,setSelectedColumns:Zt,setSelectedRows:Un,setUnexpandedRows:lt,shouldPaginate:Ke,sortDownIcon:Ve,sortUpIcon:Xe,tableBodyContainerRef:fn,tableRows:Dt,theme:Qe,unexpandedRows:at,useHoverRowBackground:en,useOddColumnBackground:on,useOddEvenRowBackground:tn,activeHeaderDropdown:Pn,setActiveHeaderDropdown:qn,onHeaderEdit:Ie}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(Qe," ").concat(null!=h?h:""," ").concat(p?"st-column-borders":""),style:de?{height:de}:{}},{children:e(Nn,{children:n("div",m({className:"st-wrapper-container"},{children:[e(kn,{}),n("div",m({className:"st-content-wrapper",onMouseUp:jt,onMouseLeave:jt},{children:[e(hn,{pinnedLeftWidth:gt,pinnedRightWidth:mt,setScrollTop:ot,sort:Ht,tableRows:Dt,rowsToRender:Tt}),e(xn,{columnEditorText:R,editColumns:G,editColumnsInitOpen:U,headers:Sn,position:S})]})),e(vn,{mainBodyRef:sn,mainBodyWidth:pt,pinnedLeftWidth:gt,pinnedRightWidth:mt,tableBodyContainerRef:fn}),e(P,{currentPage:yn,hideFooter:he,onPageChange:bn,onNextPage:Re,shouldPaginate:Ke,totalPages:Math.ceil(kt.length/Pe)})]}))})}))}))};export{Mn 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");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,s)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,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=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function s(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var l=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var s=a[i];o=r(s,o)}return o};return r(e,n),t},c=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,c(e.children)),n})},u=function(e){return void 0===e&&(e=0),e?e+1:0},d=function(e,n,t){var r=function(e,n){for(var t=0,r=c(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?!e.summaryColumn:!0===e.summaryColumn)},f=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},h=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&d(n,r,o))||null},v=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},p=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return e.summaryColumn}).flatMap(function(e){return p(e,n)}):e.children.filter(function(e){return!e.summaryColumn}).flatMap(function(e){return p(e,n)}):[e]},m=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(f({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},g=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(f({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){g(e)})},w=function(e){return"number"==typeof e.minWidth?e.minWidth:40},x=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},y=function(e){return e.row[e.rowIdAccessor]},b=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,s=void 0===a?[]:a,l=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var c=y({row:t,rowIdAccessor:l}),f=s[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(c);if((o?!i.has(v):i.has(v))&&n<s.length){var p=function(e,n){var t=e[n];return x(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(c,t),u},C=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},S=n.createContext(void 0),I=function(n){var t=n.children,r=n.value;return e.jsx(S.Provider,o({value:r},{children:t}))},R=function(){var e=n.useContext(S);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},j=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=R(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),m=p[0],g=p[1],w=!(r>1),x=!(r<d)&&!c||!m&&r===d;if(s||!u)return null;var y=function(){if(d<=15)return Array.from({length:d},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=d-Math.floor(7.5))e=Math.max(1,d-o+1),n=d;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<d-1&&(t.push(-1),t.push(d)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&l(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(t){switch(t.label){case 0:return e=r===d,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return g(!1),[2];t.label=2;case 2:return(n<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),y.map(function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=d&&l(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},E=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},k=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},N=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,s=Math.max(0,o-a*n),l=o+t+a*n,c=Math.max(0,Math.floor(s/a)),u=Math.min(i.length,Math.ceil(l/a));return i.slice(c,u)},H=function(e){return e.position*(e.rowHeight+1)-1},F=function(e){return e.position*(e.rowHeight+1)},A=function(t){var r=t.children,i=t.onClose,a=t.open,s=t.overflow,l=void 0===s?"auto":s,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=R().mainBodyRef,p=n.useRef(null),m=n.useRef(null),g=n.useState("bottom-left"),w=g[0],x=g[1],y=n.useState({}),b=y[0],C=y[1],S=n.useState(!1),I=S[0],j=S[1];return n.useEffect(function(){a&&p.current?(j(!1),!m.current&&p.current.parentElement&&(m.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&m.current){var e,n=p.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,i=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,s="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(s="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===s?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===c?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===s?l.top=t.height+4:l.bottom=t.height+4,"left"===c?l.left=0:l.right=0),x("".concat(s,"-").concat(c)),C(l),j(!0)}})):a||j(!1)},[a,u,d,v,h]),n.useEffect(function(){var e=function(e){if(a&&p.current){var n=e.target;p.current&&!p.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,i,c]),n.useEffect(function(){var e=function(e){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(c(!1),null==i||i())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i,a,c]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[i,a,c]),a?e.jsx("div",o({ref:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:I?"visible":"hidden"},b),{overflow:l})},{children:r})):null},M=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,s=n.disabled,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(l?"disabled":""," ").concat(u),onClick:function(){!l&&r&&r()},role:"option","aria-selected":a,"aria-disabled":l},{children:t}))},D=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value,c=n.useState(l),u=c[0],d=c[1],f=function(e){d(e),i(e),s(!1),r()};return e.jsxs(A,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(M,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(M,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},T=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},L=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},W=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=R(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),m=p[0],g=p[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===m&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return g("months")}},{children:[(i=h,i.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===m&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return g("years")}},{children:h.getFullYear()})),"years"===m&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=h.getFullYear(),r=h.getMonth(),i=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e);v(n),a(n),null==s||s()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(i){var c=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=i===new Date(l).getDate()&&r===new Date(l).getMonth()&&t===new Date(l).getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth(),e);v(n),a(n),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},m=1;m<=i;m++)p(m);var g=35-(c+i),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e);v(n),a(n),null==s||s()}(t)}},{children:t}),"next-".concat(t)))};for(m=1;m<=g;m++)x(m);return n}(),"months"===m&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var i=t===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),g("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===m&&function(){for(var n=[],t=h.getFullYear(),r=t-6,i=function(r){var i=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(e,h.getMonth(),1)),g("months")}(r)}},{children:r}),"year-".concat(r)))},a=r;a<r+12;a++)i(a);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),a(e),null==s||s()}},{children:"Today"}))}))]}))},B=function(e){if(!e)return new Date;var n=e.toString().split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setFullYear(t),i.setMonth(r-1),i.setDate(o),isNaN(i.getTime())?new Date:i},O=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var c=function(){r()};return e.jsx(A,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(W,{value:B(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},P=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.options,l=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(A,o({open:a,onClose:function(){r()},setOpen:l,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:s.map(function(n){return e.jsx(M,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),i(e),l(!1),void r();var e}},{children:n.label}),n.value)})}))}))},q=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,s=void 0===a?"string":a,l=n.value,c=function(){i(!1)};if("boolean"===s&&"boolean"==typeof l)return e.jsx(D,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(O,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(P,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(L,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==l?"":String(l);return e.jsx(T,{defaultValue:d,onBlur:c,onChange:o})},z=0,Y=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===z||o-z>=r)&&(z=o,n(t))}},G=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},K=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(K);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=K(e[t]));return n},U=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},V=Date.now(),J={screenX:0,screenY:0},X=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return s(s([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=X(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},_=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function $(e,n,t){var r,i,a=K(e),s=!1;try{var l=_(t),c=a.findIndex(function(e){return e.accessor===n.accessor}),u=a.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:a,emergencyBreak:s=!0};var d=a.splice(c,1)[0],f=(r=l,i=o({},d),"left"===r?i.pinned="left":"right"===r?i.pinned="right":delete i.pinned,i),h=u;a.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),s=!0}return{newHeaders:a,emergencyBreak:s}}var Q=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=R().setHeaders,l=G(t);return{handleDragStart:function(e){n.current=e,V=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var s=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(c-J.screenX,2)+Math.pow(u-J.screenY,2));r.current=a;var f,h=n.current,v=!1;if(_(h)!==_(a)){f=(C=$(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,m=X(p,h.accessor),g=X(p,a.accessor);if(!m||!g)return;var w=m.length,x=g.length,y=g;if(w!==x){var b=x-w;b>0&&(y=g.slice(0,-b))}var C=function(e,n,t){var r=K(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var s=i(r,n);return a(r,n,i(r,t)),a(r,t,s),{newHeaders:r,emergencyBreak:o}}(p,m,y);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-V<1500||d<40)||(V=S,J={screenX:c,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return s([],e,!0)}),null==o||o(t)},10)}}},Z=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},ee={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ne={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},te={duration:150,easing:"ease-out",delay:0},re=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},oe=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){re(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ie=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,s=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i,l;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,s),0===e.x&&0===e.y?[2]:Z()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),Z()?o(o({},te),e):o(o({},"column"===n?ee:ne),e)}(t,i?"column":"row"),re(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,oe(n,l,t)]);case 1:return a.sent(),[2]}})})},ae=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,s,l,c,u,d,f,h,v,p,m,g,w;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,s=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,u=t.delay,d=void 0===u?0:u,f=t.onComplete,h=t.respectReducedMotion,v=void 0===h||h,Z()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),m=p.top,g=e-m,w=r-m,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(s,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,s+(d||0)+50)})])})})},se=function(t){var r=t.children,i=t.id,a=t.parentRef,s=t.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(t,["children","id","parentRef","tableRow"]),c=R(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),m=G(f),g=G(d);return n.useLayoutEffect(function(){var e,n,t,r;if(u&&v.current&&!d){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!m||f)if(!g||d){if(p.current=i,l){var c=i.x-l.x,w=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(w)<=5)){if(Math.abs(c)>5||Math.abs(w)>5){var x=o(o({},ne),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),y=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,b=null===(n=null==a?void 0:a.current)||void 0===n?void 0:n.clientHeight,C=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==y&&void 0!==b&&void 0!==C){var S=5*h,I=y-S,R=y+b+S,j=l.y>I&&l.y<R,E=i.y>I&&i.y<R,k=i.y<y,N=i.y>y+b,H=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,F=.6*h,A=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(j&&!E&&N){var M=y+b+A(i.y,y,y+b)+H%15*F*2.5+H%7*(.4*h);return void ae({element:v.current,options:{startY:l.y,endY:M,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){M=y-A(i.y,y,y+b)-H%15*F*2.5-H%7*(.4*h);return void ae({element:v.current,options:{startY:l.y,endY:M,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>y+b){var D=y+b+A(l.y,y,y+b)+H%10*F*1;return void ae({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<y){D=y-A(l.y,y,y+b)-H%10*F*1;return void ae({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}ie({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,m,g,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};se.displayName="Animate";var le=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},ce=function(n){var t=n.checked,r=void 0!==t&&t,i=n.children,a=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){a&&a(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx(le,{className:"st-checkbox-checkmark"})})),i]}))},ue=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},de=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,l=t.isInitialFocused,c=t.nestedIndex,u=t.rowIndex,d=t.tableRow,h=R(),p=h.cellRegistry,m=h.cellUpdateFlash,g=h.columnBorders,w=h.draggedHeaderRef,b=h.enableRowSelection,C=h.expandIcon,S=h.handleMouseDown,I=h.handleMouseOver,j=h.handleRowSelect,E=h.headers,k=h.hoveredHeaderRef,N=h.isCopyFlashing,H=h.isRowSelected,F=h.isWarningFlashing,A=h.onCellEdit,M=h.onCellClick,D=h.onTableHeaderDragEnd,T=h.rowButtons,L=h.rowGrouping,W=h.rowIdAccessor,B=h.rowsWithSelectedCells,O=h.selectedColumns,P=h.setUnexpandedRows,z=h.tableBodyContainerRef,G=h.theme,K=h.unexpandedRows,U=h.useOddColumnBackground,V=d.depth,J=d.row,X=n.useState(J[a.accessor]),_=X[0],$=X[1],Z=n.useState(!1),ee=Z[0],ne=Z[1],te=n.useState(!1),re=te[0],oe=te[1],ie=n.useState(!1),ae=ie[0],le=ie[1],de=n.useRef(null),fe=y({row:J,rowIdAccessor:W}),he=L&&L[V],ve=!!he&&function(e,n){if(!n)return!1;var t=e[n];return x(t)}(J,he),pe=!K.has(String(fe)),me=N({rowIndex:u,colIndex:i,rowId:fe}),ge=F({rowIndex:u,colIndex:i,rowId:fe}),we=n.useMemo(function(){var e,n,t;if(!g)return!1;var r=E.filter(function(e){return"left"===e.pinned}),o=E.filter(function(e){return!e.pinned}),i=E.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[g,E,a.accessor,a.pinned]),xe=Q({draggedHeaderRef:w,headers:E,hoveredHeaderRef:k,onTableHeaderDragEnd:D}).handleDragOver,ye=Y(),be=f({accessor:a.accessor,rowId:fe}),Ce=v({rowId:fe,accessor:a.accessor}),Se=a.isSelectionColumn&&b;n.useEffect(function(){if(p){var e="".concat(fe,"-").concat(a.accessor);return p.set(e,{updateContent:function(e){_!==e?($(e),m&&(oe(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(function(){oe(!1)},800))):$(e)}}),function(){p.delete(e),de.current&&clearTimeout(de.current)}}},[p,m,fe,a.accessor,_]),n.useEffect(function(){if(re){var e=setTimeout(function(){oe(!1)},850);return function(){return clearTimeout(e)}}},[re]),n.useEffect(function(){$(J[a.accessor])},[J,a.accessor]);var Ie="boolean"===a.type||"date"===a.type||"enum"===a.type,Re=Boolean(null==a?void 0:a.isEditable),je=O.has(i),Ee=s&&!je,ke=n.useMemo(function(){return!!Se&&B.has(String(fe))},[Se,B,fe]),Ne="st-cell ".concat(V>0&&a.expandable?"st-cell-depth-".concat(V):""," ").concat(Ee?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(je?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Re?"clickable":""," ").concat(re?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ge?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(U?c%2==0?"even-column":"odd-column":""," ").concat(Se?"st-selection-cell":""," ").concat(ke?"st-selection-has-highlighted-cell":""," ").concat(we?"st-last-column":""),He=n.useCallback(function(e){$(e),J[a.accessor]=e,null==A||A({accessor:a.accessor,newValue:e,row:J,rowIndex:u})},[a.accessor,A,J,u]),Fe=n.useCallback(function(){P(function(e){var n=new Set(e),t=String(fe);return n.has(t)?n.delete(t):n.add(t),n})},[fe,P]);return!ee||Ie||Se?e.jsxs(se,o({className:Ne,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":fe,"data-row-index":u,id:be,onClick:function(){M&&!Se&&M({accessor:a.accessor,colIndex:i,row:J,rowId:fe,rowIndex:u,value:_})},onDoubleClick:function(){return a.isEditable&&!Se&&ne(!0)},onDragOver:function(e){Se||ye({callback:xe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){ee||Se||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||ee||(e.preventDefault(),ne(!0))},onMouseDown:function(){ee||Se||S({rowIndex:u,colIndex:i,rowId:fe})},onMouseEnter:function(){le(!0)},onMouseLeave:function(){le(!1)},onMouseOver:function(){ee||Se||I({rowIndex:u,colIndex:i,rowId:fe})},parentRef:z,tableRow:d},{children:[a.expandable&&ve?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(pe?"expanded":"collapsed"),onClick:Fe},{children:C})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:Se?e.jsxs("div",o({className:"st-selection-cell-content"},{children:[e.jsx("div",o({className:"st-selection-control"},{children:ae||H&&H(String(fe))?e.jsx(ce,{checked:!!H&&H(String(fe)),onChange:function(e){j&&j(String(fe),e)}}):e.jsx("span",o({className:"st-row-number"},{children:u+1}))})),function(){if(!T||!Se||0===T.length)return null;if(!(ae||H&&H(String(fe))))return null;var n={row:J};return e.jsx("div",o({className:"st-row-buttons"},{children:T.map(function(t,r){return e.jsx("span",o({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:J,theme:G}):ue({content:_,header:a})})})),ee&&Ie&&!Se&&e.jsx(q,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ne,type:a.type,value:_})]}),Ce):e.jsx("div",o({className:"st-cell-editing",id:f({accessor:a.accessor,rowId:fe}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(q,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ne,type:a.type,value:_})}))},fe=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,l=n.tableRow,c=R(),u=c.rowIdAccessor,d=c.collapsedHeaders,v=o.filter(function(e){return h({header:e,pinned:i,headers:o,collapsedHeaders:d})});return e.jsx(e.Fragment,{children:v.map(function(n,c){var d=y({row:l.row,rowIdAccessor:u}),h=f({accessor:n.accessor,rowId:d});return e.jsx(he,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:l},h)})})},he=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,l=t.rowIndex,c=t.rowIndices,u=t.tableRow,d=r[o.accessor],v=R(),p=v.getBorderClass,m=v.isSelected,g=v.isInitialFocusedCell,w=v.rowIdAccessor,x=v.collapsedHeaders,b=y({row:u.row,rowIdAccessor:w});if(o.children&&o.children.length>0){var C=o.children.filter(function(e){return h({header:e,pinned:s,headers:i,collapsedHeaders:x})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=f({accessor:n.accessor,rowId:b});return e.jsx(he,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:l,rowIndices:c,tableRow:u},t)})})}var S={rowIndex:l,colIndex:d,rowId:b},I=p(S),j=m(S),E=g(S),k=f({accessor:o.accessor,rowId:b});return e.jsx(de,{borderClass:I,colIndex:d,header:o,isHighlighted:j,isInitialFocused:E,nestedIndex:a,rowIndex:l,tableRow:u},k)},ve=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,s=n.hoveredIndex,l=n.index,c=n.pinned,u=n.rowHeight,d=n.rowIndices,f=n.setHoveredIndex,h=n.tableRow,v=R(),p=v.useHoverRowBackground,m=v.rowIdAccessor,g=v.isAnimating,w=v.isRowSelected,x=v.useOddEvenRowBackground,b=h.position,C=b%2==0,S=y({row:h.row,rowIdAccessor:m}),I=!!w&&w(String(S));return e.jsx("div",o({className:"st-row ".concat(x?C?"even":"odd":""," ").concat(s===l&&p?"hovered":""," ").concat(I?"selected":""),onMouseEnter:function(){g||f(l)},style:{gridTemplateColumns:i,top:F({position:b,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(fe,{columnIndexStart:r,columnIndices:t,headers:a,pinned:c,rowIndex:b,rowIndices:d,tableRow:h},S)}))},pe=function(t){var r=t.displayStrongBorder,i=t.position,a=t.rowHeight,s=t.templateColumns,l=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=s.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=s.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,a=0;a<r.length;a++){if(t<=o+r[a]){i=a;break}o+=r[a],i=a}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:s,top:H({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},me=n.createContext(void 0),ge=["default"],we=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(me);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),i=o.registerPane,a=o.unregisterPane;return n.useEffect(function(){return t.current&&i(t.current,ge),function(){t.current&&a(t.current,ge)}},[t,i,a]),n.cloneElement(r,{ref:function(e){t.current=e}})},xe=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},ye=n.forwardRef(function(t,r){var i=t.columnIndexStart,a=t.columnIndices,s=t.headers,l=t.hoveredIndex,c=t.pinned,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,h=t.templateColumns,v=t.totalHeight,p=t.rowsToRender,m=t.width,g=c?"st-body-pinned-".concat(c):"st-body-main",w=R().rowIdAccessor,x=n.useRef(null);return n.useImperativeHandle(r,function(){return x.current},[]),n.useMemo(function(){return U(s,c)},[s,c])?e.jsx(xe,o({condition:!c,wrapper:function(n){return e.jsx(we,o({childRef:x},{children:n}))}},{children:e.jsx("div",o({className:g,ref:x,style:o({position:"relative",height:"".concat(v,"px"),width:m},!c&&{flexGrow:1})},{children:p.map(function(t,r){var o=y({row:t.row,rowIdAccessor:w});return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(pe,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:h,rowIndex:r-1}),e.jsx(ve,{columnIndexStart:i,columnIndices:a,gridTemplateColumns:h,headers:s,hoveredIndex:l,index:r,pinned:c,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:t},o)]},o)})}))})):null});function be(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=s(s(s([],t,!0),n,!0),r,!0),c=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({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&h({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}ye.displayName="TableSection";var Ce=function(t){var r=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,l=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,u=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,h=t.tableRows,v=R(),p=v.collapsedHeaders,m=v.headerContainerRef,g=v.headers,w=v.isAnimating,x=v.mainBodyRef,b=v.onLoadMore,C=v.rowHeight,S=v.rowIdAccessor,I=v.scrollbarWidth,j=v.setIsScrolling,E=v.shouldPaginate,k=v.tableBodyContainerRef,N=n.useState(null),H=N[0],F=N[1],A=n.useState(!1),M=A[0],D=A[1];n.useEffect(function(){w&&null!==H&&F(null)},[w,H]),function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],s=i[1];n.useEffect(function(){var e=null==t?void 0:t.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")}},[t,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;s(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(n),function(){n&&i.unobserve(n)}}},[t,r])}({headerContainerRef:m,mainSectionRef:k,scrollbarWidth:I}),n.useEffect(function(){return function(){L.current&&clearTimeout(L.current)}},[]);var T=n.useRef(null),L=n.useRef(null),W=n.useRef(0),B=function(e){return e.length}(h),O=B*(C+1)-1,P=n.useMemo(function(){return be({headers:g,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:p})},[g,i,l,p]),q=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(y({row:n.row,rowIdAccessor:S}));e[r]=t}),e},[d,S]),z=n.useCallback(function(e,n){if(b&&!E&&!M){e.scrollHeight-(n+e.clientHeight)<=200&&n>W.current&&(D(!0),b(),setTimeout(function(){D(!1)},1e3))}},[b,E,M]),Y={columnIndices:P,headerContainerRef:m,headers:g,hoveredIndex:H,rowHeight:C,rowIndices:q,rowsToRender:d,setHoveredIndex:F};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;j(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(function(){j(!1)},150),T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(function(){f(t),z(n,t),W.current=t})},ref:k},{children:[e.jsx(ye,o({},Y,{pinned:"left",templateColumns:a,totalHeight:O,width:s})),e.jsx(ye,o({},Y,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:O})),e.jsx(ye,o({},Y,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:O,width:u}))]}))},Se=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,u="touches"in n;if(t&&!t.hide){i(!0);var d,f=w(t);if(t.children&&t.children.length>0){var h=p(t,l);d=h.length>0?h:[t]}else d=[t];var v=function(e){var n="right"===t.pinned?c-e:e-c,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=.8*i;if(!n.pinned)return Math.max(.6*i,600);var s=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+p(n,r).reduce(function(e,n){return e+m(n)},0)},0),l=w(n);return s<l?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):s}({header:t,headers:r,collapsedHeaders:l});if(d.length>1)Ie({delta:n,leafHeaders:d,minWidth:f,startWidth:a,maxWidth:i});else{var u=Math.max(Math.min(a+n,i),f);d[0].width=u}r.forEach(function(e){g(e)});var h=s([],r,!0);o(h)};if(u){var x=function(e){var n=e.touches[0];v(n.clientX)},y=function(){document.removeEventListener("touchmove",x),document.removeEventListener("touchend",y),i(!1)};document.addEventListener("touchmove",x),document.addEventListener("touchend",y)}else{var b=function(e){v(e.clientX)},C=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C),i(!1)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",C)}}},Ie=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,w(n))},40),s=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-s;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/s),o=Math.max(n+t,r);e.width=o})},Re=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},je={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Ee=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},ke=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ne=function(e){return["between","notBetween","in","notIn"].includes(e)},He=function(e){return["isEmpty","isNotEmpty"].includes(e)},Fe=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},Ae=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Me=function(t){var r=t.value,i=t.onChange,a=t.options,s=t.placeholder,l=void 0===s?"Select...":s,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],m=n.useState(-1),g=m[0],w=m[1],x=n.useRef(null),y=a.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<a.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:a.length-1});break;case"Enter":e.preventDefault(),g>=0&&(i(a[g].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,g,a,i]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=a.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:y?y.label:l})),e.jsx(Ae,{})]})),e.jsx(A,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:a.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===g?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,i(e),p(!1),void w(-1);var e}},{children:n.label}),t)})}))}))]}))},De=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:je[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Me,{value:t,onChange:function(e){r(e)},options:i})}))},Te=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,s=n.autoFocus,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c,d=n.onEnterPress;return e.jsx("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:l,className:"st-filter-input ".concat(u).trim()})},Le=function(n){var t=n.children,r=n.className,i=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(i).trim()},{children:t}))},We=function(n){var t=n.onApply,r=n.onClear,i=n.canApply,a=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Be=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,s=t.onClearFilter,l=n.useState((null==i?void 0:i.operator)||"contains"),c=l[0],u=l[1],d=n.useState(String((null==i?void 0:i.value)||"")),f=d[0],h=d[1],v=Ee("string");n.useEffect(function(){i?(u(i.operator),h(String(i.value||""))):(u("contains"),h(""))},[i]);var p=function(){var e=o({accessor:r.accessor,operator:c},ke(c)&&{value:f});a(e)},m=He(c)||f.trim();return e.jsxs(Fe,{children:[e.jsx(De,{value:c,onChange:u,operators:v}),ke(c)&&e.jsx(Le,{children:e.jsx(Te,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(We,{onApply:p,onClear:s,canApply:!!m,showClear:!!i})]})},Oe=function(t){var r,o,i=t.header,a=t.currentFilter,s=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==a?void 0:a.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")),m=p[0],g=p[1],w=n.useState(String((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")),x=w[0],y=w[1],b=Ee("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),g(String((null===(e=a.values)||void 0===e?void 0:e[0])||"")),y(String((null===(n=a.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),g(""),y(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};ke(u)?e.value=parseFloat(h):Ne(u)&&(e.values=[parseFloat(m.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(Fe,{children:[e.jsx(De,{value:u,onChange:d,operators:b}),ke(u)&&e.jsx(Le,{children:e.jsx(Te,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Ne(u)&&e.jsxs(Le,{children:[e.jsx(Te,{type:"number",value:m,onChange:g,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(Te,{type:"number",value:x,onChange:y,placeholder:"To...",onEnterPress:C})]}),e.jsx(We,{onApply:C,onClear:l,canApply:!!He(u)||(ke(u)?""!==h.trim():!!Ne(u)&&""!==String(m).trim()&&""!==String(x).trim()),showClear:!!a})]})},Pe=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,s=n.placeholder;return e.jsx(Me,{value:t,onChange:r,options:o,className:a,placeholder:s})},qe=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,s=n.useState((null==o?void 0:o.operator)||"equals"),l=s[0],c=s[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=Ee("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=He(l)||""!==d;return e.jsxs(Fe,{children:[e.jsx(De,{value:l,onChange:c,operators:h}),ke(l)&&e.jsx(Le,{children:e.jsx(Pe,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(We,{onApply:function(){var e={accessor:r.accessor,operator:l};ke(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},ze=function(t){var r,i,a=t.header,s=t.currentFilter,l=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==s?void 0:s.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==s?void 0:s.value)?String(s.value):""),v=h[0],p=h[1],m=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),g=m[0],w=m[1],x=n.useState(String((null===(i=null==s?void 0:s.values)||void 0===i?void 0:i[1])||"")),y=x[0],b=x[1],C=Ee("date");n.useEffect(function(){var e,n;s?(f(s.operator),p(String(s.value||"")),w(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),b(""))},[s]);var S=function(t){var r=t.value,i=t.onChange,a=t.placeholder,s=t.autoFocus,l=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=new Date(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){s&&p.current&&p.current.focus()},[s]);var m=r?new Date(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:a,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(l||""),style:{cursor:"pointer"}}),e.jsx(A,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(W,{value:m,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(Fe,{children:[e.jsx(De,{value:d,onChange:f,operators:C}),ke(d)&&e.jsx(Le,{children:e.jsx(S,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Ne(d)&&e.jsxs(Le,{children:[e.jsx(S,{value:g,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(S,{value:y,onChange:b,placeholder:"To date..."})]}),e.jsx(We,{onApply:function(){var e={accessor:a.accessor,operator:d};ke(d)?e.value=v:Ne(d)&&(e.values=[g,y]),l(e)},onClear:c,canApply:!!He(d)||(ke(d)?""!==v.trim():!!Ne(d)&&""!==g.trim()&&""!==y.trim()),showClear:!!s})]})},Ye=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==i?void 0:i.values)?i.values.map(String):u),f=d[0],h=d[1],v=n.useState(""),p=v[0],m=v[1],g=n.useMemo(function(){if(!p)return c;var e=p.toLowerCase();return c.filter(function(n){return n.label.toLowerCase().includes(e)})},[c,p]);n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var w=f.length===u.length,x=c.length>10;return e.jsxs(Fe,{children:[e.jsx(Le,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(ce,o({checked:w,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),x&&e.jsx("div",o({className:"st-enum-search"},{children:e.jsx(Te,{type:"text",value:p,onChange:m,placeholder:"Search..."})})),g.map(function(n,t){return e.jsx(ce,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):s(s([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===g.length&&e.jsx("div",o({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(We,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else l()},onClear:l,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},Ge=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(Oe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(ze,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(Ye,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Be,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Ke=function(t){var r,i,a=t.colIndex,c=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,h=t.gridRowStart,v=t.header,p=t.reverse,m=t.sort,g=n.useState(!1),w=g[0],x=g[1],y=n.useState(!1),b=y[0],C=y[1],S=n.useState(v.label||""),I=S[0],j=S[1],E=R(),k=E.activeHeaderDropdown,N=E.areAllRowsSelected,H=E.collapsedHeaders,F=E.columnBorders,M=E.columnReordering,D=E.columnResizing,L=E.columnsWithSelectedCells,W=E.draggedHeaderRef,B=E.enableHeaderEditing,O=E.enableRowSelection,P=E.filters,q=E.handleApplyFilter,z=E.handleClearFilter,G=E.handleSelectAll,K=E.headerCollapseIcon,U=E.headerDropdown,V=E.headerExpandIcon,J=E.headerRegistry,X=E.headers,_=E.hoveredHeaderRef,$=E.onColumnOrderChange,Z=E.onColumnSelect,ee=E.onHeaderEdit,ne=E.onSort,te=E.onTableHeaderDragEnd,re=E.rowHeight,oe=E.selectColumns,ie=E.selectableColumns,ae=E.selectedColumns,le=E.setActiveHeaderDropdown,ue=E.setCollapsedHeaders,de=E.setHeaders,fe=E.setInitialFocusedCell,he=E.setIsResizing,ve=E.setSelectedCells,pe=E.setSelectedColumns,me=E.sortDownIcon,ge=E.sortUpIcon,we=Boolean(null==v?void 0:v.isSortable),xe=Boolean(null==v?void 0:v.filterable),ye=P[v.accessor],be=(null==k?void 0:k.accessor)===v.accessor,Ce=v.isSelectionColumn&&O,Ie=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(v),je=H.has(v.accessor),Ee=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,s=e.margin,l=void 0===s?4:s,c=n.useRef(null),u=n.useState({}),d=u[0],f=u[1];return n.useEffect(function(){if(t&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,r=window.innerWidth-e.right,i="bottom",s={};o>n&&o<=t&&(i="top");var u="left";a>r+e.width&&(u="right"),"bottom"===i?s.top=e.bottom+l:s.bottom=window.innerHeight-e.top+l,"left"===u?s.left=e.left:s.right=window.innerWidth-e.right,f(s)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:c,position:d}}({isOpen:be,estimatedHeight:200,estimatedWidth:250,margin:4}),ke=Ee.triggerRef,Ne=Ee.position,He=n.useMemo(function(){var e,n,t;if(!F)return!1;var r=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===v.accessor},[F,X,v.accessor,v.pinned]),Fe=n.useMemo(function(){return!(!ie||Ce)&&l(v,a).some(function(e){return ae.has(e)})},[ie,Ce,v,a,ae]),Ae=n.useMemo(function(){return!Ce&&L.has(a)},[Ce,L,a]),Me=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!je||v.children.some(function(e){return e.summaryColumn}))},[v.children,je]),De="st-header-cell ".concat(v.accessor===(null===(r=_.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=W.current)||void 0===i?void 0:i.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(M&&!we?"columnReordering":""," ").concat(Me?"parent":""," ").concat(He?"st-last-column":""," ").concat(B&&!Ce?"st-header-editable":""," ").concat(Fe?"st-header-selected":""," ").concat(Ae&&!Fe?"st-header-has-highlighted-cell":""),Te=Q({draggedHeaderRef:W,headers:X,hoveredHeaderRef:_,onColumnOrderChange:$,onTableHeaderDragEnd:te}),Le=Te.handleDragStart,We=Te.handleDragEnd,Be=Te.handleDragOver,Oe=Y();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=String(v.accessor);return J.set(e,{setEditing:function(e){C(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){j(v.label||"")},[v.label]);var Pe=n.useCallback(function(e){j(e);var n=X.map(function(n){return n.accessor===v.accessor?o(o({},n),{label:e}):n});de(n),ee&&ee(v,e)},[X,de,ee,v]),qe=n.useCallback(function(){le&&le(null)},[le]),ze=n.useCallback(function(e){e.stopPropagation(),ue(function(e){var n=new Set(e);return je?n.delete(v.accessor):n.add(v.accessor),n})},[ue,je,v.accessor]),Ye=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ie){var r=l(t,a),o=r.some(function(e){return ae.has(e)});if(B&&o&&!n.shiftKey)return U&&be&&qe(),void C(!0);n.shiftKey&&oe?pe(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,u,d=s(s([],(a=o,l=n,c=Math.min(a,l),u=Math.max(a,l),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(s(s([],Array.from(e),!0),d,!0))}):oe&&oe(r),ve(new Set),fe(null)}Z&&Z(t),!ie&&t.isSortable&&ne(t.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)}},[]),!v)return null;var Ke=D&&!Ce&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:Se,callbackProps:{event:e.nativeEvent,gridColumnEnd:c,gridColumnStart:u,header:v,headers:X,setHeaders:de,setIsResizing:he,startWidth:t,collapsedHeaders:H},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:Se,callbackProps:{event:e,gridColumnEnd:c,gridColumnStart:u,header:v,headers:X,setHeaders:de,setIsResizing:he,startWidth:t,collapsedHeaders:H},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ue=m&&m.key.accessor===v.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return Ye({event:e,header:v})}},{children:["ascending"===m.direction&&ge&&ge,"descending"===m.direction&&me&&me]})),Ve=xe&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),x(!w)}},{children:[e.jsx(Re,{className:"st-header-icon",style:{fill:ye?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(A,o({open:w,overflow:"visible",setOpen:x,onClose:function(){return x(!1)}},{children:e.jsx(Ge,{header:v,currentFilter:ye,onApplyFilter:function(e){q(e),x(!1)},onClearFilter:function(){z(v.accessor),x(!1)}})}))]})),Je=Ie&&!Ce&&e.jsx("div",o({className:"st-icon-container st-collapse-icon-container",onClick:ze},{children:je?K:V}));return e.jsxs(se,o({className:De,id:f({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){Ce||Oe({callback:Be,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:o({gridRowStart:h,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:c},d-h>1?{}:{height:re})},{children:[p&&Ke,"right"===v.align&&Je,"right"===v.align&&Ve,"right"===v.align&&Ue,e.jsx("div",o({ref:ke,className:"st-header-label",draggable:M&&!v.disableReorder&&!Ce,onClick:function(e){Ce||Ye({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){e.event;var n=e.header;n.isSelectionColumn||ie&&n.isSortable&&ne(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),We()},onDragStart:Ce?void 0:function(e){M&&v&&function(e){Le(e)}(v)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(ce,{checked:!!N&&N(),onChange:function(e){G&&G(e)}}):b?e.jsx(T,{defaultValue:I,onBlur:function(){return C(!1)},onChange:Pe}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:a,header:v}):I||(null==v?void 0:v.label)}))})),"right"!==v.align&&Ue,"right"!==v.align&&Ve,"right"!==v.align&&Je,!p&&Ke,U&&!Ce&&e.jsx("div",o({className:"st-header-dropdown-container"},{children:U({accessor:v.accessor,colIndex:a,header:v,isOpen:be,onClose:qe,position:Ne})}))]}))},Ue=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,c=t.pinned,u=t.sectionRef,d=t.sort,f=t.width,v=R().collapsedHeaders,p=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!h({header:o,pinned:c,headers:s,collapsedHeaders:v}))return 0;a||n++;var f=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return h({header:e,pinned:c,headers:s,collapsedHeaders:v})}).length)&&void 0!==d?d:0,p=n,m=f>0?p+f:p+1,g=i,w=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:p,gridColumnEnd:m,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var x=!0;o.children.forEach(function(e){h({header:e,pinned:c,headers:s,collapsedHeaders:v})&&(t(e,i+1,x),x=!1)})}return m-p},o=s.filter(function(e){return h({header:e,pinned:c,headers:s,collapsedHeaders:v})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,c,r,v]);return e.jsx(xe,o({condition:!c,wrapper:function(n){return e.jsx(we,o({childRef:u},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(c?"pinned-".concat(c):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative",width:f}},{children:e.jsx(e.Fragment,{children:p.map(function(n){return e.jsx(Ke,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===c,sort:d},n.header.accessor)})})}))}))},Ve=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ve)):1},Je=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,v=t.pinnedLeftWidth,p=t.pinnedRightWidth,m=R(),g=m.headerContainerRef,w=m.pinnedLeftRef,x=m.pinnedRightRef,y=m.collapsedHeaders,b=n.useMemo(function(){return be({headers:i,pinnedLeftColumns:l,pinnedRightColumns:u,collapsedHeaders:y})},[i,l,u,y]),C=n.useMemo(function(){var e=0,n=s(s(s([],l,!0),i,!0),u,!0);return i.forEach(function(t){if(h({header:t,headers:n,collapsedHeaders:y})){var r=Ve(t);e=Math.max(e,r)}}),{maxDepth:e}},[i,l,u,y]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:g},{children:[U(i,"left")&&e.jsx(Ue,{columnIndices:b,gridTemplateColumns:c,handleScroll:void 0,headers:i,maxDepth:C,pinned:"left",sectionRef:w,sort:f,width:v}),e.jsx(Ue,{columnIndices:b,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:C,sectionRef:r,sort:f}),U(i,"right")&&e.jsx(Ue,{columnIndices:b,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:C,pinned:"right",sectionRef:x,sort:f,width:p})]}))},Xe=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return e.summaryColumn});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return!e.summaryColumn});r({headers:i,flattenedHeaders:o})}else o.push(e)}),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},_e=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=R(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=u.collapsedHeaders,p=n.useRef(null),m=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),w=h.filter(function(e){return"right"===e.pinned}),x=n.useMemo(function(){return Xe({headers:g,collapsedHeaders:v})},[g,v]),y=n.useMemo(function(){return Xe({headers:m,collapsedHeaders:v})},[m,v]),b=n.useMemo(function(){return Xe({headers:w,collapsedHeaders:v})},[w,v]),C={centerHeaderRef:p,headers:h,mainTemplateColumns:y,pinnedLeftColumns:g,pinnedLeftTemplateColumns:x,pinnedRightColumns:w,pinnedRightTemplateColumns:b,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},S={tableRows:l,mainTemplateColumns:y,pinnedLeftColumns:g,pinnedLeftTemplateColumns:x,pinnedLeftWidth:r,pinnedRightColumns:w,pinnedRightTemplateColumns:b,pinnedRightWidth:i,setScrollTop:a,rowsToRender:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Je,o({},C)),e.jsx(Ce,o({},S))]}))},$e=function(t){var r,i,a=t.mainBodyWidth,s=t.mainBodyRef,l=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=R().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),m=u.current&&u.current.scrollHeight>u.current.clientHeight,g=d?28:0,w=(d?c+1:c)+(u.current&&m?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;v(a>e)}}()},1)},[s,a]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:l,height:null===(r=p.current)||void 0===r?void 0:r.offsetHeight}}),a>0&&e.jsx(we,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})}))})),c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:w,height:null===(i=p.current)||void 0===i?void 0:i.offsetHeight}}),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},Qe={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return Qe.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?Qe.string(e,n,t):"number"==typeof e&&"number"==typeof n?Qe.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Qe.boolean(e,n,t):Qe.string(String(e),String(n),t)}},Ze=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return s([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return Qe.number(i,a,r)}return"date"===t?Qe.date(String(e),String(n),r):"boolean"===t?Qe.boolean(Boolean(e),Boolean(n),r):"enum"===t?Qe.enum(String(e),String(n),r):Qe.string(String(e),String(n),r)}(e[r],n[r],a,l)})},en=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return Ze({rows:t,sortColumn:r,headers:n})},nn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):en({headers:i,rows:t,sortColumn:r}):t},tn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),s=!1;if(!a)for(var l=0,c=i.children;l<c.length;l++){var u=c[l];if(tn([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},rn=function(e){return e.every(function(e){return e.hide})},on=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(on(e.children),rn(e.children)&&(e.hide=!0))})},an=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=R(),p=v.expandIcon,m=v.headers,g=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,y=null!=u?u:c.hide||x&&c.children&&rn(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[l&&e.jsx("div",o({className:"st-header-icon-container"},{children:x?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(ce,o({checked:y,onChange:function(e){(c.hide=e,e)?on(r):(tn(r,c.accessor),x&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,tn(r,c.children[0].accessor)));g(s([],m,!0))}},{children:c.label}))]})),x&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(an,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!y||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},sn=function(t){var r=t.headers,i=t.open,a="left"===t.position?"left":"",s=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(i?"open":""," ").concat(a),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn?null:e.jsx(an,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},ln=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,s=t.headers,l=t.position,c=void 0===l?"right":l,u=n.useState(a),d=u[0],f=u[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(sn,{headers:s,open:d,position:c})]})):null},cn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},un=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},dn=function(t){var i=t.children,a=n.useRef({}),s=n.useCallback(function(e,n){return!!a.current[n]&&a.current[n].find(function(n){return n===e})},[]),l=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=n.useCallback(function(e){e.onscroll=null},[]),u=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=a.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),l(e,n),window.requestAnimationFrame(function(){var e=Object.keys(a.current).filter(function(e){return a.current[e].includes(n)});u(n,e)}))})})})}},[c,l]),d=n.useCallback(function(e,n){n.forEach(function(n){a.current[n]||(a.current[n]=[]),s(e,n)||(a.current[n].length>0&&l(a.current[n][0],e),a.current[n].push(e))}),u(e,n)},[s,l,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(s(e,n)){c(e);var t=a.current[n].indexOf(e);-1!==t&&a.current[n].splice(t,1)}})},[s,c]);return e.jsx(me.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},fn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=je[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},hn=function(){var n=R(),t=n.filters,r=n.handleClearFilter,i=n.headers,a=Object.values(t);return 0===a.length||a.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:a.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:fn(n,i)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},vn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},pn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var s=Number(e),l=Number(r);switch(t){case"equals":return s===l;case"notEquals":return s!==l;case"greaterThan":return s>l;case"lessThan":return s<l;case"greaterThanOrEqual":return s>=l;case"lessThanOrEqual":return s<=l;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return s>=u&&s<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],s<u||s>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=vn(h),m=vn(v);switch(t){case"equals":return p.getTime()===m.getTime();case"notEquals":return p.getTime()!==m.getTime();case"before":return p<m;case"after":return p>m;case"between":if(o&&2===o.length){var g=o.map(function(e){return vn(new Date(String(e||"")))}),w=g[0],x=g[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var y=o.map(function(e){return vn(new Date(String(e||"")))});return w=y[0],x=y[1],p<w||p>x}return!0}}if("boolean"==typeof e){var b=Boolean(r);if("equals"===t)return e===b}if(Array.isArray(e)){var C=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),I=o.includes(S);return"in"===t?I:!I}return!1}var R=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return R===j;case"notEquals":return R!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},mn=function(e){var t=e.rows,r=e.headers,i=e.rowGrouping;return n.useMemo(function(){if(!i||0===i.length)return t;var e=function(e){return c(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),a=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=i[t],s=i[t+1],l=n[r];if(l&&x(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=gn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},gn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&x(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,s=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===s.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=s.reduce(function(e,n){return e+n},0);break;case"average":a=s.reduce(function(e,n){return e+n},0)/s.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,s);break;case"max":a=Math.max.apply(Math,s);break;default:return}return t.formatResult?t.formatResult(a):a}},wn=function(e){var t=e.rows,r=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,s=n.useState(new Set),l=s[0],c=s[1],u=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(t,r,l)},[t,r,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),h=n.useMemo(function(){return a?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(t,r,l):[]},[t,r,l,a]),v=n.useCallback(function(e,n){if(a){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,l);if(c(i),o){var s=t.find(function(n){return String(n[r])===e});s&&o({row:s,isSelected:n,selectedRows:i})}}},[l,t,r,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(t,r),o&&t.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=t.find(function(n){return String(n[r])===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[t,r,o,l,a]),m=n.useCallback(function(e){if(a){var n=u(e);v(e,!n)}},[u,v,a]),g=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=t.find(function(e){return String(e[r])===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,t,r,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:u,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:h,handleRowSelect:v,handleSelectAll:p,handleToggleRow:m,clearSelection:g}},xn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,c=t.cellUpdateFlash,d=void 0!==c&&c,f=t.className,h=t.columnBorders,g=void 0!==h&&h,w=t.columnEditorPosition,S=void 0===w?"right":w,R=t.columnEditorText,H=void 0===R?"Columns":R,F=t.columnReordering,A=void 0!==F&&F,M=t.columnResizing,D=void 0!==M&&M,T=t.defaultHeaders,L=t.editColumns,W=void 0!==L&&L,B=t.editColumnsInitOpen,O=void 0!==B&&B,P=t.enableHeaderEditing,q=void 0!==P&&P,z=t.enableRowSelection,Y=void 0!==z&&z,K=t.expandAll,U=void 0===K||K,V=t.expandIcon,J=void 0===V?e.jsx(k,{className:"st-expand-icon"}):V,X=t.externalFilterHandling,_=void 0!==X&&X,$=t.externalSortHandling,Q=void 0!==$&&$,Z=t.headerCollapseIcon,ee=void 0===Z?e.jsx(k,{className:"st-header-icon"}):Z,te=t.headerExpandIcon,re=void 0===te?e.jsx(E,{className:"st-header-icon"}):te,oe=t.headerDropdown,ie=t.height,ae=t.hideFooter,se=void 0!==ae&&ae,le=t.nextIcon,ce=void 0===le?e.jsx(k,{className:"st-next-prev-icon"}):le,ue=t.onCellEdit,de=t.onCellClick,fe=t.onColumnOrderChange,he=t.onColumnSelect,ve=t.onFilterChange,pe=t.onGridReady,me=t.onHeaderEdit,ge=t.onLoadMore,we=t.onNextPage,xe=t.onRowSelectionChange,ye=t.onSortChange,be=t.prevIcon,Ce=void 0===be?e.jsx(E,{className:"st-next-prev-icon"}):be,Se=t.rowButtons,Ie=t.rowGrouping,Re=t.rowHeight,je=void 0===Re?32:Re,Ee=t.rowIdAccessor,ke=t.rows,Ne=t.selectionColumnWidth,He=void 0===Ne?42:Ne,Fe=t.rowsPerPage,Ae=void 0===Fe?10:Fe,Me=t.selectableCells,De=void 0!==Me&&Me,Te=t.selectableColumns,Le=void 0!==Te&&Te,We=t.shouldPaginate,Be=void 0!==We&&We,Oe=t.sortDownIcon,Pe=void 0===Oe?e.jsx(cn,{className:"st-header-icon"}):Oe,qe=t.sortUpIcon,ze=void 0===qe?e.jsx(un,{className:"st-header-icon"}):qe,Ye=t.tableRef,Ge=t.theme,Ke=void 0===Ge?"light":Ge,Ue=t.useHoverRowBackground,Ve=void 0===Ue||Ue,Je=t.useOddEvenRowBackground,Xe=void 0!==Je&&Je,Qe=t.useOddColumnBackground,Ze=void 0!==Qe&&Qe;Ze&&(Xe=!1),g&&(Ve=!1);var tn=n.useReducer(function(e){return e+1},0)[1],rn=n.useRef(null),on=n.useRef(null),an=n.useRef(null),sn=n.useRef(null),fn=n.useRef(null),vn=n.useRef(null),gn=n.useRef(null),xn=n.useState(1),yn=xn[0],bn=xn[1],Cn=n.useState(T),Sn=Cn[0],In=Cn[1],Rn=n.useState(!1),jn=Rn[0],En=Rn[1],kn=n.useState(!1),Nn=kn[0],Hn=kn[1],Fn=n.useState(null),An=Fn[0],Mn=Fn[1],Dn=n.useState(new Set),Tn=Dn[0],Ln=Dn[1];n.useEffect(function(){In(T)},[T]);var Wn=wn({rows:ke,rowIdAccessor:Ee,onRowSelectionChange:xe,enableRowSelection:Y}),Bn=Wn.selectedRows,On=Wn.setSelectedRows,Pn=Wn.isRowSelected,qn=Wn.areAllRowsSelected,zn=Wn.selectedRowCount,Yn=Wn.selectedRowsData,Gn=Wn.handleRowSelect,Kn=Wn.handleSelectAll,Un=Wn.handleToggleRow,Vn=Wn.clearSelection,Jn=n.useMemo(function(){var e,n=s([],Sn,!0);Y&&!(null===(e=null==Sn?void 0:Sn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=s([{accessor:"__row_selection__",label:"",width:He,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[Y,Sn,He]),Xn=n.useState(0),_n=Xn[0],$n=Xn[1],Qn=n.useState(new Set),Zn=Qn[0],et=Qn[1],nt=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){if(t.current){var e=t.current.offsetWidth-t.current.clientWidth;i(e)}},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:vn}),tt=nt.scrollbarWidth,rt=nt.setScrollbarWidth,ot=n.useState(0),it=ot[0],at=ot[1];n.useLayoutEffect(function(){var e=function(){vn.current&&at(vn.current.clientWidth)};e();var n=null;return vn.current&&(n=new ResizeObserver(e)).observe(vn.current),function(){n&&n.disconnect()}},[]);var st=n.useMemo(function(){var e=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,s=0,l=0;if(n.forEach(function(e){if(!e.hide){var n=p(e,i).reduce(function(e,n){return e+m(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?s+=n:l+=n}}),t&&t>0){var c=t*o;a>c&&(a=c),s>c&&(s=c)}return{leftWidth:u(a),rightWidth:u(s),mainWidth:l}}({headers:Jn,containerWidth:it,collapsedHeaders:Tn});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Jn,it,Tn]),lt=st.mainBodyWidth,ct=st.pinnedLeftWidth,ut=st.pinnedRightWidth,dt=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var i=parseInt(t,10);o=window.innerHeight*i/100}else if(t.endsWith("%")){var a=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-r)},[t,r])}({height:ie,rowHeight:je}),ft=mn({rows:ke,headers:Sn,rowGrouping:Ie}),ht=function(e){var t=e.rows,r=e.externalFilterHandling,i=e.onFilterChange,a=n.useState({}),s=a[0],l=a[1],c=n.useMemo(function(){return pn({externalFilterHandling:r,tableRows:t,filterState:s})},[t,s,r]),u=n.useCallback(function(e){var n,t=o(o({},s),((n={})[e.accessor]=e,n));l(t),null==i||i(t)},[s,i]),d=n.useCallback(function(e){var n=o({},s);delete n[e],l(n),null==i||i(n)},[s,i]),f=n.useCallback(function(){l({}),null==i||i({})},[i]),h=n.useCallback(function(e){var n,i=o(o({},s),((n={})[e.accessor]=e,n));return pn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:ft,externalFilterHandling:_,onFilterChange:ve}),vt=ht.filters,pt=ht.filteredRows,mt=ht.updateFilter,gt=ht.clearFilter,wt=ht.clearAllFilters,xt=ht.computeFilteredRowsPreview,yt=function(e){var t=e.headers,r=e.tableRows,i=e.externalSortHandling,a=e.onSortChange,s=e.rowGrouping,l=n.useState(null),c=l[0],u=l[1],d=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,i=e.sortColumn,a=en({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(x(s)){var l=d({rows:s,sortColumn:i,headers:t,groupingKeys:n.slice(1)});return o(o({},e),((r={})[a]=l,r))}return e}):a},[]),f=n.useMemo(function(){return nn({externalSortHandling:i,tableRows:r,sortColumn:c,rowGrouping:s,headers:t,sortNestedRows:d})},[r,c,t,i,s,d]),h=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},r=n(t);if(r){var o=null;c&&c.key.accessor===e?"ascending"===c.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},u(o),null==a||a(o)}},[c,t,a]),v=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},o=n(t);if(!o)return r;var a=null;return c&&c.key.accessor===e?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},nn({externalSortHandling:i,tableRows:r,sortColumn:a,rowGrouping:s,headers:t,sortNestedRows:d})},[c,t,r,i,s,d]);return{sort:c,sortedRows:f,updateSort:h,computeSortedRowsPreview:v}}({headers:Sn,tableRows:pt,externalSortHandling:Q,onSortChange:ye,rowGrouping:Ie}),bt=yt.sort,Ct=yt.sortedRows,St=yt.updateSort,It=function(e){var t=e.allowAnimations,r=e.sortedRows,i=e.originalRows,a=e.currentPage,l=e.rowsPerPage,c=e.shouldPaginate,u=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,h=e.expandAll,v=e.contentHeight,p=e.rowHeight,m=e.scrollTop,g=e.computeFilteredRowsPreview,w=e.computeSortedRowsPreview,x=n.useState(!1),C=x[0],S=x[1],I=n.useState([]),R=I[0],j=I[1],E=n.useRef([]),k=n.useRef([]),H=n.useRef(new Map),F=n.useRef(null),A=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?b({rows:n,rowGrouping:u,rowIdAccessor:d,unexpandedRows:f,expandAll:h}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[a,l,c,u,d,f,h]);n.useMemo(function(){if(0===H.current.size){var e=A(i),n=new Map;e.forEach(function(e){var t=String(y({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),H.current=n}},[i,A,d]);var M=n.useMemo(function(){return A(r)},[r,A]),D=n.useMemo(function(){return N({bufferRowCount:5,contentHeight:v,tableRows:M,rowHeight:p,scrollTop:m})},[M,v,p,m]),T=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),L=n.useMemo(function(){if(0===E.current.length)return!1;var e=M.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}),n=E.current.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[M,d]);n.useLayoutEffect(function(){if(!C){if(!t||c)return j([]),E.current=M,void(k.current=D);if(0===E.current.length)return j([]),E.current=M,void(k.current=D);if(!L)return j([]),E.current=M,void(k.current=D);F.current={tableRows:M,visibleRows:D},S(!0)}},[t,M,L,C,c,D]),n.useLayoutEffect(function(){if(C&&F.current&&R.length>0){var e=setTimeout(function(){var e=F.current;S(!1),j([]),E.current=e.tableRows,k.current=e.visibleRows,F.current=null},ne.duration+100);return function(){return clearTimeout(e)}}},[C,R.length]);var W=n.useMemo(function(){if(!t||c)return D;if(R.length>0){var e=new Map;return M.forEach(function(n){var t=String(y({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),R.map(function(n){var t=String(y({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return D},[D,R,M,t,c,d]),B=n.useCallback(function(e){if(t&&!c){var n=g(e),r=A(n),o=N({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:m}),i=T(D,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return M.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],D,!0),i,!0))}},[t,c,g,A,v,p,m,T,M,D,d]),O=n.useCallback(function(e){if(t&&!c){var n=w(e),r=A(n),o=N({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:m}),i=T(D,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return M.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],D,!0),i,!0))}},[t,c,w,A,v,p,m,T,M,D,d]);return{currentTableRows:M,currentVisibleRows:D,isAnimating:C,prepareForFilterChange:B,prepareForSortChange:O,rowsToRender:W}}({allowAnimations:l,sortedRows:Ct,originalRows:ft,currentPage:yn,rowsPerPage:Ae,shouldPaginate:Be,rowGrouping:Ie,rowIdAccessor:Ee,unexpandedRows:Zn,expandAll:U,contentHeight:dt,rowHeight:je,scrollTop:_n,computeFilteredRowsPreview:xt,computeSortedRowsPreview:yt.computeSortedRowsPreview}),Rt=It.currentTableRows,jt=It.rowsToRender,Et=It.prepareForFilterChange,kt=It.prepareForSortChange,Nt=It.isAnimating,Ht=n.useRef(new Map),Ft=n.useRef(new Map),At=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=e.collapsedHeaders,d=n.useState(new Set),f=d[0],h=d[1],v=n.useState(new Set),m=v[0],g=v[1],w=n.useState(null),x=w[0],b=w[1],S=n.useState(null),I=S[0],R=S[1],j=n.useState(new Set),E=j[0],k=j[1],N=n.useState(new Set),H=N[0],F=N[1],A=n.useRef(!1),M=n.useRef(null),D=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),m.forEach(function(n){e.add(n)}),e},[f,m]),T=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),m.size>0&&o.forEach(function(n){var t=y({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[f,m,o,s]),L=n.useMemo(function(){return r.flatMap(function(e){return p(e,u)})},[r,u]),W=n.useCallback(function(){var e=L.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,i=t.split("-").map(Number),a=i[0],s=i[1];e[a]||(e[a]=[]);var l=n.get(s);return l&&(null===(r=o[a])||void 0===r?void 0:r.row)?e[a][s]=o[a].row[l]:e[a][s]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),k(new Set(f)),setTimeout(function(){k(new Set)},800))},[L,f,o]),B=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,u,d,f;return a(this,function(a){switch(a.label){case 0:if(!I)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=L.filter(function(e){return!e.hide}),r=new Set,i=new Set,u=I.rowIndex,d=I.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,a){var f=u+n,h=d+a;if(!(f>=o.length||h>=t.length)){var v=o[f],p=t[h],m=y({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var g=e;if("number"===p.type){var w=Number(e);isNaN(w)||(g=w)}else if("boolean"===p.type)g="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var x=new Date(e);isNaN(x.getTime())||(g=x)}if(v.row[p.accessor]=g,c){var b="".concat(m,"-").concat(p.accessor),S=c.get(b);S&&S.updateContent(g)}null==l||l({accessor:p.accessor,newValue:g,row:v.row,rowIndex:f});var I=C({colIndex:h,rowIndex:f,rowId:m});r.add(I)}else{var R=C({colIndex:h,rowIndex:f,rowId:m});i.add(R)}}})}),r.size>0&&(k(r),setTimeout(function(){k(new Set)},800)),i.size>0&&(F(i),setTimeout(function(){F(new Set)},800)),[3,4]):[2];case 3:return f=a.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[I,L,o,s,l,c]),O=n.useCallback(function(){if(0!==f.size){var e=L.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],u=i[1];if(!(a>=o.length||u>=e.length)){var d=o[a],f=e[u],h=y({row:d.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),d.row[f.accessor]=v,c){var p="".concat(h,"-").concat(f.accessor),m=c.get(p);m&&m.updateContent(v)}null==l||l({accessor:f.accessor,newValue:v,row:d.row,rowIndex:a}),t.add(n)}else r.add(n)}}),t.size>0&&(k(t),setTimeout(function(){k(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,L,o,s,l,c]),P=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=r;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<o.length){var d=y({row:o[c].row,rowIdAccessor:s});t.add(C({colIndex:u,rowIndex:c,rowId:d}))}g(new Set),b(null),h(t)},[o,s,g,b,h]),q=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<L.length){var n=C(e);g(new Set),b(null),h(new Set([n])),R(e)}},[L.length,o.length,g,b,h,R]),z=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),R(null),g(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&b(e[e.length-1])},[h,R,g,b]);n.useEffect(function(){var e=function(e){var n;if(t&&I){var r=I.rowIndex,i=I.colIndex,a=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void B();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void O();if(y({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return y({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=y({row:o[r-1].row,rowIdAccessor:s});q({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=y({row:o[r+1].row,rowIdAccessor:s}),q({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<L.length-1&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),g(new Set),b(null),M.current=null,R(null))}else W()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[W,L.length,I,s,P,q,t,o,B,O]);var Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=C({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=m.has(n);return i||a},[f,m]),G=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?y({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?y({row:o[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!Y(c)||m.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!Y(u)||m.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),Y(d)||i.push("st-selected-left-border"),Y(f)||i.push("st-selected-right-border"),i.join(" ")},[Y,o,m,s]),K=n.useMemo(function(){return I?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===I.rowIndex&&t===I.colIndex&&r===I.rowId}:function(){return!1}},[I]),U=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=C({colIndex:n,rowIndex:t,rowId:r});return E.has(o)},[E]),V=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=C({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]);return{getBorderClass:G,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(A.current=!0,M.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){g(new Set),b(null);var e=C({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),R({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&A.current&&M.current){for(var i=new Set,a=Math.min(M.current.rowIndex,r),l=Math.max(M.current.rowIndex,r),c=Math.min(M.current.colIndex,n),u=Math.max(M.current.colIndex,n),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var v=y({row:o[d].row,rowIdAccessor:s});i.add(C({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){A.current=!1},isCopyFlashing:U,isWarningFlashing:V,isInitialFocusedCell:K,isSelected:Y,lastSelectedColumnIndex:x,pasteFromClipboard:B,selectColumns:z,selectedCells:f,selectedColumns:m,setInitialFocusedCell:R,setSelectedCells:h,setSelectedColumns:g,deleteSelectedCells:O,columnsWithSelectedCells:D,rowsWithSelectedCells:T}}({selectableCells:De,headers:Sn,tableRows:Rt,rowIdAccessor:Ee,onCellEdit:ue,cellRegistry:Ht.current,collapsedHeaders:Tn}),Mt=At.getBorderClass,Dt=At.handleMouseDown,Tt=At.handleMouseOver,Lt=At.handleMouseUp,Wt=At.isCopyFlashing,Bt=At.isInitialFocusedCell,Ot=At.isSelected,Pt=At.isWarningFlashing,qt=At.selectColumns,zt=At.selectedCells,Yt=At.selectedColumns,Gt=At.setInitialFocusedCell,Kt=At.setSelectedCells,Ut=At.setSelectedColumns,Vt=At.columnsWithSelectedCells,Jt=At.rowsWithSelectedCells,Xt=n.useCallback(function(e){kt(e),setTimeout(function(){St(e)},0)},[kt,St]),_t=n.useCallback(function(e){In(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,s=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(s&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,s,l])}({selectableColumns:Le,selectedCells:zt,selectedColumns:Yt,setSelectedCells:Kt,setSelectedColumns:Ut,activeHeaderDropdown:An,setActiveHeaderDropdown:Mn}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:tn,tableBodyContainerRef:vn,setScrollbarWidth:rt}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:pe}),function(e){var t=e.tableRef,r=e.rows,o=e.rowIdAccessor,i=e.cellRegistryRef,a=e.headerRegistryRef,s=e.visibleRows;n.useEffect(function(){t&&(t.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,a=e.newValue,s=null==r?void 0:r[t];if(s){var l=y({row:s,rowIdAccessor:o}),c=v({rowId:l,accessor:n}),u=i.current.get(c);u&&u.updateContent(a),void 0!==s[n]&&(s[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=a.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return s}})},[i,a,r,o,t,s])}({cellRegistryRef:Ht,headerRegistryRef:Ft,rowIdAccessor:Ee,rows:ke,tableRef:Ye,visibleRows:jt}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:vt,onFilterChange:ve}),function(e){var t=e.sort,r=e.onSortChange,o=G(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:bt,onSortChange:ye});var $t=n.useCallback(function(e){Et(e),setTimeout(function(){mt(e)},0)},[Et,mt]);return e.jsx(I,o({value:{allowAnimations:l,areAllRowsSelected:qn,cellRegistry:Ht.current,cellUpdateFlash:d,clearSelection:Vn,collapsedHeaders:Tn,columnBorders:g,columnReordering:A,columnResizing:D,draggedHeaderRef:rn,editColumns:W,enableHeaderEditing:q,enableRowSelection:Y,expandIcon:J,filters:vt,forceUpdate:tn,getBorderClass:Mt,handleApplyFilter:$t,handleClearAllFilters:wt,handleClearFilter:gt,handleMouseDown:Dt,handleMouseOver:Tt,handleRowSelect:Gn,handleSelectAll:Kn,handleToggleRow:Un,headerCollapseIcon:ee,headerContainerRef:gn,headerDropdown:oe,headerExpandIcon:re,headerRegistry:Ft.current,headers:Jn,hoveredHeaderRef:on,isAnimating:Nt,isCopyFlashing:Wt,isInitialFocusedCell:Bt,isResizing:jn,isRowSelected:Pn,isScrolling:Nn,isSelected:Ot,isWarningFlashing:Pt,mainBodyRef:an,nextIcon:ce,onCellEdit:ue,onCellClick:de,onColumnOrderChange:fe,onColumnSelect:he,onLoadMore:ge,onSort:Xt,onTableHeaderDragEnd:_t,pinnedLeftRef:sn,pinnedRightRef:fn,prevIcon:Ce,rowButtons:Se,rowGrouping:Ie,rowHeight:je,rowIdAccessor:Ee,scrollbarWidth:tt,selectColumns:qt,selectableColumns:Le,selectedColumns:Yt,columnsWithSelectedCells:Vt,rowsWithSelectedCells:Jt,selectedRows:Bn,selectedRowCount:zn,selectedRowsData:Yn,setCollapsedHeaders:Ln,setHeaders:In,setInitialFocusedCell:Gt,setIsResizing:En,setIsScrolling:Hn,setSelectedCells:Kt,setSelectedColumns:Ut,setSelectedRows:On,setUnexpandedRows:et,shouldPaginate:Be,sortDownIcon:Pe,sortUpIcon:ze,tableBodyContainerRef:vn,tableRows:Rt,theme:Ke,unexpandedRows:Zn,useHoverRowBackground:Ve,useOddColumnBackground:Ze,useOddEvenRowBackground:Xe,activeHeaderDropdown:An,setActiveHeaderDropdown:Mn,onHeaderEdit:me}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(Ke," ").concat(null!=f?f:""," ").concat(g?"st-column-borders":""),style:ie?{height:ie}:{}},{children:e.jsx(dn,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(hn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Lt,onMouseLeave:Lt},{children:[e.jsx(_e,{pinnedLeftWidth:ct,pinnedRightWidth:ut,setScrollTop:$n,sort:bt,tableRows:Rt,rowsToRender:jt}),e.jsx(ln,{columnEditorText:H,editColumns:W,editColumnsInitOpen:O,headers:Sn,position:S})]})),e.jsx($e,{mainBodyRef:an,mainBodyWidth:lt,pinnedLeftWidth:ct,pinnedRightWidth:ut,tableBodyContainerRef:vn}),e.jsx(j,{currentPage:yn,hideFooter:se,onPageChange:bn,onNextPage:we,shouldPaginate:Be,totalPages:Math.ceil(Ct.length/Ae)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(xn,o({},t)):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,s)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,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=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function s(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var l=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var s=a[i];o=r(s,o)}return o};return r(e,n),t},c=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,c(e.children)),n})},u=function(e){return void 0===e&&(e=0),e?e+1:0},d=function(e,n,t){var r=function(e,n){for(var t=0,r=c(e);t<r.length;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);return!!r&&(t.has(r.accessor)?!e.summaryColumn:!0===e.summaryColumn)},f=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},h=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&d(n,r,o))||null},v=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},p=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return e.summaryColumn}).flatMap(function(e){return p(e,n)}):e.children.filter(function(e){return!e.summaryColumn}).flatMap(function(e){return p(e,n)}):[e]},m=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(f({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},g=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(f({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){g(e)})},w=function(e){return"number"==typeof e.minWidth?e.minWidth:40},x=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},y=function(e){return e.row[e.rowIdAccessor]},b=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,s=void 0===a?[]:a,l=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var c=y({row:t,rowIdAccessor:l}),f=s[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(c);if((o?!i.has(v):i.has(v))&&n<s.length){var p=function(e,n){var t=e[n];return x(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(c,t),u},C=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},S=n.createContext(void 0),I=function(n){var t=n.children,r=n.value;return e.jsx(S.Provider,o({value:r},{children:t}))},R=function(){var e=n.useContext(S);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},j=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=R(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),m=p[0],g=p[1],w=!(r>1),x=!(r<d)&&!c||!m&&r===d;if(s||!u)return null;var y=function(){if(d<=15)return Array.from({length:d},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=d-Math.floor(7.5))e=Math.max(1,d-o+1),n=d;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<d-1&&(t.push(-1),t.push(d)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&l(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(t){switch(t.label){case 0:return e=r===d,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return g(!1),[2];t.label=2;case 2:return(n<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),y.map(function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=d&&l(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},E=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},k=function(n){var t=n.className;return e.jsx("svg",o({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"})}))},N=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,s=Math.max(0,o-a*n),l=o+t+a*n,c=Math.max(0,Math.floor(s/a)),u=Math.min(i.length,Math.ceil(l/a));return i.slice(c,u)},H=function(e){return e.position*(e.rowHeight+1)-1},F=function(e){return e.position*(e.rowHeight+1)},A=function(t){var r=t.children,i=t.onClose,a=t.open,s=t.overflow,l=void 0===s?"auto":s,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=R().mainBodyRef,p=n.useRef(null),m=n.useRef(null),g=n.useState("bottom-left"),w=g[0],x=g[1],y=n.useState({}),b=y[0],C=y[1],S=n.useState(!1),I=S[0],j=S[1];return n.useEffect(function(){a&&p.current?(j(!1),!m.current&&p.current.parentElement&&(m.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&m.current){var e,n=p.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,i=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,s="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(s="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===s?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===c?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===s?l.top=t.height+4:l.bottom=t.height+4,"left"===c?l.left=0:l.right=0),x("".concat(s,"-").concat(c)),C(l),j(!0)}})):a||j(!1)},[a,u,d,v,h]),n.useEffect(function(){var e=function(e){if(a&&p.current){var n=e.target;p.current&&!p.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,i,c]),n.useEffect(function(){var e=function(e){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(c(!1),null==i||i())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i,a,c]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[i,a,c]),a?e.jsx("div",o({ref:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:I?"visible":"hidden"},b),{overflow:l})},{children:r})):null},M=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,s=n.disabled,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(l?"disabled":""," ").concat(u),onClick:function(){!l&&r&&r()},role:"option","aria-selected":a,"aria-disabled":l},{children:t}))},D=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value,c=n.useState(l),u=c[0],d=c[1],f=function(e){d(e),i(e),s(!1),r()};return e.jsxs(A,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(M,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(M,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},T=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},L=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},W=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=R(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),m=p[0],g=p[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===m&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return g("months")}},{children:[(i=h,i.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===m&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return g("years")}},{children:h.getFullYear()})),"years"===m&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=h.getFullYear(),r=h.getMonth(),i=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e,12,0,0);v(n),a(n),null==s||s()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(i){var c=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=new Date(l),d=i===u.getDate()&&r===u.getMonth()&&t===u.getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(d?"selected":""),onClick:function(){return function(e){var n=h.getFullYear(),t=h.getMonth(),r=new Date(n,t,e,12,0,0);v(r),a(r),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},m=1;m<=i;m++)p(m);var g=35-(c+i),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e,12,0,0);v(n),a(n),null==s||s()}(t)}},{children:t}),"next-".concat(t)))};for(m=1;m<=g;m++)x(m);return n}(),"months"===m&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var i=t===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),g("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===m&&function(){for(var n=[],t=h.getFullYear(),r=t-6,i=function(r){var i=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(e,h.getMonth(),1)),g("months")}(r)}},{children:r}),"year-".concat(r)))},a=r;a<r+12;a++)i(a);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);v(n),a(n),null==s||s()}},{children:"Today"}))}))]}))},B=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},O=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},P=function(e){if(!e)return new Date;if("string"==typeof e)return B(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:O(n)}return e instanceof Date?O(e):new Date},q=function(e){return e?B(e.toString()):new Date},z=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var c=function(){r()};return e.jsx(A,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(W,{value:q(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},Y=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.options,l=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(A,o({open:a,onClose:function(){r()},setOpen:l,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:s.map(function(n){return e.jsx(M,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),i(e),l(!1),void r();var e}},{children:n.label}),n.value)})}))}))},G=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,s=void 0===a?"string":a,l=n.value,c=function(){i(!1)};if("boolean"===s&&"boolean"==typeof l)return e.jsx(D,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(z,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(Y,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(L,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==l?"":String(l);return e.jsx(T,{defaultValue:d,onBlur:c,onChange:o})},K=0,U=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===K||o-K>=r)&&(K=o,n(t))}},V=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},J=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(J);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=J(e[t]));return n},X=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},_=Date.now(),$={screenX:0,screenY:0},Q=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return s(s([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Q(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},Z=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ee(e,n,t){var r,i,a=J(e),s=!1;try{var l=Z(t),c=a.findIndex(function(e){return e.accessor===n.accessor}),u=a.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:a,emergencyBreak:s=!0};var d=a.splice(c,1)[0],f=(r=l,i=o({},d),"left"===r?i.pinned="left":"right"===r?i.pinned="right":delete i.pinned,i),h=u;a.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),s=!0}return{newHeaders:a,emergencyBreak:s}}var ne=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=R().setHeaders,l=V(t);return{handleDragStart:function(e){n.current=e,_=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var s=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(c-$.screenX,2)+Math.pow(u-$.screenY,2));r.current=a;var f,h=n.current,v=!1;if(Z(h)!==Z(a)){f=(C=ee(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,m=Q(p,h.accessor),g=Q(p,a.accessor);if(!m||!g)return;var w=m.length,x=g.length,y=g;if(w!==x){var b=x-w;b>0&&(y=g.slice(0,-b))}var C=function(e,n,t){var r=J(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var s=i(r,n);return a(r,n,i(r,t)),a(r,t,s),{newHeaders:r,emergencyBreak:o}}(p,m,y);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-_<1500||d<40)||(_=S,$={screenX:c,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return s([],e,!0)}),null==o||o(t)},10)}}},te=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},re={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},oe={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ie={duration:150,easing:"ease-out",delay:0},ae=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},se=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){ae(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},le=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,s=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i,l;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,s),0===e.x&&0===e.y?[2]:te()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),te()?o(o({},ie),e):o(o({},"column"===n?re:oe),e)}(t,i?"column":"row"),ae(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,se(n,l,t)]);case 1:return a.sent(),[2]}})})},ce=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,s,l,c,u,d,f,h,v,p,m,g,w;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,s=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,u=t.delay,d=void 0===u?0:u,f=t.onComplete,h=t.respectReducedMotion,v=void 0===h||h,te()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),m=p.top,g=e-m,w=r-m,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(s,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,s+(d||0)+50)})])})})},ue=function(t){var r=t.children,i=t.id,a=t.parentRef,s=t.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(t,["children","id","parentRef","tableRow"]),c=R(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),m=V(f),g=V(d);return n.useLayoutEffect(function(){var e,n,t,r;if(u&&v.current&&!d){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!m||f)if(!g||d){if(p.current=i,l){var c=i.x-l.x,w=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(w)<=5)){if(Math.abs(c)>5||Math.abs(w)>5){var x=o(o({},oe),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),y=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,b=null===(n=null==a?void 0:a.current)||void 0===n?void 0:n.clientHeight,C=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==y&&void 0!==b&&void 0!==C){var S=5*h,I=y-S,R=y+b+S,j=l.y>I&&l.y<R,E=i.y>I&&i.y<R,k=i.y<y,N=i.y>y+b,H=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,F=.6*h,A=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(j&&!E&&N){var M=y+b+A(i.y,y,y+b)+H%15*F*2.5+H%7*(.4*h);return void ce({element:v.current,options:{startY:l.y,endY:M,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){M=y-A(i.y,y,y+b)-H%15*F*2.5-H%7*(.4*h);return void ce({element:v.current,options:{startY:l.y,endY:M,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>y+b){var D=y+b+A(l.y,y,y+b)+H%10*F*1;return void ce({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<y){D=y-A(l.y,y,y+b)-H%10*F*1;return void ce({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}le({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,m,g,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};ue.displayName="Animate";var de=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},fe=function(n){var t=n.checked,r=void 0!==t&&t,i=n.children,a=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){a&&a(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx(de,{className:"st-checkbox-checkmark"})})),i]}))},he=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?P(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ve=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,l=t.isInitialFocused,c=t.nestedIndex,u=t.rowIndex,d=t.tableRow,h=R(),p=h.cellRegistry,m=h.cellUpdateFlash,g=h.columnBorders,w=h.draggedHeaderRef,b=h.enableRowSelection,C=h.expandIcon,S=h.handleMouseDown,I=h.handleMouseOver,j=h.handleRowSelect,E=h.headers,k=h.hoveredHeaderRef,N=h.isCopyFlashing,H=h.isRowSelected,F=h.isWarningFlashing,A=h.onCellEdit,M=h.onCellClick,D=h.onTableHeaderDragEnd,T=h.rowButtons,L=h.rowGrouping,W=h.rowIdAccessor,B=h.rowsWithSelectedCells,O=h.selectedColumns,P=h.setUnexpandedRows,q=h.tableBodyContainerRef,z=h.theme,Y=h.unexpandedRows,K=h.useOddColumnBackground,V=d.depth,J=d.row,X=n.useState(J[a.accessor]),_=X[0],$=X[1],Q=n.useState(!1),Z=Q[0],ee=Q[1],te=n.useState(!1),re=te[0],oe=te[1],ie=n.useState(!1),ae=ie[0],se=ie[1],le=n.useRef(null),ce=y({row:J,rowIdAccessor:W}),de=L&&L[V],ve=!!de&&function(e,n){if(!n)return!1;var t=e[n];return x(t)}(J,de),pe=!Y.has(String(ce)),me=N({rowIndex:u,colIndex:i,rowId:ce}),ge=F({rowIndex:u,colIndex:i,rowId:ce}),we=n.useMemo(function(){var e,n,t;if(!g)return!1;var r=E.filter(function(e){return"left"===e.pinned}),o=E.filter(function(e){return!e.pinned}),i=E.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[g,E,a.accessor,a.pinned]),xe=ne({draggedHeaderRef:w,headers:E,hoveredHeaderRef:k,onTableHeaderDragEnd:D}).handleDragOver,ye=U(),be=f({accessor:a.accessor,rowId:ce}),Ce=v({rowId:ce,accessor:a.accessor}),Se=a.isSelectionColumn&&b;n.useEffect(function(){if(p){var e="".concat(ce,"-").concat(a.accessor);return p.set(e,{updateContent:function(e){_!==e?($(e),m&&(oe(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(function(){oe(!1)},800))):$(e)}}),function(){p.delete(e),le.current&&clearTimeout(le.current)}}},[p,m,ce,a.accessor,_]),n.useEffect(function(){if(re){var e=setTimeout(function(){oe(!1)},850);return function(){return clearTimeout(e)}}},[re]),n.useEffect(function(){$(J[a.accessor])},[J,a.accessor]);var Ie="boolean"===a.type||"date"===a.type||"enum"===a.type,Re=Boolean(null==a?void 0:a.isEditable),je=O.has(i),Ee=s&&!je,ke=n.useMemo(function(){return!!Se&&B.has(String(ce))},[Se,B,ce]),Ne="st-cell ".concat(V>0&&a.expandable?"st-cell-depth-".concat(V):""," ").concat(Ee?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(je?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Re?"clickable":""," ").concat(re?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ge?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(K?c%2==0?"even-column":"odd-column":""," ").concat(Se?"st-selection-cell":""," ").concat(ke?"st-selection-has-highlighted-cell":""," ").concat(we?"st-last-column":""),He=n.useCallback(function(e){$(e),J[a.accessor]=e,null==A||A({accessor:a.accessor,newValue:e,row:J,rowIndex:u})},[a.accessor,A,J,u]),Fe=n.useCallback(function(){P(function(e){var n=new Set(e),t=String(ce);return n.has(t)?n.delete(t):n.add(t),n})},[ce,P]);return!Z||Ie||Se?e.jsxs(ue,o({className:Ne,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":ce,"data-row-index":u,id:be,onClick:function(){M&&!Se&&M({accessor:a.accessor,colIndex:i,row:J,rowId:ce,rowIndex:u,value:_})},onDoubleClick:function(){return a.isEditable&&!Se&&ee(!0)},onDragOver:function(e){Se||ye({callback:xe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){Z||Se||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||Z||(e.preventDefault(),ee(!0))},onMouseDown:function(){Z||Se||S({rowIndex:u,colIndex:i,rowId:ce})},onMouseEnter:function(){se(!0)},onMouseLeave:function(){se(!1)},onMouseOver:function(){Z||Se||I({rowIndex:u,colIndex:i,rowId:ce})},parentRef:q,tableRow:d},{children:[a.expandable&&ve?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(pe?"expanded":"collapsed"),onClick:Fe},{children:C})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:Se?e.jsxs("div",o({className:"st-selection-cell-content"},{children:[e.jsx("div",o({className:"st-selection-control"},{children:ae||H&&H(String(ce))?e.jsx(fe,{checked:!!H&&H(String(ce)),onChange:function(e){j&&j(String(ce),e)}}):e.jsx("span",o({className:"st-row-number"},{children:u+1}))})),function(){if(!T||!Se||0===T.length)return null;if(!(ae||H&&H(String(ce))))return null;var n={row:J};return e.jsx("div",o({className:"st-row-buttons"},{children:T.map(function(t,r){return e.jsx("span",o({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:J,theme:z}):he({content:_,header:a})})})),Z&&Ie&&!Se&&e.jsx(G,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ee,type:a.type,value:_})]}),Ce):e.jsx("div",o({className:"st-cell-editing",id:f({accessor:a.accessor,rowId:ce}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(G,{enumOptions:a.enumOptions,onChange:He,setIsEditing:ee,type:a.type,value:_})}))},pe=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,l=n.tableRow,c=R(),u=c.rowIdAccessor,d=c.collapsedHeaders,v=o.filter(function(e){return h({header:e,pinned:i,headers:o,collapsedHeaders:d})});return e.jsx(e.Fragment,{children:v.map(function(n,c){var d=y({row:l.row,rowIdAccessor:u}),h=f({accessor:n.accessor,rowId:d});return e.jsx(me,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:l},h)})})},me=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,l=t.rowIndex,c=t.rowIndices,u=t.tableRow,d=r[o.accessor],v=R(),p=v.getBorderClass,m=v.isSelected,g=v.isInitialFocusedCell,w=v.rowIdAccessor,x=v.collapsedHeaders,b=y({row:u.row,rowIdAccessor:w});if(o.children&&o.children.length>0){var C=o.children.filter(function(e){return h({header:e,pinned:s,headers:i,collapsedHeaders:x})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=f({accessor:n.accessor,rowId:b});return e.jsx(me,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:l,rowIndices:c,tableRow:u},t)})})}var S={rowIndex:l,colIndex:d,rowId:b},I=p(S),j=m(S),E=g(S),k=f({accessor:o.accessor,rowId:b});return e.jsx(ve,{borderClass:I,colIndex:d,header:o,isHighlighted:j,isInitialFocused:E,nestedIndex:a,rowIndex:l,tableRow:u},k)},ge=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,s=n.index,l=n.pinned,c=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,h=R(),v=h.useHoverRowBackground,p=h.rowIdAccessor,m=h.isAnimating,g=h.isRowSelected,w=h.useOddEvenRowBackground,x=f.position,b=x%2==0,C=y({row:f.row,rowIdAccessor:p}),S=!!g&&g(String(C));return e.jsx("div",o({className:"st-row ".concat(w?b?"even":"odd":""," ").concat(S?"selected":""),"data-index":s,onMouseEnter:function(){!m&&v&&d(s)},style:{gridTemplateColumns:i,top:F({position:x,rowHeight:c}),height:"".concat(c,"px")}},{children:e.jsx(pe,{columnIndexStart:r,columnIndices:t,headers:a,pinned:l,rowIndex:x,rowIndices:u,tableRow:f},C)}))},we=function(t){var r=t.displayStrongBorder,i=t.position,a=t.rowHeight,s=t.templateColumns,l=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=s.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=s.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,a=0;a<r.length;a++){if(t<=o+r[a]){i=a;break}o+=r[a],i=a}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:s,top:H({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},xe=n.createContext(void 0),ye=["default"],be=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(xe);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),i=o.registerPane,a=o.unregisterPane;return n.useEffect(function(){return t.current&&i(t.current,ye),function(){t.current&&a(t.current,ye)}},[t,i,a]),n.cloneElement(r,{ref:function(e){t.current=e}})},Ce=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},Se=n.forwardRef(function(t,r){var i=t.columnIndexStart,a=t.columnIndices,s=t.headers,l=t.pinned,c=t.rowHeight,u=t.rowIndices,d=t.setHoveredIndex,f=t.templateColumns,h=t.totalHeight,v=t.rowsToRender,p=t.width,m=l?"st-body-pinned-".concat(l):"st-body-main",g=R().rowIdAccessor,w=n.useRef(null);return n.useImperativeHandle(r,function(){return w.current},[]),n.useMemo(function(){return X(s,l)},[s,l])?e.jsx(Ce,o({condition:!l,wrapper:function(n){return e.jsx(be,o({childRef:w},{children:n}))}},{children:e.jsx("div",o({className:m,ref:w,style:o({position:"relative",height:"".concat(h,"px"),width:p},!l&&{flexGrow:1})},{children:v.map(function(t,r){var o=y({row:t.row,rowIdAccessor:g});return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(we,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:c,templateColumns:f,rowIndex:r-1}),e.jsx(ge,{columnIndexStart:i,columnIndices:a,gridTemplateColumns:f,headers:s,index:r,pinned:l,rowHeight:c,rowIndices:u,setHoveredIndex:d,tableRow:t},o)]},o)})}))})):null});function Ie(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=s(s(s([],t,!0),n,!0),r,!0),c=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({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&h({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Se.displayName="TableSection";var Re=function(t){var r=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,l=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,u=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,h=t.tableRows,v=R(),p=v.collapsedHeaders,m=v.headerContainerRef,g=v.headers,w=v.isAnimating,x=v.mainBodyRef,b=v.onLoadMore,C=v.rowHeight,S=v.rowIdAccessor,I=v.scrollbarWidth,j=v.setIsScrolling,E=v.shouldPaginate,k=v.tableBodyContainerRef,N=n.useState(!1),H=N[0],F=N[1],A=n.useRef(new Set),M=n.useCallback(function(e){(A.current.forEach(function(e){return e.classList.remove("hovered")}),A.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),A.current.add(e)})},[]);n.useEffect(function(){w&&M(null)},[w,M]),function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],s=i[1];n.useEffect(function(){var e=null==t?void 0:t.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")}},[t,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;s(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(n),function(){n&&i.unobserve(n)}}},[t,r])}({headerContainerRef:m,mainSectionRef:k,scrollbarWidth:I}),n.useEffect(function(){return function(){T.current&&clearTimeout(T.current)}},[]);var D=n.useRef(null),T=n.useRef(null),L=n.useRef(0),W=function(e){return e.length}(h),B=W*(C+1)-1,O=n.useMemo(function(){return Ie({headers:g,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:p})},[g,i,l,p]),P=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(y({row:n.row,rowIdAccessor:S}));e[r]=t}),e},[d,S]),q=n.useCallback(function(e,n){if(b&&!E&&!H){e.scrollHeight-(n+e.clientHeight)<=200&&n>L.current&&(F(!0),b(),setTimeout(function(){F(!1)},1e3))}},[b,E,H]),z={columnIndices:O,headerContainerRef:m,headers:g,rowHeight:C,rowIndices:P,rowsToRender:d,setHoveredIndex:M};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return M(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;j(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(function(){j(!1)},150),D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){f(t),q(n,t),L.current=t})},ref:k},{children:[e.jsx(Se,o({},z,{pinned:"left",templateColumns:a,totalHeight:B,width:s})),e.jsx(Se,o({},z,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:B})),e.jsx(Se,o({},z,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:B,width:u}))]}))},je=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,u="touches"in n;if(t&&!t.hide){i(!0);var d,f=w(t);if(t.children&&t.children.length>0){var h=p(t,l);d=h.length>0?h:[t]}else d=[t];var v=function(e){var n="right"===t.pinned?c-e:e-c,i=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=.8*i;if(!n.pinned)return Math.max(.6*i,600);var s=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+p(n,r).reduce(function(e,n){return e+m(n)},0)},0),l=w(n);return s<l?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):s}({header:t,headers:r,collapsedHeaders:l});if(d.length>1)Ee({delta:n,leafHeaders:d,minWidth:f,startWidth:a,maxWidth:i});else{var u=Math.max(Math.min(a+n,i),f);d[0].width=u}r.forEach(function(e){g(e)});var h=s([],r,!0);o(h)};if(u){var x=function(e){var n=e.touches[0];v(n.clientX)},y=function(){document.removeEventListener("touchmove",x),document.removeEventListener("touchend",y),i(!1)};document.addEventListener("touchmove",x),document.addEventListener("touchend",y)}else{var b=function(e){v(e.clientX)},C=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C),i(!1)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",C)}}},Ee=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,w(n))},40),s=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-s;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/s),o=Math.max(n+t,r);e.width=o})},ke=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Ne={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},He=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Fe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ae=function(e){return["between","notBetween","in","notIn"].includes(e)},Me=function(e){return["isEmpty","isNotEmpty"].includes(e)},De=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},Te=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Le=function(t){var r=t.value,i=t.onChange,a=t.options,s=t.placeholder,l=void 0===s?"Select...":s,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],m=n.useState(-1),g=m[0],w=m[1],x=n.useRef(null),y=a.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<a.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:a.length-1});break;case"Enter":e.preventDefault(),g>=0&&(i(a[g].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,g,a,i]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=a.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:y?y.label:l})),e.jsx(Te,{})]})),e.jsx(A,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:a.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===g?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,i(e),p(!1),void w(-1);var e}},{children:n.label}),t)})}))}))]}))},We=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:Ne[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Le,{value:t,onChange:function(e){r(e)},options:i})}))},Be=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,s=n.autoFocus,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c,d=n.onEnterPress;return e.jsx("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:l,className:"st-filter-input ".concat(u).trim()})},Oe=function(n){var t=n.children,r=n.className,i=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(i).trim()},{children:t}))},Pe=function(n){var t=n.onApply,r=n.onClear,i=n.canApply,a=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},qe=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,s=t.onClearFilter,l=n.useState((null==i?void 0:i.operator)||"contains"),c=l[0],u=l[1],d=n.useState(String((null==i?void 0:i.value)||"")),f=d[0],h=d[1],v=He("string");n.useEffect(function(){i?(u(i.operator),h(String(i.value||""))):(u("contains"),h(""))},[i]);var p=function(){var e=o({accessor:r.accessor,operator:c},Fe(c)&&{value:f});a(e)},m=Me(c)||f.trim();return e.jsxs(De,{children:[e.jsx(We,{value:c,onChange:u,operators:v}),Fe(c)&&e.jsx(Oe,{children:e.jsx(Be,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(Pe,{onApply:p,onClear:s,canApply:!!m,showClear:!!i})]})},ze=function(t){var r,o,i=t.header,a=t.currentFilter,s=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==a?void 0:a.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")),m=p[0],g=p[1],w=n.useState(String((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")),x=w[0],y=w[1],b=He("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),g(String((null===(e=a.values)||void 0===e?void 0:e[0])||"")),y(String((null===(n=a.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),g(""),y(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};Fe(u)?e.value=parseFloat(h):Ae(u)&&(e.values=[parseFloat(m.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(De,{children:[e.jsx(We,{value:u,onChange:d,operators:b}),Fe(u)&&e.jsx(Oe,{children:e.jsx(Be,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Ae(u)&&e.jsxs(Oe,{children:[e.jsx(Be,{type:"number",value:m,onChange:g,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(Be,{type:"number",value:x,onChange:y,placeholder:"To...",onEnterPress:C})]}),e.jsx(Pe,{onApply:C,onClear:l,canApply:!!Me(u)||(Fe(u)?""!==h.trim():!!Ae(u)&&""!==String(m).trim()&&""!==String(x).trim()),showClear:!!a})]})},Ye=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,s=n.placeholder;return e.jsx(Le,{value:t,onChange:r,options:o,className:a,placeholder:s})},Ge=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,s=n.useState((null==o?void 0:o.operator)||"equals"),l=s[0],c=s[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=He("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=Me(l)||""!==d;return e.jsxs(De,{children:[e.jsx(We,{value:l,onChange:c,operators:h}),Fe(l)&&e.jsx(Oe,{children:e.jsx(Ye,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Pe,{onApply:function(){var e={accessor:r.accessor,operator:l};Fe(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},Ke=function(t){var r,i,a=t.header,s=t.currentFilter,l=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==s?void 0:s.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==s?void 0:s.value)?String(s.value):""),v=h[0],p=h[1],m=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),g=m[0],w=m[1],x=n.useState(String((null===(i=null==s?void 0:s.values)||void 0===i?void 0:i[1])||"")),y=x[0],b=x[1],C=He("date");n.useEffect(function(){var e,n;s?(f(s.operator),p(String(s.value||"")),w(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),b(""))},[s]);var S=function(t){var r=t.value,i=t.onChange,a=t.placeholder,s=t.autoFocus,l=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=P(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){s&&p.current&&p.current.focus()},[s]);var m=r?P(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:a,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(l||""),style:{cursor:"pointer"}}),e.jsx(A,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(W,{value:m,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(De,{children:[e.jsx(We,{value:d,onChange:f,operators:C}),Fe(d)&&e.jsx(Oe,{children:e.jsx(S,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Ae(d)&&e.jsxs(Oe,{children:[e.jsx(S,{value:g,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(S,{value:y,onChange:b,placeholder:"To date..."})]}),e.jsx(Pe,{onApply:function(){var e={accessor:a.accessor,operator:d};Fe(d)?e.value=v:Ae(d)&&(e.values=[g,y]),l(e)},onClear:c,canApply:!!Me(d)||(Fe(d)?""!==v.trim():!!Ae(d)&&""!==g.trim()&&""!==y.trim()),showClear:!!s})]})},Ue=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==i?void 0:i.values)?i.values.map(String):u),f=d[0],h=d[1],v=n.useState(""),p=v[0],m=v[1],g=n.useMemo(function(){if(!p)return c;var e=p.toLowerCase();return c.filter(function(n){return n.label.toLowerCase().includes(e)})},[c,p]);n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var w=f.length===u.length,x=c.length>10;return e.jsxs(De,{children:[e.jsx(Oe,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(fe,o({checked:w,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),x&&e.jsx("div",o({className:"st-enum-search"},{children:e.jsx(Be,{type:"text",value:p,onChange:m,placeholder:"Search..."})})),g.map(function(n,t){return e.jsx(fe,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):s(s([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===g.length&&e.jsx("div",o({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(Pe,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else l()},onClear:l,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},Ve=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(ze,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Ge,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Ke,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(Ue,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Je=function(t){var r,i,a=t.colIndex,c=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,h=t.gridRowStart,v=t.header,p=t.reverse,m=t.sort,g=n.useState(!1),w=g[0],x=g[1],y=n.useState(!1),b=y[0],C=y[1],S=n.useState(v.label||""),I=S[0],j=S[1],E=R(),k=E.activeHeaderDropdown,N=E.areAllRowsSelected,H=E.collapsedHeaders,F=E.columnBorders,M=E.columnReordering,D=E.columnResizing,L=E.columnsWithSelectedCells,W=E.draggedHeaderRef,B=E.enableHeaderEditing,O=E.enableRowSelection,P=E.filters,q=E.handleApplyFilter,z=E.handleClearFilter,Y=E.handleSelectAll,G=E.headerCollapseIcon,K=E.headerDropdown,V=E.headerExpandIcon,J=E.headerRegistry,X=E.headers,_=E.hoveredHeaderRef,$=E.onColumnOrderChange,Q=E.onColumnSelect,Z=E.onHeaderEdit,ee=E.onSort,te=E.onTableHeaderDragEnd,re=E.rowHeight,oe=E.selectColumns,ie=E.selectableColumns,ae=E.selectedColumns,se=E.setActiveHeaderDropdown,le=E.setCollapsedHeaders,ce=E.setHeaders,de=E.setInitialFocusedCell,he=E.setIsResizing,ve=E.setSelectedCells,pe=E.setSelectedColumns,me=E.sortDownIcon,ge=E.sortUpIcon,we=Boolean(null==v?void 0:v.isSortable),xe=Boolean(null==v?void 0:v.filterable),ye=P[v.accessor],be=(null==k?void 0:k.accessor)===v.accessor,Ce=v.isSelectionColumn&&O,Se=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(v),Ie=H.has(v.accessor),Re=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,s=e.margin,l=void 0===s?4:s,c=n.useRef(null),u=n.useState({}),d=u[0],f=u[1];return n.useEffect(function(){if(t&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,r=window.innerWidth-e.right,i="bottom",s={};o>n&&o<=t&&(i="top");var u="left";a>r+e.width&&(u="right"),"bottom"===i?s.top=e.bottom+l:s.bottom=window.innerHeight-e.top+l,"left"===u?s.left=e.left:s.right=window.innerWidth-e.right,f(s)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:c,position:d}}({isOpen:be,estimatedHeight:200,estimatedWidth:250,margin:4}),Ee=Re.triggerRef,Ne=Re.position,He=n.useMemo(function(){var e,n,t;if(!F)return!1;var r=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===v.accessor},[F,X,v.accessor,v.pinned]),Fe=n.useMemo(function(){return!(!ie||Ce)&&l(v,a).some(function(e){return ae.has(e)})},[ie,Ce,v,a,ae]),Ae=n.useMemo(function(){return!Ce&&L.has(a)},[Ce,L,a]),Me=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!Ie||v.children.some(function(e){return e.summaryColumn}))},[v.children,Ie]),De="st-header-cell ".concat(v.accessor===(null===(r=_.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=W.current)||void 0===i?void 0:i.accessor)===v.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(M&&!we?"columnReordering":""," ").concat(Me?"parent":""," ").concat(He?"st-last-column":""," ").concat(B&&!Ce?"st-header-editable":""," ").concat(Fe?"st-header-selected":""," ").concat(Ae&&!Fe?"st-header-has-highlighted-cell":""),Te=ne({draggedHeaderRef:W,headers:X,hoveredHeaderRef:_,onColumnOrderChange:$,onTableHeaderDragEnd:te}),Le=Te.handleDragStart,We=Te.handleDragEnd,Be=Te.handleDragOver,Oe=U();n.useEffect(function(){if(J&&!v.isSelectionColumn){var e=String(v.accessor);return J.set(e,{setEditing:function(e){C(e)}}),function(){J.delete(e)}}},[J,v.accessor,v.isSelectionColumn]),n.useEffect(function(){j(v.label||"")},[v.label]);var Pe=n.useCallback(function(e){j(e);var n=X.map(function(n){return n.accessor===v.accessor?o(o({},n),{label:e}):n});ce(n),Z&&Z(v,e)},[X,ce,Z,v]),qe=n.useCallback(function(){se&&se(null)},[se]),ze=n.useCallback(function(e){e.stopPropagation(),le(function(e){var n=new Set(e);return Ie?n.delete(v.accessor):n.add(v.accessor),n})},[le,Ie,v.accessor]),Ye=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ie){var r=l(t,a),o=r.some(function(e){return ae.has(e)});if(B&&o&&!n.shiftKey)return K&&be&&qe(),void C(!0);n.shiftKey&&oe?pe(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,u,d=s(s([],(a=o,l=n,c=Math.min(a,l),u=Math.max(a,l),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(s(s([],Array.from(e),!0),d,!0))}):oe&&oe(r),ve(new Set),de(null)}Q&&Q(t),!ie&&t.isSortable&&ee(t.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)}},[]),!v)return null;var Ge=D&&!Ce&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:je,callbackProps:{event:e.nativeEvent,gridColumnEnd:c,gridColumnStart:u,header:v,headers:X,setHeaders:ce,setIsResizing:he,startWidth:t,collapsedHeaders:H},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(f({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Oe({callback:je,callbackProps:{event:e,gridColumnEnd:c,gridColumnStart:u,header:v,headers:X,setHeaders:ce,setIsResizing:he,startWidth:t,collapsedHeaders:H},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ke=m&&m.key.accessor===v.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return Ye({event:e,header:v})}},{children:["ascending"===m.direction&&ge&&ge,"descending"===m.direction&&me&&me]})),Ue=xe&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),x(!w)}},{children:[e.jsx(ke,{className:"st-header-icon",style:{fill:ye?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(A,o({open:w,overflow:"visible",setOpen:x,onClose:function(){return x(!1)}},{children:e.jsx(Ve,{header:v,currentFilter:ye,onApplyFilter:function(e){q(e),x(!1)},onClearFilter:function(){z(v.accessor),x(!1)}})}))]})),Je=Se&&!Ce&&e.jsx("div",o({className:"st-icon-container st-collapse-icon-container",onClick:ze},{children:Ie?G:V}));return e.jsxs(ue,o({className:De,id:f({accessor:v.accessor,rowId:"header"}),onDragOver:function(e){Ce||Oe({callback:Be,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:o({gridRowStart:h,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:c},d-h>1?{}:{height:re})},{children:[p&&Ge,"right"===v.align&&Je,"right"===v.align&&Ue,"right"===v.align&&Ke,e.jsx("div",o({ref:Ee,className:"st-header-label",draggable:M&&!v.disableReorder&&!Ce,onClick:function(e){Ce||Ye({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){e.event;var n=e.header;n.isSelectionColumn||ie&&n.isSortable&&ee(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),We()},onDragStart:Ce?void 0:function(e){M&&v&&function(e){Le(e)}(v)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(fe,{checked:!!N&&N(),onChange:function(e){Y&&Y(e)}}):b?e.jsx(T,{defaultValue:I,onBlur:function(){return C(!1)},onChange:Pe}):v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:a,header:v}):I||(null==v?void 0:v.label)}))})),"right"!==v.align&&Ke,"right"!==v.align&&Ue,"right"!==v.align&&Je,!p&&Ge,K&&!Ce&&e.jsx("div",o({className:"st-header-dropdown-container"},{children:K({accessor:v.accessor,colIndex:a,header:v,isOpen:be,onClose:qe,position:Ne})}))]}))},Xe=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,c=t.pinned,u=t.sectionRef,d=t.sort,f=t.width,v=R().collapsedHeaders,p=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!h({header:o,pinned:c,headers:s,collapsedHeaders:v}))return 0;a||n++;var f=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return h({header:e,pinned:c,headers:s,collapsedHeaders:v})}).length)&&void 0!==d?d:0,p=n,m=f>0?p+f:p+1,g=i,w=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:p,gridColumnEnd:m,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var x=!0;o.children.forEach(function(e){h({header:e,pinned:c,headers:s,collapsedHeaders:v})&&(t(e,i+1,x),x=!1)})}return m-p},o=s.filter(function(e){return h({header:e,pinned:c,headers:s,collapsedHeaders:v})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,c,r,v]);return e.jsx(Ce,o({condition:!c,wrapper:function(n){return e.jsx(be,o({childRef:u},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(c?"pinned-".concat(c):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative",width:f}},{children:e.jsx(e.Fragment,{children:p.map(function(n){return e.jsx(Je,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===c,sort:d},n.header.accessor)})})}))}))},_e=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(_e)):1},$e=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,v=t.pinnedLeftWidth,p=t.pinnedRightWidth,m=R(),g=m.headerContainerRef,w=m.pinnedLeftRef,x=m.pinnedRightRef,y=m.collapsedHeaders,b=n.useMemo(function(){return Ie({headers:i,pinnedLeftColumns:l,pinnedRightColumns:u,collapsedHeaders:y})},[i,l,u,y]),C=n.useMemo(function(){var e=0,n=s(s(s([],l,!0),i,!0),u,!0);return i.forEach(function(t){if(h({header:t,headers:n,collapsedHeaders:y})){var r=_e(t);e=Math.max(e,r)}}),{maxDepth:e}},[i,l,u,y]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:g},{children:[X(i,"left")&&e.jsx(Xe,{columnIndices:b,gridTemplateColumns:c,handleScroll:void 0,headers:i,maxDepth:C,pinned:"left",sectionRef:w,sort:f,width:v}),e.jsx(Xe,{columnIndices:b,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:C,sectionRef:r,sort:f}),X(i,"right")&&e.jsx(Xe,{columnIndices:b,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:C,pinned:"right",sectionRef:x,sort:f,width:p})]}))},Qe=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return e.summaryColumn});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return!e.summaryColumn});r({headers:i,flattenedHeaders:o})}else o.push(e)}),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},Ze=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=R(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=u.collapsedHeaders,p=n.useRef(null),m=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),w=h.filter(function(e){return"right"===e.pinned}),x=n.useMemo(function(){return Qe({headers:g,collapsedHeaders:v})},[g,v]),y=n.useMemo(function(){return Qe({headers:m,collapsedHeaders:v})},[m,v]),b=n.useMemo(function(){return Qe({headers:w,collapsedHeaders:v})},[w,v]),C={centerHeaderRef:p,headers:h,mainTemplateColumns:y,pinnedLeftColumns:g,pinnedLeftTemplateColumns:x,pinnedRightColumns:w,pinnedRightTemplateColumns:b,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},S={tableRows:l,mainTemplateColumns:y,pinnedLeftColumns:g,pinnedLeftTemplateColumns:x,pinnedLeftWidth:r,pinnedRightColumns:w,pinnedRightTemplateColumns:b,pinnedRightWidth:i,setScrollTop:a,rowsToRender:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx($e,o({},C)),e.jsx(Re,o({},S))]}))},en=function(t){var r,i,a=t.mainBodyWidth,s=t.mainBodyRef,l=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=R().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),m=u.current&&u.current.scrollHeight>u.current.clientHeight,g=d?28:0,w=(d?c+1:c)+(u.current&&m?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;v(a>e)}}()},1)},[s,a]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:l,height:null===(r=p.current)||void 0===r?void 0:r.offsetHeight}}),a>0&&e.jsx(be,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})}))})),c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:w,height:null===(i=p.current)||void 0===i?void 0:i.offsetHeight}}),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},nn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return nn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?nn.string(e,n,t):"number"==typeof e&&"number"==typeof n?nn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?nn.boolean(e,n,t):nn.string(String(e),String(n),t)}},tn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return s([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[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(t)||0},i=o(e),a=o(n);return nn.number(i,a,r)}return"date"===t?nn.date(String(e),String(n),r):"boolean"===t?nn.boolean(Boolean(e),Boolean(n),r):"enum"===t?nn.enum(String(e),String(n),r):nn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},rn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return tn({rows:t,sortColumn:r,headers:n})},on=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):rn({headers:i,rows:t,sortColumn:r}):t},an=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),s=!1;if(!a)for(var l=0,c=i.children;l<c.length;l++){var u=c[l];if(an([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},sn=function(e){return e.every(function(e){return e.hide})},ln=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(ln(e.children),sn(e.children)&&(e.hide=!0))})},cn=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=R(),p=v.expandIcon,m=v.headers,g=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,y=null!=u?u:c.hide||x&&c.children&&sn(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[l&&e.jsx("div",o({className:"st-header-icon-container"},{children:x?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(fe,o({checked:y,onChange:function(e){(c.hide=e,e)?ln(r):(an(r,c.accessor),x&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,an(r,c.children[0].accessor)));g(s([],m,!0))}},{children:c.label}))]})),x&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(cn,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!y||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},un=function(t){var r=t.headers,i=t.open,a="left"===t.position?"left":"",s=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(i?"open":""," ").concat(a),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn?null:e.jsx(cn,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},dn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,s=t.headers,l=t.position,c=void 0===l?"right":l,u=n.useState(a),d=u[0],f=u[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(un,{headers:s,open:d,position:c})]})):null},fn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},hn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},vn=function(t){var i=t.children,a=n.useRef({}),s=n.useCallback(function(e,n){return!!a.current[n]&&a.current[n].find(function(n){return n===e})},[]),l=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=n.useCallback(function(e){e.onscroll=null},[]),u=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=a.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),l(e,n),window.requestAnimationFrame(function(){var e=Object.keys(a.current).filter(function(e){return a.current[e].includes(n)});u(n,e)}))})})})}},[c,l]),d=n.useCallback(function(e,n){n.forEach(function(n){a.current[n]||(a.current[n]=[]),s(e,n)||(a.current[n].length>0&&l(a.current[n][0],e),a.current[n].push(e))}),u(e,n)},[s,l,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(s(e,n)){c(e);var t=a.current[n].indexOf(e);-1!==t&&a.current[n].splice(t,1)}})},[s,c]);return e.jsx(xe.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},pn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Ne[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},mn=function(){var n=R(),t=n.filters,r=n.handleClearFilter,i=n.headers,a=Object.values(t);return 0===a.length||a.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:a.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:pn(n,i)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},gn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var s=Number(e),l=Number(r);switch(t){case"equals":return s===l;case"notEquals":return s!==l;case"greaterThan":return s>l;case"lessThan":return s<l;case"greaterThanOrEqual":return s>=l;case"lessThanOrEqual":return s<=l;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return s>=u&&s<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],s<u||s>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=P(e),v=P(String(r||"")),p=O(h),m=O(v);switch(t){case"equals":return p.getTime()===m.getTime();case"notEquals":return p.getTime()!==m.getTime();case"before":return p<m;case"after":return p>m;case"between":if(o&&2===o.length){var g=o.map(function(e){return O(P(String(e||"")))}),w=g[0],x=g[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var y=o.map(function(e){return O(P(String(e||"")))});return w=y[0],x=y[1],p<w||p>x}return!0}}if("boolean"==typeof e){var b=Boolean(r);if("equals"===t)return e===b}if(Array.isArray(e)){var C=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),I=o.includes(S);return"in"===t?I:!I}return!1}var R=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return R===j;case"notEquals":return R!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},wn=function(e){var t=e.rows,r=e.headers,i=e.rowGrouping;return n.useMemo(function(){if(!i||0===i.length)return t;var e=function(e){return c(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),a=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=i[t],s=i[t+1],l=n[r];if(l&&x(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=xn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},xn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&x(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,s=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===s.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=s.reduce(function(e,n){return e+n},0);break;case"average":a=s.reduce(function(e,n){return e+n},0)/s.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,s);break;case"max":a=Math.max.apply(Math,s);break;default:return}return t.formatResult?t.formatResult(a):a}},yn=function(e){var t=e.rows,r=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,s=n.useState(new Set),l=s[0],c=s[1],u=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(t,r,l)},[t,r,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),h=n.useMemo(function(){return a?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(t,r,l):[]},[t,r,l,a]),v=n.useCallback(function(e,n){if(a){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,l);if(c(i),o){var s=t.find(function(n){return String(n[r])===e});s&&o({row:s,isSelected:n,selectedRows:i})}}},[l,t,r,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(t,r),o&&t.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=t.find(function(n){return String(n[r])===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[t,r,o,l,a]),m=n.useCallback(function(e){if(a){var n=u(e);v(e,!n)}},[u,v,a]),g=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=t.find(function(e){return String(e[r])===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,t,r,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:u,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:h,handleRowSelect:v,handleSelectAll:p,handleToggleRow:m,clearSelection:g}},bn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,c=t.cellUpdateFlash,d=void 0!==c&&c,f=t.className,h=t.columnBorders,g=void 0!==h&&h,w=t.columnEditorPosition,S=void 0===w?"right":w,R=t.columnEditorText,H=void 0===R?"Columns":R,F=t.columnReordering,A=void 0!==F&&F,M=t.columnResizing,D=void 0!==M&&M,T=t.defaultHeaders,L=t.editColumns,W=void 0!==L&&L,B=t.editColumnsInitOpen,O=void 0!==B&&B,P=t.enableHeaderEditing,q=void 0!==P&&P,z=t.enableRowSelection,Y=void 0!==z&&z,G=t.expandAll,K=void 0===G||G,U=t.expandIcon,J=void 0===U?e.jsx(k,{className:"st-expand-icon"}):U,X=t.externalFilterHandling,_=void 0!==X&&X,$=t.externalSortHandling,Q=void 0!==$&&$,Z=t.headerCollapseIcon,ee=void 0===Z?e.jsx(k,{className:"st-header-icon"}):Z,ne=t.headerExpandIcon,te=void 0===ne?e.jsx(E,{className:"st-header-icon"}):ne,re=t.headerDropdown,ie=t.height,ae=t.hideFooter,se=void 0!==ae&&ae,le=t.nextIcon,ce=void 0===le?e.jsx(k,{className:"st-next-prev-icon"}):le,ue=t.onCellEdit,de=t.onCellClick,fe=t.onColumnOrderChange,he=t.onColumnSelect,ve=t.onFilterChange,pe=t.onGridReady,me=t.onHeaderEdit,ge=t.onLoadMore,we=t.onNextPage,xe=t.onRowSelectionChange,ye=t.onSortChange,be=t.prevIcon,Ce=void 0===be?e.jsx(E,{className:"st-next-prev-icon"}):be,Se=t.rowButtons,Ie=t.rowGrouping,Re=t.rowHeight,je=void 0===Re?32:Re,Ee=t.rowIdAccessor,ke=t.rows,Ne=t.selectionColumnWidth,He=void 0===Ne?42:Ne,Fe=t.rowsPerPage,Ae=void 0===Fe?10:Fe,Me=t.selectableCells,De=void 0!==Me&&Me,Te=t.selectableColumns,Le=void 0!==Te&&Te,We=t.shouldPaginate,Be=void 0!==We&&We,Oe=t.sortDownIcon,Pe=void 0===Oe?e.jsx(fn,{className:"st-header-icon"}):Oe,qe=t.sortUpIcon,ze=void 0===qe?e.jsx(hn,{className:"st-header-icon"}):qe,Ye=t.tableRef,Ge=t.theme,Ke=void 0===Ge?"light":Ge,Ue=t.useHoverRowBackground,Ve=void 0===Ue||Ue,Je=t.useOddEvenRowBackground,Xe=void 0!==Je&&Je,_e=t.useOddColumnBackground,$e=void 0!==_e&&_e;$e&&(Xe=!1),g&&(Ve=!1);var Qe=n.useReducer(function(e){return e+1},0)[1],nn=n.useRef(null),tn=n.useRef(null),an=n.useRef(null),sn=n.useRef(null),ln=n.useRef(null),cn=n.useRef(null),un=n.useRef(null),pn=n.useState(1),xn=pn[0],bn=pn[1],Cn=n.useState(T),Sn=Cn[0],In=Cn[1],Rn=n.useState(!1),jn=Rn[0],En=Rn[1],kn=n.useState(!1),Nn=kn[0],Hn=kn[1],Fn=n.useState(null),An=Fn[0],Mn=Fn[1],Dn=n.useState(new Set),Tn=Dn[0],Ln=Dn[1];n.useEffect(function(){In(T)},[T]);var Wn=yn({rows:ke,rowIdAccessor:Ee,onRowSelectionChange:xe,enableRowSelection:Y}),Bn=Wn.selectedRows,On=Wn.setSelectedRows,Pn=Wn.isRowSelected,qn=Wn.areAllRowsSelected,zn=Wn.selectedRowCount,Yn=Wn.selectedRowsData,Gn=Wn.handleRowSelect,Kn=Wn.handleSelectAll,Un=Wn.handleToggleRow,Vn=Wn.clearSelection,Jn=n.useMemo(function(){var e,n=s([],Sn,!0);Y&&!(null===(e=null==Sn?void 0:Sn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=s([{accessor:"__row_selection__",label:"",width:He,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[Y,Sn,He]),Xn=n.useState(0),_n=Xn[0],$n=Xn[1],Qn=n.useState(new Set),Zn=Qn[0],et=Qn[1],nt=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){if(t.current){var e=t.current.offsetWidth-t.current.clientWidth;i(e)}},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:cn}),tt=nt.scrollbarWidth,rt=nt.setScrollbarWidth,ot=n.useState(0),it=ot[0],at=ot[1];n.useLayoutEffect(function(){var e=function(){cn.current&&at(cn.current.clientWidth)};e();var n=null;return cn.current&&(n=new ResizeObserver(e)).observe(cn.current),function(){n&&n.disconnect()}},[]);var st=n.useMemo(function(){var e=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,s=0,l=0;if(n.forEach(function(e){if(!e.hide){var n=p(e,i).reduce(function(e,n){return e+m(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?s+=n:l+=n}}),t&&t>0){var c=t*o;a>c&&(a=c),s>c&&(s=c)}return{leftWidth:u(a),rightWidth:u(s),mainWidth:l}}({headers:Jn,containerWidth:it,collapsedHeaders:Tn});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Jn,it,Tn]),lt=st.mainBodyWidth,ct=st.pinnedLeftWidth,ut=st.pinnedRightWidth,dt=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var i=parseInt(t,10);o=window.innerHeight*i/100}else if(t.endsWith("%")){var a=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-r)},[t,r])}({height:ie,rowHeight:je}),ft=wn({rows:ke,headers:Sn,rowGrouping:Ie}),ht=function(e){var t=e.rows,r=e.externalFilterHandling,i=e.onFilterChange,a=n.useState({}),s=a[0],l=a[1],c=n.useMemo(function(){return gn({externalFilterHandling:r,tableRows:t,filterState:s})},[t,s,r]),u=n.useCallback(function(e){var n,t=o(o({},s),((n={})[e.accessor]=e,n));l(t),null==i||i(t)},[s,i]),d=n.useCallback(function(e){var n=o({},s);delete n[e],l(n),null==i||i(n)},[s,i]),f=n.useCallback(function(){l({}),null==i||i({})},[i]),h=n.useCallback(function(e){var n,i=o(o({},s),((n={})[e.accessor]=e,n));return gn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:ft,externalFilterHandling:_,onFilterChange:ve}),vt=ht.filters,pt=ht.filteredRows,mt=ht.updateFilter,gt=ht.clearFilter,wt=ht.clearAllFilters,xt=ht.computeFilteredRowsPreview,yt=function(e){var t=e.headers,r=e.tableRows,i=e.externalSortHandling,a=e.onSortChange,s=e.rowGrouping,l=n.useState(null),c=l[0],u=l[1],d=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,i=e.sortColumn,a=rn({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(x(s)){var l=d({rows:s,sortColumn:i,headers:t,groupingKeys:n.slice(1)});return o(o({},e),((r={})[a]=l,r))}return e}):a},[]),f=n.useMemo(function(){return on({externalSortHandling:i,tableRows:r,sortColumn:c,rowGrouping:s,headers:t,sortNestedRows:d})},[r,c,t,i,s,d]),h=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},r=n(t);if(r){var o=null;c&&c.key.accessor===e?"ascending"===c.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},u(o),null==a||a(o)}},[c,t,a]),v=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},o=n(t);if(!o)return r;var a=null;return c&&c.key.accessor===e?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},on({externalSortHandling:i,tableRows:r,sortColumn:a,rowGrouping:s,headers:t,sortNestedRows:d})},[c,t,r,i,s,d]);return{sort:c,sortedRows:f,updateSort:h,computeSortedRowsPreview:v}}({headers:Sn,tableRows:pt,externalSortHandling:Q,onSortChange:ye,rowGrouping:Ie}),bt=yt.sort,Ct=yt.sortedRows,St=yt.updateSort,It=function(e){var t=e.allowAnimations,r=e.sortedRows,i=e.originalRows,a=e.currentPage,l=e.rowsPerPage,c=e.shouldPaginate,u=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,h=e.expandAll,v=e.contentHeight,p=e.rowHeight,m=e.scrollTop,g=e.computeFilteredRowsPreview,w=e.computeSortedRowsPreview,x=n.useState(!1),C=x[0],S=x[1],I=n.useState([]),R=I[0],j=I[1],E=n.useRef([]),k=n.useRef([]),H=n.useRef(new Map),F=n.useRef(null),A=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?b({rows:n,rowGrouping:u,rowIdAccessor:d,unexpandedRows:f,expandAll:h}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[a,l,c,u,d,f,h]);n.useMemo(function(){if(0===H.current.size){var e=A(i),n=new Map;e.forEach(function(e){var t=String(y({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),H.current=n}},[i,A,d]);var M=n.useMemo(function(){return A(r)},[r,A]),D=n.useMemo(function(){return N({bufferRowCount:5,contentHeight:v,tableRows:M,rowHeight:p,scrollTop:m})},[M,v,p,m]),T=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),L=n.useMemo(function(){if(0===E.current.length)return!1;var e=M.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))}),n=E.current.map(function(e){return String(y({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[M,d]);n.useLayoutEffect(function(){if(!C){if(!t||c)return j([]),E.current=M,void(k.current=D);if(0===E.current.length)return j([]),E.current=M,void(k.current=D);if(!L)return j([]),E.current=M,void(k.current=D);F.current={tableRows:M,visibleRows:D},S(!0)}},[t,M,L,C,c,D]),n.useLayoutEffect(function(){if(C&&F.current&&R.length>0){var e=setTimeout(function(){var e=F.current;S(!1),j([]),E.current=e.tableRows,k.current=e.visibleRows,F.current=null},oe.duration+100);return function(){return clearTimeout(e)}}},[C,R.length]);var W=n.useMemo(function(){if(!t||c)return D;if(R.length>0){var e=new Map;return M.forEach(function(n){var t=String(y({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),R.map(function(n){var t=String(y({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return D},[D,R,M,t,c,d]),B=n.useCallback(function(e){if(t&&!c){var n=g(e),r=A(n),o=N({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:m}),i=T(D,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return M.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],D,!0),i,!0))}},[t,c,g,A,v,p,m,T,M,D,d]),O=n.useCallback(function(e){if(t&&!c){var n=w(e),r=A(n),o=N({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:m}),i=T(D,o).entering.map(function(e){var n=String(y({row:e.row,rowIdAccessor:d}));return M.find(function(e){return String(y({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&j(s(s([],D,!0),i,!0))}},[t,c,w,A,v,p,m,T,M,D,d]);return{currentTableRows:M,currentVisibleRows:D,isAnimating:C,prepareForFilterChange:B,prepareForSortChange:O,rowsToRender:W}}({allowAnimations:l,sortedRows:Ct,originalRows:ft,currentPage:xn,rowsPerPage:Ae,shouldPaginate:Be,rowGrouping:Ie,rowIdAccessor:Ee,unexpandedRows:Zn,expandAll:K,contentHeight:dt,rowHeight:je,scrollTop:_n,computeFilteredRowsPreview:xt,computeSortedRowsPreview:yt.computeSortedRowsPreview}),Rt=It.currentTableRows,jt=It.rowsToRender,Et=It.prepareForFilterChange,kt=It.prepareForSortChange,Nt=It.isAnimating,Ht=n.useRef(new Map),Ft=n.useRef(new Map),At=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=e.collapsedHeaders,d=n.useState(new Set),f=d[0],h=d[1],v=n.useState(new Set),m=v[0],g=v[1],w=n.useState(null),x=w[0],b=w[1],S=n.useState(null),I=S[0],R=S[1],j=n.useState(new Set),E=j[0],k=j[1],N=n.useState(new Set),H=N[0],F=N[1],A=n.useRef(!1),M=n.useRef(null),D=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),m.forEach(function(n){e.add(n)}),e},[f,m]),T=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),m.size>0&&o.forEach(function(n){var t=y({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[f,m,o,s]),L=n.useMemo(function(){return r.flatMap(function(e){return p(e,u)})},[r,u]),W=n.useCallback(function(){var e=L.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,i=t.split("-").map(Number),a=i[0],s=i[1];e[a]||(e[a]=[]);var l=n.get(s);return l&&(null===(r=o[a])||void 0===r?void 0:r.row)?e[a][s]=o[a].row[l]:e[a][s]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),k(new Set(f)),setTimeout(function(){k(new Set)},800))},[L,f,o]),B=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,u,d,f;return a(this,function(a){switch(a.label){case 0:if(!I)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=L.filter(function(e){return!e.hide}),r=new Set,i=new Set,u=I.rowIndex,d=I.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,a){var f=u+n,h=d+a;if(!(f>=o.length||h>=t.length)){var v=o[f],p=t[h],m=y({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var g=e;if("number"===p.type){var w=Number(e);isNaN(w)||(g=w)}else if("boolean"===p.type)g="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var x=new Date(e);isNaN(x.getTime())||(g=x)}if(v.row[p.accessor]=g,c){var b="".concat(m,"-").concat(p.accessor),S=c.get(b);S&&S.updateContent(g)}null==l||l({accessor:p.accessor,newValue:g,row:v.row,rowIndex:f});var I=C({colIndex:h,rowIndex:f,rowId:m});r.add(I)}else{var R=C({colIndex:h,rowIndex:f,rowId:m});i.add(R)}}})}),r.size>0&&(k(r),setTimeout(function(){k(new Set)},800)),i.size>0&&(F(i),setTimeout(function(){F(new Set)},800)),[3,4]):[2];case 3:return f=a.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[I,L,o,s,l,c]),O=n.useCallback(function(){if(0!==f.size){var e=L.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],u=i[1];if(!(a>=o.length||u>=e.length)){var d=o[a],f=e[u],h=y({row:d.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),d.row[f.accessor]=v,c){var p="".concat(h,"-").concat(f.accessor),m=c.get(p);m&&m.updateContent(v)}null==l||l({accessor:f.accessor,newValue:v,row:d.row,rowIndex:a}),t.add(n)}else r.add(n)}}),t.size>0&&(k(t),setTimeout(function(){k(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,L,o,s,l,c]),P=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=r;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<o.length){var d=y({row:o[c].row,rowIdAccessor:s});t.add(C({colIndex:u,rowIndex:c,rowId:d}))}g(new Set),b(null),h(t)},[o,s,g,b,h]),q=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<L.length){var n=C(e);g(new Set),b(null),h(new Set([n])),R(e)}},[L.length,o.length,g,b,h,R]),z=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),R(null),g(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&b(e[e.length-1])},[h,R,g,b]);n.useEffect(function(){var e=function(e){var n;if(t&&I){var r=I.rowIndex,i=I.colIndex,a=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void B();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void O();if(y({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return y({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=y({row:o[r-1].row,rowIdAccessor:s});q({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=y({row:o[r+1].row,rowIdAccessor:s}),q({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<L.length-1&&(c=y({row:o[r].row,rowIdAccessor:s}),q({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),g(new Set),b(null),M.current=null,R(null))}else W()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[W,L.length,I,s,P,q,t,o,B,O]);var Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=C({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=m.has(n);return i||a},[f,m]),G=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?y({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?y({row:o[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!Y(c)||m.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!Y(u)||m.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),Y(d)||i.push("st-selected-left-border"),Y(f)||i.push("st-selected-right-border"),i.join(" ")},[Y,o,m,s]),K=n.useMemo(function(){return I?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===I.rowIndex&&t===I.colIndex&&r===I.rowId}:function(){return!1}},[I]),U=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=C({colIndex:n,rowIndex:t,rowId:r});return E.has(o)},[E]),V=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=C({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]);return{getBorderClass:G,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(A.current=!0,M.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){g(new Set),b(null);var e=C({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),R({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&A.current&&M.current){for(var i=new Set,a=Math.min(M.current.rowIndex,r),l=Math.max(M.current.rowIndex,r),c=Math.min(M.current.colIndex,n),u=Math.max(M.current.colIndex,n),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var v=y({row:o[d].row,rowIdAccessor:s});i.add(C({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){A.current=!1},isCopyFlashing:U,isWarningFlashing:V,isInitialFocusedCell:K,isSelected:Y,lastSelectedColumnIndex:x,pasteFromClipboard:B,selectColumns:z,selectedCells:f,selectedColumns:m,setInitialFocusedCell:R,setSelectedCells:h,setSelectedColumns:g,deleteSelectedCells:O,columnsWithSelectedCells:D,rowsWithSelectedCells:T}}({selectableCells:De,headers:Sn,tableRows:Rt,rowIdAccessor:Ee,onCellEdit:ue,cellRegistry:Ht.current,collapsedHeaders:Tn}),Mt=At.getBorderClass,Dt=At.handleMouseDown,Tt=At.handleMouseOver,Lt=At.handleMouseUp,Wt=At.isCopyFlashing,Bt=At.isInitialFocusedCell,Ot=At.isSelected,Pt=At.isWarningFlashing,qt=At.selectColumns,zt=At.selectedCells,Yt=At.selectedColumns,Gt=At.setInitialFocusedCell,Kt=At.setSelectedCells,Ut=At.setSelectedColumns,Vt=At.columnsWithSelectedCells,Jt=At.rowsWithSelectedCells,Xt=n.useCallback(function(e){kt(e),setTimeout(function(){St(e)},0)},[kt,St]),_t=n.useCallback(function(e){In(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,s=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(s&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,s,l])}({selectableColumns:Le,selectedCells:zt,selectedColumns:Yt,setSelectedCells:Kt,setSelectedColumns:Ut,activeHeaderDropdown:An,setActiveHeaderDropdown:Mn}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:Qe,tableBodyContainerRef:cn,setScrollbarWidth:rt}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:pe}),function(e){var t=e.tableRef,r=e.rows,o=e.rowIdAccessor,i=e.cellRegistryRef,a=e.headerRegistryRef,s=e.visibleRows;n.useEffect(function(){t&&(t.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,a=e.newValue,s=null==r?void 0:r[t];if(s){var l=y({row:s,rowIdAccessor:o}),c=v({rowId:l,accessor:n}),u=i.current.get(c);u&&u.updateContent(a),void 0!==s[n]&&(s[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=a.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return s}})},[i,a,r,o,t,s])}({cellRegistryRef:Ht,headerRegistryRef:Ft,rowIdAccessor:Ee,rows:ke,tableRef:Ye,visibleRows:jt}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:vt,onFilterChange:ve}),function(e){var t=e.sort,r=e.onSortChange,o=V(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:bt,onSortChange:ye});var $t=n.useCallback(function(e){Et(e),setTimeout(function(){mt(e)},0)},[Et,mt]);return e.jsx(I,o({value:{allowAnimations:l,areAllRowsSelected:qn,cellRegistry:Ht.current,cellUpdateFlash:d,clearSelection:Vn,collapsedHeaders:Tn,columnBorders:g,columnReordering:A,columnResizing:D,draggedHeaderRef:nn,editColumns:W,enableHeaderEditing:q,enableRowSelection:Y,expandIcon:J,filters:vt,forceUpdate:Qe,getBorderClass:Mt,handleApplyFilter:$t,handleClearAllFilters:wt,handleClearFilter:gt,handleMouseDown:Dt,handleMouseOver:Tt,handleRowSelect:Gn,handleSelectAll:Kn,handleToggleRow:Un,headerCollapseIcon:ee,headerContainerRef:un,headerDropdown:re,headerExpandIcon:te,headerRegistry:Ft.current,headers:Jn,hoveredHeaderRef:tn,isAnimating:Nt,isCopyFlashing:Wt,isInitialFocusedCell:Bt,isResizing:jn,isRowSelected:Pn,isScrolling:Nn,isSelected:Ot,isWarningFlashing:Pt,mainBodyRef:an,nextIcon:ce,onCellEdit:ue,onCellClick:de,onColumnOrderChange:fe,onColumnSelect:he,onLoadMore:ge,onSort:Xt,onTableHeaderDragEnd:_t,pinnedLeftRef:sn,pinnedRightRef:ln,prevIcon:Ce,rowButtons:Se,rowGrouping:Ie,rowHeight:je,rowIdAccessor:Ee,scrollbarWidth:tt,selectColumns:qt,selectableColumns:Le,selectedColumns:Yt,columnsWithSelectedCells:Vt,rowsWithSelectedCells:Jt,selectedRows:Bn,selectedRowCount:zn,selectedRowsData:Yn,setCollapsedHeaders:Ln,setHeaders:In,setInitialFocusedCell:Gt,setIsResizing:En,setIsScrolling:Hn,setSelectedCells:Kt,setSelectedColumns:Ut,setSelectedRows:On,setUnexpandedRows:et,shouldPaginate:Be,sortDownIcon:Pe,sortUpIcon:ze,tableBodyContainerRef:cn,tableRows:Rt,theme:Ke,unexpandedRows:Zn,useHoverRowBackground:Ve,useOddColumnBackground:$e,useOddEvenRowBackground:Xe,activeHeaderDropdown:An,setActiveHeaderDropdown:Mn,onHeaderEdit:me}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(Ke," ").concat(null!=f?f:""," ").concat(g?"st-column-borders":""),style:ie?{height:ie}:{}},{children:e.jsx(vn,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(mn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Lt,onMouseLeave:Lt},{children:[e.jsx(Ze,{pinnedLeftWidth:ct,pinnedRightWidth:ut,setScrollTop:$n,sort:bt,tableRows:Rt,rowsToRender:jt}),e.jsx(dn,{columnEditorText:H,editColumns:W,editColumnsInitOpen:O,headers:Sn,position:S})]})),e.jsx(en,{mainBodyRef:an,mainBodyWidth:lt,pinnedLeftWidth:ct,pinnedRightWidth:ut,tableBodyContainerRef:cn}),e.jsx(j,{currentPage:xn,hideFooter:se,onPageChange:bn,onNextPage:we,shouldPaginate:Be,totalPages:Math.ceil(Ct.length/Ae)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(bn,o({},t)):null};
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Utility functions for safe date handling to avoid timezone issues
3
+ */
4
+ /**
5
+ * Safely parses a date string in YYYY-MM-DD format to a Date object at noon local time
6
+ * This prevents timezone edge cases where midnight UTC becomes the previous day in local time
7
+ */
8
+ export declare const parseDateString: (dateString: string) => Date;
9
+ /**
10
+ * Normalizes a date to remove time component for accurate date-only comparison
11
+ * Creates the date at noon to avoid timezone edge cases
12
+ */
13
+ export declare const normalizeDate: (date: Date) => Date;
14
+ /**
15
+ * Safely creates a Date object from various input types
16
+ * Always creates dates at noon local time to avoid timezone issues
17
+ */
18
+ export declare const createSafeDate: (input: string | number | Date | null | undefined) => Date;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.3",
2
+ "version": "1.4.5",
3
3
  "main": "dist/index.js",
4
4
  "module": "dist/index.es.js",
5
5
  "types": "dist/index.d.ts",