simple-table-core 2.2.5 → 2.2.7
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/{Animate-df81377f.js → Animate-70cc5e42.js} +2 -2
- package/dist/Animate-70cc5e42.js.map +1 -0
- package/dist/{DatePicker-27185b51.js → DatePicker-6dedf748.js} +2 -2
- package/dist/DatePicker-6dedf748.js.map +1 -0
- package/dist/cjs/{Animate-bba2fbda.js → Animate-178d94f1.js} +2 -2
- package/dist/cjs/Animate-178d94f1.js.map +1 -0
- package/dist/cjs/{DatePicker-ff57df85.js → DatePicker-f57c6bd2.js} +2 -2
- package/dist/cjs/DatePicker-f57c6bd2.js.map +1 -0
- package/dist/cjs/hooks/useTableAPI.d.ts +2 -1
- package/dist/cjs/index-34b11024.js +2 -0
- package/dist/cjs/index-34b11024.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/types/HeaderObject.d.ts +1 -0
- package/dist/cjs/types/TableRefType.d.ts +2 -2
- package/dist/hooks/useTableAPI.d.ts +2 -1
- package/dist/index-fa8112d6.js +2 -0
- package/dist/index-fa8112d6.js.map +1 -0
- package/dist/index.es.js +1 -1
- package/dist/types/HeaderObject.d.ts +1 -0
- package/dist/types/TableRefType.d.ts +2 -2
- package/package.json +1 -1
- package/dist/Animate-df81377f.js.map +0 -1
- package/dist/DatePicker-27185b51.js.map +0 -1
- package/dist/cjs/Animate-bba2fbda.js.map +0 -1
- package/dist/cjs/DatePicker-ff57df85.js.map +0 -1
- package/dist/cjs/index-88c874db.js +0 -2
- package/dist/cjs/index-88c874db.js.map +0 -1
- package/dist/index-6e521443.js +0 -2
- package/dist/index-6e521443.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";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);function o(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);r.length>o;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}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 u(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,u)}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=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&o[3]>u[1])){i.label=u[1];break}if(6===u[0]&&o[1]>i.label){i.label=o[1],o=u;break}if(o&&o[2]>i.label){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}function u(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;i>o;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))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;r>t;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},s=30,c=function(e){return 480>e?.3:768>e?.4:.8},d="parentExpanded",f=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;a.length>i;i++)o=r(a[i],o);return o};return r(e,n),t},v=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,v(e.children)),n})},p=function(e){return void 0===e&&(e=0),e?e+1:0},h=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},w=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||n.excludeFromRender||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&function(e,n,t){var r=function(e,n){for(var t=0,r=v(e);r.length>t;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);if(r){var o=t.has(r.accessor),i=e.showWhen||d;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,r,o))||null},m=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},g=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){var n=e.showWhen||d;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return g(e,n)}):e.children.filter(function(e){var n=e.showWhen||d;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return g(e,n)}):[e]},x=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(h({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},b=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(h({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){b(e)})},y=function(e){return"number"==typeof e.minWidth?e.minWidth:40},C=function(e,n){var t=[];return e.forEach(function(e){e.hide||t.push.apply(t,g(e,n))}),t},I=function(e){var n=e.customTheme;return Math.min(e.headerHeight+n.rowSeparatorWidth+e.childRowCount*(e.rowHeight+n.rowSeparatorWidth)+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth,n.nestedGridMaxHeight+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth)},R=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},S=function(e,n){var t=n+"";return t.includes(".")||t.includes("[")?t.split(".").reduce(function(e,n){if(null!=e){var t=R(n),r=t.index,o=e[t.key];return null!==r&&Array.isArray(o)&&(o=o[r]),o}},e):e[n]},M=function(e,n,t){var r=n+"";if(r.includes(".")||r.includes("[")){for(var o=r.split("."),i=e,a=0;o.length-1>a;a++){var u=R(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=R(o[a+1]);i[l]=null!==c.index?[]:{}}if(i=i[l],null!==s){if(!Array.isArray(i))throw Error("Expected array at ".concat(o.slice(0,a+1).join("."),", but found ").concat(typeof i));for(;s>=i.length;)i.push(null);null==i[s]&&(i[s]={}),i=i[s]}}var d=R(o[o.length-1]),f=d.key,v=d.index;if(null!==v){for(Array.isArray(i[f])||(i[f]=[]);v>=i[f].length;)i[f].push(null);i[f][v]=t}else i[f]=t}else e[n]=t},N=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},H=function(e){return e.join("-")},E=function(e,n){var t=e[n];return N(t)?t:[]},T=function(e,n,t,r,o){var i=e+"",a=r.has(i)&&r.get(i)===n,u=o.has(i)&&o.get(i)===n;return t.has(n)?!u:a},k=function(e){var n=e.depth,t=e.expandedDepths,r=e.expandedRows,o=e.collapsedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.displayPositionOffset,s=void 0===l?0:l,c=e.rowStateMap,d=e.hasLoadingRenderer,f=void 0!==d&&d,v=e.hasErrorRenderer,p=void 0!==v&&v,h=e.hasEmptyRenderer,w=void 0!==h&&h,m=e.headers,g=void 0===m?[]:m,x=e.rowHeight,b=e.headerHeight,y=e.customTheme,C=[],R=function(e,n,i,l,d){void 0===i&&(i=0),void 0===l&&(l=s),void 0===d&&(d=[]);var v=i,h=l;return e.forEach(function(i,l){var s,m,S=a[n],M=u(u([],d,!0),[l],!1),N=H(M);if(C.push({row:i,depth:n,displayPosition:h,groupingKey:S,position:v,isLastGroupRow:0===n&&l===e.length-1,rowPath:M,absoluteRowIndex:v}),v++,h++,T(N,n,t,r,o)&&a.length>n){var k=null==c?void 0:c.get(N),A=E(i,S),D=g.find(function(e){return e.expandable&&e.nestedTable});if((null==D?void 0:D.nestedTable)&&A.length>0){var F=(null===(s=D.nestedTable.customTheme)||void 0===s?void 0:s.rowHeight)||x,P=(null===(m=D.nestedTable.customTheme)||void 0===m?void 0:m.headerHeight)||b,O=I({childRowCount:A.length,rowHeight:F,headerHeight:P,customTheme:y});C.push({row:{},depth:n+1,displayPosition:h,groupingKey:S,position:v,isLastGroupRow:!1,rowPath:u(u([],M,!0),[S],!1),nestedTable:{parentRow:i,expandableHeader:D,childAccessor:S,calculatedHeight:O},absoluteRowIndex:v}),v++,h++}else if(k&&(k.loading||k.error||k.isEmpty))k.loading&&f||k.error&&p||k.isEmpty&&w?(C.push({row:{},depth:n+1,displayPosition:h,groupingKey:S,position:v,isLastGroupRow:!1,rowPath:u(u([],M,!0),[S],!1),stateIndicator:{parentRowId:N,state:k},absoluteRowIndex:v}),v++,h++):k.loading&&!f&&(C.push({row:{},depth:n+1,displayPosition:h,groupingKey:S,position:v,isLastGroupRow:!1,rowPath:u(u([],M,!0),[S,"loading-skeleton"],!1),isLoadingSkeleton:!0,absoluteRowIndex:v}),v++,h++);else if(A.length>0){var L=u(u([],M,!0),[S],!1);v=R(A,n+1,v,h,L)}}}),v};return R(e.rows,void 0===n?0:n,0,s),C},A=function(e,n){var t=n.rowTopPositions;if(0===t.length)return 0;if(0>=e)return 0;if(e>=n.totalHeight)return t.length-1;for(var r=0,o=t.length-1;o>r;){var i=Math.floor((r+o+1)/2);t[i]>e?o=i-1:r=i}return r},D=function(e,n){if(!n||0===n.length)return 0;for(var t=0,r=0,o=n.length;o>r;){var i=Math.floor((r+o)/2);e>n[i][0]?r=i+1:o=i}for(var a=0;r>a;a++)t+=n[a][1];return t},F=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.scrollTop,o=e.tableRows,i=e.scrollDirection,a=void 0===i?"none":i,u=e.heightMap,l=e.rowHeight+1;if(!u){var s=n*l,c=s,d=s;"down"===a?(c=Math.max(l,.1*s),d=.9*s):"up"===a&&(c=.9*s,d=Math.max(l,.1*s));var f=r+t+d,v=Math.max(0,Math.floor(Math.max(0,r-c)/l)),p=Math.min(o.length,Math.ceil(f/l)),h=r+t,w=Math.max(0,Math.ceil(r/l)),m=Math.min(o.length,Math.floor(h/l)),g=r+t,x=Math.max(0,Math.floor(r/l)),b=Math.min(o.length,Math.ceil(g/l));return{rendered:{startIndex:v,endIndex:p,rows:o.slice(v,p)},fullyVisible:{startIndex:w,endIndex:m,rows:o.slice(w,m)},partiallyVisible:{startIndex:x,endIndex:b,rows:o.slice(x,b)}}}var y=u.rowTopPositions,C=n*l,I=C,R=C;"down"===a?(I=Math.max(l,.1*C),R=.9*C):"up"===a&&(I=.9*C,R=Math.max(l,.1*C));var S=r+t+R,M=A(Math.max(0,r-I),u),N=A(S,u)+1;N=Math.min(o.length,N);var H=r,E=r+t,T=A(H,u);H>y[T]&&(T=Math.min(T+1,o.length));var k=A(E,u);k=Math.min(o.length,k);var D=r+t,F=A(r,u),P=A(D,u)+1;return P=Math.min(o.length,P),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:T,endIndex:k,rows:o.slice(T,k)},partiallyVisible:{startIndex:F,endIndex:P,rows:o.slice(F,P)}}},P=function(e){return F({bufferRowCount:e.bufferRowCount,contentHeight:e.contentHeight,rowHeight:e.rowHeight,scrollTop:e.scrollTop,tableRows:e.tableRows,scrollDirection:e.scrollDirection,heightMap:e.heightMap}).rendered.rows},O=function(e){var n=e.position,t=e.customTheme;return n*(e.rowHeight+t.rowSeparatorWidth)-t.rowSeparatorWidth+D(n,e.heightOffsets)},L=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+D(n,e.heightOffsets)},W=function(e,n,t){var r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>r.top?n.scrollTop-=o.top-r.top+i:r.bottom>o.bottom-i&&(n.scrollTop+=r.bottom-o.bottom+i),t){var a=t.getBoundingClientRect();a.left+i>r.left?t.scrollLeft-=a.left-r.left+i:r.right>a.right-i&&(t.scrollLeft+=r.right-a.right+i)}},B=function(e,n,t,r){var o=document.querySelector(".st-body-container"),i=document.querySelector(".st-body-main");if(o){var a=n+t.rowSeparatorWidth,u=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(u&&r){var l=function(e,n,t,r){var o=F({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:t,scrollTop:n.scrollTop,tableRows:r,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,o,n,r);if(l)return void W(u,o,i)}if(!u)return o.scrollTop=Math.max(0,e.rowIndex*a-o.clientHeight/3),void setTimeout(function(){var n=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));n&&W(n,o,i)},100);W(u,o,i)}},q=function(e){var n=e.colIndex,t=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(t)},G=n.createContext(void 0),z=function(n){return e.jsx(G.Provider,exports.__assign({value:n.value},{children:n.children}))},K=function(){var e=n.useContext(G);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},j=function(t){var r=t.currentPage,o=t.footerRenderer,u=t.hideFooter,l=t.onPageChange,s=t.onNextPage,c=t.onUserPageChange,d=t.rowsPerPage,f=t.shouldPaginate,v=t.totalPages,p=t.totalRows,h=K(),w=h.nextIcon,m=h.prevIcon,g=n.useState(!0),x=g[0],b=g[1],y=r>1,C=v>r,I=r===v,R=Math.min((r-1)*d+1,p),S=Math.min(r*d,p),M=!y,N=!C&&!s||!x&&I,H=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=r-1)?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},E=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===v,n=r+1,s&&e?[4,s(r)]:[3,2];case 1:if(!t.sent())return b(!1),[2];t.label=2;case 2:return n>v&&!s?[3,4]:(l(n),c?[4,c(n)]:[3,4]);case 3:t.sent(),t.label=4;case 4:return[2]}})})},T=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return 1>e||e>v?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})};if(u||!f)return null;if(o)return e.jsx(e.Fragment,{children:o({currentPage:r,totalPages:v,rowsPerPage:d,totalRows:p,startRow:R,endRow:S,onPageChange:T,onNextPage:E,onPrevPage:H,hasNextPage:!N,hasPrevPage:!M,nextIcon:w,prevIcon:m})});var k=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,t=[];r>8?v-7>r?(e=r-7,n=r+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14);for(var o=e;n>=o;o++)t.push(o);return v-1>n&&(t.push(-1),t.push(v)),t}();return e.jsxs("div",exports.__assign({className:"st-footer"},{children:[e.jsx("div",exports.__assign({className:"st-footer-info"},{children:e.jsxs("span",exports.__assign({className:"st-footer-results-text"},{children:["Showing ",R," to ",S," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[k.map(function(n,t){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),t):e.jsx("button",exports.__assign({onClick:function(){return T(n)},className:"st-page-btn ".concat(r===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":r===n?"page":void 0},{children:n}),t)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(M?"disabled":""),onClick:H,disabled:M,"aria-label":"Go to previous page"},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(N?"disabled":""),onClick:E,disabled:N,"aria-label":"Go to next page"},{children:w}))]}))]}))},V=function(n){return e.jsx("svg",exports.__assign({className:n.className,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"})}))},U=function(n){return e.jsx("svg",exports.__assign({className:n.className,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"})}))},_=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,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"})}))},J=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:n.className,style:exports.__assign({height:"10px"},n.style)},{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"})}))},X=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,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"})}))},Y=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:n.className,style:exports.__assign({height:"1em"},n.style)},{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"})}))},$=function(){return e.jsx("svg",exports.__assign({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"})}))},Z=function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return 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==r?void 0:r.current;if(e&&(null==t?void 0:t.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[t,r]),{isMainSectionScrollable:a}},Q=function(t){var r=t.children,o=t.onClose,i=t.open,a=t.overflow,u=void 0===a?"auto":a,l=t.setOpen,s=t.width,c=t.containerRef,d=t.positioning,f=void 0===d?"fixed":d,v=K().mainBodyRef,p=n.useRef(null),h=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],y=x[1],C=n.useState(!1),I=C[0],R=C[1];return n.useEffect(function(){i&&p.current?(R(!1),!h.current&&p.current.parentElement&&(h.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&h.current){var e,n=p.current,t=h.current.getBoundingClientRect(),r=n.offsetHeight,o=s||n.offsetWidth,i=(e=(null==c?void 0:c.current)?c.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,u="bottom",l={};(r>i&&a>=r||r>i&&a>i)&&(u="top");var d="left";o>e.right-t.right+t.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===d?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===u?l.top=t.height+4:l.bottom=t.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),y(l),R(!0)}})):i||R(!1)},[i,s,c,v,f]),n.useEffect(function(){var e=function(e){i&&p.current&&p.current&&!p.current.contains(e.target)&&(l(!1),null==o||o())};return i&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[i,o,l]),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)&&(l(!1),null==o||o())}},n=function(n){"Enter"===n.key&&e(n)};return i&&(document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",n,!0)),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",n,!0)}},[o,i,l]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&i&&(l(!1),null==o||o())};return i&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[o,i,l]),i?e.jsx("div",exports.__assign({ref:p,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()},onTouchStart:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:s?"".concat(s,"px"):"auto",visibility:I?"visible":"hidden"},b),{overflow:u})},{children:r})):null},ee=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,s=void 0===l?"":l;return e.jsx("div",exports.__assign({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(u?"disabled":""," ").concat(s),onClick:function(){!u&&r&&r()},role:"option","aria-selected":i,"aria-disabled":u},{children:t}))},ne=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=n.useState(t.value),l=u[0],s=u[1],c=function(e){s(e),o(e),a(!1),r()};return e.jsxs(Q,exports.__assign({open:i,onClose:function(){r()},setOpen:a,width:120},{children:[e.jsx(ee,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(ee,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},te=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){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},re=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,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()}})},oe=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-bba2fbda.js")})}),ie=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-ff57df85.js")})}),ae=n.lazy(function(){return Promise.resolve().then(function(){return Un})}),ue=n.lazy(function(){return Promise.resolve().then(function(){return Jn})}),le=function(t){var r=o(t,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},r))},{children:e.jsx(oe,exports.__assign({},t))}))},se=function(t){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(ie,exports.__assign({},t))}))},ce=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(ae,exports.__assign({},t))}))},de=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(ue,exports.__assign({},t))}))},fe=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number);return new Date(n[0],n[1]-1,n[2],12,0,0)}var t=new Date(e);return isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0)},ve=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},pe=function(e){if(!e)return new Date;if("string"==typeof e)return fe(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:ve(n)}return e instanceof Date?ve(e):new Date},he=function(e){return e?fe(""+e):new Date},we=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=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 l=function(){r()};return e.jsx(Q,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(se,{value:he(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),r()},onClose:l})}))},me=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.options,u=t.setOpen,l=n.useState(t.value||""),s=l[0],c=l[1];return e.jsx(Q,exports.__assign({open:i,onClose:function(){r()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(ee,exports.__assign({isSelected:s===n.value,onClick:function(){return c(e=n.value),o(e),u(!1),void r();var e}},{children:n.label}),n.value)})}))}))},ge=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,s=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(ne,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(we,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(me,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(re,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(te,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},xe=0,be=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();0!==xe&&r>o-xe||(xe=o,n(t))}},ye=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},Ce=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(Ce);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Ce(e[t]));return n},Ie=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Re=Date.now(),Se={screenX:0,screenY:0},Me=function(e,n,t){void 0===t&&(t=[]);for(var r=0;e.length>r;r++){var o=e[r];if(o.accessor===n)return u(u([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Me(o.children,n,u(u([],t,!0),[r],!1));if(i)return i}}return null},Ne=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};var He=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=K().setHeaders,l=ye(t);return{handleDragStart:function(e){n.current=e,Re=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,c=o.screenY,d=Math.sqrt(Math.pow(s-Se.screenX,2)+Math.pow(c-Se.screenY,2));r.current=a;var f,v,p,h=n.current,w=!1;if(Ne(h)!==Ne(a))f=(R=function(e,n,t){var r,o,i=Ce(e),a=!1;try{var u=Ne(t),l=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===l||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var c=i.splice(l,1)[0],d=(r=u,o=exports.__assign({},c),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o);i.splice(s,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}(t,h,a)).newHeaders,w=R.emergencyBreak;else{var m=t,g=Me(m,h.accessor),x=Me(m,a.accessor);if(!g||!x)return;var b=g.length,y=x.length,C=x;if(b!==y){var I=y-b;I>0&&(C=x.slice(0,-I))}if((v=g).length!==(p=C).length||1!==v.length&&!v.slice(0,-1).every(function(e,n){return e===p[n]}))return;var R=function(e,n,t){var r=Ce(e),o=!1;function i(e,n){for(var t=e,r=0;n.length-1>r;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;n.length-1>i;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var u=i(r,n);return a(r,n,i(r,t)),a(r,t,u),{newHeaders:r,emergencyBreak:o}}(m,g,C);f=R.newHeaders,w=R.emergencyBreak}if(!(u||a.accessor===h.accessor||10>d||JSON.stringify(f)===JSON.stringify(t)||w)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>S-Re||40>d)||(Re=S,Se={screenX:s,screenY:c},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(t)},10)}}},Ee=function(n){var t=n.checked,r=void 0!==t&&t,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){i&&i(!r)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":n.ariaLabel,"aria-checked":r}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(r?"st-checked":""),"aria-hidden":"true"},{children:r&&e.jsx(J,{className:"st-checkbox-checkmark"})})),o]}))},Te=function(n){var t,r=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:r}):"lineAreaChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ce,exports.__assign({data:t},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(de,exports.__assign({data:t},o.chartOptions)):null:"boolean"==typeof r?r?"True":"False":Array.isArray(r)?0===r.length?"[]":r.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==r&&("string"==typeof r||"number"==typeof r||"object"==typeof r&&r instanceof Date)?pe(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):r},ke=r.default.memo(function(t){var r=t.borderClass,o=t.colIndex,i=t.displayRowNumber,a=t.header,u=t.isHighlighted,l=t.isInitialFocused,s=t.nestedIndex,c=t.parentHeader,d=t.rowIndex,f=t.tableRow,v=K(),p=v.canExpandRowGroup,w=v.cellRegistry,g=v.cellUpdateFlash,x=v.collapsedRows,b=v.columnBorders,y=v.draggedHeaderRef,C=v.enableRowSelection,I=v.expandedDepths,R=v.expandedRows,E=v.expandIcon,k=v.handleMouseDown,A=v.handleMouseOver,D=v.handleRowSelect,F=v.headers,P=v.hoveredHeaderRef,O=v.isCopyFlashing,L=v.isLoading,W=v.isRowSelected,B=v.isWarningFlashing,q=v.onCellEdit,G=v.onCellClick,z=v.onRowGroupExpand,j=v.onTableHeaderDragEnd,V=v.rowButtons,U=v.rowGrouping,_=v.setCollapsedRows,J=v.setExpandedRows,X=v.setRowStateMap,Y=v.rowsWithSelectedCells,$=v.selectedColumns,Z=v.tableBodyContainerRef,Q=v.theme,ee=v.useOddColumnBackground,ne=f.depth,te=f.row,re=f.rowPath,oe=f.absoluteRowIndex,ie=n.useState(S(te,a.accessor)),ae=ie[0],ue=ie[1],se=n.useState(!1),ce=se[0],de=se[1],fe=n.useState(!1),ve=fe[0],pe=fe[1],he=n.useState(!1),we=he[0],me=he[1],xe=n.useRef(null),ye=H(re||[oe]),Ce=U&&U[ne],Ie=!!Ce&&function(e,n){return!!n&&N(e[n])}(te,Ce),Re=U&&U.length>ne,Se=!p||p(te),Me=!!a.nestedTable,Ne=T(ye,ne,I,R,x),ke=O({rowIndex:d,colIndex:o,rowId:ye}),Ae=B({rowIndex:d,colIndex:o,rowId:ye}),De=n.useMemo(function(){var e,n,t;if(!b)return!1;var r=F.filter(function(e){return"left"===e.pinned}),o=F.filter(function(e){return!e.pinned}),i=F.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[b,F,a.accessor,a.pinned]),Fe=He({draggedHeaderRef:y,headers:F,hoveredHeaderRef:P,onTableHeaderDragEnd:j}).handleDragOver,Pe=be(),Oe=h({accessor:a.accessor,rowId:ye}),Le=m({rowId:ye,accessor:a.accessor}),We=a.isSelectionColumn&&C;n.useEffect(function(){if(w){var e="".concat(ye,"-").concat(a.accessor);return w.set(e,{updateContent:function(e){ae!==e?(ue(e),g&&(pe(!0),xe.current&&clearTimeout(xe.current),xe.current=setTimeout(function(){pe(!1)},800))):ue(e)}}),function(){w.delete(e),xe.current&&clearTimeout(xe.current)}}},[w,g,ye,a.accessor,ae]),n.useEffect(function(){if(ve){var e=setTimeout(function(){pe(!1)},850);return function(){return clearTimeout(e)}}},[ve]),n.useEffect(function(){ue(S(te,a.accessor))},[te,a.accessor]);var Be="boolean"===a.type||"date"===a.type||"enum"===a.type,qe=!!(null==a?void 0:a.isEditable),Ge=$.has(o),ze=u&&!Ge,Ke=n.useMemo(function(){return!!We&&Y.has(ye+"")},[We,Y,ye]),je=null==c?void 0:c.singleRowChildren,Ve="st-cell ".concat(ne>0&&a.expandable?"st-cell-depth-".concat(ne):""," ").concat(ze?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Ge?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(qe?"clickable":""," ").concat(ve?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(ke?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Ae?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(ee?s%2==0?"even-column":"odd-column":""," ").concat(We?"st-selection-cell":""," ").concat(Ke?"st-selection-has-highlighted-cell":""," ").concat(De?"st-last-column":""," ").concat(je?"st-sub-cell":""," ").concat(we?"hovered":""),Ue=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),ue(e),M(te,a.accessor,e),null==q||q({accessor:a.accessor,newValue:e,row:te,rowIndex:d})},[a.accessor,a.type,q,te,d]),_e=n.useCallback(function(e){e.stopPropagation();var n=T(ye,ne,I,R,x),t=ye+"";if(n?(_(function(e){var n=new Map(e);return n.set(t,ne),n}),J(function(e){var n=new Map(e);return n.delete(t),n})):(J(function(e){var n=new Map(e);return n.set(t,ne),n}),_(function(e){var n=new Map(e);return n.delete(t),n})),n&&X(function(e){var n=new Map(e);return n.delete(ye),n}),z){var r=a.pinned;z({depth:ne,event:e,groupingKey:Ce,groupingKeys:U||[],isExpanded:!n,row:te,rowIndexPath:re||[],setEmpty:function(e,n){X(function(t){var o=new Map(t),i=o.get(ye)||{};return o.set(ye,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:r})),o})},setError:function(e){X(function(n){var t=new Map(n),o=t.get(ye)||{};return t.set(ye,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:r})),t})},setLoading:function(e){X(function(n){var t=new Map(n),o=t.get(ye)||{};return t.set(ye,exports.__assign(exports.__assign({},o),{loading:e,error:null,isEmpty:!1,triggerSection:r})),t})}})}},[x,Ce,ne,I,R,a.pinned,z,te,U,ye,re,_,J,X]);return L||f.isLoadingSkeleton?e.jsx("div",exports.__assign({className:Ve},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!ce||Be||We?e.jsxs(le,exports.__assign({className:Ve,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ye,"data-row-index":d,"aria-colindex":o+1,id:Oe,onClick:function(){G&&!We&&G({accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:ae})},onDoubleClick:function(){return a.isEditable&&!We&&de(!0)},onDragOver:function(e){We||Pe({callback:Fe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){ce||We||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||ce||(e.preventDefault(),de(!0))},onMouseDown:function(){ce||We||k({rowIndex:d,colIndex:o,rowId:ye})},onMouseEnter:function(){me(!0)},onMouseLeave:function(){me(!1)},onMouseOver:function(){ce||We||A({rowIndex:d,colIndex:o,rowId:ye})},parentRef:Z,tableRow:f},{children:[a.expandable&&Re?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Se&&(Ie||z||Me)?Ne?"expanded":"collapsed":"placeholder"),onClick:Se&&(Ie||z||Me)?function(e){return _e(e)}:void 0,role:Se&&(Ie||z||Me)?"button":"presentation",tabIndex:Se&&(Ie||z||Me)?0:-1,"aria-label":Se&&(Ie||z||Me)?"".concat(Ne?"Collapse":"Expand"," row group"):void 0,"aria-expanded":Se&&(Ie||z||Me)?Ne:void 0,"aria-hidden":!(Se&&(Ie||z||Me)),onKeyDown:Se&&(Ie||z||Me)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),_e(e))}:void 0},{children:E})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:L||f.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:We?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:we||W&&W(ye+"")?e.jsx(Ee,{checked:!!W&&W(ye+""),onChange:function(e){D&&D(ye+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!V||!We||0===V.length)return null;if(!(we||W&&W(ye+"")))return null;var n={row:te,rowIndex:i};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:V.map(function(t,r){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?function(){var e;return a.cellRenderer({accessor:a.accessor,colIndex:o,row:te,rowIndex:oe,rowPath:re,theme:Q,value:ae,formattedValue:null===(e=null==a?void 0:a.valueFormatter)||void 0===e?void 0:e.call(a,{accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:ae})})}():Te({content:ae,header:a,colIndex:o,row:te,rowIndex:d})})})),!L&&!f.isLoadingSkeleton&&ce&&Be&&!We&&e.jsx(ge,{enumOptions:a.enumOptions,onChange:Ue,setIsEditing:de,type:a.type,value:ae})]}),Le):e.jsx("div",exports.__assign({className:"st-cell-editing",id:h({accessor:a.accessor,rowId:ye}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(ge,{enumOptions:a.enumOptions,onChange:Ue,setIsEditing:de,type:a.type,value:ae})}))},function(e,n){if(e.rowIndex!==n.rowIndex||e.colIndex!==n.colIndex||e.isHighlighted!==n.isHighlighted||e.isInitialFocused!==n.isInitialFocused||e.borderClass!==n.borderClass)return!1;if(e.tableRow!==n.tableRow){if(e.tableRow.row!==n.tableRow.row)return!1;if(e.tableRow.position!==n.tableRow.position||e.tableRow.displayPosition!==n.tableRow.displayPosition)return!1}return(e.header===n.header||e.header.accessor===n.header.accessor&&e.header.isEditable===n.header.isEditable&&e.header.type===n.header.type&&e.header.cellRenderer===n.header.cellRenderer&&e.header.valueFormatter===n.header.valueFormatter)&&e.parentHeader===n.parentHeader&&e.displayRowNumber===n.displayRowNumber&&e.nestedIndex===n.nestedIndex}),Ae=function(t){var r=t.columnIndices,o=t.displayRowNumber,i=t.header,a=t.headers,u=t.nestedIndex,l=t.parentHeader,s=t.pinned,c=t.rowIndex,d=t.rowIndices,f=t.tableRow,v=r[i.accessor],p=K(),m=p.getBorderClass,g=p.isSelected,x=p.isInitialFocusedCell,b=p.collapsedHeaders,y=H(f.rowPath||[f.position]);if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return w({header:e,pinned:s,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var I={rowIndex:c,colIndex:v,rowId:y},R=m(I),S=g(I),M=x(I),N=h({accessor:i.accessor,rowId:y});return e.jsxs(n.Fragment,{children:[e.jsx(ke,{borderClass:R,colIndex:v,displayRowNumber:o,header:i,isHighlighted:S,isInitialFocused:M,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},N),C.map(function(n){var t=h({accessor:n.accessor,rowId:y});return e.jsx(Ae,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},t)})]})}return e.jsx(n.Fragment,{children:C.map(function(n){var t=h({accessor:n.accessor,rowId:y});return e.jsx(Ae,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},t)})})}var E={rowIndex:c,colIndex:v,rowId:y},T=m(E),k=g(E),A=x(E),D=h({accessor:i.accessor,rowId:y});return e.jsx(ke,{borderClass:T,colIndex:v,displayRowNumber:o,header:i,isHighlighted:k,isInitialFocused:A,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},D)},De=r.default.memo(function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,s=n.tableRow,c=K().collapsedHeaders,d=o.filter(function(e){return w({header:e,pinned:i,headers:o,collapsedHeaders:c})});return e.jsx(e.Fragment,{children:d.map(function(n,c){var d=H(s.rowPath||[s.position]),f=h({accessor:n.accessor,rowId:d});return e.jsx(Ae,{columnIndices:r,displayRowNumber:u,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:s},f)})})},function(e,n){return e.rowIndex===n.rowIndex&&e.displayRowNumber===n.displayRowNumber&&e.columnIndexStart===n.columnIndexStart&&(e.tableRow===n.tableRow||e.tableRow.row===n.tableRow.row)&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.rowIndices===n.rowIndices}),Fe=function(n){var t=n.rowState,r=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return t.loading&&r?a=r:t.error&&o?a=o:t.isEmpty&&i&&(a=i),a?e.jsx("div",exports.__assign({className:"st-cell st-state-row-cell",style:{gridColumn:"1 / -1",padding:0}},{children:a})):null},Pe=function(n){var t=n.calculatedHeight,r=n.childAccessor,o=n.depth,i=n.expandableHeader,a=n.index,u=n.parentRow,l=n.position,s=K(),c=s.theme,d=s.rowGrouping,f=s.rowHeight,v=s.heightOffsets,p=s.customTheme,h=s.loadingStateRenderer,w=s.errorStateRenderer,m=s.emptyStateRenderer,g=s.expandIcon,x=s.filterIcon,b=s.sortUpIcon,y=s.sortDownIcon,C=s.nextIcon,I=s.prevIcon,R=s.headerCollapseIcon,M=s.headerExpandIcon,N=i.nestedTable;if(!N)return null;var H=S(u,r),E=Array.isArray(H)?H:[],T=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,k=t-p.nestedGridPaddingTop-p.nestedGridPaddingBottom,A=N.customTheme?exports.__assign(exports.__assign({},p),N.customTheme):p;return e.jsx("div",exports.__assign({className:"st-row st-nested-grid-row","data-index":a,style:{transform:"translate3d(0, ".concat(L({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(t,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx(Kn,exports.__assign({},N,{rows:E,theme:c,customTheme:A,height:"".concat(k,"px"),rowGrouping:T,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,expandIcon:g,filterIcon:x,sortUpIcon:b,sortDownIcon:y,nextIcon:C,prevIcon:I,headerCollapseIcon:R,headerExpandIcon:M}))}))},Oe=r.default.memo(function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,s=n.rowIndices,c=n.setHoveredIndex,d=n.tableRow,f=K(),v=f.customTheme,p=f.emptyStateRenderer,h=f.errorStateRenderer,w=f.heightOffsets,m=f.isAnimating,g=f.isRowSelected,x=f.loadingStateRenderer,b=f.maxHeaderDepth,y=f.rows,C=f.useHoverRowBackground,I=f.useOddEvenRowBackground,R=d.position,S=d.displayPosition,M=d.stateIndicator,N=d.nestedTable;if(N)return u?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:R,rowHeight:l,heightOffsets:w,customTheme:v}),"px, 0)"),height:"".concat(N.calculatedHeight,"px")}}):e.jsx(Pe,{calculatedHeight:N.calculatedHeight,childAccessor:N.childAccessor,depth:d.depth-1,expandableHeader:N.expandableHeader,index:a,parentRow:N.parentRow,position:R});if(M){if(M.state.triggerSection===u){if(!(M.state.loading&&x||M.state.error&&h||M.state.isEmpty&&p))return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:R,rowHeight:l,heightOffsets:w,customTheme:v}),"px, 0)"),height:"".concat(l,"px")}});var E=y.find(function(e,n){return H([n])===M.parentRowId});return e.jsx("div",exports.__assign({className:"st-row st-state-row","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:R,rowHeight:l,heightOffsets:w,customTheme:v}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Fe,{parentRow:E||{},rowState:M.state,gridTemplateColumns:o,loadingStateRenderer:x,errorStateRenderer:h,emptyStateRenderer:p})}))}return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:R,rowHeight:l,heightOffsets:w,customTheme:v}),"px, 0)"),height:"".concat(l,"px")}})}var T=R%2==0,k=H(d.rowPath||[d.position]),A=!!g&&g(k+"");return e.jsx("div",exports.__assign({className:"st-row ".concat(I?T?"even":"odd":""," ").concat(A?"selected":""),"data-index":a,"aria-rowindex":R+b+1,onMouseEnter:function(){!m&&C&&c(a)},style:{gridTemplateColumns:o,top:L({position:R,rowHeight:l,heightOffsets:w,customTheme:v}),height:"".concat(l,"px")}},{children:e.jsx(De,{columnIndexStart:r,columnIndices:t,displayRowNumber:S,headers:i,pinned:u,rowIndex:R,rowIndices:s,tableRow:d},k)}))},function(e,n){return e.index===n.index&&e.tableRow.position===n.tableRow.position&&e.tableRow.displayPosition===n.tableRow.displayPosition&&e.tableRow.row===n.tableRow.row&&e.tableRow.stateIndicator===n.tableRow.stateIndicator&&e.rowHeight===n.rowHeight&&e.gridTemplateColumns===n.gridTemplateColumns&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.rowIndices===n.rowIndices&&e.columnIndexStart===n.columnIndexStart}),Le=function(t){var r=t.displayStrongBorder,o=t.position,i=t.rowHeight,a=t.templateColumns,u=K(),l=u.heightOffsets,s=u.customTheme,c=n.useRef(null);return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,t=n.style.pointerEvents;n.style.pointerEvents="none";var r=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=t,r){var o=r.closest(".st-cell");if(o instanceof HTMLElement){c.current=o;var i=o.getBoundingClientRect(),a=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:i.top+i.height/2});o.dispatchEvent(a)}}},onMouseUp:function(e){if(c.current){var n=c.current.getBoundingClientRect(),t=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});c.current.dispatchEvent(t),c.current=null}},style:{gridTemplateColumns:a,transform:"translate3d(0, ".concat(O({position:o,rowHeight:i,heightOffsets:l,customTheme:s}),"px, 0)")}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},We=n.createContext(void 0),Be=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(We);if(!e)throw Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),u=a.registerPane,l=a.unregisterPane;return n.useEffect(function(){var e=[i];return t.current&&u(t.current,e),function(){t.current&&l(t.current,e)}},[t,u,l,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},qe=n.forwardRef(function(t,r){var o=t.columnIndexStart,i=t.columnIndices,a=t.headers,u=t.pinned,l=t.rowHeight,s=t.rowIndices,c=t.setHoveredIndex,d=t.templateColumns,f=t.totalHeight,v=t.rowsToRender,p=t.width,h=u?"st-body-pinned-".concat(u):"st-body-main",w=n.useRef(null);return n.useImperativeHandle(r,function(){return w.current},[]),n.useMemo(function(){return Ie(a,u)},[a,u])?e.jsx(Be,exports.__assign({childRef:w,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:h,ref:w,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:p},!u&&{flexGrow:1})},{children:v.map(function(t,r){var f=t.stateIndicator?"state-".concat(t.stateIndicator.parentRowId,"-").concat(t.position):H(t.rowPath||[t.position]);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(Le,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:l,templateColumns:d}),e.jsx(Oe,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:r,pinned:u,rowHeight:l,rowIndices:s,setHoveredIndex:c,tableRow:t})]},f)})}))})):null});function Ge(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],t,!0),n,!0),r,!0),s=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return w({header:e,headers:l,collapsedHeaders:o})}).forEach(function(n,t){s(n,!e.singleRowChildren&&0===t)})};return t.forEach(function(e,n){s(e,0===n)}),n.filter(function(e){return!e.pinned&&w({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){s(e,0===n&&0===t.length)}),r.forEach(function(e){s(e,!1)}),i}qe.displayName="TableSection";var ze=function(t){var r=t.mainTemplateColumns,o=t.pinnedLeftColumns,i=t.pinnedLeftTemplateColumns,a=t.pinnedLeftWidth,u=t.pinnedRightColumns,l=t.pinnedRightTemplateColumns,s=t.pinnedRightWidth,c=t.rowsToRender,d=t.setScrollTop,f=t.setScrollDirection,v=t.shouldShowEmptyState,p=t.tableRows,h=K(),w=h.collapsedHeaders,m=h.headerContainerRef,g=h.headers,x=h.heightOffsets,b=h.isAnimating,y=h.mainBodyRef,C=h.onLoadMore,I=h.rowHeight,R=h.scrollbarWidth,S=h.setIsScrolling,M=h.shouldPaginate,N=h.tableBodyContainerRef,E=h.tableEmptyStateRenderer,T=h.customTheme,k=n.useState(!1),A=k[0],D=k[1],F=n.useRef(new Set),P=n.useCallback(function(e){if(document.querySelectorAll(".st-row.hovered").forEach(function(e){e.classList.remove("hovered")}),F.current.clear(),null!==e&&N.current){var n=N.current;n.querySelectorAll('.st-row[data-index="'.concat(e,'"]:not(.st-nested-grid-row)')).forEach(function(e){var t=e;t.closest(".st-body-container")===n&&(t.classList.add("hovered"),F.current.add(t))})}},[N]);n.useEffect(function(){b&&P(null)},[b,P]),Z({headerContainerRef:m,mainSectionRef:N,scrollbarWidth:R}),n.useEffect(function(){return function(){L.current&&clearTimeout(L.current)}},[]);var O=n.useRef(null),L=n.useRef(null),W=n.useRef(0),B=function(e){return e.length}(p),q=n.useMemo(function(){return function(e,n,t,r){return e*(n+r.rowSeparatorWidth)-r.rowSeparatorWidth+((null==t?void 0:t.reduce(function(e,n){return e+n[1]},0))||0)}(B,I,x,T)},[B,I,x,T]),G=n.useMemo(function(){return Ge({headers:g,pinnedLeftColumns:o,pinnedRightColumns:u,collapsedHeaders:w})},[g,o,u,w]),z=n.useMemo(function(){var e={};return c.forEach(function(n,t){var r=H(n.rowPath||[n.position])+"";e[r]=t}),e},[c]),j=n.useCallback(function(e,n){!C||M||A||200>=e.scrollHeight-(n+e.clientHeight)&&n>W.current&&(D(!0),C(),setTimeout(function(){D(!1)},1e3))},[C,M,A]),V={columnIndices:G,headerContainerRef:m,headers:g,rowHeight:I,rowIndices:z,rowsToRender:c,setHoveredIndex:P};return e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return P(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;S(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(function(){S(!1)},150),O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(function(){var e=W.current,r=t>e?"down":e>t?"up":"none";d(t),f(r),j(n,t),W.current=t})},ref:N},{children:v?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:E})):e.jsxs(e.Fragment,{children:[e.jsx(qe,exports.__assign({},V,{pinned:"left",templateColumns:i,totalHeight:q,width:a})),e.jsx(qe,exports.__assign({},V,{columnIndexStart:o.length,ref:y,templateColumns:r,totalHeight:q})),e.jsx(qe,exports.__assign({},V,{columnIndexStart:o.length+r.length,pinned:"right",templateColumns:l,totalHeight:q,width:s}))]})}))},Ke=function(e){var n=e.event,t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.tableBodyContainerRef,l=e.startWidth,s=e.collapsedHeaders,d=e.autoExpandColumns,f=void 0!==d&&d,v=e.reverse,p=void 0!==v&&v;n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,w="touches"in n;if(t&&!t.hide){i(!0);var m,I=y(t);if(t.children&&t.children.length>0){var R=g(t,s);m=R.length>0?R:[t]}else m=[t];var S=new Map,M=0;if(f){var N=r.filter(function(e){return e.pinned===t.pinned});if(C(N,s).forEach(function(e){var n="number"==typeof e.width?e.width:"string"==typeof e.width&&e.width.endsWith("px")?parseFloat(e.width):100;S.set(e.accessor,n)}),a.current){var H=a.current.clientWidth,E=Ve({headers:r,containerWidth:H,collapsedHeaders:s}),T=E.leftWidth,k=E.rightWidth;M="left"===t.pinned?T:"right"===t.pinned?k:Math.max(0,H-T-k)}}var A=function(e){var n="right"===t.pinned?h-e:e-h;if(f){var i=r.filter(function(e){return e.pinned===t.pinned});_e({delta:n,startWidth:l,resizedHeader:m.length>0?m[0]:t,sectionHeaders:i,reverse:p,collapsedHeaders:s,initialWidthsMap:S,sectionWidth:M,isParentResize:m.length>1,childrenToResize:m})}else{var a=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=c(window.innerWidth);if(!n.pinned)return 1/0;var u=i*a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+g(n,r).reduce(function(e,n){return e+x(n)},0)},0),l=y(n);return l>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):u}({header:t,headers:r,collapsedHeaders:s});m.length>1?je({delta:n,leafHeaders:m,minWidth:I,startWidth:l,maxWidth:a}):m[0].width=Math.max(Math.min(l+n,a),I),r.forEach(function(e){b(e)})}var d=u([],r,!0);o(d)};if(w){var D=function(e){A(e.touches[0].clientX)},F=function(){document.removeEventListener("touchmove",D),document.removeEventListener("touchend",F),i(!1)};document.addEventListener("touchmove",D),document.addEventListener("touchend",F)}else{var P=function(e){A(e.clientX)},O=function(){document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",O),i(!1)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",O)}}},je=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,y(n))},40),u=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;t.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),r)})},Ve=function(e){var n=e.containerWidth,t=e.maxPinnedWidthPercent,r=void 0===t?.8:t,o=e.collapsedHeaders,i=0,a=0,u=0;e.headers.forEach(function(e){if(!e.hide){var n=g(e,o).reduce(function(e,n){return e+x(n)},0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:u+=n}});var l=i,s=a;if(n&&n>0){var c=n*r;i>c&&(i=c),a>c&&(a=c)}return{leftWidth:p(i),rightWidth:p(a),mainWidth:u,leftContentWidth:l,rightContentWidth:s}},Ue=function(e){var n=e.columnsToShrink,t=e.totalCompensation,r=e.initialWidthsMap;if(0>t){var o=Math.abs(t),i=n.reduce(function(e,n){return e+(r.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,t){var a=r.get(e.accessor)||100,u=o*(a/i);if(t===n.length-1){var l=n.slice(0,t).reduce(function(e,n){var t=r.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-t)},0);u=o-l}e.width=a+u})}else for(var a=t,u=function(){var e=n.map(function(e){var n=r.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-30),initialWidth:n,minWidth:30}}),t=e.filter(function(e){return e.headroom>0});if(t.length>0){var o=t.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;t.forEach(function(e,n){var r=u*(e.headroom/o);r=Math.min(r,e.headroom),n===t.length-1&&(r=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-r,i+=r}),a-=i}else{var l=e.filter(function(e){return e.minWidth>s});if(0>=l.length)return"break";var c=a,d=c/l.length,f=0;l.forEach(function(e,n){var t=e.minWidth-s,r=Math.min(d,t);n===l.length-1&&(r=Math.min(c-f,t));var o=e.initialWidth-r;e.column.width=o,e.column.minWidth=Math.max(o,s),f+=r}),a-=f}};a>.5&&"break"!==u(););},_e=function(e){var n=e.delta,t=e.startWidth,r=e.resizedHeader,o=e.sectionHeaders,i=e.reverse,a=e.collapsedHeaders,u=e.initialWidthsMap,l=e.sectionWidth,c=e.isParentResize,d=e.childrenToResize,f=void 0===d?[]:d;if(void 0!==c&&c&&f.length>1){var v=C(o,a),p=v.findIndex(function(e){return e.accessor===f[0].accessor}),h=v.findIndex(function(e){return e.accessor===f[f.length-1].accessor});if(-1===p||-1===h)return;var w,m=h===v.length-1;w=0===p?v.slice(h+1):m||i?v.slice(0,p):v.slice(h+1);var g=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){var x=n,b=!1;if(g+n>l){b=!0;var y=w.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-s)},0);x=Math.min(n,y)}var I=(R=t+x)/(S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0));f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*I,30)}),b&&x>0&&w.length>0&&Ue({columnsToShrink:w,totalCompensation:x,initialWidthsMap:u})}else{var R,S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0),M=(R=Math.max(t+n,s*f.length))/S;f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*M,30)}),(F=t-R)>0&&w.length>0&&Ue({columnsToShrink:w,totalCompensation:-F,initialWidthsMap:u})}}else{var N=C(o,a),H=N.findIndex(function(e){return e.accessor===r.accessor});if(-1!==H){var E,T=H===N.length-1;if(0!==(E=0===H?N.slice(H+1):T||i?N.slice(0,H):N.slice(H+1)).length){var k=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){if(l>=k+n)return void(r.width=t+n);y=E.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-s)},0);var A=Math.min(n,y);r.width=t+A,A>0&&Ue({columnsToShrink:E,totalCompensation:A,initialWidthsMap:u})}else{var D=Math.max(t+n,30),F=t-D;r.width=D,F>0&&Ue({columnsToShrink:E,totalCompensation:-F,initialWidthsMap:u})}}else r.width=Math.max(t+n,30)}}},Je={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Xe=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"]}},Ye=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},$e=function(e){return["between","notBetween","in","notIn"].includes(e)},Ze=function(e){return["isEmpty","isNotEmpty"].includes(e)},Qe=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},en=function(t){var r=t.value,o=t.onChange,i=t.options,a=t.placeholder,u=void 0===a?"Select...":a,l=t.className,s=void 0===l?"":l,c=t.disabled,d=void 0!==c&&c,f=n.useState(!1),v=f[0],p=f[1],h=n.useState(-1),w=h[0],m=h[1],g=n.useRef(null),x=i.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),m(function(e){return i.length-1>e?e+1:0});break;case"ArrowUp":e.preventDefault(),m(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),0>w||(o(i[w].value),p(!1),m(-1));break;case"Escape":e.preventDefault(),p(!1),m(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,w,i,o]);var b=function(e){o(e),p(!1),m(-1)};return e.jsxs("div",exports.__assign({ref:g,className:"st-custom-select ".concat(s," ").concat(d?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",exports.__assign({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!d)if(p(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===r});m(0>e?0:e)}},disabled:d,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",exports.__assign({className:"st-custom-select-value"},{children:x?x.label:u})),e.jsx($,{})]})),e.jsx(Q,exports.__assign({open:v,setOpen:p,onClose:function(){p(!1),m(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",exports.__assign({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,t){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),t)})}))}))]}))},nn=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Je[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(en,{value:t,onChange:function(e){r(e)},options:o})}))},tn=function(n){var t=n.type,r=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===t?"text":t,value:n.value,onChange:function(e){return r(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&a&&a()},placeholder:n.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},rn=function(n){var t=n.children,r=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},on=function(n){var t=n.onClear,r=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!r,className:"st-filter-button st-filter-button-apply ".concat(r?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&t&&e.jsx("button",exports.__assign({onClick:t,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},an=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=Xe("string");n.useEffect(function(){o?(s(o.operator),f((o.value||"")+"")):(s("contains"),f(""))},[o]);var p=function(){var e=exports.__assign({accessor:r.accessor,operator:l},Ye(l)&&{value:d});i(e)},h=Ze(l)||d.trim();return e.jsxs(Qe,{children:[e.jsx(nn,{value:l,onChange:s,operators:v}),Ye(l)&&e.jsx(rn,{children:e.jsx(tn,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(on,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},un=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],p=f[1],h=n.useState(((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")+""),w=h[0],m=h[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],y=Xe("number");n.useEffect(function(){var e,n;a?(d(a.operator),p((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),p(""),m(""),b(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:c};Ye(c)?e.value=parseFloat(v):$e(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(Qe,{children:[e.jsx(nn,{value:c,onChange:d,operators:y}),Ye(c)&&e.jsx(rn,{children:e.jsx(tn,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),$e(c)&&e.jsxs(rn,{children:[e.jsx(tn,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(tn,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(on,{onApply:C,onClear:l,canApply:!!Ze(c)||(Ye(c)?""!==v.trim():!!$e(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},ln=function(n){var t=n.className;return e.jsx(en,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===t?"":t,placeholder:n.placeholder})},sn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],s=u[1],c=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=c[0],f=c[1],v=Xe("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=Ze(l)||""!==d;return e.jsxs(Qe,{children:[e.jsx(nn,{value:l,onChange:s,operators:v}),Ye(l)&&e.jsx(rn,{children:e.jsx(ln,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(on,{onApply:function(){var e={accessor:r.accessor,operator:l};Ye(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},cn=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],p=f[1],h=n.useState((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])?a.values[0]+"":""),w=h[0],m=h[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],y=Xe("date");n.useEffect(function(){var e,n;a?(d(a.operator),p((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),p(""),m(""),b(""))},[a]);var C=function(t){var r=t.value,o=t.onChange,i=t.placeholder,a=t.autoFocus,u=t.className,l=n.useState(!1),s=l[0],c=l[1],d=n.useState(""),f=d[0],v=d[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=pe(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){a&&p.current&&p.current.focus()},[a]);var h=r?pe(r):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:f,placeholder:i,onClick:function(){c(!s)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),c(!s)):"Escape"===e.key&&c(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(Q,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(se,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(Qe,{children:[e.jsx(nn,{value:c,onChange:d,operators:y}),Ye(c)&&e.jsx(rn,{children:e.jsx(C,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),$e(c)&&e.jsxs(rn,{children:[e.jsx(C,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(C,{value:x,onChange:b,placeholder:"To date..."})]}),e.jsx(on,{onApply:function(){var e={accessor:i.accessor,operator:c};Ye(c)?e.value=v:$e(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!Ze(c)||(Ye(c)?""!==v.trim():!!$e(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},dn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,l=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),s=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),c=n.useState((null==o?void 0:o.values)?o.values.map(String):s),d=c[0],f=c[1],v=n.useState(""),p=v[0],h=v[1],w=n.useMemo(function(){if(!p)return l;var e=p.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,p]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:s)},[o,s]);var m=l.length>10;return e.jsxs(Qe,{children:[e.jsx(rn,{children:e.jsxs("div",exports.__assign({className:"st-enum-filter-options"},{children:[e.jsx("div",exports.__assign({className:"st-enum-select-all"},{children:e.jsx(Ee,exports.__assign({checked:d.length===s.length,onChange:function(e){f(e?s:[])}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),m&&e.jsx("div",exports.__assign({className:"st-enum-search"},{children:e.jsx(tn,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,t){return e.jsx(Ee,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(on,{onApply:function(){d.length!==s.length?i({accessor:r.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==s.length,showClear:!!o})]})},fn=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(un,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(sn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(cn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(dn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(an,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},vn=function(t){var r=t.content,o=t.children,i=t.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],s=u[1],c=n.useState({top:0,left:0}),d=c[0],f=c[1],v=n.useRef(null),p=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!r||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var h=n.cloneElement(o,{ref:p,onMouseEnter:function(){v.current=setTimeout(function(){if(p.current&&r.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),f({top:t,left:n}),s(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),s(!1)}});return e.jsxs(e.Fragment,{children:[h,l&&e.jsx("div",exports.__assign({className:"st-tooltip",style:{position:"fixed",top:"".concat(d.top,"px"),left:"".concat(d.left,"px"),zIndex:1e4}},{children:r}))]})},pn=function(t){var r,o,i=t.colIndex,a=t.gridColumnEnd,l=t.gridColumnStart,s=t.gridRowEnd,c=t.gridRowStart,v=t.header,p=t.parentHeader,w=t.reverse,m=t.sort,g=n.useState(!1),x=g[0],b=g[1],y=n.useState(!1),C=y[0],I=y[1],R=n.useState(v.label||""),S=R[0],M=R[1],N=K(),H=N.activeHeaderDropdown,E=N.areAllRowsSelected,T=N.autoExpandColumns,k=N.collapsedHeaders,A=N.columnBorders,D=N.columnReordering,F=N.columnResizing,P=N.columnsWithSelectedCells,O=N.draggedHeaderRef,L=N.enableHeaderEditing,W=N.filterIcon,B=N.handleApplyFilter,q=N.handleClearFilter,G=N.handleSelectAll,z=N.headerCollapseIcon,j=N.headerDropdown,V=N.headerExpandIcon,U=N.headerRegistry,_=N.headers,J=N.hoveredHeaderRef,X=N.onColumnOrderChange,Y=N.onColumnSelect,$=N.onHeaderEdit,Z=N.onSort,ee=N.onTableHeaderDragEnd,ne=N.headerHeight,re=N.selectColumns,oe=N.selectableColumns,ie=N.selectedColumns,ae=N.setActiveHeaderDropdown,ue=N.setCollapsedHeaders,se=N.setHeaders,ce=N.setInitialFocusedCell,de=N.setIsResizing,fe=N.setSelectedCells,ve=N.setSelectedColumns,pe=N.sortDownIcon,he=N.sortUpIcon,we=N.tableBodyContainerRef,me=!!(null==v?void 0:v.isSortable),ge=!!(null==v?void 0:v.filterable),xe=N.filters[v.accessor],ye=(null==H?void 0:H.accessor)===v.accessor,Ce=v.isSelectionColumn&&N.enableRowSelection,Ie=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(v),Re=k.has(v.accessor),Se=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,s=n.useRef(null),c=n.useState({}),d=c[0],f=c[1];return n.useEffect(function(){if(t&&s.current){var e=function(){if(s.current){var e=s.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=window.innerWidth-e.right,r="bottom",i={};o>n&&e.top>=o&&(r="top");var u="left";a>t+e.width&&(u="right"),"bottom"===r?i.top=e.bottom+l:i.bottom=window.innerHeight-e.top+l,"left"===u?i.left=e.left:i.right=window.innerWidth-e.right,f(i)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:s,position:d}}({isOpen:ye,estimatedHeight:200,estimatedWidth:250,margin:4}),Me=Se.triggerRef,Ne=Se.position,Te=n.useMemo(function(){var e,n,t;if(!A)return!1;var r=_.filter(function(e){return"left"===e.pinned}),o=_.filter(function(e){return!e.pinned}),i=_.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===v.accessor},[A,_,v.accessor,v.pinned]),ke=n.useMemo(function(){return!(!oe||Ce)&&f(v,i).some(function(e){return ie.has(e)})},[oe,Ce,v,i,ie]),Ae=n.useMemo(function(){return!Ce&&f(v,i).some(function(e){return P.has(e)})},[Ce,v,i,P]),De=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!Re||v.children.some(function(e){var n=e.showWhen||d;return"parentCollapsed"===n||"always"===n}))},[v.children,Re]),Fe=null==p?void 0:p.singleRowChildren,Pe=De&&!v.singleRowChildren,Oe="st-header-cell ".concat(v.accessor===(null===(r=J.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(o=O.current)||void 0===o?void 0:o.accessor)===v.accessor?"st-dragging":""," ").concat(me?"clickable":""," ").concat(D&&!me?"columnReordering":""," ").concat(Pe?"parent":""," ").concat(Fe?"st-sub-header":""," ").concat(Te?"st-last-column":""," ").concat(L&&!Ce?"st-header-editable":""," ").concat(ke?"st-header-selected":""," ").concat(Ae&&!ke?"st-header-has-highlighted-cell":""),Le=He({draggedHeaderRef:O,headers:_,hoveredHeaderRef:J,onColumnOrderChange:X,onTableHeaderDragEnd:ee}),We=Le.handleDragStart,Be=Le.handleDragEnd,qe=Le.handleDragOver,Ge=be();n.useEffect(function(){if(U&&!v.isSelectionColumn){var e=v.accessor+"";return U.set(e,{setEditing:function(e){I(e)}}),function(){U.delete(e)}}},[U,v.accessor,v.isSelectionColumn]),n.useEffect(function(){M(v.label||"")},[v.label]);var ze=function(e){b(!x)},je=n.useCallback(function(e){M(e);var n=_.map(function(n){return n.accessor===v.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});se(n),$&&$(v,e)},[_,se,$,v]),Ve=n.useCallback(function(){ae&&ae(null)},[ae]),Ue=n.useCallback(function(e){e.stopPropagation(),ue(function(e){var n=new Set(e);return Re?n.delete(v.accessor):n.add(v.accessor),n})},[ue,Re,v.accessor]),_e=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(oe){var r=f(t,i),o=r.some(function(e){return ie.has(e)});if(L&&o&&!n.shiftKey)return j&&ye&&Ve(),void I(!0);n.shiftKey&&re?ve(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);i>t&&(i=t,o=e)});var a,l,s,c=u(u([],(s=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-s+1},function(e,n){return s+n})),!0),r,!0);return new Set(u(u([],Array.from(e),!0),c,!0))}):re&&re(r),fe(new Set),ce(null)}Y&&Y(t),!oe&&t.isSortable&&Z(t.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!v)return null;var Je=F&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(v.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Ke,callbackProps:{event:e.nativeEvent,header:v,headers:_,setHeaders:se,setIsResizing:de,tableBodyContainerRef:we,startWidth:t,collapsedHeaders:k,autoExpandColumns:T,reverse:w},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Ke,callbackProps:{event:e,header:v,headers:_,setHeaders:se,setIsResizing:de,tableBodyContainerRef:we,startWidth:t,collapsedHeaders:k,autoExpandColumns:T,reverse:w},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Xe=m&&m.key.accessor===v.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return _e({event:e,header:v})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Z(v.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(v.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&he&&he,"desc"===m.direction&&pe&&pe]})),Ye=ge&&W&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:ze,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.target===e.currentTarget||e.currentTarget.contains(e.target))&&(e.target.closest(".st-dropdown-content")||(e.preventDefault(),ze()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(v.label),"aria-expanded":x,"aria-haspopup":"dialog"},{children:[n.cloneElement(W,{style:{fill:xe?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(Q,exports.__assign({open:x,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(fn,{header:v,currentFilter:xe,onApplyFilter:function(e){B(e),b(!1)},onClearFilter:function(){q(v.accessor),b(!1)}})}))]})),$e=Ie&&!Ce&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return Ue(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ue(e))},tabIndex:0,role:"button","aria-label":"".concat(Re?"Expand":"Collapse"," ").concat(v.label," column"),"aria-expanded":!Re},{children:Re?z:V})),Ze=e.jsx(vn,exports.__assign({content:v.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(Ee,{checked:!!E&&E(),onChange:function(e){G&&G(e)},ariaLabel:"Select all rows"}):C?e.jsx(te,{defaultValue:S,onBlur:function(){return I(!1)},onChange:je}):S||(null==v?void 0:v.label)}))})),Qe="header-desc-".concat(v.accessor),en=function(e,n){var t=[];return e.type&&"other"!==e.type&&t.push("".concat(e.type," column")),e.isSortable&&t.push("sortable"),n&&t.push("filterable"),e.tooltip&&t.push(e.tooltip),t.join(", ")}(v,ge);return e.jsxs(le,exports.__assign({className:Oe,id:h({accessor:v.accessor,rowId:"header"}),"aria-sort":function(){if(v.isSortable)return(null==m?void 0:m.key.accessor)===v.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"aria-describedby":en?Qe:void 0,onDragOver:function(e){Ce||Ge({callback:qe,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:exports.__assign({gridRowStart:c,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-c>1?{}:{height:ne})},{children:[w&&Je,!v.headerRenderer&&"right"===v.align&&$e,!v.headerRenderer&&"right"===v.align&&Ye,!v.headerRenderer&&"right"===v.align&&Xe,e.jsx("div",exports.__assign({ref:Me,className:"st-header-label",draggable:D&&!v.disableReorder&&!Ce,onClick:function(e){Ce||_e({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){var n=e.header;n.isSelectionColumn||oe&&n.isSortable&&Z(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),Be()},onDragStart:Ce?void 0:function(e){D&&v&&function(e){We(e)}(v)}},{children:v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:i,header:v,components:{sortIcon:Xe||void 0,filterIcon:Ye||void 0,collapseIcon:$e||void 0,labelContent:Ze}}):Ze})),!v.headerRenderer&&"right"!==v.align&&Xe,!v.headerRenderer&&"right"!==v.align&&Ye,!v.headerRenderer&&"right"!==v.align&&$e,!w&&Je,j&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:j({accessor:v.accessor,colIndex:i,header:v,isOpen:ye,onClose:Ve,position:Ne})})),en&&e.jsx("span",exports.__assign({id:Qe,className:"st-sr-only"},{children:en}))]}))},hn=function(t){var r=t.columnIndices,o=t.gridTemplateColumns,i=t.handleScroll,a=t.headers,u=t.maxDepth,l=t.pinned,s=t.sectionRef,c=t.sort,d=t.width,f=K().collapsedHeaders,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,s,c){var d,v;if(void 0===s&&(s=!1),!w({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;s||n++;var p,h,m=null!==(v=null===(d=o.children)||void 0===d?void 0:d.filter(function(e){return w({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==v?v:0,g=n;if(o.singleRowChildren&&m>0?(p=g+1,h=u+1):m>0?(p=g+m,h=i+1):(p=g+1,h=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:p,gridRowStart:i,gridRowEnd:h,colIndex:r[o.accessor],parentHeader:c}),o.children&&o.children.length>0){var x=o.singleRowChildren?i:i+1,b=!o.singleRowChildren;o.children.forEach(function(e){w({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(t(e,x,b,o),b=!1)})}return p-g},o=a.filter(function(e){return w({header:e,pinned:l,headers:a,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[a,u,l,r,f]);return e.jsx(Be,exports.__assign({childRef:s,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:"st-header-".concat(l?"pinned-".concat(l):"main")},i&&{onScroll:i},{ref:s,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(pn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:c},n.header.accessor)})})}))}))},wn=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,a=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,l=t.pinnedRightColumns,s=t.pinnedRightTemplateColumns,c=t.sort,d=t.pinnedLeftWidth,f=t.pinnedRightWidth,v=K(),p=v.headerContainerRef,h=v.pinnedLeftRef,w=v.pinnedRightRef,m=v.collapsedHeaders,g=v.tableRows,x=v.maxHeaderDepth,b=n.useMemo(function(){return Ge({headers:o,pinnedLeftColumns:a,pinnedRightColumns:l,collapsedHeaders:m})},[o,a,l,m]),y=n.useMemo(function(){return Object.keys(b).length},[b]);return e.jsxs("div",exports.__assign({className:"st-header-container",ref:p,"aria-rowcount":g.length+x,"aria-colcount":y},{children:[Ie(o,"left")&&e.jsx(hn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:x,pinned:"left",sectionRef:h,sort:c,width:d}),e.jsx(hn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:x,sectionRef:r,sort:c}),Ie(o,"right")&&e.jsx(hn,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:x,pinned:"right",sectionRef:w,sort:c,width:f})]}))},mn=function(e){var n=e.collapsedHeaders,t=e.autoExpandColumns,r=function(e){var t=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide&&!e.excludeFromRender)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||d;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&t.push(e),o.length>0?r({headers:o,flattenedHeaders:t}):e.singleRowChildren||t.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||d;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&t.push(e),r({headers:i,flattenedHeaders:t})}else t.push(e)}),t},o=r({headers:e.headers,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e,n){var t=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),t&&"number"==typeof t&&(t="".concat(t,"px")),void 0===t||n?r:"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(t,", ").concat(r,")"):"max(".concat(t,", ").concat(r,")")}(e,t)}).join(" "))},gn=function(t){var r=t.hideHeader,o=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,u=t.setScrollDirection,l=t.shouldShowEmptyState,s=t.sort,c=t.tableRows,d=t.rowsToRender,f=K(),v=f.columnResizing,p=f.editColumns,h=f.headers,w=f.collapsedHeaders,m=f.autoExpandColumns,g=n.useRef(null),x=h.filter(function(e){return!e.pinned}),b=h.filter(function(e){return"left"===e.pinned}),y=h.filter(function(e){return"right"===e.pinned}),C=n.useMemo(function(){return mn({headers:b,collapsedHeaders:w,autoExpandColumns:m})},[b,w,m]),I=n.useMemo(function(){return mn({headers:x,collapsedHeaders:w,autoExpandColumns:m})},[x,w,m]),R=n.useMemo(function(){return mn({headers:y,collapsedHeaders:w,autoExpandColumns:m})},[y,w,m]),S={centerHeaderRef:g,headers:h,mainTemplateColumns:I,pinnedLeftColumns:b,pinnedLeftTemplateColumns:C,pinnedRightColumns:y,pinnedRightTemplateColumns:R,sort:s,pinnedLeftWidth:o,pinnedRightWidth:i},M={mainTemplateColumns:I,pinnedLeftColumns:b,pinnedLeftTemplateColumns:C,pinnedLeftWidth:o,pinnedRightColumns:y,pinnedRightTemplateColumns:R,pinnedRightWidth:i,rowsToRender:d,setScrollDirection:u,setScrollTop:a,shouldShowEmptyState:l,tableRows:c};return e.jsxs("div",exports.__assign({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:p?"calc(100% - 27.5px)":"100%"}},{children:[!r&&e.jsx(wn,exports.__assign({},S)),e.jsx(ze,exports.__assign({},M))]}))},xn=function(t){var r=t.mainBodyWidth,o=t.mainBodyRef,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.pinnedLeftContentWidth,l=t.pinnedRightContentWidth,s=t.tableBodyContainerRef,c=K().editColumns,d=n.useState(!1),f=d[0],v=d[1],p=n.useRef(null),h=n.useRef(null),w=n.useRef(null),m=c?28:0,g=(c?a+1:a)+(s.current&&s.current&&s.current.scrollHeight>s.current.clientHeight?s.current.offsetWidth-s.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){o.current&&v(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,r]),f?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(Be,exports.__assign({childRef:h,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:h,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),r>0&&e.jsx(Be,exports.__assign({childRef:p},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:p},{children:e.jsx("div",{style:{width:r}})}))})),a>0&&e.jsx(Be,exports.__assign({childRef:w,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:w,style:{width:g}},{children:e.jsx("div",{style:{width:l}})}))})),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},bn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"asc"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"asc"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"asc"===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"asc"===t?i:-i},enum:function(e,n,t){return bn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"asc"===t?-1:1:null==n?"asc"===t?1:-1:"string"==typeof e&&"string"==typeof n?bn.string(e,n,t):"number"==typeof e&&"number"==typeof n?bn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?bn.boolean(e,n,t):bn.string(e+"",n+"",t)}},yn=function(e){return function(e){var n=e.rows,t=e.sortColumn,r=function(e,n){for(var t=0,o=e;o.length>t;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children,n);if(a)return a}}},o=r(e.headers,t.key.accessor),i=(null==o?void 0:o.type)||"string",a=t.direction,l=t.key.accessor;return u([],n,!0).sort(function(e,t){var r,u;if(null==o?void 0:o.valueGetter){var s=n.indexOf(e),c=n.indexOf(t);r=o.valueGetter({accessor:l,row:e,rowIndex:s}),u=o.valueGetter({accessor:l,row:t,rowIndex:c})}else r=S(e,l),u=S(t,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:t,valueA:r,valueB:u,direction:a}):function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"asc"===r?-1:1;if(null==n||""===n)return"asc"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=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 bn.number(i,a,r)}return"date"===t?bn.date(e+"",n+"",r):"boolean"===t?bn.boolean(!!e,!!n,r):"enum"===t?bn.enum(e+"",n+"",r):bn.string(e+"",n+"",r)}(r,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Cn=function(e){return n.useMemo(function(){var n=v(e),t=new Map;return n.forEach(function(e){t.set(e.accessor,e)}),t},[e])},In=function(e){var n=e.tableRows,t=e.sortColumn,r=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:t?r&&r.length>0?(0,e.sortNestedRows)({groupingKeys:r,headers:o,rows:n,sortColumn:t}):yn({headers:o,rows:n,sortColumn:t}):n},Rn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;o.length>r;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}),u=!1;if(!a)for(var l=0,s=i.children;s.length>l;l++){var c=s[l];if(Rn([c],n,t),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},Sn=function(e){return e.every(function(e){return e.hide})},Mn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Mn(e.children),Sn(e.children)&&(e.hide=!0))})},Nn=function(t){var r=t.allHeaders,o=t.depth,i=void 0===o?0:o,a=t.doesAnyHeaderHaveChildren,l=t.header,s=t.isCheckedOverride,c=n.useState(!0),d=c[0],f=c[1],v=K(),p=v.expandIcon,h=v.headers,w=v.setHeaders,m=v.onColumnVisibilityChange,g=a?"".concat(16*i,"px"):"8px",x=l.children&&l.children.length>0,b=null!=s?s:l.hide||x&&l.children&&Sn(l.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:g}},{children:[a&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:x?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(d?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!d)}},{children:p})):null})),e.jsx(Ee,exports.__assign({checked:b,onChange:function(e){l.hide=e,e?Mn(r):(Rn(r,l.accessor),x&&l.children&&l.children.length>0&&l.children.every(function(e){return!0===e.hide})&&l.children[0]&&(l.children[0].hide=!1,Rn(r,l.children[0].accessor)));var n=u([],h,!0);if(w(n),m){var t=function(e){var n={},t=function(e){n[e.accessor]=!e.hide,e.children&&e.children.length>0&&e.children.forEach(t)};return e.forEach(t),n}(n);m(t)}}},{children:l.label}))]})),x&&d&&l.children&&e.jsx("div",exports.__assign({className:"st-nested-headers"},{children:l.children.map(function(n,t){return e.jsx(Nn,{allHeaders:r,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!b||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},Hn=function(t){var r=t.headers,o=t.open,i="left"===t.position?"left":"",a=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn||n.excludeFromRender?null:e.jsx(Nn,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},En=function(t){var r=t.columnEditorText,o=t.editColumns,i=t.headers,a=t.position,u=void 0===a?"right":a,l=n.useState(t.editColumnsInitOpen),s=l[0],c=l[1];return o?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(s?"open":""," ").concat(u),onClick:function(){return function(e){c(e)}(!s)},style:{width:28}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:r})),e.jsx(Hn,{headers:i,open:s,position:u})]})):null},Tn=function(t){var o=t.children,i=n.useRef({}),a=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),u=n.useCallback(function(e,n){e.scrollWidth-e.clientWidth>0&&(n.scrollLeft=e.scrollLeft)},[]),l=n.useCallback(function(e){e.onscroll=null},[]),s=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=i.current[n])||void 0===t||t.forEach(function(n){e!==n&&(l(n),u(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});s(n,e)}))})})})}},[l,u]),c=n.useCallback(function(e,n){n.forEach(function(n){i.current[n]||(i.current[n]=[]),a(e,n)||(i.current[n].length>0&&u(i.current[n][0],e),i.current[n].push(e))}),s(e,n)},[a,u,s]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var t=i.current[n].indexOf(e);-1!==t&&i.current[n].splice(t,1)}})},[a,l]);return e.jsx(We.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:r.default.Children.only(o)}))},kn=function(e){var n=e.tableRows,t=e.filterState;return e.externalFilterHandling?n:t&&0!==Object.keys(t).length?n.filter(function(e){return Object.values(t).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||""===(e+"").trim();if("isNotEmpty"===t)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=(e+"").toLowerCase(),a=r?(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(+e)){var u=+e,l=+r;switch(t){case"equals":return u===l;case"notEquals":return u!==l;case"greaterThan":return u>l;case"lessThan":return l>u;case"greaterThanOrEqual":return u>=l;case"lessThanOrEqual":return l>=u;case"between":if(o&&2===o.length){var s=o.map(Number),c=s[1];return u>=s[0]&&c>=u}return!1;case"notBetween":if(o&&2===o.length){var d=o.map(Number);return c=d[1],d[0]>u||u>c}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=pe(e),v=pe((r||"")+""),p=ve(f),h=ve(v);switch(t){case"equals":return p.getTime()===h.getTime();case"notEquals":return p.getTime()!==h.getTime();case"before":return h>p;case"after":return p>h;case"between":if(o&&2===o.length){var w=o.map(function(e){return ve(pe((e||"")+""))}),m=w[1];return p>=w[0]&&m>=p}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(e){return ve(pe((e||"")+""))});return m=g[1],g[0]>p||p>m}return!0}}if("boolean"==typeof e&&"equals"===t)return e===!!r;if(Array.isArray(e)){var x=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", ");e=x}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===t?b:!b}return!1}var y=(e+"").toLowerCase(),C=r?(r+"").toLowerCase():"";switch(t){case"equals":return y===C;case"notEquals":return y!==C;default:return!0}}(S(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},An=function(e){var n,t=document.querySelector(".simple-table-root");if("string"==typeof e){if(e.endsWith("px"))return parseInt(e,10);if(e.endsWith("vh"))return window.innerHeight*parseInt(e,10)/100;if(e.endsWith("%")){var r=null===(n=null==t?void 0:t.parentElement)||void 0===n?void 0:n.clientHeight;return!r||50>r?0:r*parseInt(e,10)/100}return window.innerHeight}return e},Dn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;if(r&&t&&N(t))i(t);else{var a=S(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,u=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===u.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=u.reduce(function(e,n){return e+n},0);break;case"average":a=u.reduce(function(e,n){return e+n},0)/u.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,u);break;case"max":a=Math.max.apply(Math,u);break;default:return}return t.formatResult?t.formatResult(a):a}},Fn=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},Pn=function(e){return function(){for(var n=[],t=0;arguments.length>t;t++)n[t]=arguments[t];return new Promise(function(t){e.apply(void 0,n),setTimeout(function(){return t()},0)})}},On=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},Ln={COLUMN_REORDER:{duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ROW_REORDER:{duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},REDUCED_MOTION:{duration:150,easing:"ease-out",delay:0}},Wn=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")},Bn=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){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(){Wn(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},qn=function(e){var t=e.rows,r=e.rowGrouping,o=void 0===r?[]:r,i=e.expandedRows,a=e.collapsedRows,l=e.expandedDepths,s=e.rowStateMap,c=e.hasLoadingRenderer,d=e.hasErrorRenderer,f=e.hasEmptyRenderer,v=e.headers,p=e.rowHeight,h=e.headerHeight,w=e.customTheme;return n.useMemo(function(){if(!o||0===o.length){var e=t.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowPath:[n],absoluteRowIndex:n}});return{flattenedRows:e,heightOffsets:[],paginatableRows:e}}var n=[],r=[],m=[],g=0,x=function(e,t,b){void 0===b&&(b=[]),e.forEach(function(e,y){var C,R,S=o[t],M=n.length,N=u(u([],b,!0),[y],!1),k=H(N),A={row:e,depth:t,displayPosition:g,groupingKey:S,position:M,isLastGroupRow:0===t,rowPath:N,absoluteRowIndex:M};if(n.push(A),r.push(A),g++,T(k,t,l,i,a)&&o.length>t){var D=null==s?void 0:s.get(k),F=E(e,S),P=v.find(function(e){return e.expandable&&e.nestedTable});if((null==P?void 0:P.nestedTable)&&F.length>0){var O=n.length,L=(null===(C=P.nestedTable.customTheme)||void 0===C?void 0:C.rowHeight)||p,W=(null===(R=P.nestedTable.customTheme)||void 0===R?void 0:R.headerHeight)||h,B=I({childRowCount:F.length,rowHeight:L,headerHeight:W,customTheme:w});m.push([O,B-p]),n.push({row:{},depth:t+1,displayPosition:g-1,groupingKey:S,position:O,isLastGroupRow:!1,rowPath:u(u([],N,!0),[S],!1),nestedTable:{parentRow:e,expandableHeader:P,childAccessor:S,calculatedHeight:B},absoluteRowIndex:O})}else if(D&&(D.loading||D.error||D.isEmpty)){if(D.loading&&c||D.error&&d||D.isEmpty&&f){var q=n.length;n.push({row:{},depth:t+1,displayPosition:g-1,groupingKey:S,position:q,isLastGroupRow:!1,rowPath:u(u([],N,!0),[S],!1),stateIndicator:{parentRowId:k,state:D},absoluteRowIndex:q})}else if(D.loading&&!c){var G=n.length;n.push({row:{},depth:t+1,displayPosition:g-1,groupingKey:S,position:G,isLastGroupRow:!1,rowPath:u(u([],N,!0),[S,"loading-skeleton"],!1),isLoadingSkeleton:!0,absoluteRowIndex:G})}}else if(F.length>0){var z=u(u([],N,!0),[S],!1);x(F,t+1,z)}}})};return x(t,0),{flattenedRows:n,heightOffsets:m,paginatableRows:r}},[t,o,i,a,l,s,c,d,f,v,p,h,w])},Gn=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},zn={rowHeight:32,headerHeight:32,footerHeight:49,rowSeparatorWidth:1,borderWidth:1,pinnedBorderWidth:1,nestedGridBorderWidth:2,nestedGridPaddingTop:8,nestedGridPaddingBottom:8,nestedGridPaddingLeft:8,nestedGridPaddingRight:8,nestedGridMaxHeight:400,selectionColumnWidth:42},Kn=function(t){var r=n.useState(!1),o=r[0],i=r[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(jn,exports.__assign({},t)):null},jn=function(t){var r=t.allowAnimations,o=void 0!==r&&r,s=t.autoExpandColumns,d=void 0!==s&&s,f=t.canExpandRowGroup,p=t.cellUpdateFlash,h=void 0!==p&&p,w=t.className,x=t.columnBorders,b=void 0!==x&&x,y=t.columnEditorPosition,C=void 0===y?"right":y,I=t.columnEditorText,R=void 0===I?"Columns":I,E=t.columnReordering,T=void 0!==E&&E,A=t.columnResizing,D=void 0!==A&&A,F=t.copyHeadersToClipboard,O=void 0!==F&&F,L=t.customTheme,W=t.defaultHeaders,G=t.editColumns,K=void 0!==G&&G,J=t.editColumnsInitOpen,$=void 0!==J&&J,Q=t.emptyStateRenderer,ee=t.enableHeaderEditing,ne=void 0!==ee&&ee,te=t.enableRowSelection,re=void 0!==te&&te,oe=t.errorStateRenderer,ie=t.expandAll,ae=void 0===ie||ie,ue=t.expandIcon,le=void 0===ue?e.jsx(U,{className:"st-expand-icon"}):ue,se=t.externalFilterHandling,ce=void 0!==se&&se,de=t.externalSortHandling,fe=void 0!==de&&de,ve=t.filterIcon,pe=void 0===ve?e.jsx(Y,{className:"st-header-icon"}):ve,he=t.footerRenderer,we=t.headerCollapseIcon,me=void 0===we?e.jsx(U,{className:"st-header-icon"}):we,ge=t.headerDropdown,xe=t.headerExpandIcon,be=void 0===xe?e.jsx(V,{className:"st-header-icon"}):xe,Ce=t.height,Ie=t.hideFooter,Re=void 0!==Ie&&Ie,Se=t.hideHeader,Me=void 0!==Se&&Se,Ne=t.includeHeadersInCSVExport,He=void 0===Ne||Ne,Ee=t.initialSortColumn,Te=t.initialSortDirection,ke=void 0===Te?"asc":Te,Ae=t.isLoading,De=void 0!==Ae&&Ae,Fe=t.loadingStateRenderer,Pe=t.maxHeight,Oe=t.nextIcon,Le=void 0===Oe?e.jsx(U,{className:"st-next-prev-icon"}):Oe,We=t.onCellClick,Be=t.onCellEdit,qe=t.onColumnOrderChange,Ge=t.onColumnSelect,ze=t.onColumnVisibilityChange,Ke=t.onFilterChange,je=t.onGridReady,Ue=t.onHeaderEdit,_e=t.onLoadMore,Je=t.onNextPage,Xe=t.onPageChange,Ye=t.onRowGroupExpand,$e=t.onRowSelectionChange,Ze=t.onSortChange,Qe=t.prevIcon,en=void 0===Qe?e.jsx(V,{className:"st-next-prev-icon"}):Qe,nn=t.rowButtons,tn=t.rowGrouping,rn=t.rows,on=t.rowsPerPage,an=void 0===on?10:on,un=t.selectableCells,ln=void 0!==un&&un,sn=t.selectableColumns,cn=void 0!==sn&&sn,dn=t.serverSidePagination,fn=void 0!==dn&&dn,vn=t.shouldPaginate,pn=void 0!==vn&&vn,hn=t.sortDownIcon,wn=void 0===hn?e.jsx(X,{className:"st-header-icon"}):hn,mn=t.sortUpIcon,bn=void 0===mn?e.jsx(_,{className:"st-header-icon"}):mn,Rn=t.tableEmptyStateRenderer,Sn=void 0===Rn?e.jsx(Gn,{}):Rn,Mn=t.tableRef,Nn=t.theme,Hn=void 0===Nn?"light":Nn,On=t.totalRowCount,Wn=t.useHoverRowBackground,Bn=void 0===Wn||Wn,Kn=t.useOddColumnBackground,jn=void 0!==Kn&&Kn,Vn=t.useOddEvenRowBackground,Un=void 0!==Vn&&Vn,_n=n.useMemo(function(){return exports.__assign(exports.__assign({},zn),L)},[L]),Jn=_n.rowHeight,Xn=_n.headerHeight,Yn=_n.footerHeight,$n=_n.selectionColumnWidth;jn&&(Un=!1),b&&(Bn=!1);var Zn=n.useRef(null),Qn=n.useRef(null),et=n.useRef(null),nt=n.useRef(null),tt=n.useRef(null),rt=n.useRef(null),ot=n.useRef(null),it=n.useReducer(function(e){return e+1},0)[1],at=n.useState(new Map),ut=at[0],lt=at[1],st=n.useState(rn),ct=st[0],dt=st[1],ft=n.useRef(new Map);n.useEffect(function(){dt(rn);var e=new Map;rn.forEach(function(n,t){var r=H([t]);e.set(r,t)}),ft.current=e},[rn]);var vt,pt,ht,wt,mt,gt,xt,bt,yt,Ct,It=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){t.current&&i(t.current.offsetWidth-t.current.clientWidth)},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:rt}),Rt=It.scrollbarWidth,St=It.setScrollbarWidth,Mt=Z({headerContainerRef:ot,mainSectionRef:rt,scrollbarWidth:Rt}).isMainSectionScrollable,Nt=n.useMemo(function(){if(De&&0===ct.length){var e=pn?an:10;return Mt&&(e+=1),Array.from({length:e},function(e,n){return{}})}return ct},[De,ct,an,Mt,pn]),Ht=n.useState(1),Et=Ht[0],Tt=Ht[1],kt=n.useState(W),At=kt[0],Dt=kt[1],Ft=n.useState(!1),Pt=Ft[0],Ot=Ft[1],Lt=n.useState(!1),Wt=Lt[0],Bt=Lt[1],qt=n.useState(null),Gt=qt[0],zt=qt[1],Kt=n.useCallback(function(){var e=new Set,n=function(t){t.forEach(function(t){t.collapseDefault&&t.collapsible&&e.add(t.accessor),t.children&&n(t.children)})};return n(W),e},[W]),jt=n.useState(Kt),Vt=jt[0],Ut=jt[1];n.useEffect(function(){Dt(W)},[W]);var _t=n.useMemo(function(){var e,n=u([],At,!0);return re&&!(null===(e=null==At?void 0:At[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:$n,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[re,At,$n]),Jt=n.useState(0),Xt=Jt[0],Yt=Jt[1],$t=n.useState("none"),Zt=$t[0],Qt=$t[1],er=function(e,t){var r=n.useState(function(){return function(e,n){if(!n||0===n.length)return new Set;if(e){var t=Array.from({length:n.length},function(e,n){return n});return new Set(t)}return new Set}(e,t)}),o=r[0],i=r[1];return n.useEffect(function(){i(t&&0!==t.length?function(e){var n=t.length,r=Array.from(e).filter(function(e){return n>e});return new Set(r)}:new Set)},[t]),{expandedDepths:o,setExpandedDepths:i}}(ae,tn),nr=er.expandedDepths,tr=er.setExpandedDepths,rr=n.useState(new Map),or=rr[0],ir=rr[1],ar=n.useState(new Map),ur=ar[0],lr=ar[1],sr=function(){var e=n.useState(""),t=e[0],r=e[1],o=n.useRef(null);return n.useEffect(function(){return t&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){r("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[t]),{announcement:t,announce:function(e){r(e)}}}(),cr=sr.announcement,dr=sr.announce,fr=function(e){var t=e.effectiveHeaders,r=e.headerHeight,o=e.rowHeight,i=e.tableBodyContainerRef,a=n.useState(0),u=a[0],l=a[1],s=n.useCallback(function(e){var n,t;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(t=e.children)||void 0===t?void 0:t.length)?1+Math.max.apply(Math,e.children.map(s)):1},[]),c=n.useMemo(function(){var e=0;return t.forEach(function(n){var t=s(n);e=Math.max(e,t)}),e},[t,s]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,t=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(t){var i=parseFloat(t);isNaN(i)||(e=i)}}return c*(null!=r?r:o)+e},[c,r,o]);return n.useLayoutEffect(function(){var e=function(){i.current&&l(i.current.clientWidth)};e();var n=null;return i.current&&(n=new ResizeObserver(e)).observe(i.current),function(){n&&n.disconnect()}},[i]),{containerWidth:u,calculatedHeaderHeight:d,maxHeaderDepth:c}}({effectiveHeaders:_t,headerHeight:Xn,rowHeight:Jn,tableBodyContainerRef:rt}),vr=fr.containerWidth,pr=fr.calculatedHeaderHeight,hr=fr.maxHeaderDepth,wr=n.useRef(0),mr=n.useRef(0),gr=n.useMemo(function(){var e=c(window.innerWidth),n=Ve({headers:_t,containerWidth:vr,maxPinnedWidthPercent:e,collapsedHeaders:Vt});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[_t,vr,Vt]),xr=gr.mainBodyWidth,br=gr.pinnedLeftWidth,yr=gr.pinnedRightWidth,Cr=gr.pinnedLeftContentWidth,Ir=gr.pinnedRightContentWidth;n.useEffect(function(){if(d&&0!==vr&&!Pt){var e,n=function(e){var t=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?t.push.apply(t,n(e.children)):t.push(e))}),t};if((e=et.current?et.current.clientWidth:Math.max(0,vr-br-yr))>0){var t=At.filter(function(e){return!e.pinned});n(t).length===mr.current&&10>Math.abs(e-wr.current)||Dt(function(t){var r=t.filter(function(e){return!e.pinned}),o=n(r),i=o.reduce(function(e,n){return e+("number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150)},0);if(0===i)return t;var a=e/i;if(.01>Math.abs(a-1))return t;wr.current=e,mr.current=o.length;var u=new Map,l=0;o.forEach(function(n,t){if(!n.pinned){var r,i="number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150;t===o.length-1?r=e-l:l+=r=Math.round(i*a),u.set(n.accessor,r)}});var s=function(e){var n;if(e.hide)return e;var t=null===(n=e.children)||void 0===n?void 0:n.map(s);if(!e.children||0===e.children.length){if(e.pinned)return exports.__assign(exports.__assign({},e),{children:t});var r=u.get(e.accessor);if(void 0!==r)return exports.__assign(exports.__assign({},e),{width:r,children:t});var o="number"==typeof e.width?e.width:"string"==typeof e.width&&e.width.endsWith("px")?parseFloat(e.width):150;return exports.__assign(exports.__assign({},e),{width:Math.round(o*a),children:t})}return exports.__assign(exports.__assign({},e),{children:t})};return t.map(s)})}}},[d,vr,Pt,At,br,yr]);var Rr=function(e){var t=e.rows,r=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return t;var e=function(e){return v(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=o[t],a=o[t+1],u=n[r];if(u&&N(u)){var l=i(u,t+1),s=exports.__assign({},n);return s[r]=l,e.forEach(function(e){var n=Dn(l,e.accessor,e.aggregation,a);void 0!==n&&M(s,e.accessor,n)}),s}return n})};return i(n)},[t,r,o])}({rows:Nt,headers:At,rowGrouping:tn}),Sr=function(e){var t=e.rows,r=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],s=u[1],c=Cn(r),d=n.useMemo(function(){return kn({externalFilterHandling:o,tableRows:t,filterState:l})},[t,l,o]),f=n.useCallback(function(e){var n,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(s(t),null==i||i(t),a){var r=c.get(e.accessor);r&&a("Filter applied to ".concat(r.label))}},[l,i,a,c]),v=n.useCallback(function(e){var n=exports.__assign({},l);if(delete n[e],s(n),null==i||i(n),a){var t=c.get(e);t&&a("Filter removed from ".concat(t.label))}},[l,i,a,c]),p=n.useCallback(function(){s({}),null==i||i({}),a&&a("All filters cleared")},[i,a]),h=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return kn({externalFilterHandling:o,tableRows:t,filterState:r})},[l,t,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Rr,headers:_t,externalFilterHandling:ce,onFilterChange:Ke,announce:dr}),Mr=Sr.filters,Nr=Sr.updateFilter,Hr=Sr.clearFilter,Er=Sr.clearAllFilters,Tr=Sr.computeFilteredRowsPreview,kr=function(e){var t=e.headers,r=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,s=e.announce,c=Cn(t),d=n.useCallback(function(){if(!u)return null;var e=c.get(u);return e?{key:e,direction:l||"asc"}:null},[c,u,l]),f=n.useState(d),v=f[0],p=f[1],h=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.sortColumn,o=yn({headers:t,rows:e.rows,sortColumn:r});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(N(a)){var u=h({rows:a,sortColumn:r,headers:t,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return In({externalSortHandling:o,tableRows:r,sortColumn:v,rowGrouping:a,headers:t,sortNestedRows:h})},[r,v,t,o,a,h]),m=n.useCallback(function(e){if(!e)return p(null),void(null==i||i(null));var n=e.accessor,t=e.direction,r=c.get(n);if(r){var o=null;if(t?o={key:r,direction:t}:v&&v.key.accessor===n?"asc"===v.direction&&(o={key:r,direction:"desc"}):o={key:r,direction:"asc"},p(o),null==i||i(o),s)if(o){var a="asc"===o.direction?"ascending":"descending";s("Sorted by ".concat(r.label,", ").concat(a))}else s("Sort removed from ".concat(r.label))}},[v,c,i,s]),g=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;o.length>r;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}}},i=n(t);if(!i)return r;var u=null;return v&&v.key.accessor===e?"asc"===v.direction&&(u={key:i,direction:"desc"}):u={key:i,direction:"asc"},In({externalSortHandling:o,tableRows:r,sortColumn:u,rowGrouping:a,headers:t,sortNestedRows:h})},[v,t,r,o,a,h]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:g}}({headers:At,tableRows:Sr.filteredRows,externalSortHandling:fe,onSortChange:Ze,rowGrouping:tn,initialSortColumn:Ee,initialSortDirection:ke,announce:dr}),Ar=kr.sort,Dr=kr.updateSort,Fr=kr.computeSortedRowsPreview,Pr=qn({rows:kr.sortedRows,rowGrouping:tn,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!oe,hasEmptyRenderer:!!Q,headers:_t,rowHeight:Jn,headerHeight:Xn,customTheme:_n}),Or=Pr.flattenedRows,Lr=Pr.heightOffsets,Wr=Pr.paginatableRows,Br=function(e){var t=e.tableRows,r=e.onRowSelectionChange,o=e.enableRowSelection,i=void 0!==o&&o,a=n.useState(new Set),u=a[0],l=a[1],s=n.useCallback(function(e){return!!i&&function(e,n){return n.has(e)}(e,u)},[u,i]),c=n.useCallback(function(){return!!i&&function(e,n){return 0!==e.length&&e.every(function(e){return n.has(H(e.rowPath||[e.position])+"")})}(t,u)},[t,u,i]),d=n.useMemo(function(){return i?function(e){return e.size}(u):0},[u,i]),f=n.useMemo(function(){return i?function(e,n){return e.filter(function(e){return n.has(H(e.rowPath||[e.position])+"")}).map(function(e){return e.row})}(t,u):[]},[t,u,i]),v=n.useCallback(function(e,n){if(i){var o=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(l(o),r){var a=t.find(function(n){return H(n.rowPath||[n.position])+""===e});a&&r({row:a.row,isSelected:n,selectedRows:o})}}},[u,t,r,i]),p=n.useCallback(function(e){var n;i&&(e?(n=function(e){return new Set(e.map(function(e){return H(e.rowPath||[e.position])+""}))}(t),r&&t.forEach(function(e){return r({row:e.row,isSelected:!0,selectedRows:n})})):(n=new Set,r&&u.forEach(function(e){var o=t.find(function(n){return H(n.rowPath||[n.position])+""===e});o&&r({row:o.row,isSelected:!1,selectedRows:n})})),l(n))},[t,r,u,i]),h=n.useCallback(function(e){if(i){var n=s(e);v(e,!n)}},[s,v,i]),w=n.useCallback(function(){if(i){if(r){var e=new Set;u.forEach(function(n){var o=t.find(function(e){return H(e.rowPath||[e.position])+""===n});o&&r({row:o.row,isSelected:!1,selectedRows:e})})}l(new Set)}},[u,t,r,i]);return{selectedRows:u,setSelectedRows:l,isRowSelected:s,areAllRowsSelected:c,selectedRowCount:d,selectedRowsData:f,handleRowSelect:v,handleSelectAll:p,handleToggleRow:h,clearSelection:w}}({tableRows:Or,onRowSelectionChange:$e,enableRowSelection:re});vt=Br.selectedRows,pt=Br.setSelectedRows,ht=Br.isRowSelected,wt=Br.areAllRowsSelected,mt=Br.selectedRowCount,gt=Br.selectedRowsData,xt=Br.handleRowSelect,bt=Br.handleSelectAll,yt=Br.handleToggleRow,Ct=Br.clearSelection;var qr=qn({rows:Rr,rowGrouping:tn,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!oe,hasEmptyRenderer:!!Q,headers:_t,rowHeight:Jn,headerHeight:Xn,customTheme:_n}).flattenedRows,Gr=n.useCallback(function(e){var n=Tr(e);return tn&&0!==tn.length?k({rows:n,rowGrouping:tn,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!oe,hasEmptyRenderer:!!Q,headers:_t,rowHeight:Jn,headerHeight:Xn,customTheme:_n}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowPath:[n],absoluteRowIndex:n}})},[Tr,tn,or,ur,nr,ut,Fe,oe,Q,_t,Jn,Xn,_n]),zr=n.useCallback(function(e){var n=Fr(e);return tn&&0!==tn.length?k({rows:n,rowGrouping:tn,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!oe,hasEmptyRenderer:!!Q,headers:_t,rowHeight:Jn,headerHeight:Xn,customTheme:_n}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowPath:[n],absoluteRowIndex:n}})},[Fr,tn,or,ur,nr,ut,Fe,oe,Q,_t,Jn,Xn,_n]),Kr=function(e){var t=e.height,r=e.maxHeight,o=e.rowHeight,i=e.shouldPaginate,a=e.rowsPerPage,u=e.totalRowCount,l=e.headerHeight,s=e.footerHeight;return n.useMemo(function(){if(r){var e=An(r);if(0===e)return;var n=l||o;if(e>=n+u*o+(s||0)||20>u)return;return Math.max(0,e-n)}if(!t&&i&&a)return o*(a+1);if(t){var c=An(t);if(0!==c)return Math.max(0,c-o)}},[t,r,o,i,a,u,l,s])}({height:Ce,maxHeight:Pe,rowHeight:Jn,shouldPaginate:pn,rowsPerPage:an,totalRowCount:null!=On?On:Wr.length,headerHeight:pr,footerHeight:pn&&!Re?Yn:void 0}),jr=function(e){var t=e.allowAnimations,r=e.flattenedRows,o=e.originalFlattenedRows,i=e.paginatableRows,a=e.currentPage,s=e.rowsPerPage,c=e.shouldPaginate,d=e.serverSidePagination,f=e.contentHeight,v=e.rowHeight,p=e.scrollTop,h=e.scrollDirection,w=void 0===h?"none":h,m=e.heightOffsets,g=e.customTheme,x=e.computeFilteredRowsPreview,b=e.computeSortedRowsPreview,y=n.useState(!1),C=y[0],I=y[1],R=n.useState([]),S=R[0],M=R[1],N=n.useRef([]),E=n.useRef([]),T=n.useMemo(function(){return l(v)},[v]),k=n.useRef(new Map),A=n.useRef(null),D=n.useCallback(function(e,n){if(!c||d)return e.map(function(e,n){return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:n})});var t=(a-1)*s,r=n.slice(t,a*s),o=new Set(r.map(function(e){return H(e.rowPath||[e.position])+""}));return e.filter(function(e){var n=H(e.rowPath||[e.position])+"";if(o.has(n))return!0;if(e.nestedTable||e.stateIndicator||e.isLoadingSkeleton){var t=e.rowPath?e.rowPath.slice(0,-1):[],r=H(t)+"";return o.has(r)}return!1}).map(function(e,n){var r=e.nestedTable?e.absoluteRowIndex:c&&!d?t+n:n;return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:r})})},[a,s,d,c]);n.useMemo(function(){if(0===k.current.size&&o.length>0){var e=new Map;o.forEach(function(n,t){var r=H(n.rowPath||[n.position])+"";e.set(r,t)}),k.current=e}},[o]);var F=n.useMemo(function(){return D(r,i)},[r,i,D]),O=n.useMemo(function(){if(!m||0===m.length||!c||d)return m;var e=new Map;return F.forEach(function(n){n.nestedTable&&e.set(n.absoluteRowIndex,n.position)}),m.filter(function(n){return e.has(n[0])}).map(function(n){var t=n[1];return[e.get(n[0]),t]})},[m,F,c,d]),L=n.useMemo(function(){if(O&&0!==O.length)return function(e,n,t,r){var o=n+r.rowSeparatorWidth,i=Array(e),a=new Map;t&&t.forEach(function(e){a.set(e[0],e[1])});for(var u=0,l=0;e>l;l++){i[l]=u,u+=o;var s=a.get(l);void 0!==s&&(u+=s)}return{rowTopPositions:i,totalHeight:u-r.rowSeparatorWidth}}(F.length,v,O,g)},[F.length,v,O,g]),W=n.useMemo(function(){return void 0===f?F:P({bufferRowCount:T,contentHeight:f,tableRows:F,rowHeight:v,scrollTop:p,scrollDirection:w,heightMap:L})},[F,f,v,p,w,T,L]),B=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return H(e.rowPath||[e.position])+""})),r=new Set(n.map(function(e){return H(e.rowPath||[e.position])+""}));return{staying:n.filter(function(e){var n=H(e.rowPath||[e.position])+"";return t.has(n)}),entering:n.filter(function(e){var n=H(e.rowPath||[e.position])+"";return!t.has(n)}),leaving:e.filter(function(e){var n=H(e.rowPath||[e.position])+"";return!r.has(n)})}},[]),q=n.useMemo(function(){if(0===N.current.length)return!1;var e=F.map(function(e){return H(e.rowPath||[e.position])+""}),n=N.current.map(function(e){return H(e.rowPath||[e.position])+""});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[F]);n.useLayoutEffect(function(){if(!C){var e=function(){S.length>0&&M([])};if(!t||c)return e(),N.current=F,void(E.current=W);if(0===N.current.length)return e(),N.current=F,void(E.current=W);if(!q)return e(),N.current=F,void(E.current=W);A.current={tableRows:F,visibleRows:W},I(!0)}},[t,F,S.length,q,C,c,W]),n.useLayoutEffect(function(){if(C&&A.current&&S.length>0){var e=setTimeout(function(){var e=A.current;I(!1),M([]),N.current=e.tableRows,E.current=e.visibleRows,A.current=null},Ln.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[C,S.length]);var G=n.useMemo(function(){if(!t||c)return W;if(S.length>0){var e=new Map,n=new Map;return F.forEach(function(t){var r=H(t.rowPath||[t.position])+"";e.set(r,t.position),n.set(r,t.displayPosition)}),S.map(function(t){var r=H(t.rowPath||[t.position])+"",o=e.get(r),i=n.get(r);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},t),{position:o,displayPosition:i}):t})}return W},[W,S,F,t,c]),z=n.useCallback(function(e){if(t&&!c&&void 0!==f){var n=x(e),r=n.filter(function(e){return!e.nestedTable&&!e.stateIndicator&&!e.isLoadingSkeleton}),o=D(n,r),i=P({bufferRowCount:T,contentHeight:f,tableRows:o,rowHeight:v,scrollTop:p,scrollDirection:w,heightMap:L}),a=B(W,i).entering.map(function(e){var n=H(e.rowPath||[e.position])+"";return F.find(function(e){return H(e.rowPath||[e.position])+""===n})||e}).filter(Boolean);a.length>0&&M(u(u([],W,!0),a,!0))}},[t,c,x,D,f,v,p,w,B,F,W,T,L]),K=n.useCallback(function(e){if(t&&!c&&void 0!==f){var n=b(e),r=n.filter(function(e){return!e.nestedTable&&!e.stateIndicator&&!e.isLoadingSkeleton}),o=D(n,r),i=P({bufferRowCount:T,contentHeight:f,tableRows:o,rowHeight:v,scrollTop:p,scrollDirection:w,heightMap:L}),a=B(W,i).entering.map(function(e){var n=H(e.rowPath||[e.position])+"";return F.find(function(e){return H(e.rowPath||[e.position])+""===n})||e}).filter(Boolean);a.length>0&&M(u(u([],W,!0),a,!0))}},[t,c,b,D,f,v,p,w,B,F,W,T,L]);return{currentTableRows:F,currentVisibleRows:W,isAnimating:C,prepareForFilterChange:z,prepareForSortChange:K,rowsToRender:G,paginatedHeightOffsets:O}}({allowAnimations:o,flattenedRows:Or,originalFlattenedRows:qr,paginatableRows:Wr,currentPage:Et,rowsPerPage:an,shouldPaginate:pn,serverSidePagination:fn,contentHeight:Kr,rowHeight:Jn,scrollTop:Xt,scrollDirection:Zt,heightOffsets:Lr,customTheme:_n,computeFilteredRowsPreview:Gr,computeSortedRowsPreview:zr}),Vr=jr.currentTableRows,Ur=jr.rowsToRender,_r=jr.prepareForFilterChange,Jr=jr.prepareForSortChange,Xr=jr.isAnimating,Yr=jr.paginatedHeightOffsets,$r=n.useRef(new Map),Zr=n.useRef(new Map),Qr=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,u=e.onCellEdit,l=e.cellRegistry,s=e.collapsedHeaders,c=e.rowHeight,d=e.enableRowSelection,f=void 0!==d&&d,v=e.copyHeadersToClipboard,p=void 0!==v&&v,h=e.customTheme,w=n.useState(new Set),m=w[0],x=w[1],b=n.useState(new Set),y=b[0],C=b[1],I=n.useState(null),R=I[0],N=I[1],E=n.useState(null),T=E[0],k=E[1],A=n.useState(new Set),D=A[0],F=A[1],P=n.useState(new Set),O=P[0],L=P[1],W=n.useState(!1),G=W[0],z=W[1],K=n.useRef(!1),j=n.useRef(null),V=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),y.forEach(function(n){e.add(n)}),e},[m,y]),U=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),y.size>0&&o.forEach(function(n){var t=H(n.rowPath||[n.position]);e.add(t+"")}),e},[m,y,o]),_=n.useMemo(function(){return r.flatMap(function(e){return g(e,s)})},[r,s]),J=n.useCallback(function(){if(0!==m.size){var e=function(e,n,t,r){void 0===r&&(r=!1);var o=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),i=new Map,a=new Map;o.forEach(function(e,n){i.set(n,e.accessor),a.set(n,e)});var u=Array.from(e).reduce(function(e,n){var r,o=n.split("-").map(Number),u=o[0],l=o[1];e[u]||(e[u]=[]);var s=i.get(l),c=a.get(l);if(s&&(null===(r=t[u])||void 0===r?void 0:r.row)){var d=t[u].row,f=S(d,s);if(!1!==(null==c?void 0:c.useFormattedValueForClipboard)&&(null==c?void 0:c.valueFormatter)){var v=c.valueFormatter({accessor:s,colIndex:l,row:d,rowIndex:u,value:f});e[u][l]=v}else e[u][l]=!c||"lineAreaChart"!==c.type&&"barChart"!==c.type?f:Array.isArray(f)?f.join(", "):""}else e[u][l]="";return e},{}),l=new Set;r&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var s="";r&&l.size>0&&(s=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,t=a.get(e);return null!==(n=null==t?void 0:t.label)&&void 0!==n?n:""}).join("\t"));var c=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return r&&s?"".concat(s,"\n").concat(c):c}(m,_,o,p);navigator.clipboard.writeText(e),F(new Set(m)),setTimeout(function(){return F(new Set)},800)}},[m,_,o,p]),X=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i;return a(this,function(a){switch(a.label){case 0:if(!T)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,t,r,o,i){var a=new Set,u=new Set,l=e.split("\n").filter(function(e){return e.length>0});if(0===l.length)return{updatedCells:a,warningCells:u};var s=t.filter(function(e){return!e.hide&&!e.excludeFromRender}),c=n.rowIndex,d=n.colIndex;return l.forEach(function(e,n){e.split("\t").forEach(function(e,t){var l=c+n,f=d+t;if(r.length>l&&s.length>f){var v=r[l],p=s[f],h=H(v.rowPath||[v.position]);if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=+e;isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var g=new Date(e);isNaN(g.getTime())||(w=g)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(w=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(M(v.row,p.accessor,w),i){var x="".concat(h,"-").concat(p.accessor),b=i.get(x);b&&b.updateContent(w)}null==o||o({accessor:p.accessor,newValue:w,row:v.row,rowIndex:l});var y="".concat(l,"-").concat(f,"-").concat(h);a.add(y)}else{var C="".concat(l,"-").concat(f,"-").concat(h);u.add(C)}}})}),{updatedCells:a,warningCells:u}}(e,T,_,o,u,l),r=n.warningCells,(t=n.updatedCells).size>0&&(F(t),setTimeout(function(){return F(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[T,_,o,u,l]),Y=n.useCallback(function(){if(0!==m.size){var e=function(e,n,t,r,o){var i=new Set,a=new Set,u=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),l=new Map;return u.forEach(function(e,n){l.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),l=n[0],s=n[1];if(t.length>l&&u.length>s){var c=t[l],d=u[s],f=H(c.rowPath||[c.position]);if(null==d?void 0:d.isEditable){var v;if(v="string"===d.type?"":"number"===d.type?null:"boolean"!==d.type&&("date"===d.type?null:"lineAreaChart"===d.type||"barChart"===d.type||Array.isArray(S(c.row,d.accessor))?[]:""),M(c.row,d.accessor,v),o){var p="".concat(f,"-").concat(d.accessor),h=o.get(p);h&&h.updateContent(v)}null==r||r({accessor:d.accessor,newValue:v,row:c.row,rowIndex:l}),i.add(e)}else a.add(e)}}),{deletedCells:i,warningCells:a}}(m,_,o,u,l),n=e.deletedCells,t=e.warningCells;n.size>0&&(F(n),setTimeout(function(){return F(new Set)},800)),t.size>0&&(L(t),setTimeout(function(){return L(new Set)},800))}},[m,_,o,u,l]),$=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),u=Math.max(e.colIndex,n.colIndex),l=r;i>=l;l++)for(var s=a;u>=s;s++)if(l>=0&&o.length>l){if(f&&0===s)continue;var d=o[l],v=H(d.rowPath||[d.position]);t.add(q({colIndex:s,rowIndex:l,rowId:v}))}C(new Set),N(null),x(t),k(n),setTimeout(function(){return B(n,c,h)},0)},[o,c,f,h]),Z=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?_.length:_.length-1)>=e.colIndex){var n=q(e);C(new Set),N(null),x(new Set([n])),k(e),setTimeout(function(){return B(e,c,h)},0)}},[_.length,o.length,c,f,h]),Q=n.useCallback(function(e,n){void 0===n&&(n=!1),x(new Set),k(null),C(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&N(e[e.length-1])},[]);!function(e){var t=e.copyToClipboard,r=e.deleteSelectedCells,o=e.enableRowSelection,i=void 0!==o&&o,a=e.initialFocusedCell,u=e.leafHeaders,l=e.pasteFromClipboard,s=e.selectCellRange,c=e.selectSingleCell,d=e.selectableCells,f=e.selectedCells,v=e.setLastSelectedColumnIndex,p=e.setSelectedCells,h=e.setSelectedColumns,w=e.startCell,m=e.tableRows;n.useEffect(function(){var e=function(e){if(d&&a&&0!==f.size){var s=document.activeElement;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement||"true"===(null==s?void 0:s.getAttribute("contenteditable")))){var c=a.rowIndex,R=a.colIndex,S=a.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void l();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var M=new Set,N=0;m.length>N;N++)for(var E=0;u.length>E;E++){var T=i?E+1:E,k=m[N],A=H(k.rowPath||[k.position]);M.add("".concat(N,"-").concat(T,"-").concat(A))}return p(M),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void r();var D=m[c];if((D?H(D.rowPath||[D.position]):null)!==S){var F=m.findIndex(function(e){return H(e.rowPath||[e.position])===S});if(-1===F)return;c=F}var P=function(e,n,t){var r=e,o=n;return"up"===t?r=0:"down"===t?r=m.length-1:"left"===t?o=i?1:0:"right"===t&&(o=i?u.length:u.length-1),{rowIndex:r,colIndex:o}};"ArrowUp"===e.key?(e.preventDefault(),n(e,c,R,P)):"ArrowDown"===e.key?(e.preventDefault(),o(e,c,R,P)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,c,R,P)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,c,R,P)):"Home"===e.key?(e.preventDefault(),b(e,c)):"End"===e.key?(e.preventDefault(),y(e,c)):"PageUp"===e.key?(e.preventDefault(),C(e,c,R)):"PageDown"===e.key?(e.preventDefault(),I(e,c,R)):"Escape"===e.key&&(p(new Set),h(new Set),v(null),w.current=null)}else t()}}},n=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),o>=0){var i=H((u=m[o]).rowPath||[u.position]);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else if(n>0){var u;o=n-1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),i=H((u=m[o]).rowPath||[u.position]),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null}},o=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),m.length>o){var i=H((u=m[o]).rowPath||[u.position]);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else if(m.length-1>n){var u;o=n+1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),i=H((u=m[o]).rowPath||[u.position]),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null}},g=function(e,n,t,r){if(e.shiftKey&&"ArrowLeft"===e.key){w.current||(w.current=a);var o=t-1;if(e.ctrlKey||e.metaKey)o=r(n,t,"left").colIndex;else if(i&&0===o)return;if(o>=0){var u=H((l=m[n]).rowPath||[l.position]);s(w.current,{rowIndex:n,colIndex:o,rowId:u})}}else if(t>0){if(o=t-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)o=r(n,t,"left").colIndex;else if(i&&0===o)return;var l;0>o||(u=H((l=m[n]).rowPath||[l.position]),c({rowIndex:n,colIndex:o,rowId:u}),w.current=null)}},x=function(e,n,t,r){var o=i?u.length:u.length-1;if(e.shiftKey&&"ArrowRight"===e.key){w.current||(w.current=a);var l=t+1;if((e.ctrlKey||e.metaKey)&&(l=r(n,t,"right").colIndex),o>=l){var d=H((f=m[n]).rowPath||[f.position]);s(w.current,{rowIndex:n,colIndex:l,rowId:d})}}else if(o>t){var f;l=t+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(l=r(n,t,"right").colIndex),l>o||(d=H((f=m[n]).rowPath||[f.position]),c({rowIndex:n,colIndex:l,rowId:d}),w.current=null)}},b=function(e,n,t){if(e.shiftKey){w.current||(w.current=a);var r=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(r=0);var u=H((l=m[r]).rowPath||[l.position]);s(w.current,{rowIndex:r,colIndex:o,rowId:u})}else{var l;r=n,o=i?1:0,(e.ctrlKey||e.metaKey)&&(r=0),u=H((l=m[r]).rowPath||[l.position]),c({rowIndex:r,colIndex:o,rowId:u}),w.current=null}},y=function(e,n,t){if(e.shiftKey){w.current||(w.current=a);var r=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(r=m.length-1);var l=H((d=m[r]).rowPath||[d.position]);s(w.current,{rowIndex:r,colIndex:o,rowId:l})}else{var d;r=n,o=i?u.length:u.length-1,(e.ctrlKey||e.metaKey)&&(r=m.length-1),l=H((d=m[r]).rowPath||[d.position]),c({rowIndex:r,colIndex:o,rowId:l}),w.current=null}},C=function(e,n,t){var r=Math.max(0,n-10);if(e.shiftKey){w.current||(w.current=a);var o=H((i=m[r]).rowPath||[i.position]);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else{var i;o=H((i=m[r]).rowPath||[i.position]),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null}},I=function(e,n,t){var r=Math.min(m.length-1,n+10);if(e.shiftKey){w.current||(w.current=a);var o=H((i=m[r]).rowPath||[i.position]);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else{var i;o=H((i=m[r]).rowPath||[i.position]),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[d,a,m,u,c,s,f,p,h,v,t,l,r,w,i])}({selectableCells:t,initialFocusedCell:T,tableRows:o,leafHeaders:_,selectSingleCell:Z,selectCellRange:$,selectedCells:m,setSelectedCells:x,setSelectedColumns:C,setLastSelectedColumnIndex:N,copyToClipboard:J,pasteFromClipboard:X,deleteSelectedCells:Y,startCell:j,enableRowSelection:f});var ee=n.useCallback(function(e,n){var t=new Set,r=new Map;o.forEach(function(e,n){var t=H(e.rowPath||[e.position]);r.set(t+"",n)});for(var i=r.get(e.rowId+""),a=r.get(n.rowId+""),u=void 0!==i?i:e.rowIndex,l=void 0!==a?a:n.rowIndex,s=Math.min(u,l),c=Math.max(u,l),d=Math.min(e.colIndex,n.colIndex),v=Math.max(e.colIndex,n.colIndex),p=s;c>=p;p++)for(var h=d;v>=h;h++)if(p>=0&&o.length>p){if(f&&0===h)continue;var w=o[p],m=H(w.rowPath||[w.position]);t.add(q({colIndex:h,rowIndex:p,rowId:m}))}x(t)},[o,f]),ne=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(!t)return null;var r=t.getBoundingClientRect(),o=Array.from(document.querySelectorAll(".st-cell[data-row-index][data-col-index]:not(.st-selection-cell)"));if(0===o.length)return null;var i=Math.max(r.left,Math.min(r.right,e)),a=Math.max(r.top,Math.min(r.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,t=n.getBoundingClientRect(),r=t.top+t.height/2,o=Math.sqrt(Math.pow(t.left+t.width/2-i,2)+Math.pow(r-a,2));l>o&&(l=o,u=n)}}),null!==u){var s=u,c=parseInt(s.getAttribute("data-row-index")||"-1",10),d=parseInt(s.getAttribute("data-col-index")||"-1",10),f=s.getAttribute("data-row-id");if(c>=0&&d>=0&&null!==f)return{rowIndex:c,colIndex:d,rowId:f}}return null},[]),te=n.useCallback(function(e,n){var t=document.elementFromPoint(e,n);if(!t)return null;var r=t.closest(".st-cell");if(r instanceof HTMLElement){var o=parseInt(r.getAttribute("data-row-index")||"-1",10),i=parseInt(r.getAttribute("data-col-index")||"-1",10),a=r.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return ne(e,n)},[ne]),re=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(t){var r=t.getBoundingClientRect();r.top+50>n?t.scrollTop-=10*Math.min(3,1+Math.max(0,r.top-n)/100):n>r.bottom-50&&(t.scrollTop+=10*Math.min(3,1+Math.max(0,n-r.bottom)/100));var o=document.querySelector(".st-body-main");o&&(r.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,r.left-e)/100):e>r.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-r.right)/100)))}},[]),oe=n.useCallback(function(e){var n=e.colIndex,t=q({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),r=m.has(t),o=y.has(n);return r||o},[m,y]),ie=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId;if(G)return"";var i=[],a=o[t-1],u=a?H(a.rowPath||[a.position]):null,l=o[t+1],s=l?H(l.rowPath||[l.position]):null,c=null!==u?{colIndex:n,rowIndex:t-1,rowId:u}:null,d=null!==s?{colIndex:n,rowIndex:t+1,rowId:s}:null,f={colIndex:n-1,rowIndex:t,rowId:r},v={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!oe(c)||y.has(n)&&0===t)&&i.push("st-selected-top-border"),(!d||!oe(d)||y.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),oe(f)||i.push("st-selected-left-border"),oe(v)||i.push("st-selected-right-border"),i.join(" ")},[G,oe,o,y]),ae=n.useMemo(function(){return T?function(e){return e.rowIndex===T.rowIndex&&e.colIndex===T.colIndex&&e.rowId===T.rowId}:function(){return!1}},[T]),ue=n.useCallback(function(e){var n=q({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return D.has(n)},[D]),le=n.useCallback(function(e){var n=q({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return O.has(n)},[O]);return{getBorderClass:ie,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){K.current=!0,z(!0),j.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){C(new Set),N(null);var e=q({colIndex:n,rowIndex:r,rowId:o});x(new Set([e])),k({rowIndex:r,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,s=function(){if(K.current&&j.current){if(null!==i&&null!==a){re(i,a);var e=Date.now();if(e-l>=16){var n=te(i,a);n&&ee(j.current,n),l=e}}u=requestAnimationFrame(s)}else null!==u&&(cancelAnimationFrame(u),u=null)},c=function(e){K.current&&j.current&&(i=e.clientX,a=e.clientY)},d=function(){K.current=!1,z(!1),null!==u&&(cancelAnimationFrame(u),u=null),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",d),u=requestAnimationFrame(s)}},handleMouseOver:function(e){t&&K.current&&j.current&&ee(j.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ue,isWarningFlashing:le,isInitialFocusedCell:ae,isSelected:oe,lastSelectedColumnIndex:R,pasteFromClipboard:X,selectColumns:Q,selectedCells:m,selectedColumns:y,setInitialFocusedCell:k,setSelectedCells:x,setSelectedColumns:C,deleteSelectedCells:Y,columnsWithSelectedCells:V,rowsWithSelectedCells:U,startCell:j}}({selectableCells:ln,headers:At,tableRows:Vr,onCellEdit:Be,cellRegistry:$r.current,collapsedHeaders:Vt,rowHeight:Jn,enableRowSelection:re,copyHeadersToClipboard:O,customTheme:_n}),eo=Qr.getBorderClass,no=Qr.handleMouseDown,to=Qr.handleMouseOver,ro=Qr.isCopyFlashing,oo=Qr.isInitialFocusedCell,io=Qr.isSelected,ao=Qr.isWarningFlashing,uo=Qr.selectColumns,lo=Qr.selectedCells,so=Qr.selectedColumns,co=Qr.setInitialFocusedCell,fo=Qr.setSelectedCells,vo=Qr.setSelectedColumns,po=Qr.columnsWithSelectedCells,ho=Qr.rowsWithSelectedCells,wo=Qr.startCell,mo=n.useCallback(function(e){Jr(e),setTimeout(function(){Dr({accessor:e})},0)},[Jr,Dr]),go=n.useCallback(function(e){Dt(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown,s=e.startCell;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(u&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set),s&&(s.current=null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,u,l,s])}({selectableColumns:cn,selectedCells:lo,selectedColumns:so,setSelectedCells:fo,setSelectedColumns:vo,activeHeaderDropdown:Gt,setActiveHeaderDropdown:zt,startCell:wo}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){t(),r.current&&o(r.current.offsetWidth-r.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:it,tableBodyContainerRef:rt,setScrollbarWidth:St}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:je}),function(e){var t=e.cellRegistryRef,r=e.clearAllFilters,o=e.clearFilter,i=e.currentPage,a=e.expandedDepths,l=e.filters,s=e.flattenedRows,c=e.headerRegistryRef,d=e.headers,f=e.includeHeadersInCSVExport,v=e.paginatableRows,p=e.rowGrouping,h=e.rows,w=e.rowsPerPage,g=e.setCollapsedRows,x=e.setCurrentPage,b=e.setExpandedDepths,y=e.setExpandedRows,C=e.sort,I=e.tableRef,R=e.totalRowCount,N=e.updateFilter,E=e.updateSort,T=e.visibleRows;n.useEffect(function(){I&&(I.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==h?void 0:h[r];if(i){var a=H([r]),u=m({rowId:a,accessor:n}),l=t.current.get(u);l&&l.updateContent(o),void 0!==S(i,n)&&M(i,n,o)}},setHeaderRename:function(e){var n=c.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return T},getAllRows:function(){return s},getHeaders:function(){return d},exportToCSV:function(e){!function(e,n,t,r){void 0===r&&(r=!0);var o=function(e,n,t){void 0===t&&(t=!0);var r=function(e){var n=[],t=function(e){for(var r=0,o=e;o.length>r;r++){var i=o[r];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),t(i.children)):n.push(i))}};return t(e),n}(n),o=r.map(function(e){return Fn(e.label)}).join(","),i=e.map(function(e,n){var t=e.row;return r.map(function(e,r){var o=S(t,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o,formattedValue:i});return Fn(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}),Fn(i)):Fn(o)}).join(",")});return(t?u([o],i,!0):i).join("\n")}(e,n,r);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(o,t)}(s,d,(void 0===e?{}:e).filename,f)},getSortState:function(){return C},applySortState:Pn(E),getFilterState:function(){return l},applyFilter:Pn(N),clearFilter:Pn(o),clearAllFilters:Pn(r),getCurrentPage:function(){return i},getTotalPages:function(){return Math.ceil((null!=R?R:v.length)/w)},setPage:function(e){return x(e)},expandAll:function(){var e=Array.from({length:(null==p?void 0:p.length)||0},function(e,n){return n});b(new Set(e)),y(new Map),g(new Map)},collapseAll:function(){b(new Set),y(new Map),g(new Map)},expandDepth:function(e){b(function(n){for(var t=new Set(n),r=0;e>=r;r++)t.add(r);return t}),y(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),g(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},collapseDepth:function(e){b(function(n){var t=new Set(n);return t.delete(e),t}),y(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),g(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},toggleDepth:function(e){b(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),y(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),g(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},setExpandedDepths:function(e){b(e)},getExpandedDepths:function(){return a},getGroupingProperty:function(e){return null==p?void 0:p[e]},getGroupingDepth:function(e){var n;return null!==(n=null==p?void 0:p.indexOf(e))&&void 0!==n?n:-1}})},[t,r,o,i,a,l,s,c,d,f,v,p,e.rowIndexMap,h,w,e.serverSidePagination,g,x,b,y,e.setRows,e.shouldPaginate,C,I,R,N,E,T])}({cellRegistryRef:$r,clearAllFilters:Er,clearFilter:Hr,currentPage:Et,expandedDepths:nr,filters:Mr,flattenedRows:Or,headerRegistryRef:Zr,headers:_t,includeHeadersInCSVExport:He,paginatableRows:Wr,rowGrouping:tn,rowIndexMap:ft,rows:Nt,rowsPerPage:an,serverSidePagination:fn,setCollapsedRows:lr,setCurrentPage:Tt,setExpandedDepths:tr,setExpandedRows:ir,setRows:dt,shouldPaginate:pn,sort:Ar,tableRef:Mn,totalRowCount:On,updateFilter:Nr,updateSort:Dr,visibleRows:Ur}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:Mr,onFilterChange:Ke}),function(e){var t=e.sort,r=e.onSortChange,o=ye(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:Ar,onSortChange:Ze});var xo=n.useCallback(function(e){_r(e),setTimeout(function(){Nr(e)},0)},[_r,Nr]),bo=!De&&0===Vr.length;return e.jsx(z,exports.__assign({value:{activeHeaderDropdown:Gt,allowAnimations:o,areAllRowsSelected:wt,autoExpandColumns:d,canExpandRowGroup:f,cellRegistry:$r.current,cellUpdateFlash:h,clearSelection:Ct,collapsedHeaders:Vt,columnBorders:b,columnReordering:T,columnResizing:D,columnsWithSelectedCells:po,copyHeadersToClipboard:O,draggedHeaderRef:Zn,editColumns:K,emptyStateRenderer:Q,enableHeaderEditing:ne,enableRowSelection:re,errorStateRenderer:oe,expandedDepths:nr,expandIcon:le,filterIcon:pe,filters:Mr,forceUpdate:it,getBorderClass:eo,handleApplyFilter:xo,handleClearAllFilters:Er,handleClearFilter:Hr,handleMouseDown:no,handleMouseOver:to,handleRowSelect:xt,handleSelectAll:bt,handleToggleRow:yt,headerCollapseIcon:me,headerContainerRef:ot,headerDropdown:ge,headerExpandIcon:be,headerHeight:Xn,headerRegistry:Zr.current,headers:_t,heightOffsets:Yr,hoveredHeaderRef:Qn,includeHeadersInCSVExport:He,isAnimating:Xr,isCopyFlashing:ro,isInitialFocusedCell:oo,isLoading:De,isResizing:Pt,isRowSelected:ht,isScrolling:Wt,isSelected:io,isWarningFlashing:ao,loadingStateRenderer:Fe,mainBodyRef:et,maxHeaderDepth:hr,nextIcon:Le,onCellClick:We,onCellEdit:Be,onColumnOrderChange:qe,onColumnSelect:Ge,onColumnVisibilityChange:ze,onHeaderEdit:Ue,onLoadMore:_e,onRowGroupExpand:Ye,onSort:mo,onTableHeaderDragEnd:go,pinnedLeftRef:nt,pinnedRightRef:tt,prevIcon:en,rowButtons:nn,rowGrouping:tn,rowHeight:Jn,rowStateMap:ut,rows:ct,rowsWithSelectedCells:ho,scrollbarWidth:Rt,selectColumns:uo,selectableColumns:cn,selectedColumns:so,selectedRowCount:mt,selectedRows:vt,selectedRowsData:gt,setActiveHeaderDropdown:zt,setCollapsedHeaders:Ut,setHeaders:Dt,setInitialFocusedCell:co,setIsResizing:Ot,setIsScrolling:Bt,setRowStateMap:lt,setSelectedCells:fo,setSelectedColumns:vo,setSelectedRows:pt,setExpandedDepths:tr,setExpandedRows:ir,setCollapsedRows:lr,shouldPaginate:pn,sortDownIcon:wn,sortUpIcon:bn,tableBodyContainerRef:rt,tableEmptyStateRenderer:Sn,tableRows:Vr,theme:Hn,customTheme:_n,expandedRows:or,collapsedRows:ur,useHoverRowBackground:Bn,useOddColumnBackground:jn,useOddEvenRowBackground:Un}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(Hn," ").concat(null!=w?w:""," ").concat(b?"st-column-borders":""),style:Pe?{maxHeight:Pe,height:void 0===Kr?"auto":Pe}:Ce?{height:Ce}:{}},{children:[e.jsx(Tn,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(gn,{hideHeader:Me,pinnedLeftWidth:br,pinnedRightWidth:yr,setScrollTop:Yt,setScrollDirection:Qt,shouldShowEmptyState:bo,sort:Ar,tableRows:Vr,rowsToRender:Ur}),e.jsx(En,{columnEditorText:R,editColumns:K,editColumnsInitOpen:$,headers:At,position:C})]})),!bo&&e.jsx(xn,{mainBodyRef:et,mainBodyWidth:xr,pinnedLeftWidth:br,pinnedRightWidth:yr,pinnedLeftContentWidth:Cr,pinnedRightContentWidth:Ir,tableBodyContainerRef:rt}),!bo&&e.jsx(j,{currentPage:Et,footerRenderer:he,hideFooter:Re,onPageChange:Tt,onNextPage:Je,onUserPageChange:Xe,rowsPerPage:an,shouldPaginate:pn,totalPages:Math.ceil((null!=On?On:Wr.length)/an),totalRows:null!=On?On:Wr.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:cr}))]}))}))},Vn=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,s=n.fillOpacity,c=void 0===s?.2:s,d=n.strokeWidth,f=void 0===d?2:d,v=n.className,p=void 0===v?"":v,h=n.min,w=n.max;if(!t||0===t.length)return null;var m=void 0!==h?h:Math.min.apply(Math,t),g=(void 0!==w?w:Math.max.apply(Math,t))-m||1,x=a,b=t.map(function(e,n){return{x:n/(t.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),y="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(p),style:{display:"block"}},{children:[e.jsx("path",{d:y,fill:l||"var(--st-chart-fill-color)",fillOpacity:c,stroke:"none",vectorEffect:"non-scaling-stroke"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}))},Un=Object.freeze({__proto__:null,default:Vn}),_n=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,s=void 0===l?2:l,c=n.className,d=void 0===c?"":c,f=n.min,v=n.max;if(!t||0===t.length)return null;var p=void 0!==f?f:Math.min.apply(Math,t),h=void 0!==v?v:Math.max.apply(Math,t),w=h-p||1,m=a,g=(100-s*(t.length-1))/t.length,x=0>p,b=x?m*(h/w):m;return e.jsx("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(m),preserveAspectRatio:"none",className:"st-bar-chart ".concat(d),style:{display:"block"}},{children:t.map(function(n,t){var r=t*(g+s),o=(n-p)/w*m,i=m-o,a=o;return x&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:r,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:1},t)})}))},Jn=Object.freeze({__proto__:null,default:_n});exports.ANIMATION_CONFIGS=Ln,exports.AngleDownIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},exports.AngleLeftIcon=V,exports.AngleRightIcon=U,exports.AngleUpIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},exports.AscIcon=_,exports.BarChart=_n,exports.CheckIcon=J,exports.DEFAULT_CUSTOM_THEME=zn,exports.DefaultEmptyState=Gn,exports.DescIcon=X,exports.FilterIcon=Y,exports.LineAreaChart=Vn,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=$,exports.SimpleTable=Kn,exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,u,l,s,c,d,f,v,p,h,w,m,g;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,u=void 0===(i=t.duration)?300:i,s=void 0===(l=t.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(c=t.delay)?0:c,f=t.onComplete,p=void 0===(v=t.respectReducedMotion)||v,On()&&p?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(h=n.getBoundingClientRect(),m=e-(w=h.top),g=r-w,[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.style.transition="transform ".concat(u,"ms ").concat(s),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"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,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){return{x:("x"in e?e.x:e.left)-n.x,y:("y"in e?e.y:e.top)-n.y}}(r,o),0===e.x&&0===e.y||On()&&!1!==t.respectReducedMotion?[2]:(u=t,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=On()?exports.__assign(exports.__assign({},Ln.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},Ln.COLUMN_REORDER),u):exports.__assign(exports.__assign({},Ln.ROW_REORDER),u),Wn(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,Bn(n,i,t)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=ye,exports.useTableContext=K;
|
|
2
|
-
//# sourceMappingURL=index-88c874db.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-88c874db.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|