react-fluid-table
Version:
A React table inspired by @tanstack/react-virtual
4 lines (3 loc) • 38.5 kB
JavaScript
import*as e from"react";import t,{useRef as n,useState as r,useCallback as i,useEffect as o,useMemo as s,memo as l,forwardRef as a,useLayoutEffect as c,useImperativeHandle as u}from"react";import{flushSync as h}from"react-dom";function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){return void n(e)}l.done?t(a):Promise.resolve(a).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){f(o,r,i,s,l,"next",e)}function l(e){f(o,r,i,s,l,"throw",e)}s(void 0)}))}}function v(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g.apply(null,arguments)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function w(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof l?r:l,c=Object.create(a.prototype);return x(c,"_invoke",function(n,r,i){var o,l,a,c=0,u=i||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,l=0,a=e,d.n=n,s}};function f(n,r){for(l=n,a=r,t=0;!h&&c&&!i&&t<u.length;t++){var i,o=u[t],f=d.p,m=o[2];n>3?(i=m===r)&&(a=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(l=0,d.v=r,d.n=o[1]):f<m&&(i=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,l=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,m){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,m),l=u,a=m;(t=l<2?e:a)||!h;){o||(l?l<3?(l>1&&(d.n=-1),f(l,a)):d.n=a:d.v=a);try{if(c=2,o){if(l||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),l=1);o=e}else if((t=(h=d.n<0)?a:n.call(r,d))!==s)break}catch(t){o=e,l=1,a=t}finally{c=1}}return{value:t,done:h}}}(n,i,o),!0),c}var s={};function l(){}function a(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(x(t={},r,(function(){return this})),t),h=c.prototype=l.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,x(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return a.prototype=c,x(h,"constructor",c),x(c,"constructor",a),a.displayName="GeneratorFunction",x(c,i,"GeneratorFunction"),x(h),x(h,i,"Generator"),x(h,r,(function(){return this})),x(h,"toString",(function(){return"[object Generator]"})),(w=function(){return{w:o,m:d}})()}function x(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}x=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function o(t,n){x(e,t,(function(e){return this._invoke(t,n,e)}))}o("next",0),o("throw",1),o("return",2)}},x(e,t,n,r)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,l=[],a=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O,S,C,M,z,T,k,I,j,H,N,W,R,_,D,P,A,F,V,B,L,K,$,G,U,q,Y,J,Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Z(){if(S)return O;return S=1,O=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function ee(){if(T)return z;T=1;var e=function(){if(M)return C;M=1;var e="object"==typeof Q&&Q&&Q.Object===Object&&Q;return C=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return z=n}function te(){if(W)return N;W=1;var e=function(){if(H)return j;H=1;var e=/\s/;return j=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}}(),t=/^\s+/;return N=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n}}function ne(){if(_)return R;_=1;var e=ee().Symbol;return R=e}function re(){if(B)return V;B=1;var e=ne(),t=function(){if(P)return D;P=1;var e=ne(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;return D=function(e){var t=n.call(e,i),o=e[i];try{e[i]=void 0;var s=!0}catch(e){}var l=r.call(e);return s&&(t?e[i]=o:delete e[i]),l}}(),n=function(){if(F)return A;F=1;var e=Object.prototype.toString;return A=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return V=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function ie(){if(G)return $;G=1;var e=re(),t=K?L:(K=1,L=function(e){return null!=e&&"object"==typeof e});return $=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}function oe(){if(J)return Y;J=1;var e=Z(),t=function(){if(I)return k;I=1;var e=ee();return k=function(){return e.Date.now()}}(),n=function(){if(q)return U;q=1;var e=te(),t=Z(),n=ie(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;return U=function(l){if("number"==typeof l)return l;if(n(l))return NaN;if(t(l)){var a="function"==typeof l.valueOf?l.valueOf():l;l=t(a)?a+"":a}if("string"!=typeof l)return 0===l?l:+l;l=e(l);var c=i.test(l);return c||o.test(l)?s(l.slice(2),c?2:8):r.test(l)?NaN:+l}}(),r=Math.max,i=Math.min;return Y=function(o,s,l){var a,c,u,h,d,f,m=0,v=!1,g=!1,p=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function y(e){var t=a,n=c;return a=c=void 0,m=e,h=o.apply(n,t)}function b(e){var t=e-f;return void 0===f||t>=s||t<0||g&&e-m>=u}function w(){var e=t();if(b(e))return x(e);d=setTimeout(w,function(e){var t=s-(e-f);return g?i(t,u-(e-m)):t}(e))}function x(e){return d=void 0,p&&a?y(e):(a=c=void 0,h)}function E(){var e=t(),n=b(e);if(a=arguments,c=this,f=e,n){if(void 0===d)return function(e){return m=e,d=setTimeout(w,s),v?y(e):h}(f);if(g)return clearTimeout(d),d=setTimeout(w,s),y(f)}return void 0===d&&(d=setTimeout(w,s)),h}return s=n(s)||0,e(l)&&(v=!!l.leading,u=(g="maxWait"in l)?r(n(l.maxWait)||0,s):u,p="trailing"in l?!!l.trailing:p),E.cancel=function(){void 0!==d&&clearTimeout(d),m=0,a=f=c=d=void 0},E.flush=function(){return void 0===d?h:x(t())},E},Y}var se,le,ae=X(oe());var ce=function(){if(le)return se;le=1;var e=oe(),t=Z();return se=function(n,r,i){var o=!0,s=!0;if("function"!=typeof n)throw new TypeError("Expected a function");return t(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),e(n,r,{leading:o,maxWait:r,trailing:s})}}(),ue=X(ce);function he({skipOnMount:t=!1,refreshMode:s,refreshRate:l=1e3,refreshOptions:a,handleWidth:c=!0,handleHeight:u=!0,targetRef:h,observerOptions:d,onResize:f}={}){const m=n(t),v=(t=>{const n=e.useRef(t);return e.useEffect((()=>{n.current=t})),e.useMemo((()=>(...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])})(f),[g,p]=r({width:void 0,height:void 0}),{refProxy:y,refElement:b}=(t=>{const[n,r]=e.useState((null==t?void 0:t.current)||null);return t&&setTimeout((()=>{t.current!==n&&r(t.current)}),0),{refProxy:e.useMemo((()=>new Proxy((e=>{e!==n&&r(e)}),{get:(e,t)=>"current"===t?n:e[t],set:(e,t,n)=>("current"===t?r(n):e[t]=n,!0)})),[n]),refElement:n,setRefElement:r}})(h),{box:w}=d||{},x=i((e=>{if(!c&&!u)return;if(m.current)return void(m.current=!1);e.forEach((e=>{const t=((e,t)=>{var n,r;const i=null===(n=e.borderBoxSize)||void 0===n?void 0:n[0],o=null===(r=e.contentBoxSize)||void 0===r?void 0:r[0];return"border-box"===t&&i?{width:i.inlineSize,height:i.blockSize}:"content-box"===t&&o?{width:o.inlineSize,height:o.blockSize}:{width:e.contentRect.width,height:e.contentRect.height}})(e,w);p((n=>((e,t)=>c&&e.width!==t.width||u&&e.height!==t.height)(n,t)?(null==v||v({width:t.width,height:t.height,entry:e}),t):n))}))}),[c,u,m,w]),E=i(((e,t,n,r)=>{switch(t){case"debounce":return ae(e,n,r);case"throttle":return ue(e,n,r);default:return e}})(x,s,l,a),[x,s,l,a]);return o((()=>{let e;if(b)try{e=new window.ResizeObserver(E),e.observe(b,d)}catch(e){console.warn("ResizeObserver not supported or failed to initialize:",e)}else(g.width||g.height)&&(null==v||v({width:null,height:null,entry:null}),p({width:void 0,height:void 0}));return()=>{var t,n,r;null===(t=null==e?void 0:e.disconnect)||void 0===t||t.call(e),null===(r=(n=E).cancel)||void 0===r||r.call(n)}}),[E,b]),Object.assign({ref:y},g)}var de=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.flat().filter((function(e){return!!e})).map((function(e){return e.toString().trim()})).join(" ")},fe=function(e){return document.querySelector(e)},me=function(e,t,n){var r;return t>0?t:null!==(r=null==e?void 0:e.offsetHeight)&&void 0!==r?r:n},ve=function(e,t,n,r,i){var o=Math.max(t,1),s=n,l=Math.max(e-s,0),a=Math.max(r,Math.floor(l/o));return i.map((function(t){if(t.width)return t.width;if(t.maxWidth&&a-t.maxWidth>0)return o=Math.max(o-1,1),s+=t.maxWidth,l=Math.max(e-s,0),a=Math.max(r,Math.floor(l/o)),t.maxWidth;if(t.minWidth&&t.minWidth-a>0)return o=Math.max(o-1,1),s+=t.minWidth,l=Math.max(e-s,0),a=Math.max(r,Math.floor(l/o)),t.minWidth;return a}))},ge=function(e){return e.reduce((function(e,t){return{fixedWidth:e.fixedWidth+(t.width||0),remainingCols:e.remainingCols+(void 0===t.width?1:0)}}),{fixedWidth:0,remainingCols:0})},pe=function(e,t,n,r){var i=r.estimatedRow,o=r.estimatedHeader,s=r.estimatedFooter,l=r.maxHeight,a=function(e){return fe("[data-header-key='".concat(e,"-header']"))}(e),c=me(a,o,37),u=n?me(function(e){return fe("[data-footer-key='".concat(e,"-footer']"))}(e),s,37):0,h=null==a?void 0:a.parentElement,d=h?h.offsetHeight-h.clientHeight:0,f=i||37,m=c+(l>0?t:Math.min(t||10,10)+1)*f+2*d+u;return l>0?Math.min(l,m):m},ye=function(e){var n=e.uuid,r=e.hasFooter,i=e.numRows,o=e.dimensions,l=e.children,a=he(),c=a.ref,u=a.width,h=void 0===u?0:u,d=a.height,f=void 0===d?0:d,m=o.rowHeight,v=o.tableWidth,g=o.tableHeight,p=o.footerHeight,y=o.headerHeight,b=o.minTableHeight,w=o.maxTableHeight,x=o.estimatedRowHeight,E=s((function(){if(g>0)return g;var e=pe(n,i,r,{estimatedRow:m||x,estimatedHeader:y||37,estimatedFooter:p||37,maxHeight:w});return b>0||w>0?Math.min(Math.max(b,e),w):f||e}),[n,i,r,m,x,y,p,f,g,b,w]),O=v>0?v:h;return t.createElement("div",{ref:c,className:"rft-sizer"},E&&O?l({height:E,width:O}):null)};function be(e,t,n){let r,i=n.initialDeps??[];function o(){var o,s,l,a;let c;n.key&&(null==(o=n.debug)?void 0:o.call(n))&&(c=Date.now());const u=e();if(!(u.length!==i.length||u.some(((e,t)=>i[t]!==e))))return r;let h;if(i=u,n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(h=Date.now()),r=t(...u),n.key&&(null==(l=n.debug)?void 0:l.call(n))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-h))/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(a=null==n?void 0:n.onChange)||a.call(n,r),r}return o.updateDeps=e=>{i=e},o}function we(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const xe=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,i)),n)}},Ee=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Oe=e=>e,Se=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},Ce=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Ee(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver((t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void i({width:t.inlineSize,height:t.blockSize})}i(Ee(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()}));return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Me={passive:!0},ze="undefined"==typeof window||"onscrollend"in window,Te=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&ze?()=>{}:xe(r,(()=>{t(i,!1)}),e.options.isScrollingResetDelay),s=r=>()=>{const{horizontal:s,isRtl:l}=e.options;i=s?n.scrollLeft*(l?-1:1):n.scrollTop,o(),t(i,r)},l=s(!0),a=s(!1);a(),n.addEventListener("scroll",l,Me);const c=e.options.useScrollendEvent&&ze;return c&&n.addEventListener("scrollend",a,Me),()=>{n.removeEventListener("scroll",l),c&&n.removeEventListener("scrollend",a)}},ke=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Ie=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const s=e+t;null==(o=null==(i=r.scrollElement)?void 0:i.scrollTo)||o.call(i,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class je{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()}))})):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Oe,rangeExtractor:Se,onChange:()=>{},measureElement:ke,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=be((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"production"!==process.env.NODE_ENV&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(n.has(t.lane))continue;const o=r.get(t.lane);if(null==o||t.end>o.end?r.set(t.lane,t):t.end<o.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=be((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i})),{key:!1}),this.getMeasurements=be((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const l=this.measurementsCache.slice(0,s);for(let i=s;i<e;i++){const e=r(i),s=1===this.options.lanes?l[i-1]:this.getFurthestMeasurement(l,i),a=s?s.end+this.options.gap:t+n,c=o.get(e),u="number"==typeof c?c:this.options.estimateSize(i),h=a+u,d=s?s.lane:i%this.options.lanes;l[i]={index:i,start:a,size:u,end:h,key:e,lane:d}}return this.measurementsCache=l,l}),{key:"production"!==process.env.NODE_ENV&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=be((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes]),((e,t,n,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const i=e.length-1,o=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let s=He(0,i,o,n),l=s;if(1===r)for(;l<i&&e[l].end<n+t;)l++;else if(r>1){const o=Array(r).fill(0);for(;l<i&&o.some((e=>e<n+t));){const t=e[l];o[t.lane]=t.end,l++}const a=Array(r).fill(n+t);for(;s>=0&&a.some((e=>e>=n));){const t=e[s];a[t.lane]=t.start,s--}s=Math.max(0,s-s%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:s,endIndex:l}}({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null),{key:"production"!==process.env.NODE_ENV&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=be((()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,n,r,i)=>null===r||null===i?[]:e({startIndex:r,endIndex:i,overscan:t,count:n})),{key:"production"!==process.env.NODE_ENV&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const i=r.key,o=this.elementsCache.get(i);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):"backward"===this.scrollDirection&&n.start<this.getScrollOffset()+this.scrollAdjustments)&&("production"!==process.env.NODE_ENV&&this.options.debug&&console.info("correction",r),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=be((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];n.push(i)}return n}),{key:"production"!==process.env.NODE_ENV&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return we(t[He(0,t.length-1,(e=>we(t[e]).start),e)])},this.getOffsetForAlignment=(e,t,n=0)=>{const r=this.getSize(),i=this.getScrollOffset();"auto"===t&&(t=e>=i+r?"end":"start"),"center"===t?e+=(n-r)/2:"end"===t&&(e-=r);const o=this.getTotalSize()-r;return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),i=this.getScrollOffset();if("auto"===t)if(n.end>=i+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=i+this.options.scrollPaddingStart))return[i,t];t="start"}const o="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(e,t);if(!r)return;const[i,o]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const i=this.getOffsetForIndex(e,o);if(!i)return;const[s]=i,l=this.getScrollOffset();t=s,r=l,Math.abs(t-r)<=1||this.scrollToIndex(e,{align:o,behavior:n})}else this.scrollToIndex(e,{align:o,behavior:n});var t,r})))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some((e=>null===e));){const n=t[r];null===e[n.lane]&&(e[n.lane]=n.end),r--}n=Math.max(...e.filter((e=>null!==e)))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const He=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else{if(!(o>r))return i;t=i-1}}return e>0?e-1:0};const Ne="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function We(t){return function(t){const n=e.useReducer((()=>({})),{})[1],r={...t,onChange:(e,r)=>{var i;r?h(n):n(),null==(i=t.onChange)||i.call(t,e,r)}},[i]=e.useState((()=>new je(r)));return i.setOptions(r),Ne((()=>i._didMount()),[]),Ne((()=>i._willUpdate())),i}({observeElementRect:Ce,observeElementOffset:Te,scrollToFn:Ie,...t})}var Re=["prevWidth"];function _e(e){var n=e.prevWidth,r=b(e,Re),i=r.width,o=r.column,s={width:i||void 0,minWidth:i||void 0,padding:o.footer?void 0:0,left:o.frozen?n:void 0};return t.createElement("div",{className:de("cell",o.frozen&&"frozen"),style:s},!!o.footer&&t.createElement(o.footer,r))}var De=l(_e);function Pe(e,n){var r=e.uuid,i=e.rows,o=e.columns,s=e.pixelWidths,l=e.sticky,a=e.className,c=e.style,u=void 0===c?{}:c,h=e.component,d=!!h||o.some((function(e){return!!e.footer})),f=y({minWidth:l?void 0:s.reduce((function(e,t){return e+t}),0)},u);if(d||(f.width=0,f.minWidth=0),!h){var m=o.some((function(e){return!!e.footer}));return t.createElement("div",{ref:n,style:y({border:m?void 0:"none"},f),"data-footer-key":"".concat(r,"-footer"),className:de("rft-footer",l&&"sticky",a)},t.createElement("div",{className:"rft-row"},o.map((function(e,n){return t.createElement(De,{key:e.key,column:e,rows:i,width:s[n],prevWidth:e.frozen?s.slice(0,n).reduce((function(e,t){return e+t}),0):0})}))))}return t.createElement("div",{ref:n,style:f,"data-footer-key":"".concat(r,"-footer"),className:de("rft-footer",l&&"sticky",a)},t.createElement(h,{rows:i,widths:s}))}De.displayName="FooterCell";var Ae=a(Pe);function Fe(e){var n=e.column,r=e.width,i=e.prevWidth,o=e.sortedCol,s=e.sortedDir,l=e.onHeaderClick,a=n.key,c=n.sortable,u=n.frozen,h={cursor:c?"pointer":void 0,width:r||void 0,minWidth:r||void 0,left:u?i:void 0};if(!n.header||"string"==typeof n.header){var d=n.headerStyle,f=void 0===d?{}:d,m=n.headerClassname;return t.createElement("div",{style:y(y({},f),h),onClick:function(){return l(n)},className:de("rft-header-cell",u&&"frozen",m)},n.header?t.createElement("div",{className:"rft-header-cell-text"},n.header):null,a!==o?null:t.createElement("div",{className:de("rft-header-cell-arrow",null==s?void 0:s.toLowerCase())}))}var v=a===o&&s||null,g=u?{position:"sticky",zIndex:1}:{};return t.createElement(n.header,{onClick:function(){return l(n)},sortDirection:v,style:y(y({},h),g)})}Ae.displayName="Footer";var Ve=l(Fe);function Be(e,n){var s=e.uuid,l=e.columns,a=e.pixelWidths,c=e.className,u=e.style,h=e.sortColumn,d=e.sortDirection,f=e.onSort,m=E(r(h),2),v=m[0],g=m[1],p=E(r(d),2),y=p[0],b=p[1],w=i((function(e){if(e.sortable){var t="ASC";v===e.key&&(t=y?"ASC"===y?"DESC":null:"ASC"),null==f||f(e.key,t),g(e.key),b(t)}}),[v,y]);return o((function(){g(h),b(d)}),[h,d]),t.createElement("div",{ref:n,style:u,"data-header-key":"".concat(s,"-header"),className:de("rft-header",c)},t.createElement("div",{className:"rft-header-row"},l.map((function(e,n){return t.createElement(Ve,{key:e.key,width:a[n],sortedCol:v,sortedDir:y,column:e,onHeaderClick:w,prevWidth:e.frozen?a.slice(0,n).reduce((function(e,t){return e+t}),0):0})}))))}Ve.displayName="HeaderCell";var Le,Ke=a(Be);function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$e.apply(null,arguments)}Ke.displayName="Header";var Ge,Ue=function(t){return e.createElement("svg",$e({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"minus-circle_svg__svg-inline--fa minus-circle_svg__fa-minus-circle minus-circle_svg__fa-w-16","data-icon":"minus-circle","data-prefix":"fas",viewBox:"0 0 512 512"},t),Le||(Le=e.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8M124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12z"})))};function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qe.apply(null,arguments)}var Ye=function(t){return e.createElement("svg",qe({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"plus-circle_svg__svg-inline--fa plus-circle_svg__fa-plus-circle plus-circle_svg__fa-w-16","data-icon":"plus-circle","data-prefix":"fas",viewBox:"0 0 512 512"},t),Ge||(Ge=e.createElement("path",{fill:"currentColor",d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8m144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12z"})))};function Je(e){var n=e.row,r=e.index,i=e.width,o=e.column,s=e.isExpanded,l=e.prevWidth,a=e.onExpanderClick,c=o.frozen,u=o.contentClassname,h=o.contentStyle,d={width:i||void 0,minWidth:i||void 0,left:c?l:void 0};if(o.expander){var f="function"==typeof u?u({row:n,index:r}):u;if("boolean"==typeof o.expander){var m=s?Ue:Ye,v=("function"==typeof h?h({row:n,index:r}):h)||{};return t.createElement("div",{className:de("rft-cell",c&&"frozen",f),style:y(y({},v),d)},t.createElement(m,{className:"rft-expander",onClick:a}))}var g=c?{position:"sticky",zIndex:2}:{};return t.createElement(o.expander,{row:n,index:r,isExpanded:s,onClick:a,style:y(y({},d),g)})}if(!o.cell){var p="function"==typeof u?u({row:n,index:r}):u,b=("function"==typeof h?h({row:n,index:r}):h)||{},w=n[o.key]||null;return o.content&&(w="string"==typeof o.content||"number"==typeof o.content?o.content:t.createElement(o.content,{row:n,index:r})),t.createElement("div",{className:de("rft-cell",c&&"frozen",p),style:y(y({},b),d)},w)}var x=o.frozen?{position:"sticky",zIndex:2}:{};return t.createElement(o.cell,{row:n,index:r,style:y(y({},d),x)})}var Qe=l(Je);function Xe(e,n){var r=e.uuid,i=e.index,o=e.offset,s=e.row,l=e.rowKey,a=e.columns,c=e.pixelWidths,u=e.isExpanded,h=e.onExpand,d=e.onRowClick,f=e.className,m=e.style,v=void 0===m?{}:m,g=e.subComponent;return t.createElement("div",{ref:n,"data-index":i,"data-row-key":"".concat(r,"-").concat(l),className:de("rft-row",f),style:y({transform:"translateY(".concat(o,"px)")},v),onClick:function(e){return null==d?void 0:d({row:s,index:i,event:e})}},a.map((function(e,n){return t.createElement(Qe,{key:"".concat(r,"-").concat(l,"-").concat(n),row:s,column:e,index:i,width:c[n],isExpanded:u,onExpanderClick:function(e){return h(s,i,l,e)},prevWidth:e.frozen?c.slice(0,n).reduce((function(e,t){return e+t}),0):0})})),!!g&&t.createElement("div",{className:de("rft-sub-component",!u&&"rft-hidden")},t.createElement(g,{row:s,index:i,isExpanded:u,widths:c})))}Qe.displayName="TableCell";var Ze=a(Xe);function et(e,l){var a=e.id,h=e.uuid,d=e.width,f=e.data,g=e.columns,p=e.rowHeight,b=e.headerStyle,x=e.headerClassname,O=e.itemKey,S=e.onSort,C=e.sortColumn,M=e.sortDirection,z=e.expandedRows,T=e.onRowClick,k=e.onLoadRows,I=e.onExpandRow,j=e.subComponent,H=e.className,N=e.rowClassname,W=e.rowStyle,R=e.footerStyle,_=e.footerClassname,D=e.footerComponent,P=e.stickyFooter,A=e.tableHeight,F=e.maxTableHeight,V=e.estimatedRowHeight,B=e.style,L=void 0===B?{}:B,K=e.hasMoreData,$=e.asyncOverscan,G=void 0===$?1:$,U=e.minColumnWidth,q=void 0===U?80:U,Y=e.endComponent,J=e.height,Q=e.headerHeight,X=e.footerHeight,Z=n(null),ee=n(null),te=n(null),ne=E(r(!1),2),re=ne[0],ie=ne[1],oe=n(null!=p?p:V),se=E(r(null==K||K),2),le=se[0],ae=se[1],ce=E(r(ge(g)),2),ue=ce[0],he=ce[1],fe=r((function(){var e=ue.fixedWidth,t=ue.remainingCols;return ve(d,t,e,q,g)})),pe=E(fe,2),ye=pe[0],be=pe[1],we=E(r({}),2),xe=we[0],Ee=we[1],Oe=i((function(e,t){var n;return null!==(n=null==O?void 0:O(e))&&void 0!==n?n:t}),[O]),Se=We({count:f.length+(Y?1:0),getScrollElement:function(){return Z.current},estimateSize:function(){var e;return null!==(e=null!=p?p:V)&&void 0!==e?e:37},getItemKey:function(e){return Oe(f[e],e)}}),Ce=Se.getVirtualItems(),Me=null!=K?K:le,ze=Se.measure,Te=Se.measurementsCache,ke=ue.fixedWidth,Ie=ue.remainingCols,je=s((function(){if(A>0||F<=0)return null;for(var e=0,t=0;t<Te.length;t++)if((e+=Te[t].size)>=F){e=F;break}return e}),[F,Te,A]),He=s((function(){if(A>0)return A;if(F>0){var e,t=null===(e=Z.current)||void 0===e?void 0:e.parentElement,n=t?t.offsetHeight-t.clientHeight:0,r=me(ee.current,Q,37),i=me(te.current,X,37);return Math.min(r+je+i+2*n,F)+2}return J}),[je,J,X,Q,F,A]),Ne="function"==typeof z?z:void 0,Re=i((function(e,t,n,r){var i=!xe[n];null==I||I({row:e,index:t,isExpanded:i,event:r}),I||Ee((function(e){return y(y({},e),{},v({},n,i))}))}),[xe]),_e=Ce.length?Ce[Ce.length-1].index:null,De=i(m(w().m((function e(){var t;return w().w((function(e){for(;;)switch(e.n){case 0:if(k&&null!=_e){e.n=1;break}return e.a(2);case 1:if(!(Me&&_e>=f.length-G)||re){e.n=5;break}return ie(!0),e.p=2,e.n=3,k();case 3:t=e.v,null==K&&ae(t);case 4:return e.p=4,ie(!1),e.f(4);case 5:return e.a(2)}}),e,null,[[2,,4,5]])}))),[_e,f.length,re,G,Me,K]);return c((function(){var e,t,n=ve(null!==(e=null===(t=Z.current)||void 0===t?void 0:t.clientWidth)&&void 0!==e?e:d,Ie,ke,q,g);be((function(e){return function(e,t){if(null==e&&null==t)return!0;if(null!=e&&null!=t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}(n,e)?e:n}))}),[d,Ie,ke,q,g]),c((function(){var e=null!=p?p:V;oe.current!==e&&ze(),oe.current=e}),[V,p,ze]),o((function(){return he(ge(g))}),[g]),o((function(){z&&"function"!=typeof z&&Ee(z)}),[z]),o((function(){De()}),[De]),u(l,(function(){return{scrollTo:function(e){return Se.scrollToOffset(e)},scrollToItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto";return Se.scrollToIndex(e,{align:t})}}})),t.createElement("div",{id:a,ref:Z,"data-table-key":h,className:de("rft",H),style:y(y({},L),{},{height:He,width:d})},t.createElement(Ke,{uuid:h,ref:ee,pixelWidths:ye,columns:g,className:x,style:b,onSort:S,sortColumn:C,sortDirection:M}),t.createElement("div",{className:"rft-body",style:{height:Se.getTotalSize()}},Ce.map((function(e){var n,r=e.index,i=e.start;if(r>f.length-1&&Y){var o="".concat(h,"-end");return t.createElement("div",{key:o,ref:Se.measureElement,className:"rft-end","data-index":r,"data-row-key":o,style:{transform:"translateY(".concat(i,"px)")}},t.createElement(Y,{isLoading:re,hasMoreData:Me}))}var s=f[r],l={row:s,index:r},a=Oe(s,r),c=null!==(n=null==Ne?void 0:Ne(l))&&void 0!==n?n:!!xe[a],u="function"==typeof N?N(l):N,d="function"==typeof W?W(l):W;return t.createElement(Ze,{ref:Se.measureElement,key:a,row:s,uuid:h,rowKey:a,style:d,offset:i,className:u,isExpanded:c,onRowClick:T,onExpand:Re,index:r,columns:g,pixelWidths:ye,subComponent:j})}))),t.createElement(Ae,{uuid:h,rows:f,ref:te,sticky:P,columns:g,pixelWidths:ye,className:_,style:R,component:D}))}Ze.displayName="Row";var tt=a(et);tt.displayName="List";var nt=["id","rowHeight","tableWidth","tableHeight","footerHeight","headerHeight","minTableHeight","maxTableHeight","estimatedRowHeight"];function rt(e,n){var i=e.id,o=e.rowHeight,l=e.tableWidth,a=void 0===l?0:l,c=e.tableHeight,u=void 0===c?0:c,h=e.footerHeight,d=void 0===h?0:h,f=e.headerHeight,m=void 0===f?0:f,v=e.minTableHeight,p=void 0===v?0:v,y=e.maxTableHeight,w=void 0===y?0:y,x=e.estimatedRowHeight,O=b(e,nt),S=E(r("".concat(i||"data-table","-").concat(function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(62*Math.random()));return t}(5))),1)[0],C=s((function(){return p>0&&w<=0?(console.warn("maxTableHeight was either not present, or is <= 0, but you provided a minTableHeight of ".concat(p,"px. As a result, the maxTableHeight will be set to ").concat(p+400,"px. To avoid this warning, please specify a maxTableHeight.")),p+400):w}),[p,w]),M={rowHeight:o||0,tableWidth:a,tableHeight:u,footerHeight:d,headerHeight:m,minTableHeight:p,estimatedRowHeight:x||0,maxTableHeight:C};return t.createElement(ye,{uuid:S,dimensions:M,numRows:O.data.length,hasFooter:!!O.footerComponent||O.columns.some((function(e){return!!e.footer}))},(function(e){var r=e.height,i=e.width;return t.createElement(tt,g({ref:n,uuid:S,width:i,height:r,rowHeight:o,tableHeight:u,maxTableHeight:C,headerHeight:m,footerHeight:d,estimatedRowHeight:x},O))}))}var it=a(rt);it.displayName="Table";export{it as Table};