text: /*! For license information please see 24.8c2ee922.chunk.js.LICENSE.txt */
  (this["webpackJsonpstreamlit-browser"]=this["webpackJsonpstreamlit-browser"]||[]).push([[24],{3850:function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return H}));var o,r=n(11),i=n(22),a=n(0),c=n.n(a),s=n(311),d=n(188),l=n(118);!function(t){t.ASCENDING="ascending",t.DESCENDING="descending"}(o||(o={}));var u=n(85),h=n(71),f=n(70),m=n(23),b=n(13),x=n.n(b),g=x()("div",{target:"e11ks2pe0"})((function(t){var e=t.width,n=t.theme;return{width:e,border:"1px solid ".concat(n.colors.fadedText05),boxSizing:"content-box","& .table-top-right":{overflow:"hidden !important",paddingRight:"6px"},"& .table-bottom-left":{overflow:"hidden !important",paddingBottom:"6px"},"& .table-bottom-right":{overflow:"overlay !important"},"& .table-bottom-right:focus-visible":{outline:"none"},"& .table-bottom-right:focus":{outline:"none"}}}),""),v=x()("div",{target:"e11ks2pe1"})((function(t){var e=t.theme;return{padding:"".concat(e.spacing.twoXS," ").concat(e.spacing.xs),borderBottom:"1px solid ".concat(e.colors.fadedText05),borderRight:"1px solid ".concat(e.colors.fadedText05),fontSize:e.fontSizes.md,fontFamily:e.fonts.sansSerif,lineHeight:e.lineHeights.table,display:"flex",alignItems:"center",justifyContent:"flex-start","&focus-visible, &:focus":{outline:"none"}}}),""),p=function(t){return{color:t.colors.fadedText60,borderBottom:"1px solid ".concat(t.colors.fadedText05),borderRight:"1px solid ".concat(t.colors.fadedText05),zIndex:1,"&:focus-visible, &:focus":{outline:"none"}}},j=function(t){return{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",lineHeight:t.lineHeights.table}},w=x()(v,{target:"e11ks2pe2"})((function(t){var e=t.theme;return p(e)}),""),C=x()(v,{target:"e11ks2pe3"})((function(t){var e=t.theme;return Object(r.a)(Object(r.a)({userSelect:"none"},p(e)),j(e))}),""),O=x()(v,{target:"e11ks2pe4"})((function(t){var e=t.theme;return Object(r.a)(Object(r.a)({userSelect:"none"},p(e)),j(e))}),""),y=x()(v,{target:"e11ks2pe5"})((function(t){var e=t.theme;return j(e)}),""),N=x()("div",{target:"e11ks2pe6"})((function(t){var e,n=t.verticalLocator,o=t.horizontalLocator,r=t.width,i=t.height;return e={position:"absolute"},Object(m.a)(e,n,"0px"),Object(m.a)(e,o,"0px"),Object(m.a)(e,"width",r),Object(m.a)(e,"height",i),e}),""),I=x()("div",{target:"e11ks2pe7"})((function(t){var e=t.theme;return{fontFamily:e.fonts.monospace,color:e.colors.fadedText60,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}}),""),S=x()("span",{target:"e11ks2pe8"})((function(t){return{color:t.theme.colors.fadedText05,verticalAlign:"top"}}),""),D=n(5);function k(t){var e,n,o,r=t.CellType,i=t.columnIndex,a=t.contents,c=t.rowIndex,s=t.sortedByUser,d=t.style,l=t.columnSortDirection,u=t.className,h=t.isNumeric,f=t.id,m=t.headerClickedCallback,b=0===c;return null!=m&&(e=function(){return m(i)},n="button",o=0),Object(D.jsx)(r,{style:d,className:u,id:f,onClick:e,role:n,tabIndex:o,"data-testid":r.displayName,"data-test-sort-direction":l,children:b?Object(D.jsx)(E,{columnIndex:i,columnSortDirection:l,contents:a,headerClickedCallback:m,isNumeric:h,rowIndex:c,sortedByUser:s}):Object(D.jsx)(T,{contents:a,isNumeric:h})})}function R(t){switch(t.sortDirection){case o.ASCENDING:return Object(D.jsx)(S,{"data-testid":"sortIcon",children:Object(D.jsx)(h.a,{content:u.ChevronTop,size:"xs",margin:"0 0 0 twoXS"})});case o.DESCENDING:return Object(D.jsx)(S,{"data-testid":"sortIcon",children:Object(D.jsx)(h.a,{content:u.ChevronBottom,size:"xs",margin:"0 0 0 twoXS"})});default:return Object(D.jsx)(D.Fragment,{})}}function E(t){t.columnIndex;var e=t.columnSortDirection,n=t.contents,r=t.headerClickedCallback,i=t.isNumeric,a=(t.rowIndex,t.sortedByUser),c=n,s=e===o.DESCENDING;if(null!=r){var d=n.length?'"'.concat(n,'"'):"this index column";c=null==e?"Sort by ".concat(d):"Sorted by ".concat(d," (").concat(s?"descending":"ascending",")")}return Object(D.jsxs)(f.d,{content:c,placement:f.b.BOTTOM_LEFT,style:{width:"100%"},children:[Object(D.jsx)(f.c,{style:{textAlign:i?"right":void 0,flex:1},children:n}),a&&Object(D.jsx)(R,{sortDirection:e})]})}function T(t){var e=t.contents,n=t.isNumeric;return Object(D.jsx)(f.a,{content:e,placement:f.b.AUTO,style:{textAlign:n?"right":void 0},children:e})}var G=n(21),A=n(72),B=2*A.a.smPx,W=function(t,e,n,o){var r=n.dimensions,i=r.headerRows,a=r.headerColumns,c=r.dataRows,s=r.columns,d=r.rows,l=B*i,u=function(t,e,n,o,r,i){var a=25,c=t>2?200:400,s=function(t){for(var n=t.index,r=8*10/10,c=24,s=100,d=a,l=0;l<Math.min(e,s);l++){var u=-1;u=l<o?l:e>s?Math.floor(Math.random()*e):l;var h=i(n,u).contents,f=(h?h.length:0)*r+c;f>d&&(d=f)}return d},d=[],l=Array.from(Array(t),(function(t,e){return s({index:e})})),u=l.reduce((function(t,e){return t+e}),0),h=r-u,f=function(t){return t.filter((function(t){return t>c}))};if(h<0)d=l.map((function(t){return t>c?c:t}));else{var m=f(l),b=h/m.length;d=l.map((function(t,e){return e in m.keys()?t+b:t}))}var x=d.reduce((function(t,e){return t+e}),0);if(x>r*(2/3)&&x<r){var g=(r-x)/t;x=(d=d.map((function(t){return t+g}))).reduce((function(t,e){return t+e}),0)}var v=Math.min(x,r),p=function(t){var e=t.index;return d[e]},j=d.slice(0,n).reduce((function(t,e){return t+e}));return{elementWidth:v,columnWidth:p,headerWidth:j}}(s,d,a,i,e-2,o),h=u.elementWidth,f=u.columnWidth,m=u.headerWidth;if(0===c&&h<60){h=60,m=60;for(var b=0,x=0;x<s;x++)b+=f({index:x});b<60&&(f=function(){return 60/s})}var g=d*B,v=(t||300)-2;return t=Math.min(g,v),{rowHeight:B,headerHeight:l,border:2,columnWidth:f,headerWidth:m,elementWidth:h,height:t}},z={blank:w,columns:C,index:O,data:y};var H=Object(d.a)((function(t){var e=t.element,n=t.height,d=t.width,u=c.a.useRef(null),h=Object(a.useState)(!1),f=Object(i.a)(h,2),m=f[0],b=f[1],x=Object(a.useState)(0),v=Object(i.a)(x,2),p=v[0],j=v[1],w=Object(a.useState)(o.ASCENDING),C=Object(i.a)(w,2),O=C[0],y=C[1],S=e.data.length>0?e.data[0].length:0,R=e.dimensions,E=R.headerRows,T=R.headerColumns,A=R.dataRows,B=R.columns,H=R.rows,L=function(t){var e=o.ASCENDING;p===t&&(e=O===o.ASCENDING?o.DESCENDING:o.ASCENDING),j(t),y(e),b(!0)};function F(t,e,n){return"unicode"===n?function(t,e){return new Intl.Collator("en",{numeric:!1,sensitivity:"base"}).compare(t,e)}(t,e):function(t,e){if(t<e)return-1;if(t>e)return 1;return 0}(t,e)}var M=function(t){var n=e.dimensions,r=n.headerColumns,a=n.dataRows,c=O!==o.DESCENDING;if(p<r||p-r>=t){for(var s=new Array(a),d=0;d<a;d+=1)s[d]=c?d:a-(d+1);return s}return function(t,n){var o=e.data.length>0?[e.data.length,e.data[0].length]:[0,0],r=Object(i.a)(o,2),a=r[0],c=r[1];if(t<0||t>=c)throw new Error("Bad sortColumnIdx ".concat(t," (should be >= 0, < ").concat(c,")"));for(var s=l.b.getTypeName(e.types.data[t]),d=new Array(a),u=0;u<a;u+=1)d[u]=u;return d.sort((function(o,r){var i=e.data[o][t],a=e.data[r][t];return n?F(i,a,s):F(a,i,s)})),d}(p-r,c)}(S),U=function(t){var e=t.element,n=t.headerRows,o=t.sortedDataRowIndices;return function(t,r){if(null!=o&&r>=n){var i=r-n;i>=0&&i<o.length?(r=o[i],r+=n):Object(G.d)("Bad sortedDataRowIndices ("+"rowIndex=".concat(r,", ")+"headerRows=".concat(n,", ")+"sortedDataRowIndices.length=".concat(o.length))}var a=e.getCell(r,t),c=a.type,s=a.cssId,d=a.cssClass,u=a.content,h=a.contentType,f=a.displayContent;return{Component:z[c],contents:f||l.b.format(u,h),cssId:s,cssClass:d}}}({element:e,headerRows:E,sortedDataRowIndices:M}),X=function(t){return function(n){var o,i=n.columnIndex,a=n.key,c=n.rowIndex,s=n.style,d=t(i,c),l=d.Component,u=d.cssId,h=d.cssClass,f=d.contents,b=0===c?L:void 0,x=i===p?O:void 0,g=null===(o=e.types.data[i-T])||void 0===o?void 0:o.pandas_type,v="int64"===g||"float64"===g,j=0!==A,w=c===A,C=i===B-T,y=Object(r.a)(Object(r.a)({},s),{},{borderBottom:w&&j?"none":void 0,borderRight:C?"none":void 0});return Object(D.jsx)(k,{CellType:l,id:u,className:h,columnIndex:i,rowIndex:c,style:y,isNumeric:v,contents:f,sortedByUser:m,columnSortDirection:x,headerClickedCallback:b},a)}}(U),J=W(n,d,e,U),_=J.rowHeight,P=J.headerHeight,q=J.border,K=J.height,Q=J.elementWidth,V=J.columnWidth,Y=J.headerWidth;setTimeout((function(){null!=u.current&&u.current.recomputeGridSize()}),0),Object(a.useEffect)((function(){p-T>=S&&(j(0),y(o.ASCENDING),b(!1))}),[p,T,S]);var Z=e.cssId,$=e.cssStyles;return Object(D.jsxs)(g,{id:Z,className:"stDataFrame",width:Q,children:[$&&Object(D.jsx)("style",{children:$}),Object(D.jsx)(s.MultiGrid,{cellRenderer:X,fixedColumnCount:T,fixedRowCount:E,columnWidth:V,columnCount:B,enableFixedColumnScroll:!1,enableFixedRowScroll:!1,height:K,rowHeight:_,rowCount:H,width:Q,classNameBottomLeftGrid:"table-bottom-left",classNameTopRightGrid:"table-top-right",classNameBottomRightGrid:"table-bottom-right",ref:u}),Object(D.jsx)(N,{verticalLocator:"top",horizontalLocator:"right",width:q,height:P}),Object(D.jsx)(N,{verticalLocator:"bottom",horizontalLocator:"left",width:Y,height:q}),0===A?Object(D.jsx)(I,{children:"empty"}):null]})}))}}]);