simple-table-core 1.2.3 → 1.2.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.
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){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},c=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},u=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},d=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return d(e)}):[e]},f=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(l({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){f(e)})},h=function(e){return"number"==typeof e.minWidth?e.minWidth:40},v=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},p=function(e){return e.row[e.rowIdAccessor]},g=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=p({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 g=String(c);if((o?!i.has(g):i.has(g))&&n<s.length){var m=function(e,n){var t=e[n];return v(t)?t:[]}(t,f);m.length>0&&(r=d(m,n+1,r))}}),r};return d(c,t),u},m=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},w=n.createContext(void 0),x=function(n){var t=n.children,r=n.value;return e.jsx(w.Provider,o({value:r},{children:t}))},y=function(){var e=n.useContext(w);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},b=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=y(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),g=p[0],m=p[1],w=!(r>1),x=!(r<d)&&!c||!g&&r===d;if(s||!u)return null;var b=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 m(!1),[2];t.label=2;case 2:return(n<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),b.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))})]}))},C=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"})}))},I=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"})}))},S=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)},R=function(e){return e.position*(e.rowHeight+1)-1},j=function(e){return e.position*(e.rowHeight+1)},E=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=y().mainBodyRef,p=n.useRef(null),g=n.useRef(null),m=n.useState("bottom-left"),w=m[0],x=m[1],b=n.useState({}),C=b[0],I=b[1],S=n.useState(!1),R=S[0],j=S[1];return n.useEffect(function(){a&&p.current?(j(!1),!g.current&&p.current.parentElement&&(g.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&g.current){var e,n=p.current,t=g.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)),I(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:R?"visible":"hidden"},C),{overflow:l})},{children:r})):null},k=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}))},N=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(E,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(k,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(k,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},F=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()}})},A=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()}})},M=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=y(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),g=p[0],m=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"===g&&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 m("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"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return m("years")}},{children:h.getFullYear()})),"years"===g&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(g,"-grid")},{children:["days"===g&&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)))},g=1;g<=i;g++)p(g);var m=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(g=1;g<=m;g++)x(g);return n}(),"months"===g&&(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)),m("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===g&&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)),m("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"}))}))]}))},H=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},T=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(E,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(M,{value:H(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},D=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(E,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(k,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)})}))}))},L=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(N,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(T,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(D,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(A,{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(F,{defaultValue:d,onBlur:c,onChange:o})},B=0,O=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===B||o-B>=r)&&(B=o,n(t))}},W=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},P=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(P);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=P(e[t]));return n},q=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},z=Date.now(),Y={screenX:0,screenY:0},G=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=G(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},U=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function K(e,n,t){var r,i,a=P(e),s=!1;try{var l=U(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 V=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=y().setHeaders,l=W(t);return{handleDragStart:function(e){n.current=e,z=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-Y.screenX,2)+Math.pow(u-Y.screenY,2));r.current=a;var f,h=n.current,v=!1;if(U(h)!==U(a)){f=(C=K(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,g=G(p,h.accessor),m=G(p,a.accessor);if(!g||!m)return;var w=g.length,x=m.length,y=m;if(w!==x){var b=x-w;b>0&&(y=m.slice(0,-b))}var C=function(e,n,t){var r=P(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,g,y);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var I=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(I-z<1500||d<40)||(z=I,Y={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)}}},J=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},X={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},$={duration:1e4,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},_={duration:150,easing:"ease-out",delay:0},Q=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")},Z=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(){Q(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ee=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]:J()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),J()?o(o({},_),e):o(o({},"column"===n?X:$),e)}(t,i?"column":"row"),Q(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,Z(n,l,t)]);case 1:return a.sent(),[2]}})})},ne=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,g,m,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,J()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),g=p.top,m=e-g,w=r-g,[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(m,"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)})])})})},te=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=y(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),g=W(f),m=W(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(!g||f)if(!m||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({},$),{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 I=5*h,S=y-I,R=y+b+I,j=l.y>S&&l.y<R,E=i.y>S&&i.y<R,k=i.y<y,N=i.y>y+b,F=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,A=.6*h,M=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 H=y+b+M(i.y,y,y+b)+F%15*A*2.5+F%7*(.4*h);return void ne({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){H=y-M(i.y,y,y+b)-F%15*A*2.5-F%7*(.4*h);return void ne({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>y+b){var T=y+b+M(l.y,y,y+b)+F%10*A*1;return void ne({element:v.current,options:{startY:T,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<y){T=y-M(l.y,y,y+b)-F%10*A*1;return void ne({element:v.current,options:{startY:T,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}ee({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,g,m,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};te.displayName="Animate";var re=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},oe=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,c=t.isInitialFocused,d=t.nestedIndex,f=t.rowIndex,h=t.tableRow,g=y(),m=g.cellRegistry,w=g.cellUpdateFlash,x=g.draggedHeaderRef,b=g.expandIcon,C=g.handleMouseDown,I=g.handleMouseOver,S=g.headers,R=g.hoveredHeaderRef,j=g.isCopyFlashing,E=g.isWarningFlashing,k=g.onCellEdit,N=g.onTableHeaderDragEnd,F=g.rowGrouping,A=g.rowIdAccessor,M=g.setUnexpandedRows,H=g.tableBodyContainerRef,T=g.theme,D=g.unexpandedRows,B=g.useOddColumnBackground,W=h.depth,P=h.row,q=n.useState(P[a.accessor]),z=q[0],Y=q[1],G=n.useState(!1),U=G[0],K=G[1],J=n.useState(!1),X=J[0],$=J[1],_=n.useRef(null),Q=p({row:P,rowIdAccessor:A}),Z=F&&F[W],ee=!!Z&&function(e,n){if(!n)return!1;var t=e[n];return v(t)}(P,Z),ne=!D.has(String(Q)),oe=j({rowIndex:f,colIndex:i,rowId:Q}),ie=E({rowIndex:f,colIndex:i,rowId:Q}),ae=V({draggedHeaderRef:x,headers:S,hoveredHeaderRef:R,onTableHeaderDragEnd:N}).handleDragOver,se=O(),le=l({accessor:a.accessor,rowId:Q}),ce=u({rowId:Q,accessor:a.accessor});n.useEffect(function(){if(m){var e="".concat(Q,"-").concat(a.accessor);return m.set(e,{updateContent:function(e){z!==e?(Y(e),w&&($(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(function(){$(!1)},800))):Y(e)}}),function(){m.delete(e),_.current&&clearTimeout(_.current)}}},[m,w,Q,a.accessor,z]),n.useEffect(function(){if(X){var e=setTimeout(function(){$(!1)},850);return function(){return clearTimeout(e)}}},[X]),n.useEffect(function(){Y(P[a.accessor])},[P,a.accessor]);var ue="boolean"===a.type||"date"===a.type||"enum"===a.type,de=Boolean(null==a?void 0:a.isEditable),fe="st-cell ".concat(W>0&&a.expandable?"st-cell-depth-".concat(W):""," ").concat(s?c?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(de?"clickable":""," ").concat(X?c?"st-cell-updating-first":"st-cell-updating":""," ").concat(oe?c?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ie?c?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(B?d%2==0?"even-column":"odd-column":""),he=n.useCallback(function(e){Y(e),P[a.accessor]=e,null==k||k({accessor:a.accessor,newValue:e,row:P,rowIndex:f})},[a.accessor,k,P,f]),ve=n.useCallback(function(){M(function(e){var n=new Set(e),t=String(Q);return n.has(t)?n.delete(t):n.add(t),n})},[Q,M]);return U&&!ue?e.jsx("div",o({className:"st-cell-editing",id:l({accessor:a.accessor,rowId:Q}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(L,{enumOptions:a.enumOptions,onChange:he,setIsEditing:K,type:a.type,value:z})})):e.jsxs(te,o({className:fe,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":Q,"data-row-index":f,id:le,onDoubleClick:function(){return a.isEditable&&K(!0)},onDragOver:function(e){return se({callback:ae,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){U||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||U||(e.preventDefault(),K(!0))},onMouseDown:function(){U||C({rowIndex:f,colIndex:i,rowId:Q})},onMouseOver:function(){U||I({rowIndex:f,colIndex:i,rowId:Q})},parentRef:H,tableRow:h},{children:[a.expandable&&ee?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(ne?"expanded":"collapsed"),onClick:ve},{children:b})):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:a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:P,theme:T}):re({content:z,header:a})})})),U&&ue&&e.jsx(L,{enumOptions:a.enumOptions,onChange:he,setIsEditing:K,type:a.type,value:z})]}),ce)},ie=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,u=n.tableRow,d=y().rowIdAccessor,f=o.filter(function(e){return c({header:e,pinned:i})});return e.jsx(e.Fragment,{children:f.map(function(n,c){var f=p({row:u.row,rowIdAccessor:d}),h=l({accessor:n.accessor,rowId:f});return e.jsx(ae,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:u},h)})})},ae=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,u=t.rowIndex,d=t.rowIndices,f=t.tableRow,h=r[o.accessor],v=y(),g=v.getBorderClass,m=v.isSelected,w=v.isInitialFocusedCell,x=v.rowIdAccessor,b=p({row:f.row,rowIdAccessor:x});if(o.children){var C=o.children.filter(function(e){return c({header:e,pinned:s})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=l({accessor:n.accessor,rowId:b});return e.jsx(ae,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:u,rowIndices:d,tableRow:f},t)})})}var I={rowIndex:u,colIndex:h,rowId:b},S=g(I),R=m(I),j=w(I),E=l({accessor:o.accessor,rowId:b});return e.jsx(oe,{borderClass:S,colIndex:h,header:o,isHighlighted:R,isInitialFocused:j,nestedIndex:a,rowIndex:u,tableRow:f},E)},se=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=y(),g=v.useHoverRowBackground,m=v.rowIdAccessor,w=v.isAnimating,x=h.position,b=x%2==0,C=p({row:h.row,rowIdAccessor:m});return e.jsx("div",o({className:"st-row ".concat(b?"even":"odd"," ").concat(s===l&&g?"hovered":""),onMouseEnter:function(){w||f(l)},style:{gridTemplateColumns:i,top:j({position:x,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(ie,{columnIndexStart:r,columnIndices:t,headers:a,pinned:c,rowIndex:x,rowIndices:d,tableRow:h},C)}))},le=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:R({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},ce=n.createContext(void 0),ue=["default"],de=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(ce);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,ue),function(){t.current&&a(t.current,ue)}},[t,i,a]),n.cloneElement(r,{ref:function(e){t.current=e}})},fe=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})})},he=function(t){var r=t.columnIndexStart,i=t.columnIndices,a=t.headers,s=t.hoveredIndex,l=t.pinned,c=t.ref,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,h=t.templateColumns,v=t.totalHeight,g=t.rowsToRender,m=t.width,w=l?"st-body-pinned-".concat(l):"st-body-main",x=y().rowIdAccessor;return n.useMemo(function(){return q(a,l)},[a,l])?e.jsx(fe,o({condition:!l,wrapper:function(n){return e.jsx(de,o({childRef:c},{children:n}))}},{children:e.jsx("div",o({className:w,ref:c,style:o({position:"relative",height:"".concat(v,"px"),width:m},!l&&{flexGrow:1})},{children:g.map(function(t,o){var c=p({row:t.row,rowIdAccessor:x});return e.jsxs(n.Fragment,{children:[0!==o&&e.jsx(le,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:h,rowIndex:o-1}),e.jsx(se,{columnIndexStart:r,columnIndices:i,gridTemplateColumns:h,headers:a,hoveredIndex:s,index:o,pinned:l,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:t},c)]},c)})}))})):null};function ve(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return c({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&c({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}var pe=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=y(),g=v.headerContainerRef,m=v.headers,w=v.isAnimating,x=v.mainBodyRef,b=v.onLoadMore,C=v.rowHeight,I=v.rowIdAccessor,S=v.scrollbarWidth,R=v.setIsScrolling,j=v.shouldPaginate,E=v.tableBodyContainerRef,k=n.useState(null),N=k[0],F=k[1],A=n.useState(!1),M=A[0],H=A[1];n.useEffect(function(){w&&null!==N&&F(null)},[w,N]),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:g,mainSectionRef:E,scrollbarWidth:S}),n.useEffect(function(){return function(){D.current&&clearTimeout(D.current)}},[]);var T=n.useRef(null),D=n.useRef(null),L=n.useRef(0),B=function(e){return e.length}(h),O=B*(C+1)-1,W=n.useMemo(function(){return ve({headers:m,pinnedLeftColumns:i,pinnedRightColumns:l})},[m,i,l]),P=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(p({row:n.row,rowIdAccessor:I}));e[r]=t}),e},[d,I]),q=n.useCallback(function(e,n){if(b&&!j&&!M){e.scrollHeight-(n+e.clientHeight)<=200&&n>L.current&&(H(!0),b(),setTimeout(function(){H(!1)},1e3))}},[b,j,M]),z={columnIndices:W,headerContainerRef:g,headers:m,hoveredIndex:N,rowHeight:C,rowIndices:P,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;R(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(function(){R(!1)},150),T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(function(){f(t),q(n,t),L.current=t})},ref:E},{children:[e.jsx(he,o({},z,{pinned:"left",templateColumns:a,totalHeight:O,width:s})),e.jsx(he,o({},z,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:O})),e.jsx(he,o({},z,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:O,width:u}))]}))},ge=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,ge(e.children)),n})},me=function(e){return void 0===e&&(e=0),e?e+1:0},we=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.setIsResizing,c=e.startWidth;n.preventDefault();var u="clientX"in n?n.clientX:n.touches[0].clientX,v="touches"in n;if(o&&!o.hide){l(!0);var p=h(o),g=t-r>1,m=g?d(o):[o],w=function(e){var n="right"===o.pinned?u-e:e-u;if(g&&m.length>1)xe({delta:n,leafHeaders:m,minWidth:p,startWidth:c});else{var t=Math.max(c+n,p);o.width=t}i.forEach(function(e){f(e)});var r=s([],i,!0);a(r)};if(v){var x=function(e){var n=e.touches[0];w(n.clientX)},y=function(){document.removeEventListener("touchmove",x),document.removeEventListener("touchend",y),l(!1)};document.addEventListener("touchmove",x),document.addEventListener("touchend",y)}else{var b=function(e){w(e.clientX)},C=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C),l(!1)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",C)}}},xe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=t.reduce(function(e,n){return Math.min(e,h(n))},40),a=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),s=Math.max(o+n,i)-a;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=s*(n/a),o=Math.max(n+t,r);e.width=o})},ye=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=d(e).reduce(function(e,n){return e+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(l({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:me(t),rightWidth:me(r),mainWidth:o}},be=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"})}))},Ce={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"},Ie=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"]}},Se=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Re=function(e){return["between","notBetween","in","notIn"].includes(e)},je=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ee=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},ke=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"})}))},Ne=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],g=n.useState(-1),m=g[0],w=g[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(),m>=0&&(i(a[m].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,m,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(ke,{})]})),e.jsx(E,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===m?"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}),n.value)})}))}))]}))},Fe=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:Ce[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Ne,{value:t,onChange:function(e){r(e)},options:i})}))},Ae=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()})},Me=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}))},He=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"}))]}))},Te=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=Ie("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},Se(c)&&{value:f});a(e)},g=je(c)||f.trim();return e.jsxs(Ee,{children:[e.jsx(Fe,{value:c,onChange:u,operators:v}),Se(c)&&e.jsx(Me,{children:e.jsx(Ae,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(He,{onApply:p,onClear:s,canApply:!!g,showClear:!!i})]})},De=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])||"")),g=p[0],m=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=Ie("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),m(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(""),m(""),y(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};Se(u)?e.value=parseFloat(h):Re(u)&&(e.values=[parseFloat(g.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(Ee,{children:[e.jsx(Fe,{value:u,onChange:d,operators:b}),Se(u)&&e.jsx(Me,{children:e.jsx(Ae,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Re(u)&&e.jsxs(Me,{children:[e.jsx(Ae,{type:"number",value:g,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(Ae,{type:"number",value:x,onChange:y,placeholder:"To...",onEnterPress:C})]}),e.jsx(He,{onApply:C,onClear:l,canApply:!!je(u)||(Se(u)?""!==h.trim():!!Re(u)&&""!==String(g).trim()&&""!==String(x).trim()),showClear:!!a})]})},Le=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(Ne,{value:t,onChange:r,options:o,className:a,placeholder:s})},Be=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=Ie("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=je(l)||""!==d;return e.jsxs(Ee,{children:[e.jsx(Fe,{value:l,onChange:c,operators:h}),Se(l)&&e.jsx(Me,{children:e.jsx(Le,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(He,{onApply:function(){var e={accessor:r.accessor,operator:l};Se(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},Oe=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],g=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),m=g[0],w=g[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=Ie("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 I=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 g=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(E,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(M,{value:g,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(Ee,{children:[e.jsx(Fe,{value:d,onChange:f,operators:C}),Se(d)&&e.jsx(Me,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Re(d)&&e.jsxs(Me,{children:[e.jsx(I,{value:m,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:y,onChange:b,placeholder:"To date..."})]}),e.jsx(He,{onApply:function(){var e={accessor:a.accessor,operator:d};Se(d)?e.value=v:Re(d)&&(e.values=[m,y]),l(e)},onClear:c,canApply:!!je(d)||(Se(d)?""!==v.trim():!!Re(d)&&""!==m.trim()&&""!==y.trim()),showClear:!!s})]})},We=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"})}))},Pe=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(We,{className:"st-checkbox-checkmark"})})),i]}))},qe=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];n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var v=f.length===u.length;return e.jsxs(Ee,{children:[e.jsx(Me,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(Pe,o({checked:v,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),c.map(function(n){return e.jsx(Pe,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}))}),n.value)})]}))}),e.jsx(He,{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})]})},ze=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(De,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Be,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Oe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Te,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Ye=function(t){var r,i,a=t.colIndex,c=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,f=t.gridRowStart,h=t.header,v=t.reverse,p=t.sort,g=n.useState(!1),m=g[0],w=g[1],x=y(),b=x.columnReordering,C=x.columnResizing,I=x.draggedHeaderRef,S=x.filters,R=x.handleApplyFilter,j=x.handleClearFilter,k=x.headers,N=x.hoveredHeaderRef,F=x.onColumnOrderChange,A=x.onSort,M=x.onTableHeaderDragEnd,H=x.rowHeight,T=x.selectColumns,D=x.selectableColumns,L=x.setHeaders,B=x.setInitialFocusedCell,W=x.setIsResizing,P=x.setSelectedCells,q=x.setSelectedColumns,z=x.sortDownIcon,Y=x.sortUpIcon,G=Boolean(null==h?void 0:h.isSortable),U=Boolean(null==h?void 0:h.filterable),K=S[h.accessor],J="st-header-cell ".concat(h.accessor===(null===(r=N.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=I.current)||void 0===i?void 0:i.accessor)===h.accessor?"st-dragging":""," ").concat(G?"clickable":""," ").concat(b&&!G?"columnReordering":""," ").concat(h.children?"parent":""),X=V({draggedHeaderRef:I,headers:k,hoveredHeaderRef:N,onColumnOrderChange:F,onTableHeaderDragEnd:M}),$=X.handleDragStart,_=X.handleDragEnd,Q=X.handleDragOver,Z=O(),ee=function(e){var n=e.event,t=e.header;if(D){var r=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}(t,a);return n.shiftKey&&T?q(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))}):T&&T(r),P(new Set),void B(null)}t.isSortable&&A(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)}},[]),!h)return null;var ne=C&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Z({callback:we,callbackProps:{event:e.nativeEvent,gridColumnEnd:c,gridColumnStart:u,header:h,headers:k,setHeaders:L,setIsResizing:W,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Z({callback:we,callbackProps:{event:e,gridColumnEnd:c,gridColumnStart:u,header:h,headers:k,setHeaders:L,setIsResizing:W,startWidth:t},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),re=p&&p.key.accessor===h.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return ee({event:e,header:h})}},{children:["ascending"===p.direction&&Y&&Y,"descending"===p.direction&&z&&z]})),oe=U&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),w(!m)}},{children:[e.jsx(be,{className:"st-header-icon",style:{fill:K?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(E,o({open:m,overflow:"visible",setOpen:w,onClose:function(){return w(!1)}},{children:e.jsx(ze,{header:h,currentFilter:K,onApplyFilter:function(e){R(e),w(!1)},onClearFilter:function(){j(h.accessor),w(!1)}})}))]}));return e.jsxs(te,o({className:J,id:l({accessor:h.accessor,rowId:"header"}),onDragOver:function(e){Z({callback:Q,callbackProps:{event:e,hoveredHeader:h},limit:50})},style:o(o({gridRowStart:f,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:c},c-u>1?{}:{width:h.width}),d-f>1?{}:{height:H})},{children:[v&&ne,"right"===h.align&&oe,"right"===h.align&&re,e.jsx("div",o({className:"st-header-label",draggable:b&&!h.disableReorder,onClick:function(e){return ee({event:e,header:h})},onDragEnd:function(e){e.preventDefault(),_()},onDragStart:function(e){b&&h&&function(e){$(e)}(h)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:h.headerRenderer?h.headerRenderer({accessor:h.accessor,colIndex:a,header:h}):null==h?void 0:h.label}))})),"right"!==h.align&&re,"right"!==h.align&&oe,!v&&ne]}))},Ge=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,u=t.pinned,d=t.sectionRef,f=t.sort,h=t.width,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var s,d;if(void 0===a&&(a=!1),!c({header:o,pinned:u}))return 0;a||n++;var f=null!==(d=null===(s=o.children)||void 0===s?void 0:s.filter(function(e){return c({header:e,pinned:u})}).length)&&void 0!==d?d:0,h=n,v=f>0?h+f:h+1,p=i,g=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:v,gridRowStart:p,gridRowEnd:g,colIndex:r[o.accessor]}),o.children){var m=!0;o.children.forEach(function(e){c({header:e,pinned:u})&&(t(e,i+1,m),m=!1)})}return v-h},o=s.filter(function(e){return c({header:e,pinned:u})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,u,r]);return e.jsx(fe,o({condition:!u,wrapper:function(n){return e.jsx(de,o({childRef:d},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},a&&{onScroll:a},{ref:d,style:{gridTemplateColumns:i,display:"grid",position:"relative",width:h}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(Ye,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===u,sort:f},n.header.accessor)})})}))}))},Ue=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ue)):1},Ke=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,s=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,h=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=y(),g=p.headerContainerRef,m=p.pinnedLeftRef,w=p.pinnedRightRef,x=n.useMemo(function(){return ve({headers:i,pinnedLeftColumns:s,pinnedRightColumns:u})},[i,s,u]),b=n.useMemo(function(){var e=0;return i.forEach(function(n){if(c({header:n})){var t=Ue(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:g},{children:[q(i,"left")&&e.jsx(Ge,{columnIndices:x,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:b,pinned:"left",sectionRef:m,sort:f,width:h}),e.jsx(Ge,{columnIndices:x,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:b,sectionRef:r,sort:f}),q(i,"right")&&e.jsx(Ge,{columnIndices:x,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:b,pinned:"right",sectionRef:w,sort:f,width:v})]}))},Ve=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.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(" "))},Je=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=y(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=n.useRef(null),p=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),m=h.filter(function(e){return"right"===e.pinned}),w=n.useMemo(function(){return Ve({headers:g})},[g]),x=n.useMemo(function(){return Ve({headers:p})},[p]),b=n.useMemo(function(){return Ve({headers:m})},[m]),C={centerHeaderRef:v,headers:h,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedRightColumns:m,pinnedRightTemplateColumns:b,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},I={tableRows:l,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedLeftWidth:r,pinnedRightColumns:m,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(Ke,o({},C)),e.jsx(pe,o({},I))]}))},Xe=function(t){var r,i,a=t.mainBodyWidth,s=t.mainBodyRef,l=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=y().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),g=u.current&&u.current.scrollHeight>u.current.clientHeight,m=d?28:0,w=(d?c+1:c)+(u.current&&g?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(de,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}}),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},$e={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 $e.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?$e.string(e,n,t):"number"==typeof e&&"number"==typeof n?$e.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?$e.boolean(e,n,t):$e.string(String(e),String(n),t)}},_e=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 $e.number(i,a,r)}return"date"===t?$e.date(String(e),String(n),r):"boolean"===t?$e.boolean(Boolean(e),Boolean(n),r):"enum"===t?$e.enum(String(e),String(n),r):$e.string(String(e),String(n),r)}(e[r],n[r],a,l)})},Qe=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return _e({rows:t,sortColumn:r,headers:n})},Ze=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}):Qe({headers:i,rows:t,sortColumn:r}):t},en=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(en([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},nn=function(e){return e.every(function(e){return e.hide})},tn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(tn(e.children),nn(e.children)&&(e.hide=!0))})},rn=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=y(),p=v.expandIcon,g=v.headers,m=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,b=null!=u?u:c.hide||x&&c.children&&nn(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(Pe,o({checked:b,onChange:function(e){(c.hide=e,e)?tn(r):(en(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,en(r,c.children[0].accessor)));m(s([],g,!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(rn,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!b||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},on=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 e.jsx(rn,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},an=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(on,{headers:s,open:d,position:c})]})):null},sn=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"})}))},ln=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"})}))},cn=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(ce.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},un=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Ce[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)},dn=function(){var n=y(),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:un(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)})}))}))}))},fn=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 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=fn(h),g=fn(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 fn(new Date(String(e||"")))}),w=m[0],x=m[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var y=o.map(function(e){return fn(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 I=String(e),S=o.includes(I);return"in"===t?S:!S}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},vn=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 ge(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&&v(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=pn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},pn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&v(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}},gn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,c=t.cellUpdateFlash,f=void 0!==c&&c,h=t.columnEditorPosition,w=void 0===h?"right":h,y=t.columnEditorText,R=void 0===y?"Columns":y,j=t.columnReordering,E=void 0!==j&&j,k=t.columnResizing,N=void 0!==k&&k,F=t.defaultHeaders,A=t.editColumns,M=void 0!==A&&A,H=t.editColumnsInitOpen,T=void 0!==H&&H,D=t.expandAll,L=void 0===D||D,B=t.expandIcon,O=void 0===B?e.jsx(I,{className:"st-expand-icon"}):B,P=t.externalFilterHandling,q=void 0!==P&&P,z=t.externalSortHandling,Y=void 0!==z&&z,G=t.height,U=t.hideFooter,K=void 0!==U&&U,V=t.nextIcon,J=void 0===V?e.jsx(I,{className:"st-next-prev-icon"}):V,X=t.onCellEdit,_=t.onColumnOrderChange,Q=t.onFilterChange,Z=t.onGridReady,ee=t.onLoadMore,ne=t.onNextPage,te=t.onSortChange,re=t.prevIcon,oe=void 0===re?e.jsx(C,{className:"st-next-prev-icon"}):re,ie=t.rowGrouping,ae=t.rowHeight,se=void 0===ae?32:ae,le=t.rowIdAccessor,ce=t.rows,ue=t.rowsPerPage,de=void 0===ue?10:ue,fe=t.selectableCells,he=void 0!==fe&&fe,ve=t.selectableColumns,pe=void 0!==ve&&ve,ge=t.shouldPaginate,me=void 0!==ge&&ge,we=t.sortDownIcon,xe=void 0===we?e.jsx(sn,{className:"st-header-icon"}):we,be=t.sortUpIcon,Ce=void 0===be?e.jsx(ln,{className:"st-header-icon"}):be,Ie=t.tableRef,Se=t.theme,Re=void 0===Se?"light":Se,je=t.useHoverRowBackground,Ee=void 0===je||je,ke=t.useOddEvenRowBackground,Ne=void 0===ke||ke,Fe=t.useOddColumnBackground,Ae=void 0!==Fe&&Fe;Ae&&(Ne=!1);var Me=n.useReducer(function(e){return e+1},0)[1],He=n.useRef(null),Te=n.useRef(null),De=n.useRef(null),Le=n.useRef(null),Be=n.useRef(null),Oe=n.useRef(null),We=n.useRef(null),Pe=n.useState(1),qe=Pe[0],ze=Pe[1],Ye=n.useState(F),Ge=Ye[0],Ue=Ye[1],Ke=n.useState(!1),Ve=Ke[0],$e=Ke[1],_e=n.useState(!1),en=_e[0],nn=_e[1];n.useEffect(function(){Ue(F)},[F]);var tn=n.useState(0),rn=tn[0],on=tn[1],un=n.useState(new Set),fn=un[0],pn=un[1],gn=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:Oe}),mn=gn.scrollbarWidth,wn=gn.setScrollbarWidth,xn=n.useMemo(function(){var e=ye({headers:Ge});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Ge]),yn=xn.mainBodyWidth,bn=xn.pinnedLeftWidth,Cn=xn.pinnedRightWidth,In=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:G,rowHeight:se}),Sn=vn({rows:ce,headers:Ge,rowGrouping:ie}),Rn=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 hn({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 hn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:Sn,externalFilterHandling:q,onFilterChange:Q}),jn=Rn.filters,En=Rn.filteredRows,kn=Rn.updateFilter,Nn=Rn.clearFilter,Fn=Rn.clearAllFilters,An=Rn.computeFilteredRowsPreview,Mn=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=Qe({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(v(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 Ze({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]),p=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"},Ze({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:p}}({headers:Ge,tableRows:En,externalSortHandling:Y,onSortChange:te,rowGrouping:ie}),Hn=Mn.sort,Tn=Mn.sortedRows,Dn=Mn.updateSort,Ln=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,m=e.rowHeight,w=e.scrollTop,x=e.computeFilteredRowsPreview,y=e.computeSortedRowsPreview,b=n.useState(!1),C=b[0],I=b[1],R=n.useState([]),j=R[0],E=R[1],k=n.useRef([]),N=n.useRef([]),F=n.useRef(new Map),A=n.useRef(null),M=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?g({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===F.current.size){var e=M(i),n=new Map;e.forEach(function(e){var t=String(p({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),F.current=n}},[i,M,d]);var H=n.useMemo(function(){return M(r)},[r,M]),T=n.useMemo(function(){return S({bufferRowCount:5,contentHeight:v,tableRows:H,rowHeight:m,scrollTop:w})},[H,v,m,w]),D=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),L=n.useMemo(function(){if(0===k.current.length)return!1;var e=H.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))}),n=k.current.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[H,d]);n.useLayoutEffect(function(){if(!C){if(!t||c)return E([]),k.current=H,void(N.current=T);if(0===k.current.length)return E([]),k.current=H,void(N.current=T);if(!L)return E([]),k.current=H,void(N.current=T);A.current={tableRows:H,visibleRows:T},I(!0)}},[t,H,L,C,c,T]),n.useLayoutEffect(function(){if(C&&A.current&&j.length>0){var e=setTimeout(function(){var e=A.current;I(!1),E([]),k.current=e.tableRows,N.current=e.visibleRows,A.current=null},$.duration+100);return function(){return clearTimeout(e)}}},[C,j.length]);var B=n.useMemo(function(){if(!t||c)return T;if(j.length>0){var e=new Map;return H.forEach(function(n){var t=String(p({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),j.map(function(n){var t=String(p({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return T},[T,j,H,t,c,d]),O=n.useCallback(function(e){if(t&&!c){var n=x(e),r=M(n),o=S({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:m,scrollTop:w}),i=D(T,o).entering.map(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(p({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],T,!0),i,!0))}},[t,c,x,M,v,m,w,D,H,T,d]),W=n.useCallback(function(e){if(t&&!c){var n=y(e),r=M(n),o=S({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:m,scrollTop:w}),i=D(T,o).entering.map(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(p({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],T,!0),i,!0))}},[t,c,y,M,v,m,w,D,H,T,d]);return{currentTableRows:H,currentVisibleRows:T,isAnimating:C,prepareForFilterChange:O,prepareForSortChange:W,rowsToRender:B}}({allowAnimations:l,sortedRows:Tn,originalRows:Sn,currentPage:qe,rowsPerPage:de,shouldPaginate:me,rowGrouping:ie,rowIdAccessor:le,unexpandedRows:fn,expandAll:L,contentHeight:In,rowHeight:se,scrollTop:rn,computeFilteredRowsPreview:An,computeSortedRowsPreview:Mn.computeSortedRowsPreview}),Bn=Ln.currentTableRows,On=Ln.rowsToRender,Wn=Ln.prepareForFilterChange,Pn=Ln.prepareForSortChange,qn=Ln.isAnimating,zn=n.useRef(new Map),Yn=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=n.useState(new Set),f=u[0],h=u[1],v=n.useState(new Set),g=v[0],w=v[1],x=n.useState(null),y=x[0],b=x[1],C=n.useState(null),I=C[0],S=C[1],R=n.useState(new Set),j=R[0],E=R[1],k=n.useState(new Set),N=k[0],F=k[1],A=n.useRef(!1),M=n.useRef(null),H=n.useMemo(function(){return r.flatMap(d)},[r]),T=n.useCallback(function(){var e=H.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),E(new Set(f)),setTimeout(function(){E(new Set)},800))},[H,f,o]),D=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=H.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],g=t[h],w=p({row:v.row,rowIdAccessor:s});if(null==g?void 0:g.isEditable){var x=e;if("number"===g.type){var y=Number(e);isNaN(y)||(x=y)}else if("boolean"===g.type)x="true"===e.toLowerCase()||"1"===e;else if("date"===g.type){var b=new Date(e);isNaN(b.getTime())||(x=b)}if(v.row[g.accessor]=x,c){var C="".concat(w,"-").concat(g.accessor),I=c.get(C);I&&I.updateContent(x)}null==l||l({accessor:g.accessor,newValue:x,row:v.row,rowIndex:f});var S=m({colIndex:h,rowIndex:f,rowId:w});r.add(S)}else{var R=m({colIndex:h,rowIndex:f,rowId:w});i.add(R)}}})}),r.size>0&&(E(r),setTimeout(function(){E(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,H,o,s,l,c]),L=n.useCallback(function(){if(0!==f.size){var e=H.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=p({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 g="".concat(h,"-").concat(f.accessor),m=c.get(g);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&&(E(t),setTimeout(function(){E(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,H,o,s,l,c]),B=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=p({row:o[c].row,rowIdAccessor:s});t.add(m({colIndex:u,rowIndex:c,rowId:d}))}w(new Set),b(null),h(t)},[o,s,w,b,h]),O=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<H.length){var n=m(e);w(new Set),b(null),h(new Set([n])),S(e)}},[H.length,o.length,w,b,h,S]),W=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),S(null),w(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,S,w,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 D();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void L();if(p({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return p({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=p({row:o[r-1].row,rowIdAccessor:s});O({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=p({row:o[r+1].row,rowIdAccessor:s}),O({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=p({row:o[r].row,rowIdAccessor:s}),O({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<H.length-1&&(c=p({row:o[r].row,rowIdAccessor:s}),O({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),w(new Set),b(null),M.current=null,S(null))}else T()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[T,H.length,I,s,B,O,t,o,D,L]);var P=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=g.has(n);return i||a},[f,g]),q=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?p({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?p({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||!P(c)||g.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!P(u)||g.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),P(d)||i.push("st-selected-left-border"),P(f)||i.push("st-selected-right-border"),i.join(" ")},[P,o,g,s]),z=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]),Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return j.has(o)},[j]),G=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return N.has(o)},[N]);return{getBorderClass:q,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(){w(new Set),b(null);var e=m({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),S({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=p({row:o[d].row,rowIdAccessor:s});i.add(m({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){A.current=!1},isCopyFlashing:Y,isWarningFlashing:G,isInitialFocusedCell:z,isSelected:P,lastSelectedColumnIndex:y,pasteFromClipboard:D,selectColumns:W,selectedCells:f,selectedColumns:g,setInitialFocusedCell:S,setSelectedCells:h,setSelectedColumns:w,deleteSelectedCells:L}}({selectableCells:he,headers:Ge,tableRows:Bn,rowIdAccessor:le,onCellEdit:X,cellRegistry:zn.current}),Gn=Yn.getBorderClass,Un=Yn.handleMouseDown,Kn=Yn.handleMouseOver,Vn=Yn.handleMouseUp,Jn=Yn.isCopyFlashing,Xn=Yn.isInitialFocusedCell,$n=Yn.isSelected,_n=Yn.isWarningFlashing,Qn=Yn.selectColumns,Zn=Yn.selectedCells,et=Yn.selectedColumns,nt=Yn.setInitialFocusedCell,tt=Yn.setSelectedCells,rt=Yn.setSelectedColumns,ot=n.useCallback(function(e){Pn(e),setTimeout(function(){Dn(e)},0)},[Pn,Dn]),it=n.useCallback(function(e){Ue(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(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])}({selectableColumns:pe,selectedCells:Zn,selectedColumns:et,setSelectedCells:tt,setSelectedColumns:rt}),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:Me,tableBodyContainerRef:Oe,setScrollbarWidth:wn}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:Z}),function(e){var t=e.tableRef,r=e.rows,o=e.rowIdAccessor,i=e.cellRegistryRef;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=p({row:s,rowIdAccessor:o}),c=u({rowId:l,accessor:n}),d=i.current.get(c);d&&d.updateContent(a),void 0!==s[n]&&(s[n]=a)}}})},[i,r,o,t])}({cellRegistryRef:zn,rowIdAccessor:le,rows:ce,tableRef:Ie}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:jn,onFilterChange:Q}),function(e){var t=e.sort,r=e.onSortChange,o=W(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:Hn,onSortChange:te});var at=n.useCallback(function(e){Wn(e),setTimeout(function(){kn(e)},0)},[Wn,kn]);return e.jsx(x,o({value:{allowAnimations:l,cellRegistry:zn.current,cellUpdateFlash:f,columnReordering:E,columnResizing:N,draggedHeaderRef:He,editColumns:M,expandIcon:O,filters:jn,forceUpdate:Me,getBorderClass:Gn,handleApplyFilter:at,handleClearAllFilters:Fn,handleClearFilter:Nn,handleMouseDown:Un,handleMouseOver:Kn,headerContainerRef:We,headers:Ge,hoveredHeaderRef:Te,isAnimating:qn,isCopyFlashing:Jn,isInitialFocusedCell:Xn,isResizing:Ve,isScrolling:en,isSelected:$n,isWarningFlashing:_n,mainBodyRef:De,nextIcon:J,onCellEdit:X,onColumnOrderChange:_,onLoadMore:ee,onSort:ot,onTableHeaderDragEnd:it,pinnedLeftRef:Le,pinnedRightRef:Be,prevIcon:oe,rowGrouping:ie,rowHeight:se,rowIdAccessor:le,scrollbarWidth:mn,selectColumns:Qn,selectableColumns:pe,setHeaders:Ue,setInitialFocusedCell:nt,setIsResizing:$e,setIsScrolling:nn,setSelectedCells:tt,setSelectedColumns:rt,setUnexpandedRows:pn,shouldPaginate:me,sortDownIcon:xe,sortUpIcon:Ce,tableBodyContainerRef:Oe,tableRows:Bn,theme:Re,unexpandedRows:fn,useHoverRowBackground:Ee,useOddColumnBackground:Ae,useOddEvenRowBackground:Ne}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(Re),style:G?{height:G}:{}},{children:e.jsx(cn,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(dn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Vn,onMouseLeave:Vn},{children:[e.jsx(Je,{pinnedLeftWidth:bn,pinnedRightWidth:Cn,setScrollTop:on,sort:Hn,tableRows:Bn,rowsToRender:On}),e.jsx(an,{columnEditorText:R,editColumns:M,editColumnsInitOpen:T,headers:Ge,position:w})]})),e.jsx(Xe,{mainBodyRef:De,mainBodyWidth:yn,pinnedLeftWidth:bn,pinnedRightWidth:Cn,tableBodyContainerRef:Oe}),e.jsx(b,{currentPage:qe,hideFooter:K,onPageChange:ze,onNextPage:ne,shouldPaginate:me,totalPages:Math.ceil(Tn.length/de)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(gn,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){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},c=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},u=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},d=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return d(e)}):[e]},f=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(l({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){f(e)})},h=function(e){return"number"==typeof e.minWidth?e.minWidth:40},v=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},p=function(e){return e.row[e.rowIdAccessor]},g=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=p({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 g=String(c);if((o?!i.has(g):i.has(g))&&n<s.length){var m=function(e,n){var t=e[n];return v(t)?t:[]}(t,f);m.length>0&&(r=d(m,n+1,r))}}),r};return d(c,t),u},m=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},w=n.createContext(void 0),x=function(n){var t=n.children,r=n.value;return e.jsx(w.Provider,o({value:r},{children:t}))},y=function(){var e=n.useContext(w);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},b=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=y(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),g=p[0],m=p[1],w=!(r>1),x=!(r<d)&&!c||!g&&r===d;if(s||!u)return null;var b=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 m(!1),[2];t.label=2;case 2:return(n<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),b.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))})]}))},C=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"})}))},I=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"})}))},S=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)},R=function(e){return e.position*(e.rowHeight+1)-1},j=function(e){return e.position*(e.rowHeight+1)},E=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=y().mainBodyRef,p=n.useRef(null),g=n.useRef(null),m=n.useState("bottom-left"),w=m[0],x=m[1],b=n.useState({}),C=b[0],I=b[1],S=n.useState(!1),R=S[0],j=S[1];return n.useEffect(function(){a&&p.current?(j(!1),!g.current&&p.current.parentElement&&(g.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&g.current){var e,n=p.current,t=g.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)),I(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:R?"visible":"hidden"},C),{overflow:l})},{children:r})):null},k=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}))},N=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(E,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(k,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(k,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},F=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()}})},A=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()}})},M=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=y(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),g=p[0],m=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"===g&&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 m("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"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return m("years")}},{children:h.getFullYear()})),"years"===g&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(g,"-grid")},{children:["days"===g&&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)))},g=1;g<=i;g++)p(g);var m=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(g=1;g<=m;g++)x(g);return n}(),"months"===g&&(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)),m("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===g&&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)),m("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"}))}))]}))},H=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},T=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(E,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(M,{value:H(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},D=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(E,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(k,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)})}))}))},L=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(N,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(T,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(D,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(A,{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(F,{defaultValue:d,onBlur:c,onChange:o})},B=0,O=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===B||o-B>=r)&&(B=o,n(t))}},W=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},P=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(P);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=P(e[t]));return n},q=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},z=Date.now(),Y={screenX:0,screenY:0},G=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=G(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},U=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function K(e,n,t){var r,i,a=P(e),s=!1;try{var l=U(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 V=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=y().setHeaders,l=W(t);return{handleDragStart:function(e){n.current=e,z=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-Y.screenX,2)+Math.pow(u-Y.screenY,2));r.current=a;var f,h=n.current,v=!1;if(U(h)!==U(a)){f=(C=K(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,g=G(p,h.accessor),m=G(p,a.accessor);if(!g||!m)return;var w=g.length,x=m.length,y=m;if(w!==x){var b=x-w;b>0&&(y=m.slice(0,-b))}var C=function(e,n,t){var r=P(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,g,y);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var I=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(I-z<1500||d<40)||(z=I,Y={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)}}},J=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},X={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},$={duration:1e4,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},_={duration:150,easing:"ease-out",delay:0},Q=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")},Z=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(){Q(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ee=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]:J()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),J()?o(o({},_),e):o(o({},"column"===n?X:$),e)}(t,i?"column":"row"),Q(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,Z(n,l,t)]);case 1:return a.sent(),[2]}})})},ne=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,g,m,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,J()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),g=p.top,m=e-g,w=r-g,[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(m,"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)})])})})},te=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=y(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),g=W(f),m=W(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(!g||f)if(!m||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({},$),{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 I=5*h,S=y-I,R=y+b+I,j=l.y>S&&l.y<R,E=i.y>S&&i.y<R,k=i.y<y,N=i.y>y+b,F=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,A=.6*h,M=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 H=y+b+M(i.y,y,y+b)+F%15*A*2.5+F%7*(.4*h);return void ne({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){H=y-M(i.y,y,y+b)-F%15*A*2.5-F%7*(.4*h);return void ne({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>y+b){var T=y+b+M(l.y,y,y+b)+F%10*A*1;return void ne({element:v.current,options:{startY:T,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<y){T=y-M(l.y,y,y+b)-F%10*A*1;return void ne({element:v.current,options:{startY:T,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}ee({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,g,m,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};te.displayName="Animate";var re=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},oe=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,c=t.isInitialFocused,d=t.nestedIndex,f=t.rowIndex,h=t.tableRow,g=y(),m=g.cellRegistry,w=g.cellUpdateFlash,x=g.draggedHeaderRef,b=g.expandIcon,C=g.handleMouseDown,I=g.handleMouseOver,S=g.headers,R=g.hoveredHeaderRef,j=g.isCopyFlashing,E=g.isWarningFlashing,k=g.onCellEdit,N=g.onTableHeaderDragEnd,F=g.rowGrouping,A=g.rowIdAccessor,M=g.setUnexpandedRows,H=g.tableBodyContainerRef,T=g.theme,D=g.unexpandedRows,B=g.useOddColumnBackground,W=h.depth,P=h.row,q=n.useState(P[a.accessor]),z=q[0],Y=q[1],G=n.useState(!1),U=G[0],K=G[1],J=n.useState(!1),X=J[0],$=J[1],_=n.useRef(null),Q=p({row:P,rowIdAccessor:A}),Z=F&&F[W],ee=!!Z&&function(e,n){if(!n)return!1;var t=e[n];return v(t)}(P,Z),ne=!D.has(String(Q)),oe=j({rowIndex:f,colIndex:i,rowId:Q}),ie=E({rowIndex:f,colIndex:i,rowId:Q}),ae=V({draggedHeaderRef:x,headers:S,hoveredHeaderRef:R,onTableHeaderDragEnd:N}).handleDragOver,se=O(),le=l({accessor:a.accessor,rowId:Q}),ce=u({rowId:Q,accessor:a.accessor});n.useEffect(function(){if(m){var e="".concat(Q,"-").concat(a.accessor);return m.set(e,{updateContent:function(e){z!==e?(Y(e),w&&($(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(function(){$(!1)},800))):Y(e)}}),function(){m.delete(e),_.current&&clearTimeout(_.current)}}},[m,w,Q,a.accessor,z]),n.useEffect(function(){if(X){var e=setTimeout(function(){$(!1)},850);return function(){return clearTimeout(e)}}},[X]),n.useEffect(function(){Y(P[a.accessor])},[P,a.accessor]);var ue="boolean"===a.type||"date"===a.type||"enum"===a.type,de=Boolean(null==a?void 0:a.isEditable),fe="st-cell ".concat(W>0&&a.expandable?"st-cell-depth-".concat(W):""," ").concat(s?c?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(de?"clickable":""," ").concat(X?c?"st-cell-updating-first":"st-cell-updating":""," ").concat(oe?c?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ie?c?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(B?d%2==0?"even-column":"odd-column":""),he=n.useCallback(function(e){Y(e),P[a.accessor]=e,null==k||k({accessor:a.accessor,newValue:e,row:P,rowIndex:f})},[a.accessor,k,P,f]),ve=n.useCallback(function(){M(function(e){var n=new Set(e),t=String(Q);return n.has(t)?n.delete(t):n.add(t),n})},[Q,M]);return U&&!ue?e.jsx("div",o({className:"st-cell-editing",id:l({accessor:a.accessor,rowId:Q}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(L,{enumOptions:a.enumOptions,onChange:he,setIsEditing:K,type:a.type,value:z})})):e.jsxs(te,o({className:fe,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":Q,"data-row-index":f,id:le,onDoubleClick:function(){return a.isEditable&&K(!0)},onDragOver:function(e){return se({callback:ae,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){U||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||U||(e.preventDefault(),K(!0))},onMouseDown:function(){U||C({rowIndex:f,colIndex:i,rowId:Q})},onMouseOver:function(){U||I({rowIndex:f,colIndex:i,rowId:Q})},parentRef:H,tableRow:h},{children:[a.expandable&&ee?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(ne?"expanded":"collapsed"),onClick:ve},{children:b})):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:a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:P,theme:T}):re({content:z,header:a})})})),U&&ue&&e.jsx(L,{enumOptions:a.enumOptions,onChange:he,setIsEditing:K,type:a.type,value:z})]}),ce)},ie=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,u=n.tableRow,d=y().rowIdAccessor,f=o.filter(function(e){return c({header:e,pinned:i})});return e.jsx(e.Fragment,{children:f.map(function(n,c){var f=p({row:u.row,rowIdAccessor:d}),h=l({accessor:n.accessor,rowId:f});return e.jsx(ae,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:u},h)})})},ae=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,u=t.rowIndex,d=t.rowIndices,f=t.tableRow,h=r[o.accessor],v=y(),g=v.getBorderClass,m=v.isSelected,w=v.isInitialFocusedCell,x=v.rowIdAccessor,b=p({row:f.row,rowIdAccessor:x});if(o.children){var C=o.children.filter(function(e){return c({header:e,pinned:s})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=l({accessor:n.accessor,rowId:b});return e.jsx(ae,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:u,rowIndices:d,tableRow:f},t)})})}var I={rowIndex:u,colIndex:h,rowId:b},S=g(I),R=m(I),j=w(I),E=l({accessor:o.accessor,rowId:b});return e.jsx(oe,{borderClass:S,colIndex:h,header:o,isHighlighted:R,isInitialFocused:j,nestedIndex:a,rowIndex:u,tableRow:f},E)},se=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=y(),g=v.useHoverRowBackground,m=v.rowIdAccessor,w=v.isAnimating,x=h.position,b=x%2==0,C=p({row:h.row,rowIdAccessor:m});return e.jsx("div",o({className:"st-row ".concat(b?"even":"odd"," ").concat(s===l&&g?"hovered":""),onMouseEnter:function(){w||f(l)},style:{gridTemplateColumns:i,top:j({position:x,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(ie,{columnIndexStart:r,columnIndices:t,headers:a,pinned:c,rowIndex:x,rowIndices:d,tableRow:h},C)}))},le=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:R({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},ce=n.createContext(void 0),ue=["default"],de=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(ce);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,ue),function(){t.current&&a(t.current,ue)}},[t,i,a]),n.cloneElement(r,{ref:function(e){t.current=e}})},fe=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})})},he=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,g=t.rowsToRender,m=t.width,w=c?"st-body-pinned-".concat(c):"st-body-main",x=y().rowIdAccessor,b=n.useRef(null);return n.useImperativeHandle(r,function(){return b.current},[]),n.useMemo(function(){return q(s,c)},[s,c])?e.jsx(fe,o({condition:!c,wrapper:function(n){return e.jsx(de,o({childRef:b},{children:n}))}},{children:e.jsx("div",o({className:w,ref:b,style:o({position:"relative",height:"".concat(v,"px"),width:m},!c&&{flexGrow:1})},{children:g.map(function(t,r){var o=p({row:t.row,rowIdAccessor:x});return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(le,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:h,rowIndex:r-1}),e.jsx(se,{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 ve(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return c({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&c({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}he.displayName="TableSection";var pe=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=y(),g=v.headerContainerRef,m=v.headers,w=v.isAnimating,x=v.mainBodyRef,b=v.onLoadMore,C=v.rowHeight,I=v.rowIdAccessor,S=v.scrollbarWidth,R=v.setIsScrolling,j=v.shouldPaginate,E=v.tableBodyContainerRef,k=n.useState(null),N=k[0],F=k[1],A=n.useState(!1),M=A[0],H=A[1];n.useEffect(function(){w&&null!==N&&F(null)},[w,N]),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:g,mainSectionRef:E,scrollbarWidth:S}),n.useEffect(function(){return function(){D.current&&clearTimeout(D.current)}},[]);var T=n.useRef(null),D=n.useRef(null),L=n.useRef(0),B=function(e){return e.length}(h),O=B*(C+1)-1,W=n.useMemo(function(){return ve({headers:m,pinnedLeftColumns:i,pinnedRightColumns:l})},[m,i,l]),P=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(p({row:n.row,rowIdAccessor:I}));e[r]=t}),e},[d,I]),q=n.useCallback(function(e,n){if(b&&!j&&!M){e.scrollHeight-(n+e.clientHeight)<=200&&n>L.current&&(H(!0),b(),setTimeout(function(){H(!1)},1e3))}},[b,j,M]),z={columnIndices:W,headerContainerRef:g,headers:m,hoveredIndex:N,rowHeight:C,rowIndices:P,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;R(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(function(){R(!1)},150),T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(function(){f(t),q(n,t),L.current=t})},ref:E},{children:[e.jsx(he,o({},z,{pinned:"left",templateColumns:a,totalHeight:O,width:s})),e.jsx(he,o({},z,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:O})),e.jsx(he,o({},z,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:O,width:u}))]}))},ge=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,ge(e.children)),n})},me=function(e){return void 0===e&&(e=0),e?e+1:0},we=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.setIsResizing,c=e.startWidth;n.preventDefault();var u="clientX"in n?n.clientX:n.touches[0].clientX,v="touches"in n;if(o&&!o.hide){l(!0);var p=h(o),g=t-r>1,m=g?d(o):[o],w=function(e){var n="right"===o.pinned?u-e:e-u;if(g&&m.length>1)xe({delta:n,leafHeaders:m,minWidth:p,startWidth:c});else{var t=Math.max(c+n,p);o.width=t}i.forEach(function(e){f(e)});var r=s([],i,!0);a(r)};if(v){var x=function(e){var n=e.touches[0];w(n.clientX)},y=function(){document.removeEventListener("touchmove",x),document.removeEventListener("touchend",y),l(!1)};document.addEventListener("touchmove",x),document.addEventListener("touchend",y)}else{var b=function(e){w(e.clientX)},C=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C),l(!1)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",C)}}},xe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=t.reduce(function(e,n){return Math.min(e,h(n))},40),a=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),s=Math.max(o+n,i)-a;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=s*(n/a),o=Math.max(n+t,r);e.width=o})},ye=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=d(e).reduce(function(e,n){return e+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(l({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:me(t),rightWidth:me(r),mainWidth:o}},be=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"})}))},Ce={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"},Ie=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"]}},Se=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Re=function(e){return["between","notBetween","in","notIn"].includes(e)},je=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ee=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},ke=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"})}))},Ne=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],g=n.useState(-1),m=g[0],w=g[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(),m>=0&&(i(a[m].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,m,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(ke,{})]})),e.jsx(E,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===m?"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}),n.value)})}))}))]}))},Fe=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:Ce[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Ne,{value:t,onChange:function(e){r(e)},options:i})}))},Ae=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()})},Me=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}))},He=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"}))]}))},Te=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=Ie("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},Se(c)&&{value:f});a(e)},g=je(c)||f.trim();return e.jsxs(Ee,{children:[e.jsx(Fe,{value:c,onChange:u,operators:v}),Se(c)&&e.jsx(Me,{children:e.jsx(Ae,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(He,{onApply:p,onClear:s,canApply:!!g,showClear:!!i})]})},De=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])||"")),g=p[0],m=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=Ie("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),m(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(""),m(""),y(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};Se(u)?e.value=parseFloat(h):Re(u)&&(e.values=[parseFloat(g.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(Ee,{children:[e.jsx(Fe,{value:u,onChange:d,operators:b}),Se(u)&&e.jsx(Me,{children:e.jsx(Ae,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Re(u)&&e.jsxs(Me,{children:[e.jsx(Ae,{type:"number",value:g,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(Ae,{type:"number",value:x,onChange:y,placeholder:"To...",onEnterPress:C})]}),e.jsx(He,{onApply:C,onClear:l,canApply:!!je(u)||(Se(u)?""!==h.trim():!!Re(u)&&""!==String(g).trim()&&""!==String(x).trim()),showClear:!!a})]})},Le=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(Ne,{value:t,onChange:r,options:o,className:a,placeholder:s})},Be=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=Ie("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=je(l)||""!==d;return e.jsxs(Ee,{children:[e.jsx(Fe,{value:l,onChange:c,operators:h}),Se(l)&&e.jsx(Me,{children:e.jsx(Le,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(He,{onApply:function(){var e={accessor:r.accessor,operator:l};Se(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},Oe=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],g=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),m=g[0],w=g[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=Ie("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 I=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 g=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(E,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(M,{value:g,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(Ee,{children:[e.jsx(Fe,{value:d,onChange:f,operators:C}),Se(d)&&e.jsx(Me,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Re(d)&&e.jsxs(Me,{children:[e.jsx(I,{value:m,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:y,onChange:b,placeholder:"To date..."})]}),e.jsx(He,{onApply:function(){var e={accessor:a.accessor,operator:d};Se(d)?e.value=v:Re(d)&&(e.values=[m,y]),l(e)},onClear:c,canApply:!!je(d)||(Se(d)?""!==v.trim():!!Re(d)&&""!==m.trim()&&""!==y.trim()),showClear:!!s})]})},We=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"})}))},Pe=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(We,{className:"st-checkbox-checkmark"})})),i]}))},qe=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];n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var v=f.length===u.length;return e.jsxs(Ee,{children:[e.jsx(Me,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(Pe,o({checked:v,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),c.map(function(n){return e.jsx(Pe,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}))}),n.value)})]}))}),e.jsx(He,{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})]})},ze=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(De,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Be,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(Oe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Te,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Ye=function(t){var r,i,a=t.colIndex,c=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,f=t.gridRowStart,h=t.header,v=t.reverse,p=t.sort,g=n.useState(!1),m=g[0],w=g[1],x=y(),b=x.columnReordering,C=x.columnResizing,I=x.draggedHeaderRef,S=x.filters,R=x.handleApplyFilter,j=x.handleClearFilter,k=x.headers,N=x.hoveredHeaderRef,F=x.onColumnOrderChange,A=x.onSort,M=x.onTableHeaderDragEnd,H=x.rowHeight,T=x.selectColumns,D=x.selectableColumns,L=x.setHeaders,B=x.setInitialFocusedCell,W=x.setIsResizing,P=x.setSelectedCells,q=x.setSelectedColumns,z=x.sortDownIcon,Y=x.sortUpIcon,G=Boolean(null==h?void 0:h.isSortable),U=Boolean(null==h?void 0:h.filterable),K=S[h.accessor],J="st-header-cell ".concat(h.accessor===(null===(r=N.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=I.current)||void 0===i?void 0:i.accessor)===h.accessor?"st-dragging":""," ").concat(G?"clickable":""," ").concat(b&&!G?"columnReordering":""," ").concat(h.children?"parent":""),X=V({draggedHeaderRef:I,headers:k,hoveredHeaderRef:N,onColumnOrderChange:F,onTableHeaderDragEnd:M}),$=X.handleDragStart,_=X.handleDragEnd,Q=X.handleDragOver,Z=O(),ee=function(e){var n=e.event,t=e.header;if(D){var r=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}(t,a);return n.shiftKey&&T?q(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))}):T&&T(r),P(new Set),void B(null)}t.isSortable&&A(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)}},[]),!h)return null;var ne=C&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Z({callback:we,callbackProps:{event:e.nativeEvent,gridColumnEnd:c,gridColumnStart:u,header:h,headers:k,setHeaders:L,setIsResizing:W,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Z({callback:we,callbackProps:{event:e,gridColumnEnd:c,gridColumnStart:u,header:h,headers:k,setHeaders:L,setIsResizing:W,startWidth:t},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),re=p&&p.key.accessor===h.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return ee({event:e,header:h})}},{children:["ascending"===p.direction&&Y&&Y,"descending"===p.direction&&z&&z]})),oe=U&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),w(!m)}},{children:[e.jsx(be,{className:"st-header-icon",style:{fill:K?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(E,o({open:m,overflow:"visible",setOpen:w,onClose:function(){return w(!1)}},{children:e.jsx(ze,{header:h,currentFilter:K,onApplyFilter:function(e){R(e),w(!1)},onClearFilter:function(){j(h.accessor),w(!1)}})}))]}));return e.jsxs(te,o({className:J,id:l({accessor:h.accessor,rowId:"header"}),onDragOver:function(e){Z({callback:Q,callbackProps:{event:e,hoveredHeader:h},limit:50})},style:o(o({gridRowStart:f,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:c},c-u>1?{}:{width:h.width}),d-f>1?{}:{height:H})},{children:[v&&ne,"right"===h.align&&oe,"right"===h.align&&re,e.jsx("div",o({className:"st-header-label",draggable:b&&!h.disableReorder,onClick:function(e){return ee({event:e,header:h})},onDragEnd:function(e){e.preventDefault(),_()},onDragStart:function(e){b&&h&&function(e){$(e)}(h)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:h.headerRenderer?h.headerRenderer({accessor:h.accessor,colIndex:a,header:h}):null==h?void 0:h.label}))})),"right"!==h.align&&re,"right"!==h.align&&oe,!v&&ne]}))},Ge=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,u=t.pinned,d=t.sectionRef,f=t.sort,h=t.width,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var s,d;if(void 0===a&&(a=!1),!c({header:o,pinned:u}))return 0;a||n++;var f=null!==(d=null===(s=o.children)||void 0===s?void 0:s.filter(function(e){return c({header:e,pinned:u})}).length)&&void 0!==d?d:0,h=n,v=f>0?h+f:h+1,p=i,g=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:v,gridRowStart:p,gridRowEnd:g,colIndex:r[o.accessor]}),o.children){var m=!0;o.children.forEach(function(e){c({header:e,pinned:u})&&(t(e,i+1,m),m=!1)})}return v-h},o=s.filter(function(e){return c({header:e,pinned:u})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,u,r]);return e.jsx(fe,o({condition:!u,wrapper:function(n){return e.jsx(de,o({childRef:d},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},a&&{onScroll:a},{ref:d,style:{gridTemplateColumns:i,display:"grid",position:"relative",width:h}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(Ye,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===u,sort:f},n.header.accessor)})})}))}))},Ue=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ue)):1},Ke=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,s=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,h=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=y(),g=p.headerContainerRef,m=p.pinnedLeftRef,w=p.pinnedRightRef,x=n.useMemo(function(){return ve({headers:i,pinnedLeftColumns:s,pinnedRightColumns:u})},[i,s,u]),b=n.useMemo(function(){var e=0;return i.forEach(function(n){if(c({header:n})){var t=Ue(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:g},{children:[q(i,"left")&&e.jsx(Ge,{columnIndices:x,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:b,pinned:"left",sectionRef:m,sort:f,width:h}),e.jsx(Ge,{columnIndices:x,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:b,sectionRef:r,sort:f}),q(i,"right")&&e.jsx(Ge,{columnIndices:x,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:b,pinned:"right",sectionRef:w,sort:f,width:v})]}))},Ve=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.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(" "))},Je=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=y(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=n.useRef(null),p=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),m=h.filter(function(e){return"right"===e.pinned}),w=n.useMemo(function(){return Ve({headers:g})},[g]),x=n.useMemo(function(){return Ve({headers:p})},[p]),b=n.useMemo(function(){return Ve({headers:m})},[m]),C={centerHeaderRef:v,headers:h,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedRightColumns:m,pinnedRightTemplateColumns:b,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},I={tableRows:l,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedLeftWidth:r,pinnedRightColumns:m,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(Ke,o({},C)),e.jsx(pe,o({},I))]}))},Xe=function(t){var r,i,a=t.mainBodyWidth,s=t.mainBodyRef,l=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=y().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),g=u.current&&u.current.scrollHeight>u.current.clientHeight,m=d?28:0,w=(d?c+1:c)+(u.current&&g?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(de,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}}),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},$e={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 $e.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?$e.string(e,n,t):"number"==typeof e&&"number"==typeof n?$e.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?$e.boolean(e,n,t):$e.string(String(e),String(n),t)}},_e=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 $e.number(i,a,r)}return"date"===t?$e.date(String(e),String(n),r):"boolean"===t?$e.boolean(Boolean(e),Boolean(n),r):"enum"===t?$e.enum(String(e),String(n),r):$e.string(String(e),String(n),r)}(e[r],n[r],a,l)})},Qe=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return _e({rows:t,sortColumn:r,headers:n})},Ze=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}):Qe({headers:i,rows:t,sortColumn:r}):t},en=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(en([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},nn=function(e){return e.every(function(e){return e.hide})},tn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(tn(e.children),nn(e.children)&&(e.hide=!0))})},rn=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=y(),p=v.expandIcon,g=v.headers,m=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,b=null!=u?u:c.hide||x&&c.children&&nn(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(Pe,o({checked:b,onChange:function(e){(c.hide=e,e)?tn(r):(en(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,en(r,c.children[0].accessor)));m(s([],g,!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(rn,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!b||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},on=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 e.jsx(rn,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},an=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(on,{headers:s,open:d,position:c})]})):null},sn=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"})}))},ln=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"})}))},cn=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(ce.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},un=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Ce[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)},dn=function(){var n=y(),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:un(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)})}))}))}))},fn=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 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=fn(h),g=fn(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 fn(new Date(String(e||"")))}),w=m[0],x=m[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var y=o.map(function(e){return fn(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 I=String(e),S=o.includes(I);return"in"===t?S:!S}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},vn=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 ge(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&&v(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=pn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},pn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&v(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}},gn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,c=t.cellUpdateFlash,f=void 0!==c&&c,h=t.columnEditorPosition,w=void 0===h?"right":h,y=t.columnEditorText,R=void 0===y?"Columns":y,j=t.columnReordering,E=void 0!==j&&j,k=t.columnResizing,N=void 0!==k&&k,F=t.defaultHeaders,A=t.editColumns,M=void 0!==A&&A,H=t.editColumnsInitOpen,T=void 0!==H&&H,D=t.expandAll,L=void 0===D||D,B=t.expandIcon,O=void 0===B?e.jsx(I,{className:"st-expand-icon"}):B,P=t.externalFilterHandling,q=void 0!==P&&P,z=t.externalSortHandling,Y=void 0!==z&&z,G=t.height,U=t.hideFooter,K=void 0!==U&&U,V=t.nextIcon,J=void 0===V?e.jsx(I,{className:"st-next-prev-icon"}):V,X=t.onCellEdit,_=t.onColumnOrderChange,Q=t.onFilterChange,Z=t.onGridReady,ee=t.onLoadMore,ne=t.onNextPage,te=t.onSortChange,re=t.prevIcon,oe=void 0===re?e.jsx(C,{className:"st-next-prev-icon"}):re,ie=t.rowGrouping,ae=t.rowHeight,se=void 0===ae?32:ae,le=t.rowIdAccessor,ce=t.rows,ue=t.rowsPerPage,de=void 0===ue?10:ue,fe=t.selectableCells,he=void 0!==fe&&fe,ve=t.selectableColumns,pe=void 0!==ve&&ve,ge=t.shouldPaginate,me=void 0!==ge&&ge,we=t.sortDownIcon,xe=void 0===we?e.jsx(sn,{className:"st-header-icon"}):we,be=t.sortUpIcon,Ce=void 0===be?e.jsx(ln,{className:"st-header-icon"}):be,Ie=t.tableRef,Se=t.theme,Re=void 0===Se?"light":Se,je=t.useHoverRowBackground,Ee=void 0===je||je,ke=t.useOddEvenRowBackground,Ne=void 0===ke||ke,Fe=t.useOddColumnBackground,Ae=void 0!==Fe&&Fe;Ae&&(Ne=!1);var Me=n.useReducer(function(e){return e+1},0)[1],He=n.useRef(null),Te=n.useRef(null),De=n.useRef(null),Le=n.useRef(null),Be=n.useRef(null),Oe=n.useRef(null),We=n.useRef(null),Pe=n.useState(1),qe=Pe[0],ze=Pe[1],Ye=n.useState(F),Ge=Ye[0],Ue=Ye[1],Ke=n.useState(!1),Ve=Ke[0],$e=Ke[1],_e=n.useState(!1),en=_e[0],nn=_e[1];n.useEffect(function(){Ue(F)},[F]);var tn=n.useState(0),rn=tn[0],on=tn[1],un=n.useState(new Set),fn=un[0],pn=un[1],gn=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:Oe}),mn=gn.scrollbarWidth,wn=gn.setScrollbarWidth,xn=n.useMemo(function(){var e=ye({headers:Ge});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Ge]),yn=xn.mainBodyWidth,bn=xn.pinnedLeftWidth,Cn=xn.pinnedRightWidth,In=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:G,rowHeight:se}),Sn=vn({rows:ce,headers:Ge,rowGrouping:ie}),Rn=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 hn({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 hn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:Sn,externalFilterHandling:q,onFilterChange:Q}),jn=Rn.filters,En=Rn.filteredRows,kn=Rn.updateFilter,Nn=Rn.clearFilter,Fn=Rn.clearAllFilters,An=Rn.computeFilteredRowsPreview,Mn=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=Qe({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(v(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 Ze({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]),p=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"},Ze({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:p}}({headers:Ge,tableRows:En,externalSortHandling:Y,onSortChange:te,rowGrouping:ie}),Hn=Mn.sort,Tn=Mn.sortedRows,Dn=Mn.updateSort,Ln=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,m=e.rowHeight,w=e.scrollTop,x=e.computeFilteredRowsPreview,y=e.computeSortedRowsPreview,b=n.useState(!1),C=b[0],I=b[1],R=n.useState([]),j=R[0],E=R[1],k=n.useRef([]),N=n.useRef([]),F=n.useRef(new Map),A=n.useRef(null),M=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?g({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===F.current.size){var e=M(i),n=new Map;e.forEach(function(e){var t=String(p({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),F.current=n}},[i,M,d]);var H=n.useMemo(function(){return M(r)},[r,M]),T=n.useMemo(function(){return S({bufferRowCount:5,contentHeight:v,tableRows:H,rowHeight:m,scrollTop:w})},[H,v,m,w]),D=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),L=n.useMemo(function(){if(0===k.current.length)return!1;var e=H.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))}),n=k.current.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[H,d]);n.useLayoutEffect(function(){if(!C){if(!t||c)return E([]),k.current=H,void(N.current=T);if(0===k.current.length)return E([]),k.current=H,void(N.current=T);if(!L)return E([]),k.current=H,void(N.current=T);A.current={tableRows:H,visibleRows:T},I(!0)}},[t,H,L,C,c,T]),n.useLayoutEffect(function(){if(C&&A.current&&j.length>0){var e=setTimeout(function(){var e=A.current;I(!1),E([]),k.current=e.tableRows,N.current=e.visibleRows,A.current=null},$.duration+100);return function(){return clearTimeout(e)}}},[C,j.length]);var B=n.useMemo(function(){if(!t||c)return T;if(j.length>0){var e=new Map;return H.forEach(function(n){var t=String(p({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),j.map(function(n){var t=String(p({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return T},[T,j,H,t,c,d]),O=n.useCallback(function(e){if(t&&!c){var n=x(e),r=M(n),o=S({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:m,scrollTop:w}),i=D(T,o).entering.map(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(p({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],T,!0),i,!0))}},[t,c,x,M,v,m,w,D,H,T,d]),W=n.useCallback(function(e){if(t&&!c){var n=y(e),r=M(n),o=S({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:m,scrollTop:w}),i=D(T,o).entering.map(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(p({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],T,!0),i,!0))}},[t,c,y,M,v,m,w,D,H,T,d]);return{currentTableRows:H,currentVisibleRows:T,isAnimating:C,prepareForFilterChange:O,prepareForSortChange:W,rowsToRender:B}}({allowAnimations:l,sortedRows:Tn,originalRows:Sn,currentPage:qe,rowsPerPage:de,shouldPaginate:me,rowGrouping:ie,rowIdAccessor:le,unexpandedRows:fn,expandAll:L,contentHeight:In,rowHeight:se,scrollTop:rn,computeFilteredRowsPreview:An,computeSortedRowsPreview:Mn.computeSortedRowsPreview}),Bn=Ln.currentTableRows,On=Ln.rowsToRender,Wn=Ln.prepareForFilterChange,Pn=Ln.prepareForSortChange,qn=Ln.isAnimating,zn=n.useRef(new Map),Yn=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=n.useState(new Set),f=u[0],h=u[1],v=n.useState(new Set),g=v[0],w=v[1],x=n.useState(null),y=x[0],b=x[1],C=n.useState(null),I=C[0],S=C[1],R=n.useState(new Set),j=R[0],E=R[1],k=n.useState(new Set),N=k[0],F=k[1],A=n.useRef(!1),M=n.useRef(null),H=n.useMemo(function(){return r.flatMap(d)},[r]),T=n.useCallback(function(){var e=H.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),E(new Set(f)),setTimeout(function(){E(new Set)},800))},[H,f,o]),D=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=H.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],g=t[h],w=p({row:v.row,rowIdAccessor:s});if(null==g?void 0:g.isEditable){var x=e;if("number"===g.type){var y=Number(e);isNaN(y)||(x=y)}else if("boolean"===g.type)x="true"===e.toLowerCase()||"1"===e;else if("date"===g.type){var b=new Date(e);isNaN(b.getTime())||(x=b)}if(v.row[g.accessor]=x,c){var C="".concat(w,"-").concat(g.accessor),I=c.get(C);I&&I.updateContent(x)}null==l||l({accessor:g.accessor,newValue:x,row:v.row,rowIndex:f});var S=m({colIndex:h,rowIndex:f,rowId:w});r.add(S)}else{var R=m({colIndex:h,rowIndex:f,rowId:w});i.add(R)}}})}),r.size>0&&(E(r),setTimeout(function(){E(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,H,o,s,l,c]),L=n.useCallback(function(){if(0!==f.size){var e=H.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=p({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 g="".concat(h,"-").concat(f.accessor),m=c.get(g);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&&(E(t),setTimeout(function(){E(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,H,o,s,l,c]),B=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=p({row:o[c].row,rowIdAccessor:s});t.add(m({colIndex:u,rowIndex:c,rowId:d}))}w(new Set),b(null),h(t)},[o,s,w,b,h]),O=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<H.length){var n=m(e);w(new Set),b(null),h(new Set([n])),S(e)}},[H.length,o.length,w,b,h,S]),W=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),S(null),w(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,S,w,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 D();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void L();if(p({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return p({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=p({row:o[r-1].row,rowIdAccessor:s});O({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=p({row:o[r+1].row,rowIdAccessor:s}),O({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=p({row:o[r].row,rowIdAccessor:s}),O({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<H.length-1&&(c=p({row:o[r].row,rowIdAccessor:s}),O({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),w(new Set),b(null),M.current=null,S(null))}else T()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[T,H.length,I,s,B,O,t,o,D,L]);var P=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=g.has(n);return i||a},[f,g]),q=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?p({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?p({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||!P(c)||g.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!P(u)||g.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),P(d)||i.push("st-selected-left-border"),P(f)||i.push("st-selected-right-border"),i.join(" ")},[P,o,g,s]),z=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]),Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return j.has(o)},[j]),G=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return N.has(o)},[N]);return{getBorderClass:q,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(){w(new Set),b(null);var e=m({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),S({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=p({row:o[d].row,rowIdAccessor:s});i.add(m({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){A.current=!1},isCopyFlashing:Y,isWarningFlashing:G,isInitialFocusedCell:z,isSelected:P,lastSelectedColumnIndex:y,pasteFromClipboard:D,selectColumns:W,selectedCells:f,selectedColumns:g,setInitialFocusedCell:S,setSelectedCells:h,setSelectedColumns:w,deleteSelectedCells:L}}({selectableCells:he,headers:Ge,tableRows:Bn,rowIdAccessor:le,onCellEdit:X,cellRegistry:zn.current}),Gn=Yn.getBorderClass,Un=Yn.handleMouseDown,Kn=Yn.handleMouseOver,Vn=Yn.handleMouseUp,Jn=Yn.isCopyFlashing,Xn=Yn.isInitialFocusedCell,$n=Yn.isSelected,_n=Yn.isWarningFlashing,Qn=Yn.selectColumns,Zn=Yn.selectedCells,et=Yn.selectedColumns,nt=Yn.setInitialFocusedCell,tt=Yn.setSelectedCells,rt=Yn.setSelectedColumns,ot=n.useCallback(function(e){Pn(e),setTimeout(function(){Dn(e)},0)},[Pn,Dn]),it=n.useCallback(function(e){Ue(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(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])}({selectableColumns:pe,selectedCells:Zn,selectedColumns:et,setSelectedCells:tt,setSelectedColumns:rt}),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:Me,tableBodyContainerRef:Oe,setScrollbarWidth:wn}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:Z}),function(e){var t=e.tableRef,r=e.rows,o=e.rowIdAccessor,i=e.cellRegistryRef;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=p({row:s,rowIdAccessor:o}),c=u({rowId:l,accessor:n}),d=i.current.get(c);d&&d.updateContent(a),void 0!==s[n]&&(s[n]=a)}}})},[i,r,o,t])}({cellRegistryRef:zn,rowIdAccessor:le,rows:ce,tableRef:Ie}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:jn,onFilterChange:Q}),function(e){var t=e.sort,r=e.onSortChange,o=W(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:Hn,onSortChange:te});var at=n.useCallback(function(e){Wn(e),setTimeout(function(){kn(e)},0)},[Wn,kn]);return e.jsx(x,o({value:{allowAnimations:l,cellRegistry:zn.current,cellUpdateFlash:f,columnReordering:E,columnResizing:N,draggedHeaderRef:He,editColumns:M,expandIcon:O,filters:jn,forceUpdate:Me,getBorderClass:Gn,handleApplyFilter:at,handleClearAllFilters:Fn,handleClearFilter:Nn,handleMouseDown:Un,handleMouseOver:Kn,headerContainerRef:We,headers:Ge,hoveredHeaderRef:Te,isAnimating:qn,isCopyFlashing:Jn,isInitialFocusedCell:Xn,isResizing:Ve,isScrolling:en,isSelected:$n,isWarningFlashing:_n,mainBodyRef:De,nextIcon:J,onCellEdit:X,onColumnOrderChange:_,onLoadMore:ee,onSort:ot,onTableHeaderDragEnd:it,pinnedLeftRef:Le,pinnedRightRef:Be,prevIcon:oe,rowGrouping:ie,rowHeight:se,rowIdAccessor:le,scrollbarWidth:mn,selectColumns:Qn,selectableColumns:pe,setHeaders:Ue,setInitialFocusedCell:nt,setIsResizing:$e,setIsScrolling:nn,setSelectedCells:tt,setSelectedColumns:rt,setUnexpandedRows:pn,shouldPaginate:me,sortDownIcon:xe,sortUpIcon:Ce,tableBodyContainerRef:Oe,tableRows:Bn,theme:Re,unexpandedRows:fn,useHoverRowBackground:Ee,useOddColumnBackground:Ae,useOddEvenRowBackground:Ne}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(Re),style:G?{height:G}:{}},{children:e.jsx(cn,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(dn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Vn,onMouseLeave:Vn},{children:[e.jsx(Je,{pinnedLeftWidth:bn,pinnedRightWidth:Cn,setScrollTop:on,sort:Hn,tableRows:Bn,rowsToRender:On}),e.jsx(an,{columnEditorText:R,editColumns:M,editColumnsInitOpen:T,headers:Ge,position:w})]})),e.jsx(Xe,{mainBodyRef:De,mainBodyWidth:yn,pinnedLeftWidth:bn,pinnedRightWidth:Cn,tableBodyContainerRef:Oe}),e.jsx(b,{currentPage:qe,hideFooter:K,onPageChange:ze,onNextPage:ne,shouldPaginate:me,totalPages:Math.ceil(Tn.length/de)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(gn,o({},t)):null};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,9 @@
1
- import { RefObject } from "react";
1
+ import { MutableRefObject } from "react";
2
2
  import HeaderObject from "./HeaderObject";
3
3
  type useDragHandlerProps = {
4
- draggedHeaderRef: RefObject<HeaderObject | null>;
4
+ draggedHeaderRef: MutableRefObject<HeaderObject | null>;
5
5
  headers: HeaderObject[];
6
- hoveredHeaderRef: RefObject<HeaderObject | null>;
6
+ hoveredHeaderRef: MutableRefObject<HeaderObject | null>;
7
7
  onColumnOrderChange?: (newHeaders: HeaderObject[]) => void;
8
8
  onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
9
9
  };
@@ -9,8 +9,8 @@ export type HandleResizeStartProps = {
9
9
  headers: HeaderObject[];
10
10
  setHeaders: Dispatch<SetStateAction<HeaderObject[]>>;
11
11
  setIsResizing: Dispatch<SetStateAction<boolean>>;
12
- mainBodyRef: RefObject<HTMLDivElement | null>;
13
- pinnedLeftRef: RefObject<HTMLDivElement | null>;
14
- pinnedRightRef: RefObject<HTMLDivElement | null>;
12
+ mainBodyRef: RefObject<HTMLDivElement>;
13
+ pinnedLeftRef: RefObject<HTMLDivElement>;
14
+ pinnedRightRef: RefObject<HTMLDivElement>;
15
15
  startWidth: number;
16
16
  };
@@ -1,22 +1,22 @@
1
- import { RefObject } from "react";
1
+ import { RefObject, MutableRefObject } from "react";
2
2
  import HeaderObject from "./HeaderObject";
3
3
  interface SharedTableProps {
4
4
  allowAnimations: boolean;
5
- centerHeaderRef: RefObject<HTMLDivElement | null>;
6
- draggedHeaderRef: RefObject<HeaderObject | null>;
7
- headerContainerRef: RefObject<HTMLDivElement | null>;
5
+ centerHeaderRef: RefObject<HTMLDivElement>;
6
+ draggedHeaderRef: MutableRefObject<HeaderObject | null>;
7
+ headerContainerRef: RefObject<HTMLDivElement>;
8
8
  headers: HeaderObject[];
9
- hoveredHeaderRef: RefObject<HeaderObject | null>;
10
- mainBodyRef: RefObject<HTMLDivElement | null>;
9
+ hoveredHeaderRef: MutableRefObject<HeaderObject | null>;
10
+ mainBodyRef: RefObject<HTMLDivElement>;
11
11
  mainTemplateColumns: string;
12
12
  onTableHeaderDragEnd: (newHeaders: HeaderObject[]) => void;
13
13
  pinnedLeftColumns: HeaderObject[];
14
- pinnedLeftHeaderRef: RefObject<HTMLDivElement | null>;
14
+ pinnedLeftHeaderRef: RefObject<HTMLDivElement>;
15
15
  pinnedLeftTemplateColumns: string;
16
16
  pinnedRightColumns: HeaderObject[];
17
- pinnedRightHeaderRef: RefObject<HTMLDivElement | null>;
17
+ pinnedRightHeaderRef: RefObject<HTMLDivElement>;
18
18
  pinnedRightTemplateColumns: string;
19
19
  rowHeight: number;
20
- tableBodyContainerRef: RefObject<HTMLDivElement | null>;
20
+ tableBodyContainerRef: RefObject<HTMLDivElement>;
21
21
  }
22
22
  export default SharedTableProps;
@@ -0,0 +1,6 @@
1
+ import HeaderObject from "./HeaderObject";
2
+ type SortColumn = {
3
+ key: HeaderObject;
4
+ direction: "ascending" | "descending";
5
+ };
6
+ export default SortColumn;
@@ -1,8 +1,8 @@
1
1
  import { RefObject } from "react";
2
- import { SortColumn } from "./SortConfig";
2
+ import SortColumn from "./SortColumn";
3
3
  import HeaderObject from "./HeaderObject";
4
4
  type TableHeaderProps = {
5
- centerHeaderRef: RefObject<HTMLDivElement | null>;
5
+ centerHeaderRef: RefObject<HTMLDivElement>;
6
6
  headers: HeaderObject[];
7
7
  mainTemplateColumns: string;
8
8
  pinnedLeftColumns: HeaderObject[];
@@ -1,6 +1,6 @@
1
1
  import { UIEventHandler } from "react";
2
2
  import { Pinned } from "./Pinned";
3
- import { SortColumn } from "./SortConfig";
3
+ import SortColumn from "./SortColumn";
4
4
  import { HeaderObject } from "..";
5
5
  import { RefObject } from "react";
6
6
  import { ColumnIndices } from "../utils/columnIndicesUtils";
@@ -11,7 +11,7 @@ interface TableHeaderSectionProps {
11
11
  headers: HeaderObject[];
12
12
  maxDepth: number;
13
13
  pinned?: Pinned;
14
- sectionRef: RefObject<HTMLDivElement | null>;
14
+ sectionRef: RefObject<HTMLDivElement>;
15
15
  sort: SortColumn | null;
16
16
  width?: number;
17
17
  }