2 lines
72 KiB
JavaScript
2 lines
72 KiB
JavaScript
var po=Object.defineProperty,go=Object.defineProperties;var vo=Object.getOwnPropertyDescriptors;var bn=Object.getOwnPropertySymbols;var mo=Object.prototype.hasOwnProperty,ho=Object.prototype.propertyIsEnumerable;var wn=(d,p,l)=>p in d?po(d,p,{enumerable:!0,configurable:!0,writable:!0,value:l}):d[p]=l,xe=(d,p)=>{for(var l in p||(p={}))mo.call(p,l)&&wn(d,l,p[l]);if(bn)for(var l of bn(p))ho.call(p,l)&&wn(d,l,p[l]);return d},Te=(d,p)=>go(d,vo(p));import{r as fe,R as _,g as Ce,A as yo,C as bo,M as wo,k as Ro,P as Co,D as So,I as Po}from"./vendor.38e754a4.js";import{p as Rn,m as Cn,B as Sn,c as xo,a as Eo,f as Io,C as Bo,S as To,g as Fo}from"./index.ee5bc09a.js";import{u as _o}from"./useRemainingViewPortHeight.7baef998.js";import{f as Oo}from"./index.9233837d.js";import{F as Ao,p as Go,A as No}from"./Fab.4dc9cb99.js";function at(d){return function(p){return!!p.type&&p.type.tabsRole===d}}var De=at("Tab"),it=at("TabList"),$e=at("TabPanel");function st(){return st=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(d[s]=l[s])}return d},st.apply(this,arguments)}function ko(d){return De(d)||it(d)||$e(d)}function ut(d,p){return fe.exports.Children.map(d,function(l){return l===null?null:ko(l)?p(l):l.props&&l.props.children&&typeof l.props.children=="object"?fe.exports.cloneElement(l,st({},l.props,{children:ut(l.props.children,p)})):l})}function lt(d,p){return fe.exports.Children.forEach(d,function(l){l!==null&&(De(l)||$e(l)?p(l):l.props&&l.props.children&&typeof l.props.children=="object"&&(it(l)&&p(l),lt(l.props.children,p)))})}var Ho=0;function Pn(){return"react-tabs-"+Ho++}function xn(d){var p=0;return lt(d,function(l){De(l)&&p++}),p}function jo(d){var p=0;return lt(d,function(l){$e(l)&&p++}),p}var Wo=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function ct(){return ct=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(d[s]=l[s])}return d},ct.apply(this,arguments)}function zo(d,p){if(d==null)return{};var l={},s=Object.keys(d),v,y;for(y=0;y<s.length;y++)v=s[y],!(p.indexOf(v)>=0)&&(l[v]=d[v]);return l}function Mo(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,dt(d,p)}function dt(d,p){return dt=Object.setPrototypeOf||function(s,v){return s.__proto__=v,s},dt(d,p)}function En(d){return d&&"getAttribute"in d}function In(d){return En(d)&&d.getAttribute("data-rttab")}function Se(d){return En(d)&&d.getAttribute("aria-disabled")==="true"}var Ve;function Lo(d){var p=d||(typeof window!="undefined"?window:void 0);try{Ve=!!(typeof p!="undefined"&&p.document&&p.document.activeElement)}catch{Ve=!1}}var ft=function(d){Mo(p,d);function p(){for(var s,v=arguments.length,y=new Array(v),u=0;u<v;u++)y[u]=arguments[u];return s=d.call.apply(d,[this].concat(y))||this,s.tabNodes=[],s.handleKeyDown=function(B){var M=s.props,c=M.direction,X=M.disableUpDownKeys;if(s.isTabFromContainer(B.target)){var q=s.props.selectedIndex,Q=!1,ee=!1;(B.keyCode===32||B.keyCode===13)&&(Q=!0,ee=!1,s.handleClick(B)),B.keyCode===37||!X&&B.keyCode===38?(c==="rtl"?q=s.getNextTab(q):q=s.getPrevTab(q),Q=!0,ee=!0):B.keyCode===39||!X&&B.keyCode===40?(c==="rtl"?q=s.getPrevTab(q):q=s.getNextTab(q),Q=!0,ee=!0):B.keyCode===35?(q=s.getLastTab(),Q=!0,ee=!0):B.keyCode===36&&(q=s.getFirstTab(),Q=!0,ee=!0),Q&&B.preventDefault(),ee&&s.setSelected(q,B)}},s.handleClick=function(B){var M=B.target;do if(s.isTabFromContainer(M)){if(Se(M))return;var c=[].slice.call(M.parentNode.children).filter(In).indexOf(M);s.setSelected(c,B);return}while((M=M.parentNode)!=null)},s}var l=p.prototype;return l.setSelected=function(v,y){if(!(v<0||v>=this.getTabsCount())){var u=this.props,B=u.onSelect,M=u.selectedIndex;B(v,M,y)}},l.getNextTab=function(v){for(var y=this.getTabsCount(),u=v+1;u<y;u++)if(!Se(this.getTab(u)))return u;for(var B=0;B<v;B++)if(!Se(this.getTab(B)))return B;return v},l.getPrevTab=function(v){for(var y=v;y--;)if(!Se(this.getTab(y)))return y;for(y=this.getTabsCount();y-- >v;)if(!Se(this.getTab(y)))return y;return v},l.getFirstTab=function(){for(var v=this.getTabsCount(),y=0;y<v;y++)if(!Se(this.getTab(y)))return y;return null},l.getLastTab=function(){for(var v=this.getTabsCount();v--;)if(!Se(this.getTab(v)))return v;return null},l.getTabsCount=function(){var v=this.props.children;return xn(v)},l.getPanelsCount=function(){var v=this.props.children;return jo(v)},l.getTab=function(v){return this.tabNodes["tabs-"+v]},l.getChildren=function(){var v=this,y=0,u=this.props,B=u.children,M=u.disabledTabClassName,c=u.focus,X=u.forceRenderTabPanel,q=u.selectedIndex,Q=u.selectedTabClassName,ee=u.selectedTabPanelClassName,V=u.environment;this.tabIds=this.tabIds||[],this.panelIds=this.panelIds||[];for(var J=this.tabIds.length-this.getTabsCount();J++<0;)this.tabIds.push(Pn()),this.panelIds.push(Pn());return ut(B,function(ne){var oe=ne;if(it(ne)){var Z=0,W=!1;Ve==null&&Lo(V),Ve&&(W=_.Children.toArray(ne.props.children).filter(De).some(function(re,ce){var pe=V||(typeof window!="undefined"?window:void 0);return pe&&pe.document.activeElement===v.getTab(ce)})),oe=fe.exports.cloneElement(ne,{children:ut(ne.props.children,function(re){var ce="tabs-"+Z,pe=q===Z,ye={tabRef:function(Re){v.tabNodes[ce]=Re},id:v.tabIds[Z],panelId:v.panelIds[Z],selected:pe,focus:pe&&(c||W)};return Q&&(ye.selectedClassName=Q),M&&(ye.disabledClassName=M),Z++,fe.exports.cloneElement(re,ye)})})}else if($e(ne)){var me={id:v.panelIds[y],tabId:v.tabIds[y],selected:q===y};X&&(me.forceRender=X),ee&&(me.selectedClassName=ee),y++,oe=fe.exports.cloneElement(ne,me)}return oe})},l.isTabFromContainer=function(v){if(!In(v))return!1;var y=v.parentElement;do{if(y===this.node)return!0;if(y.getAttribute("data-rttabs"))break;y=y.parentElement}while(y);return!1},l.render=function(){var v=this,y=this.props;y.children;var u=y.className;y.disabledTabClassName;var B=y.domRef;y.focus,y.forceRenderTabPanel,y.onSelect,y.selectedIndex,y.selectedTabClassName,y.selectedTabPanelClassName,y.environment,y.disableUpDownKeys;var M=zo(y,Wo);return _.createElement("div",ct({},M,{className:Ce(u),onClick:this.handleClick,onKeyDown:this.handleKeyDown,ref:function(X){v.node=X,B&&B(X)},"data-rttabs":!0}),this.getChildren())},p}(fe.exports.Component);ft.defaultProps={className:"react-tabs",focus:!1};ft.propTypes={};var Do=["children","defaultIndex","defaultFocus"];function $o(d,p){if(d==null)return{};var l={},s=Object.keys(d),v,y;for(y=0;y<s.length;y++)v=s[y],!(p.indexOf(v)>=0)&&(l[v]=d[v]);return l}function Vo(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,pt(d,p)}function pt(d,p){return pt=Object.setPrototypeOf||function(s,v){return s.__proto__=v,s},pt(d,p)}var Ko=0,gt=1,Ke=function(d){Vo(p,d);function p(s){var v;return v=d.call(this,s)||this,v.handleSelected=function(y,u,B){var M=v.props.onSelect,c=v.state.mode;if(!(typeof M=="function"&&M(y,u,B)===!1)){var X={focus:B.type==="keydown"};c===gt&&(X.selectedIndex=y),v.setState(X)}},v.state=p.copyPropsToState(v.props,{},s.defaultFocus),v}p.getDerivedStateFromProps=function(v,y){return p.copyPropsToState(v,y)},p.getModeFromProps=function(v){return v.selectedIndex===null?gt:Ko},p.copyPropsToState=function(v,y,u){u===void 0&&(u=!1);var B={focus:u,mode:p.getModeFromProps(v)};if(B.mode===gt){var M=Math.max(0,xn(v.children)-1),c=null;y.selectedIndex!=null?c=Math.min(y.selectedIndex,M):c=v.defaultIndex||0,B.selectedIndex=c}return B};var l=p.prototype;return l.render=function(){var v=this.props,y=v.children;v.defaultIndex,v.defaultFocus;var u=$o(v,Do),B=this.state,M=B.focus,c=B.selectedIndex;return u.focus=M,u.onSelect=this.handleSelected,c!=null&&(u.selectedIndex=c),_.createElement(ft,u,y)},p}(fe.exports.Component);Ke.defaultProps={defaultFocus:!1,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1};Ke.propTypes={};Ke.tabsRole="Tabs";var Uo=["children","className"];function vt(){return vt=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(d[s]=l[s])}return d},vt.apply(this,arguments)}function qo(d,p){if(d==null)return{};var l={},s=Object.keys(d),v,y;for(y=0;y<s.length;y++)v=s[y],!(p.indexOf(v)>=0)&&(l[v]=d[v]);return l}function Xo(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,mt(d,p)}function mt(d,p){return mt=Object.setPrototypeOf||function(s,v){return s.__proto__=v,s},mt(d,p)}var Ue=function(d){Xo(p,d);function p(){return d.apply(this,arguments)||this}var l=p.prototype;return l.render=function(){var v=this.props,y=v.children,u=v.className,B=qo(v,Uo);return _.createElement("ul",vt({},B,{className:Ce(u),role:"tablist"}),y)},p}(fe.exports.Component);Ue.defaultProps={className:"react-tabs__tab-list"};Ue.propTypes={};Ue.tabsRole="TabList";var Qo=["children","className","disabled","disabledClassName","focus","id","panelId","selected","selectedClassName","tabIndex","tabRef"];function ht(){return ht=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(d[s]=l[s])}return d},ht.apply(this,arguments)}function Jo(d,p){if(d==null)return{};var l={},s=Object.keys(d),v,y;for(y=0;y<s.length;y++)v=s[y],!(p.indexOf(v)>=0)&&(l[v]=d[v]);return l}function Yo(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,yt(d,p)}function yt(d,p){return yt=Object.setPrototypeOf||function(s,v){return s.__proto__=v,s},yt(d,p)}var bt="react-tabs__tab",Fe=function(d){Yo(p,d);function p(){return d.apply(this,arguments)||this}var l=p.prototype;return l.componentDidMount=function(){this.checkFocus()},l.componentDidUpdate=function(){this.checkFocus()},l.checkFocus=function(){var v=this.props,y=v.selected,u=v.focus;y&&u&&this.node.focus()},l.render=function(){var v,y=this,u=this.props,B=u.children,M=u.className,c=u.disabled,X=u.disabledClassName;u.focus;var q=u.id,Q=u.panelId,ee=u.selected,V=u.selectedClassName,J=u.tabIndex,ne=u.tabRef,oe=Jo(u,Qo);return _.createElement("li",ht({},oe,{className:Ce(M,(v={},v[V]=ee,v[X]=c,v)),ref:function(W){y.node=W,ne&&ne(W)},role:"tab",id:q,"aria-selected":ee?"true":"false","aria-disabled":c?"true":"false","aria-controls":Q,tabIndex:J||(ee?"0":null),"data-rttab":!0}),B)},p}(fe.exports.Component);Fe.defaultProps={className:bt,disabledClassName:bt+"--disabled",focus:!1,id:null,panelId:null,selected:!1,selectedClassName:bt+"--selected"};Fe.propTypes={};Fe.tabsRole="Tab";var Zo=["children","className","forceRender","id","selected","selectedClassName","tabId"];function wt(){return wt=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(d[s]=l[s])}return d},wt.apply(this,arguments)}function ea(d,p){if(d==null)return{};var l={},s=Object.keys(d),v,y;for(y=0;y<s.length;y++)v=s[y],!(p.indexOf(v)>=0)&&(l[v]=d[v]);return l}function ta(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,Rt(d,p)}function Rt(d,p){return Rt=Object.setPrototypeOf||function(s,v){return s.__proto__=v,s},Rt(d,p)}var Bn="react-tabs__tab-panel",_e=function(d){ta(p,d);function p(){return d.apply(this,arguments)||this}var l=p.prototype;return l.render=function(){var v,y=this.props,u=y.children,B=y.className,M=y.forceRender,c=y.id,X=y.selected,q=y.selectedClassName,Q=y.tabId,ee=ea(y,Zo);return _.createElement("div",wt({},ee,{className:Ce(B,(v={},v[q]=X,v)),role:"tabpanel",id:c,"aria-labelledby":Q}),M||X?u:null)},p}(fe.exports.Component);_e.defaultProps={className:Bn,forceRender:!1,selectedClassName:Bn+"--selected"};_e.propTypes={};_e.tabsRole="TabPanel";const na="_placeHolder_12xws_1",ra="_connQty_12xws_10",oa="_inputWrapper_12xws_22",aa="_input_12xws_22";var Oe={placeHolder:na,connQty:ra,inputWrapper:oa,input:aa},Ct={exports:{}},St={exports:{}};(function(d,p){(function(l,s){s(p,fe.exports)})(yo,function(l,s){function v(e,t,n,r,a,o,i){try{var f=e[o](i),g=f.value}catch(m){return void n(m)}f.done?t(g):Promise.resolve(g).then(r,a)}function y(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(g){v(o,r,a,i,f,"next",g)}function f(g){v(o,r,a,i,f,"throw",g)}i(void 0)})}}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function B(e,t){if(e==null)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}function M(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var o=a.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s;var c={init:"init"},X=function(e){var t=e.value;return t===void 0?"":t},q=function(){return s.createElement(s.Fragment,null,"\xA0")},Q={Cell:X,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(r,a){var o=a.style,i=a.className;return r=u({},r,{},B(a,["style","className"])),o&&(r.style=r.style?u({},r.style||{},{},o||{}):o),i&&(r.className=r.className?r.className+" "+i:i),r.className===""&&delete r.className,r},{})}var V=function(e,t){return t===void 0&&(t={}),function(n){return n===void 0&&(n={}),[].concat(e,[n]).reduce(function(r,a){return function o(i,f,g){return typeof f=="function"?o({},f(i,g)):Array.isArray(f)?ee.apply(void 0,[i].concat(f)):ee(i,f)}(r,a,u({},t,{userProps:n}))},{})}},J=function(e,t,n,r){return n===void 0&&(n={}),e.reduce(function(a,o){return o(a,n)},t)},ne=function(e,t,n){return n===void 0&&(n={}),e.forEach(function(r){r(t,n)})};function oe(e,t,n,r){e.findIndex(function(a){return a.pluginName===n}),t.forEach(function(a){e.findIndex(function(o){return o.pluginName===a})})}function Z(e,t){return typeof e=="function"?e(t):e}function W(e){var t=s.useRef();return t.current=e,s.useCallback(function(){return t.current},[])}var me=typeof document!="undefined"?s.useLayoutEffect:s.useEffect;function re(e,t){var n=s.useRef(!1);me(function(){n.current&&e(),n.current=!0},t)}function ce(e,t,n){return n===void 0&&(n={}),function(r,a){a===void 0&&(a={});var o=typeof r=="string"?t[r]:r;if(o===void 0)throw console.info(t),new Error("Renderer Error \u261D\uFE0F");return pe(o,u({},e,{column:t},n,{},a))}}function pe(e,t){return function(r){return typeof r=="function"&&(a=Object.getPrototypeOf(r)).prototype&&a.prototype.isReactComponent;var a}(n=e)||typeof n=="function"||function(r){return typeof r=="object"&&typeof r.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(r.$$typeof.description)}(n)?s.createElement(e,t):e;var n}function ye(e,t,n){return n===void 0&&(n=0),e.map(function(r){return Re(r=u({},r,{parent:t,depth:n})),r.columns&&(r.columns=ye(r.columns,r,n+1)),r})}function ge(e){return Et(e,"columns")}function Re(e){var t=e.id,n=e.accessor,r=e.Header;if(typeof n=="string"){t=t||n;var a=n.split(".");n=function(o){return function(i,f,g){if(!f)return i;var m,C=typeof f=="function"?f:JSON.stringify(f),w=ke.get(C)||function(){var R=function(h){return function b(P,S){if(S===void 0&&(S=[]),Array.isArray(P))for(var I=0;I<P.length;I+=1)b(P[I],S);else S.push(P);return S}(h).map(function(b){return String(b).replace(".","_")}).join(".").replace(An,".").replace(Gn,"").split(".")}(f);return ke.set(C,R),R}();try{m=w.reduce(function(R,h){return R[h]},i)}catch{}return m!==void 0?m:g}(o,a)}}if(!t&&typeof r=="string"&&r&&(t=r),!t&&e.columns)throw console.error(e),new Error('A column ID (or unique "Header" value) is required!');if(!t)throw console.error(e),new Error("A column ID (or string accessor) is required!");return Object.assign(e,{id:t,accessor:n}),e}function he(e,t){if(!t)throw new Error;return Object.assign(e,u({Header:q,Footer:q},Q,{},t,{},e)),Object.assign(e,{originalWidth:e.width}),e}function Pt(e,t,n){n===void 0&&(n=function(){return{}});for(var r=[],a=e,o=0,i=function(){return o++},f=function(){var g={headers:[]},m=[],C=a.some(function(w){return w.parent});a.forEach(function(w){var R,h=[].concat(m).reverse()[0];C&&(w.parent?R=u({},w.parent,{originalId:w.parent.id,id:w.parent.id+"_"+i(),headers:[w]},n(w)):R=he(u({originalId:w.id+"_placeholder",id:w.id+"_placeholder_"+i(),placeholderOf:w,headers:[w]},n(w)),t),h&&h.originalId===R.originalId?h.headers.push(w):m.push(R)),g.headers.push(w)}),r.push(g),a=m};a.length;)f();return r.reverse()}var ke=new Map;function ve(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r+=1)if(t[r]!==void 0)return t[r]}function xt(e){if(typeof e=="function")return e}function Et(e,t){var n=[];return function r(a){a.forEach(function(o){o[t]?r(o[t]):n.push(o)})}(e),n}function It(e,t){var n=t.manualExpandedKey,r=t.expanded,a=t.expandSubRows,o=a===void 0||a,i=[];return e.forEach(function(f){return function g(m,C){C===void 0&&(C=!0),m.isExpanded=m.original&&m.original[n]||r[m.id],m.canExpand=m.subRows&&!!m.subRows.length,C&&i.push(m),m.subRows&&m.subRows.length&&m.isExpanded&&m.subRows.forEach(function(w){return g(w,o)})}(f)}),i}function Ee(e,t,n){return xt(e)||t[e]||n[e]||n.text}function Xe(e,t,n){return e?e(t,n):t===void 0}function He(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var Qe=null,An=/\[/g,Gn=/\]/g,Nn=function(e){return u({role:"table"},e)},kn=function(e){return u({role:"rowgroup"},e)},Hn=function(e,t){var n=t.column;return u({key:"header_"+n.id,colSpan:n.totalVisibleHeaderCount,role:"columnheader"},e)},jn=function(e,t){var n=t.column;return u({key:"footer_"+n.id,colSpan:n.totalVisibleHeaderCount},e)},Wn=function(e,t){return u({key:"headerGroup_"+t.index,role:"row"},e)},zn=function(e,t){return u({key:"footerGroup_"+t.index},e)},Mn=function(e,t){return u({key:"row_"+t.row.id,role:"row"},e)},Ln=function(e,t){var n=t.cell;return u({key:"cell_"+n.row.id+"_"+n.column.id,role:"cell"},e)};function Dn(){return{useOptions:[],stateReducers:[],useControlledState:[],columns:[],columnsDeps:[],allColumns:[],allColumnsDeps:[],accessValue:[],materializedColumns:[],materializedColumnsDeps:[],useInstanceAfterData:[],visibleColumns:[],visibleColumnsDeps:[],headerGroups:[],headerGroupsDeps:[],useInstanceBeforeDimensions:[],useInstance:[],prepareRow:[],getTableProps:[Nn],getTableBodyProps:[kn],getHeaderGroupProps:[Wn],getFooterGroupProps:[zn],getHeaderProps:[Hn],getFooterProps:[jn],getRowProps:[Mn],getCellProps:[Ln],useFinalInstance:[]}}c.resetHiddenColumns="resetHiddenColumns",c.toggleHideColumn="toggleHideColumn",c.setHiddenColumns="setHiddenColumns",c.toggleHideAllColumns="toggleHideAllColumns";var Bt=function(e){e.getToggleHiddenProps=[$n],e.getToggleHideAllColumnsProps=[Vn],e.stateReducers.push(Kn),e.useInstanceBeforeDimensions.push(Un),e.headerGroupsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.hiddenColumns])}),e.useInstance.push(qn)};Bt.pluginName="useColumnVisibility";var $n=function(e,t){var n=t.column;return[e,{onChange:function(r){n.toggleHidden(!r.target.checked)},style:{cursor:"pointer"},checked:n.isVisible,title:"Toggle Column Visible"}]},Vn=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleHideAllColumns(!r.target.checked)},style:{cursor:"pointer"},checked:!n.allColumnsHidden&&!n.state.hiddenColumns.length,title:"Toggle All Columns Hidden",indeterminate:!n.allColumnsHidden&&n.state.hiddenColumns.length}]};function Kn(e,t,n,r){if(t.type===c.init)return u({hiddenColumns:[]},e);if(t.type===c.resetHiddenColumns)return u({},e,{hiddenColumns:r.initialState.hiddenColumns||[]});if(t.type===c.toggleHideColumn){var a=(t.value!==void 0?t.value:!e.hiddenColumns.includes(t.columnId))?[].concat(e.hiddenColumns,[t.columnId]):e.hiddenColumns.filter(function(o){return o!==t.columnId});return u({},e,{hiddenColumns:a})}return t.type===c.setHiddenColumns?u({},e,{hiddenColumns:Z(t.value,e.hiddenColumns)}):t.type===c.toggleHideAllColumns?u({},e,{hiddenColumns:(t.value!==void 0?t.value:!e.hiddenColumns.length)?r.allColumns.map(function(o){return o.id}):[]}):void 0}function Un(e){var t=e.headers,n=e.state.hiddenColumns;s.useRef(!1).current;var r=0;t.forEach(function(a){return r+=function o(i,f){i.isVisible=f&&!n.includes(i.id);var g=0;return i.headers&&i.headers.length?i.headers.forEach(function(m){return g+=o(m,i.isVisible)}):g=i.isVisible?1:0,i.totalVisibleHeaderCount=g,g}(a,!0)})}function qn(e){var t=e.columns,n=e.flatHeaders,r=e.dispatch,a=e.allColumns,o=e.getHooks,i=e.state.hiddenColumns,f=e.autoResetHiddenColumns,g=f===void 0||f,m=W(e),C=a.length===i.length,w=s.useCallback(function(S,I){return r({type:c.toggleHideColumn,columnId:S,value:I})},[r]),R=s.useCallback(function(S){return r({type:c.setHiddenColumns,value:S})},[r]),h=s.useCallback(function(S){return r({type:c.toggleHideAllColumns,value:S})},[r]),b=V(o().getToggleHideAllColumnsProps,{instance:m()});n.forEach(function(S){S.toggleHidden=function(I){r({type:c.toggleHideColumn,columnId:S.id,value:I})},S.getToggleHiddenProps=V(o().getToggleHiddenProps,{instance:m(),column:S})});var P=W(g);re(function(){P()&&r({type:c.resetHiddenColumns})},[r,t]),Object.assign(e,{allColumnsHidden:C,toggleHideColumn:w,setHiddenColumns:R,toggleHideAllColumns:h,getToggleHideAllColumnsProps:b})}var Xn={},Qn={},Jn=function(e,t,n){return e},Yn=function(e,t){return e.subRows||[]},Zn=function(e,t,n){return""+(n?[n.id,t].join("."):t)},er=function(e){return e};function Tt(e){var t=e.initialState,n=t===void 0?Xn:t,r=e.defaultColumn,a=r===void 0?Qn:r,o=e.getSubRows,i=o===void 0?Yn:o,f=e.getRowId,g=f===void 0?Zn:f,m=e.stateReducer,C=m===void 0?Jn:m,w=e.useControlledState,R=w===void 0?er:w;return u({},B(e,["initialState","defaultColumn","getSubRows","getRowId","stateReducer","useControlledState"]),{initialState:n,defaultColumn:a,getSubRows:i,getRowId:g,stateReducer:C,useControlledState:R})}function Ft(e,t){t===void 0&&(t=0);var n=0,r=0,a=0,o=0;return e.forEach(function(i){var f=i.headers;if(i.totalLeft=t,f&&f.length){var g=Ft(f,t),m=g[0],C=g[1],w=g[2],R=g[3];i.totalMinWidth=m,i.totalWidth=C,i.totalMaxWidth=w,i.totalFlexWidth=R}else i.totalMinWidth=i.minWidth,i.totalWidth=Math.min(Math.max(i.minWidth,i.width),i.maxWidth),i.totalMaxWidth=i.maxWidth,i.totalFlexWidth=i.canResize?i.totalWidth:0;i.isVisible&&(t+=i.totalWidth,n+=i.totalMinWidth,r+=i.totalWidth,a+=i.totalMaxWidth,o+=i.totalFlexWidth)}),[n,r,a,o]}function tr(e){var t=e.data,n=e.rows,r=e.flatRows,a=e.rowsById,o=e.column,i=e.getRowId,f=e.getSubRows,g=e.accessValueHooks,m=e.getInstance;t.forEach(function(C,w){return function R(h,b,P,S,I){P===void 0&&(P=0);var H=h,k=i(h,b,S),x=a[k];if(x)x.subRows&&x.originalSubRows.forEach(function(A,G){return R(A,G,P+1,x)});else if((x={id:k,original:H,index:b,depth:P,cells:[{}]}).cells.map=He,x.cells.filter=He,x.cells.forEach=He,x.cells[0].getCellProps=He,x.values={},I.push(x),r.push(x),a[k]=x,x.originalSubRows=f(h,b),x.originalSubRows){var K=[];x.originalSubRows.forEach(function(A,G){return R(A,G,P+1,x,K)}),x.subRows=K}o.accessor&&(x.values[o.id]=o.accessor(h,b,x,I,t)),x.values[o.id]=J(g,x.values[o.id],{row:x,column:o,instance:m()})}(C,w,0,void 0,n)})}c.resetExpanded="resetExpanded",c.toggleRowExpanded="toggleRowExpanded",c.toggleAllRowsExpanded="toggleAllRowsExpanded";var _t=function(e){e.getToggleAllRowsExpandedProps=[nr],e.getToggleRowExpandedProps=[rr],e.stateReducers.push(or),e.useInstance.push(ar),e.prepareRow.push(ir)};_t.pluginName="useExpanded";var nr=function(e,t){var n=t.instance;return[e,{onClick:function(r){n.toggleAllRowsExpanded()},style:{cursor:"pointer"},title:"Toggle All Rows Expanded"}]},rr=function(e,t){var n=t.row;return[e,{onClick:function(){n.toggleRowExpanded()},style:{cursor:"pointer"},title:"Toggle Row Expanded"}]};function or(e,t,n,r){if(t.type===c.init)return u({expanded:{}},e);if(t.type===c.resetExpanded)return u({},e,{expanded:r.initialState.expanded||{}});if(t.type===c.toggleAllRowsExpanded){var a=t.value,o=r.isAllRowsExpanded,i=r.rowsById;if(a!==void 0?a:!o){var f={};return Object.keys(i).forEach(function(b){f[b]=!0}),u({},e,{expanded:f})}return u({},e,{expanded:{}})}if(t.type===c.toggleRowExpanded){var g,m=t.id,C=t.value,w=e.expanded[m],R=C!==void 0?C:!w;if(!w&&R)return u({},e,{expanded:u({},e.expanded,(g={},g[m]=!0,g))});if(w&&!R){var h=e.expanded;return h[m],u({},e,{expanded:B(h,[m].map(M))})}return e}}function ar(e){var t=e.data,n=e.rows,r=e.rowsById,a=e.manualExpandedKey,o=a===void 0?"expanded":a,i=e.paginateExpandedRows,f=i===void 0||i,g=e.expandSubRows,m=g===void 0||g,C=e.autoResetExpanded,w=C===void 0||C,R=e.getHooks,h=e.plugins,b=e.state.expanded,P=e.dispatch;oe(h,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var S=W(w),I=Boolean(Object.keys(r).length&&Object.keys(b).length);I&&Object.keys(r).some(function(j){return!b[j]})&&(I=!1),re(function(){S()&&P({type:c.resetExpanded})},[P,t]);var H=s.useCallback(function(j,T){P({type:c.toggleRowExpanded,id:j,value:T})},[P]),k=s.useCallback(function(j){return P({type:c.toggleAllRowsExpanded,value:j})},[P]),x=s.useMemo(function(){return f?It(n,{manualExpandedKey:o,expanded:b,expandSubRows:m}):n},[f,n,o,b,m]),K=s.useMemo(function(){return function(j){var T=0;return Object.keys(j).forEach(function(O){var $=O.split(".");T=Math.max(T,$.length)}),T}(b)},[b]),A=W(e),G=V(R().getToggleAllRowsExpandedProps,{instance:A()});Object.assign(e,{preExpandedRows:n,expandedRows:x,rows:x,expandedDepth:K,isAllRowsExpanded:I,toggleRowExpanded:H,toggleAllRowsExpanded:k,getToggleAllRowsExpandedProps:G})}function ir(e,t){var n=t.instance.getHooks,r=t.instance;e.toggleRowExpanded=function(a){return r.toggleRowExpanded(e.id,a)},e.getToggleRowExpandedProps=V(n().getToggleRowExpandedProps,{instance:r,row:e})}var Ot=function(e,t,n){return e=e.filter(function(r){return t.some(function(a){var o=r.values[a];return String(o).toLowerCase().includes(String(n).toLowerCase())})})};Ot.autoRemove=function(e){return!e};var At=function(e,t,n){return e.filter(function(r){return t.some(function(a){var o=r.values[a];return o===void 0||String(o).toLowerCase()===String(n).toLowerCase()})})};At.autoRemove=function(e){return!e};var Gt=function(e,t,n){return e.filter(function(r){return t.some(function(a){var o=r.values[a];return o===void 0||String(o)===String(n)})})};Gt.autoRemove=function(e){return!e};var Nt=function(e,t,n){return e.filter(function(r){return t.some(function(a){return r.values[a].includes(n)})})};Nt.autoRemove=function(e){return!e||!e.length};var kt=function(e,t,n){return e.filter(function(r){return t.some(function(a){var o=r.values[a];return o&&o.length&&n.every(function(i){return o.includes(i)})})})};kt.autoRemove=function(e){return!e||!e.length};var Ht=function(e,t,n){return e.filter(function(r){return t.some(function(a){var o=r.values[a];return o&&o.length&&n.some(function(i){return o.includes(i)})})})};Ht.autoRemove=function(e){return!e||!e.length};var jt=function(e,t,n){return e.filter(function(r){return t.some(function(a){var o=r.values[a];return n.includes(o)})})};jt.autoRemove=function(e){return!e||!e.length};var Wt=function(e,t,n){return e.filter(function(r){return t.some(function(a){return r.values[a]===n})})};Wt.autoRemove=function(e){return e===void 0};var zt=function(e,t,n){return e.filter(function(r){return t.some(function(a){return r.values[a]==n})})};zt.autoRemove=function(e){return e==null};var Mt=function(e,t,n){var r=n||[],a=r[0],o=r[1];if((a=typeof a=="number"?a:-1/0)>(o=typeof o=="number"?o:1/0)){var i=a;a=o,o=i}return e.filter(function(f){return t.some(function(g){var m=f.values[g];return m>=a&&m<=o})})};Mt.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var Ie=Object.freeze({__proto__:null,text:Ot,exactText:At,exactTextCase:Gt,includes:Nt,includesAll:kt,includesSome:Ht,includesValue:jt,exact:Wt,equals:zt,between:Mt});c.resetFilters="resetFilters",c.setFilter="setFilter",c.setAllFilters="setAllFilters";var Lt=function(e){e.stateReducers.push(sr),e.useInstance.push(ur)};function sr(e,t,n,r){if(t.type===c.init)return u({filters:[]},e);if(t.type===c.resetFilters)return u({},e,{filters:r.initialState.filters||[]});if(t.type===c.setFilter){var a=t.columnId,o=t.filterValue,i=r.allColumns,f=r.filterTypes,g=i.find(function(P){return P.id===a});if(!g)throw new Error("React-Table: Could not find a column with id: "+a);var m=Ee(g.filter,f||{},Ie),C=e.filters.find(function(P){return P.id===a}),w=Z(o,C&&C.value);return Xe(m.autoRemove,w,g)?u({},e,{filters:e.filters.filter(function(P){return P.id!==a})}):u({},e,C?{filters:e.filters.map(function(P){return P.id===a?{id:a,value:w}:P})}:{filters:[].concat(e.filters,[{id:a,value:w}])})}if(t.type===c.setAllFilters){var R=t.filters,h=r.allColumns,b=r.filterTypes;return u({},e,{filters:Z(R,e.filters).filter(function(P){var S=h.find(function(I){return I.id===P.id});return!Xe(Ee(S.filter,b||{},Ie).autoRemove,P.value,S)})})}}function ur(e){var t=e.data,n=e.rows,r=e.flatRows,a=e.rowsById,o=e.allColumns,i=e.filterTypes,f=e.manualFilters,g=e.defaultCanFilter,m=g!==void 0&&g,C=e.disableFilters,w=e.state.filters,R=e.dispatch,h=e.autoResetFilters,b=h===void 0||h,P=s.useCallback(function(A,G){R({type:c.setFilter,columnId:A,filterValue:G})},[R]),S=s.useCallback(function(A){R({type:c.setAllFilters,filters:A})},[R]);o.forEach(function(A){var G=A.id,j=A.accessor,T=A.defaultCanFilter,O=A.disableFilters;A.canFilter=j?ve(O!==!0&&void 0,C!==!0&&void 0,!0):ve(T,m,!1),A.setFilter=function(N){return P(A.id,N)};var $=w.find(function(N){return N.id===G});A.filterValue=$&&$.value});var I=s.useMemo(function(){if(f||!w.length)return[n,r,a];var A=[],G={};return[function j(T,O){O===void 0&&(O=0);var $=T;return($=w.reduce(function(N,D){var L=D.id,U=D.value,E=o.find(function(te){return te.id===L});if(!E)return N;O===0&&(E.preFilteredRows=N);var z=Ee(E.filter,i||{},Ie);return z?(E.filteredRows=z(N,[L],U),E.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+E.id+"."),N)},T)).forEach(function(N){A.push(N),G[N.id]=N,N.subRows&&(N.subRows=N.subRows&&N.subRows.length>0?j(N.subRows,O+1):N.subRows)}),$}(n),A,G]},[f,w,n,r,a,o,i]),H=I[0],k=I[1],x=I[2];s.useMemo(function(){o.filter(function(A){return!w.find(function(G){return G.id===A.id})}).forEach(function(A){A.preFilteredRows=H,A.filteredRows=H})},[H,w,o]);var K=W(b);re(function(){K()&&R({type:c.resetFilters})},[R,f?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:a,filteredRows:H,filteredFlatRows:k,filteredRowsById:x,rows:H,flatRows:k,rowsById:x,setFilter:P,setAllFilters:S})}Lt.pluginName="useFilters",c.resetGlobalFilter="resetGlobalFilter",c.setGlobalFilter="setGlobalFilter";var Dt=function(e){e.stateReducers.push(lr),e.useInstance.push(cr)};function lr(e,t,n,r){if(t.type===c.resetGlobalFilter)return u({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===c.setGlobalFilter){var a=t.filterValue,o=r.userFilterTypes,i=Ee(r.globalFilter,o||{},Ie),f=Z(a,e.globalFilter);return Xe(i.autoRemove,f)?(e.globalFilter,B(e,["globalFilter"])):u({},e,{globalFilter:f})}}function cr(e){var t=e.data,n=e.rows,r=e.flatRows,a=e.rowsById,o=e.allColumns,i=e.filterTypes,f=e.globalFilter,g=e.manualGlobalFilter,m=e.state.globalFilter,C=e.dispatch,w=e.autoResetGlobalFilter,R=w===void 0||w,h=e.disableGlobalFilter,b=s.useCallback(function(x){C({type:c.setGlobalFilter,filterValue:x})},[C]),P=s.useMemo(function(){if(g||m===void 0)return[n,r,a];var x=[],K={},A=Ee(f,i||{},Ie);if(!A)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(j){var T=j.disableGlobalFilter;j.canFilter=ve(T!==!0&&void 0,h!==!0&&void 0,!0)});var G=o.filter(function(j){return j.canFilter===!0});return[function j(T){return(T=A(T,G.map(function(O){return O.id}),m)).forEach(function(O){x.push(O),K[O.id]=O,O.subRows=O.subRows&&O.subRows.length?j(O.subRows):O.subRows}),T}(n),x,K]},[g,m,f,i,o,n,r,a,h]),S=P[0],I=P[1],H=P[2],k=W(R);re(function(){k()&&C({type:c.resetGlobalFilter})},[C,g?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:a,globalFilteredRows:S,globalFilteredFlatRows:I,globalFilteredRowsById:H,rows:S,flatRows:I,rowsById:H,setGlobalFilter:b,disableGlobalFilter:h})}function $t(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}Dt.pluginName="useGlobalFilter";var Vt=Object.freeze({__proto__:null,sum:$t,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return $t(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,a){return r-a});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),dr=[],fr={};c.resetGroupBy="resetGroupBy",c.setGroupBy="setGroupBy",c.toggleGroupBy="toggleGroupBy";var Kt=function(e){e.getGroupByToggleProps=[pr],e.stateReducers.push(gr),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(vr),e.useInstance.push(hr),e.prepareRow.push(yr)};Kt.pluginName="useGroupBy";var pr=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function gr(e,t,n,r){if(t.type===c.init)return u({groupBy:[]},e);if(t.type===c.resetGroupBy)return u({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===c.setGroupBy)return u({},e,{groupBy:t.value});if(t.type===c.toggleGroupBy){var a=t.columnId,o=t.value,i=o!==void 0?o:!e.groupBy.includes(a);return u({},e,i?{groupBy:[].concat(e.groupBy,[a])}:{groupBy:e.groupBy.filter(function(f){return f!==a})})}}function vr(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(i){return i.id===o})}).filter(Boolean),a=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,a)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var mr={};function hr(e){var t=e.data,n=e.rows,r=e.flatRows,a=e.rowsById,o=e.allColumns,i=e.flatHeaders,f=e.groupByFn,g=f===void 0?Ut:f,m=e.manualGroupBy,C=e.aggregations,w=C===void 0?mr:C,R=e.plugins,h=e.state.groupBy,b=e.dispatch,P=e.autoResetGroupBy,S=P===void 0||P,I=e.disableGroupBy,H=e.defaultCanGroupBy,k=e.getHooks;oe(R,["useColumnOrder","useFilters"],"useGroupBy");var x=W(e);o.forEach(function(E){var z=E.accessor,te=E.defaultGroupBy,ue=E.disableGroupBy;E.canGroupBy=z?ve(E.canGroupBy,ue!==!0&&void 0,I!==!0&&void 0,!0):ve(E.canGroupBy,te,H,!1),E.canGroupBy&&(E.toggleGroupBy=function(){return e.toggleGroupBy(E.id)}),E.Aggregated=E.Aggregated||E.Cell});var K=s.useCallback(function(E,z){b({type:c.toggleGroupBy,columnId:E,value:z})},[b]),A=s.useCallback(function(E){b({type:c.setGroupBy,value:E})},[b]);i.forEach(function(E){E.getGroupByToggleProps=V(k().getGroupByToggleProps,{instance:x(),header:E})});var G=s.useMemo(function(){if(m||!h.length)return[n,r,a,dr,fr,r,a];var E=h.filter(function(se){return o.find(function(be){return be.id===se})}),z=[],te={},ue=[],F={},Y=[],ae={},le=function se(be,we,fn){if(we===void 0&&(we=0),we===E.length)return be;var nt=E[we],ao=g(be,nt);return Object.entries(ao).map(function(pn,io){var gn=pn[0],We=pn[1],ze=nt+":"+gn,vn=se(We,we+1,ze=fn?fn+">"+ze:ze),mn=we?Et(We,"leafRows"):We,so=function(de,rt,lo){var Me={};return o.forEach(function(ie){if(E.includes(ie.id))Me[ie.id]=rt[0]?rt[0].values[ie.id]:null;else{var hn=typeof ie.aggregate=="function"?ie.aggregate:w[ie.aggregate]||Vt[ie.aggregate];if(hn){var co=rt.map(function(Le){return Le.values[ie.id]}),fo=de.map(function(Le){var ot=Le.values[ie.id];if(!lo&&ie.aggregateValue){var yn=typeof ie.aggregateValue=="function"?ie.aggregateValue:w[ie.aggregateValue]||Vt[ie.aggregateValue];if(!yn)throw console.info({column:ie}),new Error("React Table: Invalid column.aggregateValue option for column listed above");ot=yn(ot,Le,ie)}return ot});Me[ie.id]=hn(fo,co)}else{if(ie.aggregate)throw console.info({column:ie}),new Error("React Table: Invalid column.aggregate option for column listed above");Me[ie.id]=null}}}),Me}(mn,We,we),uo={id:ze,isGrouped:!0,groupByID:nt,groupByVal:gn,values:so,subRows:vn,leafRows:mn,depth:we,index:io};return vn.forEach(function(de){z.push(de),te[de.id]=de,de.isGrouped?(ue.push(de),F[de.id]=de):(Y.push(de),ae[de.id]=de)}),uo})}(n);return le.forEach(function(se){z.push(se),te[se.id]=se,se.isGrouped?(ue.push(se),F[se.id]=se):(Y.push(se),ae[se.id]=se)}),[le,z,te,ue,F,Y,ae]},[m,h,n,r,a,o,w,g]),j=G[0],T=G[1],O=G[2],$=G[3],N=G[4],D=G[5],L=G[6],U=W(S);re(function(){U()&&b({type:c.resetGroupBy})},[b,m?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:a,groupedRows:j,groupedFlatRows:T,groupedRowsById:O,onlyGroupedFlatRows:$,onlyGroupedRowsById:N,nonGroupedFlatRows:D,nonGroupedRowsById:L,rows:j,flatRows:T,rowsById:O,toggleGroupBy:K,setGroupBy:A})}function yr(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function Ut(e,t){return e.reduce(function(n,r,a){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var qt=/([0-9]+)/gm;function Je(e,t){return e===t?0:e>t?1:-1}function Be(e,t,n){return[e.values[n],t.values[n]]}function Xt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var br=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=Be(e,t,n),a=r[0],o=r[1];for(a=Xt(a),o=Xt(o),a=a.split(qt).filter(Boolean),o=o.split(qt).filter(Boolean);a.length&&o.length;){var i=a.shift(),f=o.shift(),g=parseInt(i,10),m=parseInt(f,10),C=[g,m].sort();if(isNaN(C[0])){if(i>f)return 1;if(f>i)return-1}else{if(isNaN(C[1]))return isNaN(g)?-1:1;if(g>m)return 1;if(m>g)return-1}}return a.length-o.length},datetime:function(e,t,n){var r=Be(e,t,n),a=r[0],o=r[1];return Je(a=a.getTime(),o=o.getTime())},basic:function(e,t,n){var r=Be(e,t,n);return Je(r[0],r[1])},string:function(e,t,n){var r=Be(e,t,n),a=r[0],o=r[1];for(a=a.split("").filter(Boolean),o=o.split("").filter(Boolean);a.length&&o.length;){var i=a.shift(),f=o.shift(),g=i.toLowerCase(),m=f.toLowerCase();if(g>m)return 1;if(m>g)return-1;if(i>f)return 1;if(f>i)return-1}return a.length-o.length},number:function(e,t,n){var r=Be(e,t,n),a=r[0],o=r[1],i=/[^0-9.]/gi;return Je(a=Number(String(a).replace(i,"")),o=Number(String(o).replace(i,"")))}});c.resetSortBy="resetSortBy",c.setSortBy="setSortBy",c.toggleSortBy="toggleSortBy",c.clearSortBy="clearSortBy",Q.sortType="alphanumeric",Q.sortDescFirst=!1;var Qt=function(e){e.getSortByToggleProps=[wr],e.stateReducers.push(Rr),e.useInstance.push(Cr)};Qt.pluginName="useSortBy";var wr=function(e,t){var n=t.instance,r=t.column,a=n.isMultiSortEvent,o=a===void 0?function(i){return i.shiftKey}:a;return[e,{onClick:r.canSort?function(i){i.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(i))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function Rr(e,t,n,r){if(t.type===c.init)return u({sortBy:[]},e);if(t.type===c.resetSortBy)return u({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===c.clearSortBy)return u({},e,{sortBy:e.sortBy.filter(function(x){return x.id!==t.columnId})});if(t.type===c.setSortBy)return u({},e,{sortBy:t.sortBy});if(t.type===c.toggleSortBy){var a,o=t.columnId,i=t.desc,f=t.multi,g=r.allColumns,m=r.disableMultiSort,C=r.disableSortRemove,w=r.disableMultiRemove,R=r.maxMultiSortColCount,h=R===void 0?Number.MAX_SAFE_INTEGER:R,b=e.sortBy,P=g.find(function(x){return x.id===o}).sortDescFirst,S=b.find(function(x){return x.id===o}),I=b.findIndex(function(x){return x.id===o}),H=i!=null,k=[];return(a=!m&&f?S?"toggle":"add":I!==b.length-1||b.length!==1?"replace":S?"toggle":"replace")!=="toggle"||C||H||f&&w||!(S&&S.desc&&!P||!S.desc&&P)||(a="remove"),a==="replace"?k=[{id:o,desc:H?i:P}]:a==="add"?(k=[].concat(b,[{id:o,desc:H?i:P}])).splice(0,k.length-h):a==="toggle"?k=b.map(function(x){return x.id===o?u({},x,{desc:H?i:!S.desc}):x}):a==="remove"&&(k=b.filter(function(x){return x.id!==o})),u({},e,{sortBy:k})}}function Cr(e){var t=e.data,n=e.rows,r=e.flatRows,a=e.allColumns,o=e.orderByFn,i=o===void 0?Jt:o,f=e.sortTypes,g=e.manualSortBy,m=e.defaultCanSort,C=e.disableSortBy,w=e.flatHeaders,R=e.state.sortBy,h=e.dispatch,b=e.plugins,P=e.getHooks,S=e.autoResetSortBy,I=S===void 0||S;oe(b,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var H=s.useCallback(function(T){h({type:c.setSortBy,sortBy:T})},[h]),k=s.useCallback(function(T,O,$){h({type:c.toggleSortBy,columnId:T,desc:O,multi:$})},[h]),x=W(e);w.forEach(function(T){var O=T.accessor,$=T.canSort,N=T.disableSortBy,D=T.id,L=O?ve(N!==!0&&void 0,C!==!0&&void 0,!0):ve(m,$,!1);T.canSort=L,T.canSort&&(T.toggleSortBy=function(E,z){return k(T.id,E,z)},T.clearSortBy=function(){h({type:c.clearSortBy,columnId:T.id})}),T.getSortByToggleProps=V(P().getSortByToggleProps,{instance:x(),column:T});var U=R.find(function(E){return E.id===D});T.isSorted=!!U,T.sortedIndex=R.findIndex(function(E){return E.id===D}),T.isSortedDesc=T.isSorted?U.desc:void 0});var K=s.useMemo(function(){if(g||!R.length)return[n,r];var T=[],O=R.filter(function($){return a.find(function(N){return N.id===$.id})});return[function $(N){var D=i(N,O.map(function(L){var U=a.find(function(te){return te.id===L.id});if(!U)throw new Error("React-Table: Could not find a column with id: "+L.id+" while sorting");var E=U.sortType,z=xt(E)||(f||{})[E]||br[E];if(!z)throw new Error("React-Table: Could not find a valid sortType of '"+E+"' for column '"+L.id+"'.");return function(te,ue){return z(te,ue,L.id,L.desc)}}),O.map(function(L){var U=a.find(function(E){return E.id===L.id});return U&&U.sortInverted?L.desc:!L.desc}));return D.forEach(function(L){T.push(L),L.subRows&&L.subRows.length!==0&&(L.subRows=$(L.subRows))}),D}(n),T]},[g,R,n,r,a,i,f]),A=K[0],G=K[1],j=W(I);re(function(){j()&&h({type:c.resetSortBy})},[g?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:A,sortedFlatRows:G,rows:A,flatRows:G,setSortBy:H,toggleSortBy:k})}function Jt(e,t,n){return[].concat(e).sort(function(r,a){for(var o=0;o<t.length;o+=1){var i=t[o],f=n[o]===!1||n[o]==="desc",g=i(r,a);if(g!==0)return f?-g:g}return n[0]?r.index-a.index:a.index-r.index})}c.resetPage="resetPage",c.gotoPage="gotoPage",c.setPageSize="setPageSize";var Yt=function(e){e.stateReducers.push(Sr),e.useInstance.push(Pr)};function Sr(e,t,n,r){if(t.type===c.init)return u({pageSize:10,pageIndex:0},e);if(t.type===c.resetPage)return u({},e,{pageIndex:r.initialState.pageIndex||0});if(t.type===c.gotoPage){var a=r.pageCount,o=r.page,i=Z(t.pageIndex,e.pageIndex),f=!1;return i>e.pageIndex?f=a===-1?o.length>=e.pageSize:i<a:i<e.pageIndex&&(f=i>-1),f?u({},e,{pageIndex:i}):e}if(t.type===c.setPageSize){var g=t.pageSize,m=e.pageSize*e.pageIndex;return u({},e,{pageIndex:Math.floor(m/g),pageSize:g})}}function Pr(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,a=e.manualExpandedKey,o=a===void 0?"expanded":a,i=e.plugins,f=e.pageCount,g=e.paginateExpandedRows,m=g===void 0||g,C=e.expandSubRows,w=C===void 0||C,R=e.state,h=R.pageSize,b=R.pageIndex,P=R.expanded,S=R.globalFilter,I=R.filters,H=R.groupBy,k=R.sortBy,x=e.dispatch,K=e.data,A=e.manualPagination;oe(i,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var G=W(r);re(function(){G()&&x({type:c.resetPage})},[x,A?null:K,S,I,H,k]);var j=A?f:Math.ceil(t.length/h),T=s.useMemo(function(){return j>0?[].concat(new Array(j)).fill(null).map(function(z,te){return te}):[]},[j]),O=s.useMemo(function(){var z;if(A)z=t;else{var te=h*b,ue=te+h;z=t.slice(te,ue)}return m?z:It(z,{manualExpandedKey:o,expanded:P,expandSubRows:w})},[w,P,o,A,b,h,m,t]),$=b>0,N=j===-1?O.length>=h:b<j-1,D=s.useCallback(function(z){x({type:c.gotoPage,pageIndex:z})},[x]),L=s.useCallback(function(){return D(function(z){return z-1})},[D]),U=s.useCallback(function(){return D(function(z){return z+1})},[D]),E=s.useCallback(function(z){x({type:c.setPageSize,pageSize:z})},[x]);Object.assign(e,{pageOptions:T,pageCount:j,page:O,canPreviousPage:$,canNextPage:N,gotoPage:D,previousPage:L,nextPage:U,setPageSize:E})}Yt.pluginName="usePagination",c.resetPivot="resetPivot",c.togglePivot="togglePivot";var Zt=function(e){e.getPivotToggleProps=[xr],e.stateReducers.push(Er),e.useInstanceAfterData.push(Ir),e.allColumns.push(Br),e.accessValue.push(Tr),e.materializedColumns.push(Fr),e.materializedColumnsDeps.push(_r),e.visibleColumns.push(Or),e.visibleColumnsDeps.push(Ar),e.useInstance.push(Gr),e.prepareRow.push(Nr)};Zt.pluginName="usePivotColumns";var en=[],xr=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(r){r.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function Er(e,t,n,r){if(t.type===c.init)return u({pivotColumns:en},e);if(t.type===c.resetPivot)return u({},e,{pivotColumns:r.initialState.pivotColumns||en});if(t.type===c.togglePivot){var a=t.columnId,o=t.value,i=o!==void 0?o:!e.pivotColumns.includes(a);return u({},e,i?{pivotColumns:[].concat(e.pivotColumns,[a])}:{pivotColumns:e.pivotColumns.filter(function(f){return f!==a})})}}function Ir(e){e.allColumns.forEach(function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)})}function Br(e,t){var n=t.instance;return e.forEach(function(r){r.isPivotSource=n.state.pivotColumns.includes(r.id),r.uniqueValues=new Set}),e}function Tr(e,t){var n=t.column;return n.uniqueValues&&e!==void 0&&n.uniqueValues.add(e),e}function Fr(e,t){var n=t.instance,r=n.allColumns,a=n.state;if(!a.pivotColumns.length||!a.groupBy||!a.groupBy.length)return e;var o=a.pivotColumns.map(function(g){return r.find(function(m){return m.id===g})}).filter(Boolean),i=r.filter(function(g){return!g.isPivotSource&&!a.groupBy.includes(g.id)&&!a.pivotColumns.includes(g.id)}),f=ge(function g(m,C,w){m===void 0&&(m=0),w===void 0&&(w=[]);var R=o[m];return R?Array.from(R.uniqueValues).sort().map(function(h){var b=u({},R,{Header:R.PivotHeader||typeof R.header=="string"?R.Header+": "+h:h,isPivotGroup:!0,parent:C,depth:m,id:C?C.id+"."+R.id+"."+h:R.id+"."+h,pivotValue:h});return b.columns=g(m+1,b,[].concat(w,[function(P){return P.values[R.id]===h}])),b}):i.map(function(h){return u({},h,{canPivot:!1,isPivoted:!0,parent:C,depth:m,id:""+(C?C.id+"."+h.id:h.id),accessor:function(b,P,S){if(w.every(function(I){return I(S)}))return S.values[h.id]}})})}());return[].concat(e,f)}function _r(e,t){var n=t.instance.state,r=n.pivotColumns,a=n.groupBy;return[].concat(e,[r,a])}function Or(e,t){var n=t.instance.state;return e=e.filter(function(r){return!r.isPivotSource}),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter(function(r){return r.isGrouped||r.isPivoted})),e}function Ar(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function Gr(e){var t=e.columns,n=e.allColumns,r=e.flatHeaders,a=e.getHooks,o=e.plugins,i=e.dispatch,f=e.autoResetPivot,g=f===void 0||f,m=e.manaulPivot,C=e.disablePivot,w=e.defaultCanPivot;oe(o,["useGroupBy"],"usePivotColumns");var R=W(e);n.forEach(function(b){var P=b.accessor,S=b.defaultPivot,I=b.disablePivot;b.canPivot=P?ve(b.canPivot,I!==!0&&void 0,C!==!0&&void 0,!0):ve(b.canPivot,S,w,!1),b.canPivot&&(b.togglePivot=function(){return e.togglePivot(b.id)}),b.Aggregated=b.Aggregated||b.Cell}),r.forEach(function(b){b.getPivotToggleProps=V(a().getPivotToggleProps,{instance:R(),header:b})});var h=W(g);re(function(){h()&&i({type:c.resetPivot})},[i,m?null:t]),Object.assign(e,{togglePivot:function(b,P){i({type:c.togglePivot,columnId:b,value:P})}})}function Nr(e){e.allCells.forEach(function(t){t.isPivoted=t.column.isPivoted})}c.resetSelectedRows="resetSelectedRows",c.toggleAllRowsSelected="toggleAllRowsSelected",c.toggleRowSelected="toggleRowSelected",c.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var tn=function(e){e.getToggleRowSelectedProps=[kr],e.getToggleAllRowsSelectedProps=[Hr],e.getToggleAllPageRowsSelectedProps=[jr],e.stateReducers.push(Wr),e.useInstance.push(zr),e.prepareRow.push(Mr)};tn.pluginName="useRowSelect";var kr=function(e,t){var n=t.instance,r=t.row,a=n.manualRowSelectedKey,o=a===void 0?"isSelected":a;return[e,{onChange:function(i){r.toggleRowSelected(i.target.checked)},style:{cursor:"pointer"},checked:!(!r.original||!r.original[o])||r.isSelected,title:"Toggle Row Selected",indeterminate:r.isSomeSelected}]},Hr=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleAllRowsSelected(r.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},jr=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleAllPageRowsSelected(r.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!n.isAllPageRowsSelected&&n.page.some(function(r){var a=r.id;return n.state.selectedRowIds[a]}))}]};function Wr(e,t,n,r){if(t.type===c.init)return u({selectedRowIds:{}},e);if(t.type===c.resetSelectedRows)return u({},e,{selectedRowIds:r.initialState.selectedRowIds||{}});if(t.type===c.toggleAllRowsSelected){var a=t.value,o=r.isAllRowsSelected,i=r.rowsById,f=r.nonGroupedRowsById,g=f===void 0?i:f,m=a!==void 0?a:!o,C=Object.assign({},e.selectedRowIds);return m?Object.keys(g).forEach(function(D){C[D]=!0}):Object.keys(g).forEach(function(D){delete C[D]}),u({},e,{selectedRowIds:C})}if(t.type===c.toggleRowSelected){var w=t.id,R=t.value,h=r.rowsById,b=r.selectSubRows,P=b===void 0||b,S=r.getSubRows,I=e.selectedRowIds[w],H=R!==void 0?R:!I;if(I===H)return e;var k=u({},e.selectedRowIds);return function D(L){var U=h[L];if(U.isGrouped||(H?k[L]=!0:delete k[L]),P&&S(U))return S(U).forEach(function(E){return D(E.id)})}(w),u({},e,{selectedRowIds:k})}if(t.type===c.toggleAllPageRowsSelected){var x=t.value,K=r.page,A=r.rowsById,G=r.selectSubRows,j=G===void 0||G,T=r.isAllPageRowsSelected,O=r.getSubRows,$=x!==void 0?x:!T,N=u({},e.selectedRowIds);return K.forEach(function(D){return function L(U){var E=A[U];if(E.isGrouped||($?N[U]=!0:delete N[U]),j&&O(E))return O(E).forEach(function(z){return L(z.id)})}(D.id)}),u({},e,{selectedRowIds:N})}return e}function zr(e){var t=e.data,n=e.rows,r=e.getHooks,a=e.plugins,o=e.rowsById,i=e.nonGroupedRowsById,f=i===void 0?o:i,g=e.autoResetSelectedRows,m=g===void 0||g,C=e.state.selectedRowIds,w=e.selectSubRows,R=w===void 0||w,h=e.dispatch,b=e.page,P=e.getSubRows;oe(a,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var S=s.useMemo(function(){var O=[];return n.forEach(function($){var N=R?function D(L,U,E){if(U[L.id])return!0;var z=E(L);if(z&&z.length){var te=!0,ue=!1;return z.forEach(function(F){ue&&!te||(D(F,U,E)?ue=!0:te=!1)}),!!te||!!ue&&null}return!1}($,C,P):!!C[$.id];$.isSelected=!!N,$.isSomeSelected=N===null,N&&O.push($)}),O},[n,R,C,P]),I=Boolean(Object.keys(f).length&&Object.keys(C).length),H=I;I&&Object.keys(f).some(function(O){return!C[O]})&&(I=!1),I||b&&b.length&&b.some(function(O){var $=O.id;return!C[$]})&&(H=!1);var k=W(m);re(function(){k()&&h({type:c.resetSelectedRows})},[h,t]);var x=s.useCallback(function(O){return h({type:c.toggleAllRowsSelected,value:O})},[h]),K=s.useCallback(function(O){return h({type:c.toggleAllPageRowsSelected,value:O})},[h]),A=s.useCallback(function(O,$){return h({type:c.toggleRowSelected,id:O,value:$})},[h]),G=W(e),j=V(r().getToggleAllRowsSelectedProps,{instance:G()}),T=V(r().getToggleAllPageRowsSelectedProps,{instance:G()});Object.assign(e,{selectedFlatRows:S,isAllRowsSelected:I,isAllPageRowsSelected:H,toggleRowSelected:A,toggleAllRowsSelected:x,getToggleAllRowsSelectedProps:j,getToggleAllPageRowsSelectedProps:T,toggleAllPageRowsSelected:K})}function Mr(e,t){var n=t.instance;e.toggleRowSelected=function(r){return n.toggleRowSelected(e.id,r)},e.getToggleRowSelectedProps=V(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}var nn=function(e){return{}},rn=function(e){return{}};c.setRowState="setRowState",c.setCellState="setCellState",c.resetRowState="resetRowState";var on=function(e){e.stateReducers.push(Lr),e.useInstance.push(Dr),e.prepareRow.push($r)};function Lr(e,t,n,r){var a=r.initialRowStateAccessor,o=a===void 0?nn:a,i=r.initialCellStateAccessor,f=i===void 0?rn:i,g=r.rowsById;if(t.type===c.init)return u({rowState:{}},e);if(t.type===c.resetRowState)return u({},e,{rowState:r.initialState.rowState||{}});if(t.type===c.setRowState){var m,C=t.rowId,w=t.value,R=e.rowState[C]!==void 0?e.rowState[C]:o(g[C]);return u({},e,{rowState:u({},e.rowState,(m={},m[C]=Z(w,R),m))})}if(t.type===c.setCellState){var h,b,P,S,I,H=t.rowId,k=t.columnId,x=t.value,K=e.rowState[H]!==void 0?e.rowState[H]:o(g[H]),A=(K==null||(h=K.cellState)==null?void 0:h[k])!==void 0?K.cellState[k]:f((b=g[H])==null||(P=b.cells)==null?void 0:P.find(function(G){return G.column.id===k}));return u({},e,{rowState:u({},e.rowState,(I={},I[H]=u({},K,{cellState:u({},K.cellState||{},(S={},S[k]=Z(x,A),S))}),I))})}}function Dr(e){var t=e.autoResetRowState,n=t===void 0||t,r=e.data,a=e.dispatch,o=s.useCallback(function(g,m){return a({type:c.setRowState,rowId:g,value:m})},[a]),i=s.useCallback(function(g,m,C){return a({type:c.setCellState,rowId:g,columnId:m,value:C})},[a]),f=W(n);re(function(){f()&&a({type:c.resetRowState})},[r]),Object.assign(e,{setRowState:o,setCellState:i})}function $r(e,t){var n=t.instance,r=n.initialRowStateAccessor,a=r===void 0?nn:r,o=n.initialCellStateAccessor,i=o===void 0?rn:o,f=n.state.rowState;e&&(e.state=f[e.id]!==void 0?f[e.id]:a(e),e.setState=function(g){return n.setRowState(e.id,g)},e.cells.forEach(function(g){e.state.cellState||(e.state.cellState={}),g.state=e.state.cellState[g.column.id]!==void 0?e.state.cellState[g.column.id]:i(g),g.setState=function(m){return n.setCellState(e.id,g.column.id,m)}}))}on.pluginName="useRowState",c.resetColumnOrder="resetColumnOrder",c.setColumnOrder="setColumnOrder";var an=function(e){e.stateReducers.push(Vr),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.columnOrder])}),e.visibleColumns.push(Kr),e.useInstance.push(Ur)};function Vr(e,t,n,r){return t.type===c.init?u({columnOrder:[]},e):t.type===c.resetColumnOrder?u({},e,{columnOrder:r.initialState.columnOrder||[]}):t.type===c.setColumnOrder?u({},e,{columnOrder:Z(t.columnOrder,e.columnOrder)}):void 0}function Kr(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var r=[].concat(n),a=[].concat(e),o=[],i=function(){var f=r.shift(),g=a.findIndex(function(m){return m.id===f});g>-1&&o.push(a.splice(g,1)[0])};a.length&&r.length;)i();return[].concat(o,a)}function Ur(e){var t=e.dispatch;e.setColumnOrder=s.useCallback(function(n){return t({type:c.setColumnOrder,columnOrder:n})},[t])}an.pluginName="useColumnOrder",Q.canResize=!0,c.columnStartResizing="columnStartResizing",c.columnResizing="columnResizing",c.columnDoneResizing="columnDoneResizing",c.resetResize="resetResize";var sn=function(e){e.getResizerProps=[qr],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(Xr),e.useInstance.push(Jr),e.useInstanceBeforeDimensions.push(Qr)},qr=function(e,t){var n=t.instance,r=t.header,a=n.dispatch,o=function(i,f){var g=!1;if(i.type==="touchstart"){if(i.touches&&i.touches.length>1)return;g=!0}var m=function(S){var I=[];return function H(k){k.columns&&k.columns.length&&k.columns.map(H),I.push(k)}(S),I}(f).map(function(S){return[S.id,S.totalWidth]}),C=g?Math.round(i.touches[0].clientX):i.clientX,w=function(S){a({type:c.columnResizing,clientX:S})},R=function(){return a({type:c.columnDoneResizing})},h={mouse:{moveEvent:"mousemove",moveHandler:function(S){return w(S.clientX)},upEvent:"mouseup",upHandler:function(S){document.removeEventListener("mousemove",h.mouse.moveHandler),document.removeEventListener("mouseup",h.mouse.upHandler),R()}},touch:{moveEvent:"touchmove",moveHandler:function(S){return S.cancelable&&(S.preventDefault(),S.stopPropagation()),w(S.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(S){document.removeEventListener(h.touch.moveEvent,h.touch.moveHandler),document.removeEventListener(h.touch.upEvent,h.touch.moveHandler),R()}}},b=g?h.touch:h.mouse,P=!!function(){if(typeof Qe=="boolean")return Qe;var S=!1;try{var I={get passive(){return S=!0,!1}};window.addEventListener("test",null,I),window.removeEventListener("test",null,I)}catch{S=!1}return Qe=S}()&&{passive:!1};document.addEventListener(b.moveEvent,b.moveHandler,P),document.addEventListener(b.upEvent,b.upHandler,P),a({type:c.columnStartResizing,columnId:f.id,columnWidth:f.totalWidth,headerIdWidths:m,clientX:C})};return[e,{onMouseDown:function(i){return i.persist()||o(i,r)},onTouchStart:function(i){return i.persist()||o(i,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Xr(e,t){if(t.type===c.init)return u({columnResizing:{columnWidths:{}}},e);if(t.type===c.resetResize)return u({},e,{columnResizing:{columnWidths:{}}});if(t.type===c.columnStartResizing){var n=t.clientX,r=t.columnId,a=t.columnWidth,o=t.headerIdWidths;return u({},e,{columnResizing:u({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:a,isResizingColumn:r})})}if(t.type===c.columnResizing){var i=t.clientX,f=e.columnResizing,g=f.startX,m=f.columnWidth,C=f.headerIdWidths,w=(i-g)/m,R={};return(C===void 0?[]:C).forEach(function(h){var b=h[0],P=h[1];R[b]=Math.max(P+P*w,0)}),u({},e,{columnResizing:u({},e.columnResizing,{columnWidths:u({},e.columnResizing.columnWidths,{},R)})})}return t.type===c.columnDoneResizing?u({},e,{columnResizing:u({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}sn.pluginName="useResizeColumns";var Qr=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,a=e.state.columnResizing,o=W(e);t.forEach(function(i){var f=ve(i.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);i.canResize=f,i.width=a.columnWidths[i.id]||i.originalWidth||i.width,i.isResizing=a.isResizingColumn===i.id,f&&(i.getResizerProps=V(r().getResizerProps,{instance:o(),header:i}))})};function Jr(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,a=r===void 0||r,o=e.columns;oe(t,["useAbsoluteLayout"],"useResizeColumns");var i=W(a);re(function(){i()&&n({type:c.resetResize})},[o]);var f=s.useCallback(function(){return n({type:c.resetResize})},[n]);Object.assign(e,{resetResizing:f})}var Ye={position:"absolute",top:0},un=function(e){e.getTableBodyProps.push(je),e.getRowProps.push(je),e.getHeaderGroupProps.push(je),e.getFooterGroupProps.push(je),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:u({},Ye,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:u({},Ye,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:u({},Ye,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};un.pluginName="useAbsoluteLayout";var je=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},Ze={display:"inline-block",boxSizing:"border-box"},et=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},ln=function(e){e.getRowProps.push(et),e.getHeaderGroupProps.push(et),e.getFooterGroupProps.push(et),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:u({},Ze,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:u({},Ze,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:u({},Ze,{width:r.totalWidth+"px"})}]})};function cn(e){e.getTableProps.push(Yr),e.getRowProps.push(tt),e.getHeaderGroupProps.push(tt),e.getFooterGroupProps.push(tt),e.getHeaderProps.push(Zr),e.getCellProps.push(eo),e.getFooterProps.push(to)}ln.pluginName="useBlockLayout",cn.pluginName="useFlexLayout";var Yr=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},tt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Zr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},eo=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},to=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function dn(e){e.stateReducers.push(oo),e.getTableProps.push(no),e.getHeaderProps.push(ro)}dn.pluginName="useGridLayout";var no=function(e,t){return[e,{style:{display:"grid",gridTemplateColumns:t.instance.state.gridLayout.columnWidths.map(function(n){return n}).join(" ")}}]},ro=function(e,t){return[e,{id:"header-cell-"+t.column.id,style:{position:"sticky"}}]};function oo(e,t,n,r){if(t.type==="init")return u({gridLayout:{columnWidths:r.columns.map(function(){return"auto"})}},e);if(t.type==="columnStartResizing"){var a=t.columnId,o=r.visibleColumns.findIndex(function(h){return h.id===a}),i=function(h){var b,P=(b=document.getElementById("header-cell-"+h))==null?void 0:b.offsetWidth;if(P!==void 0)return P}(a);return i!==void 0?u({},e,{gridLayout:u({},e.gridLayout,{columnId:a,columnIndex:o,startingWidth:i})}):e}if(t.type==="columnResizing"){var f=e.gridLayout,g=f.columnIndex,m=f.startingWidth,C=f.columnWidths,w=m-(e.columnResizing.startX-t.clientX),R=[].concat(C);return R[g]=w+"px",u({},e,{gridLayout:u({},e.gridLayout,{columnWidths:R})})}}l._UNSTABLE_usePivotColumns=Zt,l.actions=c,l.defaultColumn=Q,l.defaultGroupByFn=Ut,l.defaultOrderByFn=Jt,l.defaultRenderer=X,l.emptyRenderer=q,l.ensurePluginOrder=oe,l.flexRender=pe,l.functionalUpdate=Z,l.loopHooks=ne,l.makePropGetter=V,l.makeRenderer=ce,l.reduceHooks=J,l.safeUseLayoutEffect=me,l.useAbsoluteLayout=un,l.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=s.useRef({}),r=W(e),a=W(t);return s.useCallback(function(){var o=y(regeneratorRuntime.mark(function i(){var f,g,m,C=arguments;return regeneratorRuntime.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:for(f=C.length,g=new Array(f),m=0;m<f;m++)g[m]=C[m];return n.current.promise||(n.current.promise=new Promise(function(R,h){n.current.resolve=R,n.current.reject=h})),n.current.timeout&&clearTimeout(n.current.timeout),n.current.timeout=setTimeout(y(regeneratorRuntime.mark(function R(){return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return delete n.current.timeout,h.prev=1,h.t0=n.current,h.next=5,r().apply(void 0,g);case 5:h.t1=h.sent,h.t0.resolve.call(h.t0,h.t1),h.next=12;break;case 9:h.prev=9,h.t2=h.catch(1),n.current.reject(h.t2);case 12:return h.prev=12,delete n.current.promise,h.finish(12);case 15:case"end":return h.stop()}},R,null,[[1,9,12,15]])})),a()),w.abrupt("return",n.current.promise);case 5:case"end":return w.stop()}},i)}));return function(){return o.apply(this,arguments)}}(),[r,a])},l.useBlockLayout=ln,l.useColumnOrder=an,l.useExpanded=_t,l.useFilters=Lt,l.useFlexLayout=cn,l.useGetLatest=W,l.useGlobalFilter=Dt,l.useGridLayout=dn,l.useGroupBy=Kt,l.useMountedLayoutEffect=re,l.usePagination=Yt,l.useResizeColumns=sn,l.useRowSelect=tn,l.useRowState=on,l.useSortBy=Qt,l.useTable=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e=Tt(e),n=[Bt].concat(n);var a=s.useRef({}),o=W(a.current);Object.assign(o(),u({},e,{plugins:n,hooks:Dn()})),n.filter(Boolean).forEach(function(F){F(o().hooks)});var i=W(o().hooks);o().getHooks=i,delete o().hooks,Object.assign(o(),J(i().useOptions,Tt(e)));var f=o(),g=f.data,m=f.columns,C=f.initialState,w=f.defaultColumn,R=f.getSubRows,h=f.getRowId,b=f.stateReducer,P=f.useControlledState,S=W(b),I=s.useCallback(function(F,Y){if(!Y.type)throw console.info({action:Y}),new Error("Unknown Action \u{1F446}");return[].concat(i().stateReducers,Array.isArray(S())?S():[S()]).reduce(function(ae,le){return le(ae,Y,F,o())||ae},F)},[i,S,o]),H=s.useReducer(I,void 0,function(){return I(C,{type:c.init})}),k=H[0],x=H[1],K=J([].concat(i().useControlledState,[P]),k,{instance:o()});Object.assign(o(),{state:K,dispatch:x});var A=s.useMemo(function(){return ye(J(i().columns,m,{instance:o()}))},[i,o,m].concat(J(i().columnsDeps,[],{instance:o()})));o().columns=A;var G=s.useMemo(function(){return J(i().allColumns,ge(A),{instance:o()}).map(Re)},[A,i,o].concat(J(i().allColumnsDeps,[],{instance:o()})));o().allColumns=G;var j=s.useMemo(function(){for(var F=[],Y=[],ae={},le=[].concat(G);le.length;){var se=le.shift();tr({data:g,rows:F,flatRows:Y,rowsById:ae,column:se,getRowId:h,getSubRows:R,accessValueHooks:i().accessValue,getInstance:o})}return[F,Y,ae]},[G,g,h,R,i,o]),T=j[0],O=j[1],$=j[2];Object.assign(o(),{rows:T,initialRows:[].concat(T),flatRows:O,rowsById:$}),ne(i().useInstanceAfterData,o());var N=s.useMemo(function(){return J(i().visibleColumns,G,{instance:o()}).map(function(F){return he(F,w)})},[i,G,o,w].concat(J(i().visibleColumnsDeps,[],{instance:o()})));G=s.useMemo(function(){var F=[].concat(N);return G.forEach(function(Y){F.find(function(ae){return ae.id===Y.id})||F.push(Y)}),F},[G,N]),o().allColumns=G;var D=s.useMemo(function(){return J(i().headerGroups,Pt(N,w),o())},[i,N,w,o].concat(J(i().headerGroupsDeps,[],{instance:o()})));o().headerGroups=D;var L=s.useMemo(function(){return D.length?D[0].headers:[]},[D]);o().headers=L,o().flatHeaders=D.reduce(function(F,Y){return[].concat(F,Y.headers)},[]),ne(i().useInstanceBeforeDimensions,o());var U=N.filter(function(F){return F.isVisible}).map(function(F){return F.id}).sort().join("_");N=s.useMemo(function(){return N.filter(function(F){return F.isVisible})},[N,U]),o().visibleColumns=N;var E=Ft(L),z=E[0],te=E[1],ue=E[2];return o().totalColumnsMinWidth=z,o().totalColumnsWidth=te,o().totalColumnsMaxWidth=ue,ne(i().useInstance,o()),[].concat(o().flatHeaders,o().allColumns).forEach(function(F){F.render=ce(o(),F),F.getHeaderProps=V(i().getHeaderProps,{instance:o(),column:F}),F.getFooterProps=V(i().getFooterProps,{instance:o(),column:F})}),o().headerGroups=s.useMemo(function(){return D.filter(function(F,Y){return F.headers=F.headers.filter(function(ae){return ae.headers?function le(se){return se.filter(function(be){return be.headers?le(be.headers):be.isVisible}).length}(ae.headers):ae.isVisible}),!!F.headers.length&&(F.getHeaderGroupProps=V(i().getHeaderGroupProps,{instance:o(),headerGroup:F,index:Y}),F.getFooterGroupProps=V(i().getFooterGroupProps,{instance:o(),headerGroup:F,index:Y}),!0)})},[D,o,i]),o().footerGroups=[].concat(o().headerGroups).reverse(),o().prepareRow=s.useCallback(function(F){F.getRowProps=V(i().getRowProps,{instance:o(),row:F}),F.allCells=G.map(function(Y){var ae=F.values[Y.id],le={column:Y,row:F,value:ae};return le.getCellProps=V(i().getCellProps,{instance:o(),cell:le}),le.render=ce(o(),Y,{row:F,cell:le,value:ae}),le}),F.cells=N.map(function(Y){return F.allCells.find(function(ae){return ae.column.id===Y.id})}),ne(i().prepareRow,F,{instance:o()})},[i,o,G,N]),o().getTableProps=V(i().getTableProps,{instance:o()}),o().getTableBodyProps=V(i().getTableBodyProps,{instance:o()}),ne(i().useFinalInstance,o()),o()},Object.defineProperty(l,"__esModule",{value:!0})})})(St,St.exports);Ct.exports=St.exports;const ia="_tr_198pq_1",sa="_th_198pq_7",ua="_td_198pq_24",la="_odd_198pq_30",ca="_du_198pq_35",da="_sortIconContainer_198pq_39",fa="_rotate180_198pq_46";var Pe={tr:ia,th:sa,td:ua,odd:la,du:ca,sortIconContainer:da,rotate180:fa};const Ae=!0,pa=[{accessor:"id",show:!1},{Header:"Host",accessor:"host"},{Header:"DL",accessor:"download",sortDescFirst:Ae},{Header:"UL",accessor:"upload",sortDescFirst:Ae},{Header:"DL Speed",accessor:"downloadSpeedCurr",sortDescFirst:Ae},{Header:"UL Speed",accessor:"uploadSpeedCurr",sortDescFirst:Ae},{Header:"Chains",accessor:"chains"},{Header:"Rule",accessor:"rule"},{Header:"Time",accessor:"start",sortDescFirst:Ae},{Header:"Source",accessor:"source"},{Header:"Destination IP",accessor:"destinationIP"},{Header:"Type",accessor:"type"}];function ga(d){switch(d.column.id){case"start":return Oo(d.value,0);case"download":case"upload":return Rn(d.value);case"downloadSpeedCurr":case"uploadSpeedCurr":return Rn(d.value)+"/s";default:return d.value}}const va={id:"id",desc:!0},ma={sortBy:[va],hiddenColumns:["id"]};function ha({data:d}){const{getTableProps:p,headerGroups:l,rows:s,prepareRow:v}=Ct.exports.useTable({columns:pa,data:d,initialState:ma,autoResetSortBy:!1},Ct.exports.useSortBy);return _.createElement("div",xe({},p()),l.map(y=>_.createElement("div",Te(xe({},y.getHeaderGroupProps()),{className:Pe.tr}),y.headers.map(u=>_.createElement("div",Te(xe({},u.getHeaderProps(u.getSortByToggleProps())),{className:Pe.th}),_.createElement("span",null,u.render("Header")),_.createElement("span",{className:Pe.sortIconContainer},u.isSorted?_.createElement("span",{className:u.isSortedDesc?"":Pe.rotate180},_.createElement(bo,{size:16})):null))),s.map((u,B)=>(v(u),u.cells.map((M,c)=>_.createElement("div",Te(xe({},M.getCellProps()),{className:Ce(Pe.td,B%2==0?Pe.odd:!1,c>=1&&c<=4?Pe.du:!1)}),ga(M))))))))}const ya="_overlay_148w6_1",ba="_cnt_148w6_5",wa="_afterOpen_148w6_15",Ra="_btngrp_148w6_20";var qe={overlay:ya,cnt:ba,afterOpen:wa,btngrp:Ra};const{useRef:Ca,useCallback:Sa,useMemo:Pa}=_;function xa({isOpen:d,onRequestClose:p,primaryButtonOnTap:l}){const s=Ca(null),v=Sa(()=>{s.current.focus()},[]),y=Pa(()=>({base:Ce(Cn.content,qe.cnt),afterOpen:qe.afterOpen,beforeClose:""}),[]);return _.createElement(wo,{isOpen:d,onRequestClose:p,onAfterOpen:v,className:y,overlayClassName:Ce(Cn.overlay,qe.overlay)},_.createElement("p",null,"Are you sure you want to close all connections?"),_.createElement("div",{className:qe.btngrp},_.createElement(Sn,{onClick:l,ref:s},"I'm sure"),_.createElement("div",{style:{width:20}}),_.createElement(Sn,{onClick:p},"No")))}const{useEffect:Ea,useState:Ge,useRef:Ia,useCallback:Ne}=_,Tn=30;function Ba(d){const p={};for(let l=0;l<d.length;l++){const s=d[l];p[s.id]=s}return p}function Ta(d,p){return d.toLowerCase().includes(p.toLowerCase())}function Fn(d,p){return p?d.filter(l=>[l.host,l.sourceIP,l.sourcePort,l.destinationIP,l.chains,l.rule,l.type,l.network].some(s=>Ta(s,p))):d}function Fa(d,p,l){const{id:s,metadata:v,upload:y,download:u,start:B,chains:M,rule:c}=d,{host:X,destinationPort:q,destinationIP:Q,network:ee,type:V,sourceIP:J,sourcePort:ne}=v;let oe=X;oe===""&&(oe=Q);const Z=p[s];return Te(xe({id:s,upload:y,download:u,start:l-new Date(B).valueOf(),chains:M.reverse().join(" / "),rule:c},v),{host:`${oe}:${q}`,type:`${V}(${ee})`,source:`${J}:${ne}`,downloadSpeedCurr:u-(Z?Z.download:0),uploadSpeedCurr:y-(Z?Z.upload:0)})}function _n(d){return d.length>0?_.createElement(ha,{data:d}):_.createElement("div",{className:Oe.placeHolder},_.createElement(To,{width:200,height:200,c1:"var(--color-text)"}))}function On({qty:d}){return d<100?""+d:"99+"}function _a({apiConfig:d}){const[p,l]=_o(),[s,v]=Ge([]),[y,u]=Ge([]),[B,M]=Ge(""),c=Fn(s,B),X=Fn(y,B),[q,Q]=Ge(!1),ee=Ne(()=>Q(!0),[]),V=Ne(()=>Q(!1),[]),[J,ne]=Ge(!1),oe=Ne(()=>{ne(ce=>!ce)},[]),Z=Ne(()=>{Eo(d),V()},[d,V]),W=Ia(s),me=Ne(({connections:ce})=>{const pe=Ba(W.current),ye=Date.now(),ge=ce.map(he=>Fa(he,pe,ye)),Re=[];for(const he of W.current)ge.findIndex(ke=>ke.id===he.id)<0&&Re.push(he);u(he=>[...Re,...he].slice(0,101)),ge&&(ge.length!==0||W.current.length!==0)&&!J?(W.current=ge,v(ge)):W.current=ge},[v,J]);Ea(()=>Io(d,me),[d,me]);const{t:re}=Ro();return _.createElement("div",null,_.createElement(Bo,{title:re("Connections")}),_.createElement(Ke,null,_.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between"}},_.createElement(Ue,null,_.createElement(Fe,null,_.createElement("span",null,re("Active")),_.createElement("span",{className:Oe.connQty},_.createElement(On,{qty:c.length}))),_.createElement(Fe,null,_.createElement("span",null,re("Closed")),_.createElement("span",{className:Oe.connQty},_.createElement(On,{qty:X.length})))),_.createElement("div",{className:Oe.inputWrapper},_.createElement("input",{type:"text",name:"filter",autoComplete:"off",className:Oe.input,placeholder:"Filter",onChange:ce=>M(ce.target.value)}))),_.createElement("div",{ref:p,style:{padding:30,paddingBottom:Tn,paddingTop:0}},_.createElement("div",{style:{height:l-Tn,overflow:"auto"}},_.createElement(_e,null,_.createElement(_.Fragment,null,_n(c)),_.createElement(Ao,{icon:J?_.createElement(Co,{size:16}):_.createElement(So,{size:16}),mainButtonStyles:J?{background:"#e74c3c"}:{},style:Go,text:re(J?"Resume Refresh":"Pause Refresh"),onClick:oe},_.createElement(No,{text:"Close All Connections",onClick:ee},_.createElement(Po,{size:10})))),_.createElement(_e,null,_n(X)))),_.createElement(xa,{isOpen:q,primaryButtonOnTap:Z,onRequestClose:V})))}const Oa=d=>({apiConfig:Fo(d)});var Wa=xo(Oa)(_a);export{Wa as default};
|