streamlit-nightly 1.37.1.dev20240730__py2.py3-none-any.whl → 1.37.1.dev20240731__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/static/asset-manifest.json +20 -20
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/1074.86034b28.chunk.js +1 -0
- streamlit/static/static/js/{1116.f824d083.chunk.js → 1116.d8656dab.chunk.js} +1 -1
- streamlit/static/static/js/{1168.14f7c6ff.chunk.js → 1168.6baadc46.chunk.js} +1 -1
- streamlit/static/static/js/{1451.229b62c4.chunk.js → 1451.e9542cc9.chunk.js} +1 -1
- streamlit/static/static/js/3599.f1e3cc27.chunk.js +1 -0
- streamlit/static/static/js/{4177.69f9f18d.chunk.js → 4177.e5631c43.chunk.js} +1 -1
- streamlit/static/static/js/4319.00adb829.chunk.js +1 -0
- streamlit/static/static/js/{4335.a695f906.chunk.js → 4335.fb48fd8e.chunk.js} +1 -1
- streamlit/static/static/js/4477.b85593dd.chunk.js +1 -0
- streamlit/static/static/js/4500.c007e274.chunk.js +1 -0
- streamlit/static/static/js/{4666.b9eab191.chunk.js → 4666.c8694d51.chunk.js} +1 -1
- streamlit/static/static/js/5106.e53c485c.chunk.js +1 -0
- streamlit/static/static/js/5441.a564862e.chunk.js +1 -0
- streamlit/static/static/js/6718.7bc66e7a.chunk.js +1 -0
- streamlit/static/static/js/7175.14622908.chunk.js +1 -0
- streamlit/static/static/js/{7602.85e7b7bf.chunk.js → 7602.b5f7407a.chunk.js} +1 -1
- streamlit/static/static/js/{8148.1b2c085e.chunk.js → 8148.c7db8490.chunk.js} +1 -1
- streamlit/static/static/js/8691.95ba8af9.chunk.js +1 -0
- streamlit/static/static/js/{main.0467dc11.js → main.02598bc8.js} +2 -2
- {streamlit_nightly-1.37.1.dev20240730.dist-info → streamlit_nightly-1.37.1.dev20240731.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.37.1.dev20240730.dist-info → streamlit_nightly-1.37.1.dev20240731.dist-info}/RECORD +28 -28
- streamlit/static/static/js/1074.d1dd1731.chunk.js +0 -1
- streamlit/static/static/js/3599.565b1eba.chunk.js +0 -1
- streamlit/static/static/js/4319.bf1c86bf.chunk.js +0 -1
- streamlit/static/static/js/4477.87935ac8.chunk.js +0 -1
- streamlit/static/static/js/4500.be0eb305.chunk.js +0 -1
- streamlit/static/static/js/5106.086585ae.chunk.js +0 -1
- streamlit/static/static/js/5441.324eb9ab.chunk.js +0 -1
- streamlit/static/static/js/6718.2e6586ef.chunk.js +0 -1
- streamlit/static/static/js/7175.24e7dd6b.chunk.js +0 -1
- streamlit/static/static/js/8691.cb9c04cf.chunk.js +0 -1
- /streamlit/static/static/js/{main.0467dc11.js.LICENSE.txt → main.02598bc8.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.37.1.dev20240730.data → streamlit_nightly-1.37.1.dev20240731.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.37.1.dev20240730.dist-info → streamlit_nightly-1.37.1.dev20240731.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.37.1.dev20240730.dist-info → streamlit_nightly-1.37.1.dev20240731.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.37.1.dev20240730.dist-info → streamlit_nightly-1.37.1.dev20240731.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5441],{5441:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P});var n=o(66845),i=o(25621),s=o(72965),a=o(94206),r=o(60784),l=o(62813),d=o.n(l),c=o(50641),h=o(23849),m=o(23593),u=o(63765),g=o(87814),p=o(91191);const f={DATAFRAME_INDEX:"(index)"},b=new Set([p.GI.DatetimeIndex,p.GI.Float64Index,p.GI.Int64Index,p.GI.RangeIndex,p.GI.UInt64Index]);function v(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;const o={};return e.datasets.forEach((e=>{if(!e)return;const t=e.hasName?e.name:null;o[t]=e.data})),o}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];const o=[],{dataRows:n,dataColumns:i}=e.dimensions,s=p.fu.getTypeName(e.types.index[0]),a=b.has(s);for(let r=t;r<n;r++){const t={};if(a){const o=e.getIndexValue(r,0);t[f.DATAFRAME_INDEX]="bigint"===typeof o?Number(o):o}for(let o=0;o<i;o++){const n=e.getDataValue(r,o),i=e.types.data[o],s=p.fu.getTypeName(i);if("datetimetz"!==s&&(n instanceof Date||Number.isFinite(n))&&(s.startsWith("datetime")||"date"===s)){const i=60*new Date(n).getTimezoneOffset()*1e3;t[e.columns[0][o]]=n.valueOf()+i}else t[e.columns[0][o]]="bigint"===typeof n?Number(n):n}o.push(t)}return o}var y=o(96825),x=o.n(y),S=o(99394),F=o.n(S),C=o(27466);function z(e,t){const o={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:t.fontSizes.smPx+2,orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.mdPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,C.ny)(t),domain:!1,domainWidth:1,domainColor:(0,C.ny)(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:t.spacing.lgPx,labelPadding:t.spacing.lgPx,labelSeparation:t.spacing.twoXSPx,labelOverlap:!0},legend:{labelFontSize:t.fontSizes.smPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,C.Xy)(t),titlePadding:5,labelPadding:t.spacing.lgPx,columnPadding:t.spacing.smPx,rowPadding:t.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,C.iY)(t),diverging:(0,C.ru)(t),ramp:(0,C.Gy)(t),heatmap:(0,C.Gy)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,C.Iy)(t)?{color:"#0068C9"}:{color:"#83C9FF"}},bar:{binSpacing:t.spacing.twoXSPx,discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?F()({},o,e,((e,t)=>Array.isArray(t)?t:void 0)):o}const W=(0,o(1515).Z)("div",{target:"egd2k5h0"})((e=>{let{theme:t,useContainerWidth:o,isFullScreen:n}=e;return{width:o||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&.has-actions":{paddingRight:0},".vega-actions":{zIndex:t.zIndices.popupMenu,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:"".concat(t.sizes.borderWidth," solid ").concat(t.colors.fadedText10),a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.twoXL),color:t.colors.bodyText},"a:hover":{backgroundColor:t.colors.secondaryBg,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},summary:{opacity:0,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms","&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix25}}}}}),"");var V=o(40864);const I="source";class D extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=I,this.element=null,this.formClearHelper=new g.K,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element:o,theme:n,isFullScreen:i,width:s,height:a}=this.props,r=JSON.parse(o.spec),{useContainerWidth:l}=o;if("streamlit"===o.vegaLiteTheme?r.config=z(r.config,n):"streamlit"===(null===(e=r.usermeta)||void 0===e||null===(t=e.embedOptions)||void 0===t?void 0:t.theme)?(r.config=z(r.config,n),r.usermeta.embedOptions.theme=void 0):r.config=function(e,t){const{colors:o,fontSizes:n,genericFonts:i}=t,s={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:n.twoSmPx,titleFontSize:n.twoSmPx},a={background:o.bgColor,axis:{labelColor:o.bodyText,titleColor:o.bodyText,gridColor:(0,C.ny)(t),...s},legend:{labelColor:o.bodyText,titleColor:o.bodyText,...s},title:{color:o.bodyText,subtitleColor:o.bodyText,...s},header:{labelColor:o.bodyText,titleColor:o.bodyText,...s},view:{stroke:(0,C.ny)(t),continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?x()({},a,e):a}(r.config,n),i?(r.width=s,r.height=a,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))):l&&(r.width=s,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))),r.padding||(r.padding={}),(0,c.le)(r.padding.bottom)&&(r.padding.bottom=20),r.datasets)throw new Error("Datasets should not be passed as part of the spec");return o.selectionMode.length>0&&function(e){"params"in e&&"encoding"in e&&e.params.forEach((t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&"point"===t.select.type&&!("encodings"in t.select)&&(0,c.le)(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))}))}(r),r},this.maybeConfigureSelections=()=>{if(void 0===this.vegaView)return;const{widgetMgr:e,element:t}=this.props;if(null===t||void 0===t||!t.id||0===t.selectionMode.length)return;const o=e.getElementState(this.props.element.id,"viewState");if((0,c.bb)(o))try{this.vegaView=this.vegaView.setState(o)}catch(i){(0,h.KE)("Failed to restore view state",i)}t.selectionMode.forEach(((o,n)=>{var i;null===(i=this.vegaView)||void 0===i||i.addSignalListener(o,(0,c.Ds)(150,((o,n)=>{var i;const s=null===(i=this.vegaView)||void 0===i?void 0:i.getState({data:(e,o)=>t.selectionMode.some((t=>"".concat(t,"_store")===e)),recurse:!1});(0,c.bb)(s)&&e.setElementState(t.id,"viewState",s);let a=n;"vlPoint"in n&&"or"in n.vlPoint&&(a=n.vlPoint.or);const r=JSON.parse(e.getStringValue(t)||"{}"),l={selection:{...(null===r||void 0===r?void 0:r.selection)||{},[o]:a||{}}};d()(r,l)||e.setStringValue(t,JSON.stringify(l),{fromUi:!0},this.props.fragmentId)})))}));const n=()=>{const o={selection:{}};this.props.element.selectionMode.forEach((e=>{o.selection[e]={}}));const n=e.getStringValue(t),i=n?JSON.parse(n):o;var s;d()(i,o)||(null===(s=this.props.widgetMgr)||void 0===s||s.setStringValue(this.props.element,JSON.stringify(o),{fromUi:!0},this.props.fragmentId))};this.props.element.formId&&this.formClearHelper.manageFormClearListener(this.props.widgetMgr,this.props.element.formId,n)}}async componentDidMount(){try{await this.createView()}catch(e){const t=(0,u.b)(e);this.setState({error:t})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(e){const{element:t,theme:o}=e,{element:n,theme:i}=this.props,s=t.spec,{spec:a}=n;if(!this.vegaView||s!==a||o!==i||e.width!==this.props.width||e.height!==this.props.height||e.element.vegaLiteTheme!==this.props.element.vegaLiteTheme||!d()(e.element.selectionMode,this.props.element.selectionMode)){(0,h.ji)("Vega spec changed.");try{await this.createView()}catch(g){const e=(0,u.b)(g);this.setState({error:e})}return}const r=t.data,{data:l}=n;(r||l)&&this.updateData(this.defaultDataName,r,l);const c=v(t)||{},m=v(n)||{};for(const[d,h]of Object.entries(m)){const e=d||this.defaultDataName,t=c[e];this.updateData(e,t,h)}for(const d of Object.keys(c))m.hasOwnProperty(d)||d===this.defaultDataName||this.updateData(d,null,null);this.vegaView.resize().runAsync()}updateData(e,t,o){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!o||0===o.data.numRows)try{this.vegaView.remove(e,a.truthy)}finally{return}if(!t||0===t.data.numRows)return void this.vegaView.insert(e,w(o));const{dataRows:n,dataColumns:i}=t.dimensions,{dataRows:s,dataColumns:r}=o.dimensions;!function(e,t,o,n,i,s){if(o!==s)return!1;if(t>=i)return!1;if(0===t)return!1;const a=s-1,r=t-1;return e.getDataValue(0,a)===n.getDataValue(0,a)&&e.getDataValue(r,a)===n.getDataValue(r,a)}(t,n,i,o,s,r)?(this.vegaView.data(e,w(o)),(0,h.ji)("Had to clear the ".concat(e," dataset before inserting data through Vega view."))):n<s&&this.vegaView.insert(e,w(o,n))}async createView(){if((0,h.ji)("Creating a new Vega view."),!this.element)throw Error("Element missing.");this.finalizeView();const{element:e}=this.props,t=this.generateSpec(),o={ast:!0,expr:r.N,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:a}=await(0,s.ZP)(this.element,t,o);this.vegaView=i,this.maybeConfigureSelections(),this.vegaFinalizer=a;const l=function(e){const t=v(e);if((0,c.le)(t))return null;const o={};for(const[n,i]of Object.entries(t))o[n]=w(i);return o}(e),d=l?Object.keys(l):[];if(1===d.length){const[e]=d;this.defaultDataName=e}else 0===d.length&&n.data&&(this.defaultDataName=I);const m=function(e){const t=e.data;return t&&0!==t.data.numRows?w(t):null}(e);if(m&&i.insert(this.defaultDataName,m),l)for(const[s,r]of Object.entries(l))i.insert(s,r);await i.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return(0,V.jsx)(W,{"data-testid":"stArrowVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})}}const P=(0,i.b)((0,m.Z)(D))},23593:(e,t,o)=>{o.d(t,{Z:()=>b});var n=o(66845),i=o(13005),s=o.n(i),a=o(25621),r=o(82218),l=o(97781),d=o(46927),c=o(66694),h=o(1515);const m=(0,h.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:o}=e;const n=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:o.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:o.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:o.colors.fadedText60,borderRadius:"50%",...n,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:o.colors.bodyText,transition:"none"}}}),""),u=(0,h.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:o}=e;return{"&:hover":{[m]:{opacity:1,transform:"scale(1)",transition:"none"}},...o?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var g=o(40864);class p extends n.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels("2.875rem");return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:o}=this.state,{children:n,width:i,height:s,disableFullscreenMode:a}=this.props;let c=r.d,h=this.zoomIn,p="View fullscreen";return e&&(c=l.m,h=this.zoomOut,p="Exit fullscreen"),(0,g.jsxs)(u,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!a&&(0,g.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:h,title:p,isExpanded:e,children:(0,g.jsx)(d.Z,{content:c})}),n(e?{width:t,height:o,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:i,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}p.contextType=c.E;const f=(0,a.b)(p);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class o extends n.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:o,height:n,disableFullscreenMode:i}=this.props;return(0,g.jsx)(f,{width:o,height:n,disableFullscreenMode:t||i,children:t=>{let{width:o,height:n,expanded:i,expand:s,collapse:a}=t;return(0,g.jsx)(e,{...this.props,width:o,height:n,isFullScreen:i,expand:s,collapse:a})}})}}}return o.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),s()(o,e)}},87814:(e,t,o)=>{o.d(t,{K:()=>i});var n=o(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,n.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6718],{87814:(e,t,r)=>{r.d(t,{K:()=>n});var o=r(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,o.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},36718:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var o=r(66845),n=r(97142),i=r(27420),l=r(90481),a=r(25621),s=r(87814),u=r(98478),d=r(86659),c=r(8879),p=r(68411),f=r(50641);const b=(0,r(1515).Z)("div",{target:"e1ipygm10"})((()=>({position:"absolute",top:"50%",right:"2.05em"})),"");var y=r(40864);class g extends o.PureComponent{constructor(){super(...arguments),this.formClearHelper=new s.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:r,fragmentId:o}=this.props;t.setStringValue(r,this.state.value,e,o)},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let t;t=null===e?null:this.dateToString(e),this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))},this.stringToDate=e=>{if(null===e)return null;const[t,r]=e.split(":").map(Number),o=new Date;return o.setHours(t),o.setMinutes(r),o},this.dateToString=e=>{const t=e.getHours().toString().padStart(2,"0"),r=e.getMinutes().toString().padStart(2,"0");return"".concat(t,":").concat(r)}}get initialValue(){var e;const t=this.props.widgetMgr.getStringValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{disabled:t,width:r,element:o,widgetMgr:a,theme:s}=this.props,g=(0,f.le)(o.default)&&!t,m={width:r},h={Select:{props:{disabled:t,overrides:{ControlContainer:{style:{height:s.sizes.minElementHeight,borderLeftWidth:s.sizes.borderWidth,borderRightWidth:s.sizes.borderWidth,borderTopWidth:s.sizes.borderWidth,borderBottomWidth:s.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:s.spacing.sm})},ValueContainer:{style:()=>({lineHeight:1.4,paddingRight:s.spacing.sm,paddingLeft:s.spacing.sm,paddingBottom:s.spacing.sm,paddingTop:s.spacing.sm})},SingleValue:{props:{"data-testid":"stTimeInput-timeDisplay"}},Dropdown:{style:()=>({paddingTop:0,paddingBottom:0})},Popover:{props:{overrides:{Body:{style:()=>({marginTop:"1px"})}}}},SelectArrow:{component:l.Z,props:{overrides:{Svg:{style:()=>({width:s.iconSizes.xl,height:s.iconSizes.xl})}}}}}}}};return this.formClearHelper.manageFormClearListener(a,o.formId,this.onFormCleared),(0,y.jsxs)("div",{className:"stTimeInput","data-testid":"stTimeInput",style:m,children:[(0,y.jsx)(u.O,{label:o.label,disabled:t,labelVisibility:(0,f.iF)(null===(e=o.labelVisibility)||void 0===e?void 0:e.value),children:o.help&&(0,y.jsx)(d.dT,{children:(0,y.jsx)(c.Z,{content:o.help,placement:p.u.TOP_RIGHT})})}),(0,y.jsx)(n.Z,{format:"24",step:o.step?Number(o.step):900,value:(0,f.le)(this.state.value)?void 0:this.stringToDate(this.state.value),onChange:this.handleChange,overrides:h,nullable:g,creatable:!0,"aria-label":o.label}),g&&!(0,f.le)(this.state.value)&&(0,y.jsx)(b,{onClick:()=>{this.handleChange(null)},"data-testid":"stTimeInputClearButton",children:(0,y.jsx)(i.i,{overrides:{Svg:{style:{color:s.colors.darkGray,transform:"scale(1.41)",width:s.spacing.twoXL,":hover":{fill:s.colors.bodyText}}}},$isFocusVisible:!1})})]})}}const m=(0,a.b)(g)},71077:(e,t,r)=>{r.r(t),r.d(t,{ThemeConsumer:()=>l,ThemeProvider:()=>o.Z,createThemedStyled:()=>n.Tp,createThemedUseStyletron:()=>n.fj,createThemedWithStyle:()=>n.o4,expandBorderStyles:()=>i.Qj,hexToRgb:()=>i.oo,styled:()=>n.zo,useStyletron:()=>n.hQ,withStyle:()=>n.w1,withWrapper:()=>n.Le});var o=r(42274),n=r(80745),i=r(30067),l=o.N.Consumer},92990:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getOverride=f,t.getOverrideProps=b,t.getOverrides=g,t.mergeConfigurationOverrides=h,t.mergeOverride=m,t.mergeOverrides=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.assign({},e,t);return Object.keys(r).reduce((function(r,o){return r[o]=m(y(e[o]),y(t[o])),r}),{})},t.toObjectOverride=y,t.useOverrides=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.useMemo((function(){return Object.keys(e).reduce((function(r,o){return r[o]=g(t[o],e[o]),r}),{})}),[t])};var o,n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==p(e)&&"function"!==typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=n?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,r&&r.set(e,o);return o}(r(66845)),i=r(75738),l=(o=r(70924))&&o.__esModule?o:{default:o};function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},s.apply(this,arguments)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e){return(0,i.isValidElementType)(e)?e:e&&"object"===p(e)?e.component:e}function b(e){return e&&"object"===p(e)?"object"===p(e.props)?d(d({},e.props),{},{$style:e.style}):{$style:e.style}:{}}function y(e){return(0,i.isValidElementType)(e)?{component:e}:e||{}}function g(e,t){var r=f(e)||t;if(e&&"object"===p(e)&&"function"===typeof e.props){0;var o=n.forwardRef((function(t,o){var i=e.props(t),l=b(d(d({},e),{},{props:i}));return n.createElement(r,s({ref:o},l))}));return o.displayName=r.displayName,[o,{}]}var i=b(e);return[r,i]}function m(e,t){var r=d(d({},e),t);return e.props&&t.props&&(r.props=h(e.props,t.props)),e.style&&t.style&&(r.style=h(e.style,t.style)),r}function h(e,t){return"object"===p(e)&&"object"===p(t)?(0,l.default)({},e,t):function(){return(0,l.default)({},"function"===typeof e?e.apply(void 0,arguments):e,"function"===typeof t?t.apply(void 0,arguments):t)}}},13373:(e,t,r)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!==typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=i?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}n.default=e,r&&r.set(e,n);return n}(r(66845)),l=r(71077),a=r(92990),s=(n=r(86737))&&n.__esModule?n:{default:n},u=["title","size","color","overrides"];function d(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},c.apply(this,arguments)}function p(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);l=!0);}catch(s){a=!0,n=s}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(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.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function y(e,t){var r=f((0,l.useStyletron)(),2)[1],o=e.title,n=void 0===o?"Delete Alt":o,d=e.size,b=e.color,y=e.overrides,g=void 0===y?{}:y,m=p(e,u),h=(0,a.mergeOverride)({component:r.icons&&r.icons.DeleteAlt?r.icons.DeleteAlt:null},g&&g.Svg?(0,a.toObjectOverride)(g.Svg):{});return i.createElement(s.default,c({viewBox:"0 0 24 24",ref:t,title:n,size:d,color:b,overrides:{Svg:h}},m),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var g=i.forwardRef(y);t.default=g},86737:(e,t,r)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!==typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=i?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}n.default=e,r&&r.set(e,n);return n}(r(66845)),l=r(92990),a=r(61637),s=(n=r(72620))&&n.__esModule?n:{default:n},u=["children","title","size","color","overrides"];function d(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},c.apply(this,arguments)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);l=!0);}catch(s){a=!0,n=s}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(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.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function m(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var h=function(e,t){var r=e.children,o=e.title,n=e.size,d=e.color,p=e.overrides,b=void 0===p?{}:p,g=m(e,u),h=y((0,l.getOverrides)(b.Svg,a.Svg),2),v=h[0],O=h[1],S=v.__STYLETRON__?f(f({title:o,$color:d,$size:n},g),O):f(f({title:o,color:d,size:n},(0,s.default)(g)),(0,s.default)(O));return i.createElement(v,c({"data-baseweb":"icon",ref:t},S),o?i.createElement("title",null,o):null,r)},v=i.forwardRef(h);t.default=v},72620:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={};for(var r in e)"$"!==r[0]&&(t[r]=e[r]);return t}},61637:(e,t,r)=>{function o(e){var t=e.$theme,r=e.$size,o=e.$color,n=t.sizing.scale600;r&&(n=t.sizing[r]?t.sizing[r]:"number"===typeof r?"".concat(r,"px"):r);var i="currentColor";return o&&(i=t.colors[o]?t.colors[o]:o),{display:"inline-block",fill:i,color:i,height:n,width:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.Svg=void 0,t.getSvgStyles=o;var n=(0,r(71077).styled)("svg",o);t.Svg=n,n.displayName="Svg",n.displayName="Svg"},80912:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.STATE_CHANGE_TYPE=t.SIZE=t.ENHANCER_POSITION=t.CUSTOM_INPUT_TYPE=t.ADJOINED=void 0;t.STATE_CHANGE_TYPE={change:"change"};t.CUSTOM_INPUT_TYPE={textarea:"textarea"};t.ADJOINED={none:"none",left:"left",right:"right",both:"both"};t.SIZE={mini:"mini",default:"default",compact:"compact",large:"large"};t.ENHANCER_POSITION={start:"start",end:"end"}},27420:(e,t,r)=>{t.i=void 0;var o,n=r(71077),i=r(80912),l=(o=r(13373))&&o.__esModule?o:{default:o};function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=(0,n.styled)("button",(function(e){var t,r=e.$theme,o=e.$size,n=e.$isFocusVisible,l=(t={},u(t,i.SIZE.mini,r.sizing.scale400),u(t,i.SIZE.compact,r.sizing.scale400),u(t,i.SIZE.default,r.sizing.scale300),u(t,i.SIZE.large,r.sizing.scale200),t)[o];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:l,paddingRight:l,outline:n?"solid 3px ".concat(r.colors.accent):"none",color:r.colors.contentPrimary}}));d.displayName="StyledMaskToggleButton",d.displayName="StyledMaskToggleButton";var c=(0,n.styled)("div",(function(e){var t,r=e.$alignTop,o=void 0!==r&&r,n=e.$size,l=e.$theme,a=(t={},u(t,i.SIZE.mini,l.sizing.scale200),u(t,i.SIZE.compact,l.sizing.scale200),u(t,i.SIZE.default,l.sizing.scale100),u(t,i.SIZE.large,l.sizing.scale0),t)[n];return{display:"flex",alignItems:o?"flex-start":"center",paddingLeft:a,paddingRight:a,paddingTop:o?l.sizing.scale500:"0px",color:l.colors.contentPrimary}}));c.displayName="StyledClearIconContainer",c.displayName="StyledClearIconContainer";var p=(0,n.styled)(l.default,(function(e){var t=e.$theme;return{cursor:"pointer",outline:e.$isFocusVisible?"solid 3px ".concat(t.colors.accent):"none"}}));function f(e,t){var r;return(r={},u(r,i.SIZE.mini,t.font100),u(r,i.SIZE.compact,t.font200),u(r,i.SIZE.default,t.font300),u(r,i.SIZE.large,t.font400),r)[e]}t.i=p,p.displayName="StyledClearIcon",p.displayName="StyledClearIcon";var b=function(e){var t=e.$isFocused,r=e.$adjoined,o=e.$error,n=e.$disabled,l=e.$positive,a=e.$size,u=e.$theme,d=e.$theme,c=d.borders,p=d.colors,b=d.sizing,y=d.typography,g=d.animation,m=e.$hasIconTrailing;return s(s(s(s({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:g.timing200,transitionTimingFunction:g.easeOutCurve},function(e,t){var r=t.inputBorderRadius;return e===i.SIZE.mini&&(r=t.inputBorderRadiusMini),{borderTopLeftRadius:r,borderBottomLeftRadius:r,borderTopRightRadius:r,borderBottomRightRadius:r}}(a,c)),f(a,y)),function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:n.inputFillDisabled,borderRightColor:n.inputFillDisabled,borderTopColor:n.inputFillDisabled,borderBottomColor:n.inputFillDisabled,backgroundColor:n.inputFillDisabled}:t?{borderLeftColor:n.borderSelected,borderRightColor:n.borderSelected,borderTopColor:n.borderSelected,borderBottomColor:n.borderSelected,backgroundColor:n.inputFillActive}:r?{borderLeftColor:n.inputBorderError,borderRightColor:n.inputBorderError,borderTopColor:n.inputBorderError,borderBottomColor:n.inputBorderError,backgroundColor:n.inputFillError}:o?{borderLeftColor:n.inputBorderPositive,borderRightColor:n.inputBorderPositive,borderTopColor:n.inputBorderPositive,borderBottomColor:n.inputBorderPositive,backgroundColor:n.inputFillPositive}:{borderLeftColor:n.inputBorder,borderRightColor:n.inputBorder,borderTopColor:n.inputBorder,borderBottomColor:n.inputBorder,backgroundColor:n.inputFill}}(n,t,o,l,p)),function(e,t,r,o,n){var l=e===i.ADJOINED.both||e===i.ADJOINED.left&&"rtl"!==o||e===i.ADJOINED.right&&"rtl"===o||n&&"rtl"===o,a=e===i.ADJOINED.both||e===i.ADJOINED.right&&"rtl"!==o||e===i.ADJOINED.left&&"rtl"===o||n&&"rtl"!==o;return{paddingLeft:l?r.scale550:"0px",paddingRight:a?r.scale550:"0px"}}(r,0,b,u.direction,m))};var y=(0,n.styled)("div",b);y.displayName="Root",y.displayName="Root";var g=(0,n.styled)("div",(function(e){var t=e.$size,r=e.$disabled,o=e.$isFocused,n=e.$error,l=e.$positive,a=e.$theme,d=a.colors,c=a.sizing,p=a.typography,b=a.animation;return s(s(s({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:b.timing200,transitionTimingFunction:b.easeOutCurve},f(t,p)),function(e,t){var r;return(r={},u(r,i.SIZE.mini,{paddingRight:t.scale400,paddingLeft:t.scale400}),u(r,i.SIZE.compact,{paddingRight:t.scale400,paddingLeft:t.scale400}),u(r,i.SIZE.default,{paddingRight:t.scale300,paddingLeft:t.scale300}),u(r,i.SIZE.large,{paddingRight:t.scale200,paddingLeft:t.scale200}),r)[e]}(t,c)),function(e,t,r,o,n){return e?{color:n.inputEnhancerTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}(r,o,n,l,d))}));g.displayName="InputEnhancer",g.displayName="InputEnhancer";var m=function(e){var t=e.$isFocused,r=e.$error,o=e.$disabled,n=e.$positive,i=e.$size,l=e.$theme,a=l.colors,u=l.typography,d=l.animation;return s(s({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:d.timing200,transitionTimingFunction:d.easeOutCurve},f(i,u)),function(e,t,r,o,n){return e?{color:n.inputTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}(o,t,r,n,a))};var h=(0,n.styled)("div",m);h.displayName="InputContainer",h.displayName="InputContainer";var v=function(e){var t=e.$disabled,r=(e.$isFocused,e.$error,e.$size),o=e.$theme,n=o.colors,l=o.sizing;return s(s(s({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:t?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},f(r,o.typography)),function(e,t){var r;return(r={},u(r,i.SIZE.mini,{paddingTop:t.scale100,paddingBottom:t.scale100,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.compact,{paddingTop:t.scale200,paddingBottom:t.scale200,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.default,{paddingTop:t.scale400,paddingBottom:t.scale400,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.large,{paddingTop:t.scale550,paddingBottom:t.scale550,paddingLeft:t.scale550,paddingRight:t.scale550}),r)[e]}(r,l)),function(e,t,r,o){return e?{color:o.inputTextDisabled,"-webkit-text-fill-color":o.inputTextDisabled,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholderDisabled}}:{color:o.contentPrimary,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholder}}}(t,0,0,n))};var O=(0,n.styled)("input",v);O.displayName="Input",O.displayName="Input"},70924:(e,t)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e){return Array.isArray(e)||"[object Object]"=={}.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){t=t||{};for(var n,i,l=arguments.length<=1?0:arguments.length-1,a=0;a<l;a++)for(var s in n=(a+1<1||arguments.length<=a+1?void 0:arguments[a+1])||{})void 0!==r(n[s])&&(o(i=n[s])?t[s]=e(t[s]||Array.isArray(i)&&[]||{},i):t[s]=i);return t}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7175],{79986:(e,t,r)=>{r.d(t,{Z:()=>u});r(66845);var o,n=r(50641),a=r(86659),l=r(50669),i=r(1515);const s=(0,r(7865).F4)(o||(o=(0,l.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),d=(0,i.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:o}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:o.colors.gray,margin:"0 5px"}}:{},...r?{color:o.colors.red,animationName:"".concat(s),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const u=e=>{let{dirty:t,value:r,maxLength:o,className:l,type:i="single",inForm:s}=e;const u=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u.push((0,c.jsx)(d,{includeDot:u.length>0,shouldBlink:t,children:e},u.length))};if(t){const e=s?"submit form":"apply";if("multiline"===i){const t=(0,n.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===i&&p("Press Enter to ".concat(e))}return o&&("chat"!==i||t)&&p("".concat(r.length,"/").concat(o),t&&r.length>=o),(0,c.jsx)(a.X7,{"data-testid":"InputInstructions",className:l,children:u})}},87814:(e,t,r)=>{r.d(t,{K:()=>n});var o=r(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,o.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},67175:(e,t,r)=>{r.r(t),r.d(t,{default:()=>j});var o=r(66845),n=r(20607),a=r(89997),l=r(25621),i=r(52347),s=r(82534),d=r(70479),c=r.n(d),u=r(50641),p=r(87814),m=r(23849),b=r(16295),g=r(48266),h=r(8879),f=r(68411),v=r(46927),y=r(79986),I=r(98478),x=r(86659),w=r(1515);const C=(0,w.Z)("div",{target:"e116k4er3"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}}}),""),T=(0,w.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),k=(0,w.Z)("button",{target:"e116k4er1"})((e=>{let{theme:t}=e;return{margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:"".concat(32,"px"),justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}}}),""),R=(0,w.Z)("div",{target:"e116k4er0"})((e=>{let{theme:t,clearable:r}=e;return{position:"absolute",marginRight:t.spacing.twoXS,left:0,right:"".concat(64+(r?12:0),"px")}}),"");var D=r(40864);const F=e=>{let{step:t,dataType:r}=e;return t||(r===b.Y2.DataType.INT?1:.01)},N=e=>{let{value:t,format:r,step:o,dataType:n}=e;if((0,u.le)(t))return null;let a=function(e){return(0,u.le)(e)||""===e?void 0:e}(r);if((0,u.le)(a)&&(0,u.bb)(o)){const e=o.toString();if(n===b.Y2.DataType.FLOAT&&0!==o&&e.includes(".")){const t=e.split(".")[1].length;a="%0.".concat(t,"f")}}if((0,u.le)(a))return t.toString();try{return(0,i.sprintf)(a,t)}catch(l){return(0,m.KE)("Error in sprintf(".concat(a,", ").concat(t,"): ").concat(l)),String(t)}},j=(0,l.b)((e=>{var t;let{disabled:r,element:l,widgetMgr:i,width:d,theme:m,fragmentId:w}=e;const{dataType:j,id:W,formId:L,default:S,format:B}=l,M=l.hasMin?l.min:-1/0,Z=l.hasMax?l.max:1/0,[E,V]=o.useState(F(l)),U=(e=>{var t;const r=e.element.dataType===b.Y2.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element);return null!==(t=null!==r&&void 0!==r?r:e.element.default)&&void 0!==t?t:null})({element:l,widgetMgr:i}),[z,A]=o.useState(!1),[_,Y]=o.useState(U),[K,O]=o.useState(N({value:U,...l,step:E})),[P,H]=o.useState(!1),G=o.useRef(null),X=o.useRef(new p.K),$=o.useRef(c()("number_input_")),q=((e,t,r)=>!(0,u.le)(e)&&e-t>=r)(_,E,M),J=((e,t,r)=>!(0,u.le)(e)&&e+t<=r)(_,E,Z);o.useEffect((()=>{V(F({step:l.step,dataType:l.dataType}))}),[l.dataType,l.step]);const Q=o.useCallback((e=>{let{value:t,source:r}=e;if((0,u.bb)(t)&&(M>t||t>Z)){var o;null===(o=G.current)||void 0===o||o.reportValidity()}else{var n;const e=null!==(n=null!==t&&void 0!==t?t:S)&&void 0!==n?n:null;switch(j){case b.Y2.DataType.INT:i.setIntValue({id:W,formId:L},e,r,w);break;case b.Y2.DataType.FLOAT:i.setDoubleValue({id:W,formId:L},e,r,w);break;default:throw new Error("Invalid data type")}A(!1),Y(e),O(N({value:e,dataType:j,format:B,step:E}))}}),[M,Z,G,i,w,E,j,W,L,S,B]),ee=()=>{const{value:e}=l;l.setValue=!1,Y(null!==e&&void 0!==e?e:null),O(N({value:null!==e&&void 0!==e?e:null,...l,step:E})),Q({value:null!==e&&void 0!==e?e:null,source:{fromUi:!1}})};o.useEffect((()=>{const e=X.current;return l.setValue?ee():Q({value:_,source:{fromUi:!1}}),()=>{e.disconnect()}}),[]),l.setValue&&ee();const te=(0,u.le)(l.default)&&!r;X.current.manageFormClearListener(i,l.formId,(()=>{var e;Y(null!==(e=l.default)&&void 0!==e?e:null),Q({value:_,source:{fromUi:!0}})}));const re=o.useCallback((()=>{J&&(A(!0),Q({value:(null!==_&&void 0!==_?_:M)+E,source:{fromUi:!0}}))}),[_,M,E,J]),oe=o.useCallback((()=>{q&&(A(!0),Q({value:(null!==_&&void 0!==_?_:Z)-E,source:{fromUi:!0}}))}),[_,Z,E,q]),ne=o.useCallback((e=>{const{key:t}=e;switch(t){case"ArrowUp":e.preventDefault(),re();break;case"ArrowDown":e.preventDefault(),oe()}}),[re,oe]),ae=o.useCallback((e=>{"Enter"===e.key&&(z&&Q({value:_,source:{fromUi:!0}}),(0,u.$b)({formId:L})&&i.submitForm(L,w))}),[z,_,Q,i,L,w]);return(0,D.jsxs)("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:d},children:[(0,D.jsx)(I.O,{label:l.label,disabled:r,labelVisibility:(0,u.iF)(null===(t=l.labelVisibility)||void 0===t?void 0:t.value),htmlFor:$.current,children:l.help&&(0,D.jsx)(x.dT,{children:(0,D.jsx)(h.Z,{content:l.help,placement:f.u.TOP_RIGHT})})}),(0,D.jsxs)(C,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[(0,D.jsx)(s.Z,{type:"number",inputRef:G,value:null!==K&&void 0!==K?K:"",placeholder:l.placeholder,onBlur:()=>(z&&Q({value:_,source:{fromUi:!0}}),void H(!1)),onFocus:()=>{H(!0)},onChange:e=>(e=>{const{value:t}=e.target;if(""===t)A(!0),Y(null),O(null);else{let e;e=l.dataType===b.Y2.DataType.INT?parseInt(t,10):parseFloat(t),A(!0),Y(e),O(t)}})(e),onKeyPress:e=>ae(e),onKeyDown:e=>ne(e),clearable:te,clearOnEscape:te,disabled:r,"aria-label":l.label,id:$.current,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:m.colors.darkGray,transform:"scale(1.4)",width:m.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:m.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInput-Input",step:E,min:M,max:Z},style:{lineHeight:m.lineHeights.inputWidget,paddingRight:m.spacing.sm,paddingLeft:m.spacing.sm,paddingBottom:m.spacing.sm,paddingTop:m.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),d>g.A.hideNumberInputControls&&(0,D.jsxs)(T,{children:[(0,D.jsx)(k,{className:"step-down","data-testid":"stNumberInput-StepDown",onClick:oe,disabled:!q||r,tabIndex:-1,children:(0,D.jsx)(v.Z,{content:n.W,size:"xs",color:q?"inherit":"disabled"})}),(0,D.jsx)(k,{className:"step-up","data-testid":"stNumberInput-StepUp",onClick:re,disabled:!J||r,tabIndex:-1,children:(0,D.jsx)(v.Z,{content:a.v,size:"xs",color:J?"inherit":"disabled"})})]})]}),d>g.A.hideWidgetDetails&&(0,D.jsx)(R,{clearable:te,children:(0,D.jsx)(y.Z,{dirty:z,value:null!==K&&void 0!==K?K:"",inForm:(0,u.$b)({formId:l.formId})})})]})}))}}]);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7602],{90186:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(66845),r=s(25621),o=s(38570),a=s(80318),n=s(27466),l=s(66694),d=s(40864);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(l.E),f=!(0,n.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(o.Z,{value:t,overrides:(0,a.aO)(S,u)})}},47602:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(66845),o=s(47869),a=s(18080),n=s(62813),l=s.n(n),d=s(16295),c=s(46927),h=s(68411),u=s(8879),g=s(98478),p=s(86659),m=s(87814),f=s(23849),S=s(50641),C=s(77367),R=s(90186),b=s(1515),w=s(35704);function x(e,t){switch(e){case i.XSMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.sm),fontSize:t.fontSizes.sm};case i.SMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.md)};case i.LARGE:return{padding:"".concat(t.spacing.md," ").concat(t.spacing.md)};default:return{padding:"".concat(t.spacing.xs," ").concat(t.spacing.md)}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const F=(0,b.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),I=(0,b.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:"".concat(t.radii.default," ").concat(t.radii.default," 0 0"),width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),v=(0,b.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,b.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:"".concat(t.radii.default," ").concat(t.radii.default," 0 0"),objectFit:"contain",opacity:s}}),""),y=(0,b.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,b.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),T=(0,b.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),j=(0,b.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),L=(0,b.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:"".concat(t.sizes.borderWidth," solid ").concat(t.colors.fadedText10),borderRadius:"0 0 ".concat(t.radii.default," ").concat(t.radii.default),"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:"".concat(t.spacing.xs," ").concat(t.spacing.md),margin:0,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,w.DZ)(t.colors.primary,.5))},...x(i.MEDIUM,t)}}),"");var U=s(40864);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(L,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(j,{children:(0,U.jsx)(R.Z,{value:r,size:R.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(77979),z=s(9003),Z=s(81354),D=s(11765);let O;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(O||(O={}));const X=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(T,{"data-testid":"stCameraSwitchButton",children:(0,U.jsx)(h.Z,{content:"Switch camera",placement:h.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:Z.nW.MINIMAL,onClick:t,children:(0,U.jsx)(c.Z,{content:k.Z,size:"twoXL",color:D.Z.white})})})})};var B=s(3084),W=s(25621),_=s(91706),A=s(48051),V=s.n(A),G=s(84192);let N;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(N||(N={}));const H=e=>{let{width:t}=e;return(0,U.jsxs)(I,{width:t,children:[(0,U.jsx)(c.Z,{size:"threeXL",color:D.Z.gray60,content:B.n}),(0,U.jsxs)(v,{children:["This app would like to use your camera.",(0,U.jsx)(y,{href:G.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},$=e=>{let{handleCapture:t,width:s,disabled:i,clearPhotoInProgress:o,setClearPhotoInProgress:a,facingMode:n,setFacingMode:l,testOverride:d}=e;const[c,h]=(0,r.useState)(d||N.PENDING),u=(0,r.useRef)(null),[g,p]=(0,r.useState)(s),m=(0,r.useCallback)((0,S.Ds)(1e3,p),[]);(0,r.useEffect)((()=>{m(s)}),[s,m]);const f=(0,W.u)();return(0,U.jsxs)(F,{width:g,"data-testid":"stWebcamComponent",children:[c===N.SUCCESS||i||o?_.tq&&(0,U.jsx)(X,{switchFacingMode:l}):(0,U.jsx)(H,{width:g}),(0,U.jsx)(I,{"data-testid":"stWebcamStyledBox",hidden:c!==N.SUCCESS&&!i&&!o,width:g,children:!i&&(0,U.jsx)(V(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:"".concat(f.radii.default," ").concat(f.radii.default," 0 0")},onUserMediaError:()=>{h(N.ERROR)},onUserMedia:()=>{h(N.SUCCESS),a(!1)},videoConstraints:{width:{ideal:g},facingMode:n}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==N.SUCCESS||i||o,children:"Take Photo"})]})};class K extends r.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===O.USER?O.ENVIRONMENT:O.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s="camera-input-".concat((new Date).toISOString().replace(/:/g,"_"),".jpg"),fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props,r=s.getFileUploaderStateValue(t);l()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if(null==e)return;this.setState({imgSrc:null});const{widgetMgr:t,element:s,fragmentId:i}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},i)}))},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);null!=s&&"uploading"===s.status.type&&this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(null==s||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=a.Z.CancelToken.source(),i=new C.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{a.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:O.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if(null==i)return e;const{uploadedFileInfo:r}=i;return null==r||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new C.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:O.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1},i)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new d.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:r}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(F,{width:r,className:"row-widget","data-testid":"stCameraInput",children:[(0,U.jsx)(g.O,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(p.dT,{children:(0,U.jsx)(u.Z,{content:t.help,placement:h.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{width:r,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:r,height:9*r/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(c.Z,{content:o.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)($,{handleCapture:this.handleCapture,width:r,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},77367:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},87814:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7602],{90186:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(66845),r=s(25621),o=s(38570),a=s(80318),n=s(27466),l=s(66694),d=s(40864);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(l.E),f=!(0,n.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(o.Z,{value:t,overrides:(0,a.aO)(S,u)})}},47602:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(66845),o=s(47869),a=s(18080),n=s(62813),l=s.n(n),d=s(16295),c=s(46927),h=s(68411),u=s(8879),g=s(98478),p=s(86659),m=s(87814),f=s(23849),S=s(50641),C=s(77367),R=s(90186),b=s(1515),w=s(35704);function x(e,t){switch(e){case i.XSMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.sm),fontSize:t.fontSizes.sm};case i.SMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.md)};case i.LARGE:return{padding:"".concat(t.spacing.md," ").concat(t.spacing.md)};default:return{padding:"".concat(t.spacing.xs," ").concat(t.spacing.md)}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const F=(0,b.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),I=(0,b.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:"".concat(t.radii.default," ").concat(t.radii.default," 0 0"),width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),v=(0,b.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,b.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:"".concat(t.radii.default," ").concat(t.radii.default," 0 0"),objectFit:"contain",opacity:s}}),""),y=(0,b.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,b.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),T=(0,b.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),j=(0,b.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),L=(0,b.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:"".concat(t.sizes.borderWidth," solid ").concat(t.colors.fadedText10),borderRadius:"0 0 ".concat(t.radii.default," ").concat(t.radii.default),"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:"".concat(t.spacing.xs," ").concat(t.spacing.md),margin:0,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,w.DZ)(t.colors.primary,.5))},...x(i.MEDIUM,t)}}),"");var U=s(40864);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(L,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(j,{children:(0,U.jsx)(R.Z,{value:r,size:R.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(77979),z=s(9003),Z=s(81354),D=s(11765);let O;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(O||(O={}));const X=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(T,{"data-testid":"stCameraSwitchButton",children:(0,U.jsx)(h.Z,{content:"Switch camera",placement:h.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:Z.nW.MINIMAL,onClick:t,children:(0,U.jsx)(c.Z,{content:k.Z,size:"twoXL",color:D.Z.white})})})})};var B=s(3084),W=s(25621),_=s(91706),A=s(48051),V=s.n(A),G=s(84192);let N;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(N||(N={}));const H=e=>{let{width:t}=e;return(0,U.jsxs)(I,{width:t,children:[(0,U.jsx)(c.Z,{size:"threeXL",color:D.Z.gray60,content:B.n}),(0,U.jsxs)(v,{children:["This app would like to use your camera.",(0,U.jsx)(y,{href:G.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},$=e=>{let{handleCapture:t,width:s,disabled:i,clearPhotoInProgress:o,setClearPhotoInProgress:a,facingMode:n,setFacingMode:l,testOverride:d}=e;const[c,h]=(0,r.useState)(d||N.PENDING),u=(0,r.useRef)(null),[g,p]=(0,r.useState)(s),m=(0,r.useCallback)((0,S.Ds)(1e3,p),[]);(0,r.useEffect)((()=>{m(s)}),[s,m]);const f=(0,W.u)();return(0,U.jsxs)(F,{width:g,"data-testid":"stWebcamComponent",children:[c===N.SUCCESS||i||o?_.tq&&(0,U.jsx)(X,{switchFacingMode:l}):(0,U.jsx)(H,{width:g}),(0,U.jsx)(I,{"data-testid":"stWebcamStyledBox",hidden:c!==N.SUCCESS&&!i&&!o,width:g,children:!i&&(0,U.jsx)(V(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:"".concat(f.radii.default," ").concat(f.radii.default," 0 0")},onUserMediaError:()=>{h(N.ERROR)},onUserMedia:()=>{h(N.SUCCESS),a(!1)},videoConstraints:{width:{ideal:g},facingMode:n}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==N.SUCCESS||i||o,children:"Take Photo"})]})};class K extends r.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===O.USER?O.ENVIRONMENT:O.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s="camera-input-".concat((new Date).toISOString().replace(/:/g,"_"),".jpg"),fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props,r=s.getFileUploaderStateValue(t);l()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if((0,S.le)(e))return;this.setState({imgSrc:null});const{widgetMgr:t,element:s,fragmentId:i}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},i)}))},this.deleteFile=e=>{const t=this.getFile(e);(0,S.le)(t)||("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);(0,S.le)(s)||"uploading"!==s.status.type||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if((0,S.le)(s)||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=a.Z.CancelToken.source(),i=new C.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{a.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:O.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if((0,S.le)(i))return e;const{uploadedFileInfo:r}=i;return(0,S.le)(r)||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new C.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:O.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1},i)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new d.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:r}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(F,{width:r,className:"row-widget","data-testid":"stCameraInput",children:[(0,U.jsx)(g.O,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(p.dT,{children:(0,U.jsx)(u.Z,{content:t.help,placement:h.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{width:r,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:r,height:9*r/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(c.Z,{content:o.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)($,{handleCapture:this.handleCapture,width:r,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},77367:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},87814:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){(0,i.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8148],{23593:(e,t,n)=>{n.d(t,{Z:()=>b});var i=n(66845),o=n(13005),l=n.n(o),r=n(25621),a=n(82218),s=n(97781),d=n(46927),c=n(66694),u=n(1515);const m=(0,u.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:n}=e;const i=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:n.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:n.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:n.colors.fadedText60,borderRadius:"50%",...i,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:n.colors.bodyText,transition:"none"}}}),""),h=(0,u.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:n}=e;return{"&:hover":{[m]:{opacity:1,transform:"scale(1)",transition:"none"}},...n?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var p=n(40864);class g extends i.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels("2.875rem");return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:n}=this.state,{children:i,width:o,height:l,disableFullscreenMode:r}=this.props;let c=a.d,u=this.zoomIn,g="View fullscreen";return e&&(c=s.m,u=this.zoomOut,g="Exit fullscreen"),(0,p.jsxs)(h,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,p.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:u,title:g,isExpanded:e,children:(0,p.jsx)(d.Z,{content:c})}),i(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:l,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.E;const f=(0,r.b)(g);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class n extends i.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:n,height:i,disableFullscreenMode:o}=this.props;return(0,p.jsx)(f,{width:n,height:i,disableFullscreenMode:t||o,children:t=>{let{width:n,height:i,expanded:o,expand:l,collapse:r}=t;return(0,p.jsx)(e,{...this.props,width:n,height:i,isFullScreen:o,expand:l,collapse:r})}})}}}return n.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),l()(n,e)}},75064:(e,t,n)=>{n.r(t),n.d(t,{default:()=>zt});var i=n(66845),o=n(67930),l=n(78170),r=n(17330),a=n(20545),s=n(57463),d=n(97943),c=n(41342),u=n(17875),m=n(87814),h=n(23593),p=n(16295),g=n(50641),f=n(25621),b=n(34367),v=n(31011),y=n(63730),w=n(68411),x=n(9003),C=n(81354),E=n(46927),S=n(1515),M=n(27466);const k="-2.4rem",T=(0,S.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:"".concat(t.spacing.sm," 0 ").concat(t.spacing.sm," ").concat(t.spacing.sm),position:"absolute",top:n?k:"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:k},...i&&{["".concat(i,":hover &, ").concat(i,":active &, ").concat(i,":focus-visible &")]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:k}}}}}),""),R=(0,S.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,M.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var N=n(40864);function I(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const l=(0,f.u)(),r=n?t:"";return(0,N.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,N.jsx)(w.Z,{content:(0,N.jsx)(y.ZP,{source:t,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:w.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,N.jsxs)(x.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:C.nW.ELEMENT_TOOLBAR,children:[i&&(0,N.jsx)(E.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),r&&(0,N.jsx)("span",{children:r})]})})})}const _=e=>{let{onExpand:t,onCollapse:n,isFullScreen:i,locked:o,children:l,target:r,disableFullscreenMode:a}=e;return(0,N.jsx)(T,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:o||i,target:r,children:(0,N.jsxs)(R,{children:[l,t&&!a&&!i&&(0,N.jsx)(I,{label:"Fullscreen",icon:b.i,onClick:()=>t()}),n&&!a&&i&&(0,N.jsx)(I,{label:"Close fullscreen",icon:v.m,onClick:()=>n()})]})})};var O=n(66694),D=n(38145),A=n.n(D),F=n(96825),z=n.n(F),V=n(29724),H=n.n(V),L=n(52347),W=n(53608),j=n.n(W),B=(n(87717),n(55842),n(91191));const P=["true","t","yes","y","on","1"],Z=["false","f","no","n","off","0"];function Y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function U(e){return e.hasOwnProperty("isError")&&e.isError}function q(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function J(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function K(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function G(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function X(e,t){return(0,g.le)(e)?t||{}:(0,g.le)(t)?e||{}:z()(e,t)}function Q(e){if((0,g.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if("string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:$(e))):[$(t)]}catch(t){return[$(e)]}}function $(e){try{try{return A()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return"[".concat(typeof e,"]")}}function ee(e){if((0,g.le)(e))return null;if("boolean"===typeof e)return e;const t=$(e).toLowerCase().trim();return""===t?null:!!P.includes(t)||!Z.includes(t)&&void 0}function te(e){if((0,g.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=H().unformat(e.trim());if((0,g.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function ne(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,g.le)(t)||""===t?(0===n&&(e=Math.round(e)),H()(e).format((0,g.bb)(n)?"0,0.".concat("0".repeat(n)):"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):"duration[ns]"===t?j().duration(e/1e6,"milliseconds").humanize():t.startsWith("period[")?B.fu.formatPeriodType(BigInt(e),t):(0,L.sprintf)(t,e)}function ie(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function oe(e){if((0,g.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=j().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=j().utc(e);if(t.isValid())return t.toDate();const n=j().utc(e,[j().HTML5_FMT.TIME_MS,j().HTML5_FMT.TIME_SECONDS,j().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function le(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const re=new RegExp(/(\r\n|\n|\r)/gm);function ae(e){return-1!==e.indexOf("\n")?e.replace(re," "):e}var se=n(23849);function de(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,g.bb)(e)?$(e):null,i=(0,g.bb)(n)?ae(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,g.le)(e)}}catch(n){return Y($(e),"The value cannot be interpreted as a string. Error: ".concat(n))}},getCellValue:e=>void 0===e.data?null:e.data}}de.isEditableType=!1;const ce=de;function ue(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(r)}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},l=i=>{if((0,g.le)(i))return!e.isRequired;let o=$(i),l=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),l=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!l||o)};return{...e,kind:"text",sortMode:"default",validateInput:l,getCell(e,t){if("string"===typeof n)return Y($(e),n);if(t){const t=l(e);if(!1===t)return Y($(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,g.bb)(e)?$(e):null,n=(0,g.bb)(t)?ae(t):"";return{...i,isMissingValue:(0,g.le)(t),data:t,displayData:n}}catch(r){return Y("Incompatible value","The value cannot be interpreted as string. Error: ".concat(r))}},getCellValue:e=>void 0===e.data?null:e.data}}ue.isEditableType=!0;const me=ue;function he(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function pe(e,t,n,i,l,r,a){var s;const d=X({format:n,step:i,timezone:a},t.columnTypeOptions);let c,u,m;if((0,g.bb)(d.timezone))try{var h;c=(null===(h=he(j()(),d.timezone))||void 0===h?void 0:h.utcOffset())||void 0}catch(b){}(0,g.bb)(d.min_value)&&(u=oe(d.min_value)||void 0),(0,g.bb)(d.max_value)&&(m=oe(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:l,min:u,max:m}},f=e=>{const n=oe(e);return null===n?!t.isRequired:void 0!==n&&(!((0,g.bb)(u)&&r(n)<r(u))&&!((0,g.bb)(m)&&r(n)>r(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return Y($(e),"Invalid input.");t instanceof Date&&(e=t)}const i=oe(e);let o="",l="",r=c;if(void 0===i)return Y($(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=j().utc(i);if(!e.isValid())return Y($(i),"This should never happen. Please report this bug. \nError: ".concat(e.toString()));if(d.timezone){try{e=he(e,d.timezone)}catch(b){return Y(e.toISOString(),"Failed to adjust to the provided timezone: ".concat(d.timezone,". \nError: ").concat(b))}r=e.utcOffset()}try{l=ie(e,d.format||n)}catch(b){return Y(e.toISOString(),"Failed to format the date for rendering with: ".concat(d.format,". \nError: ").concat(b))}o=ie(e,n)}return{...p,copyData:o,isMissingValue:(0,g.le)(i),data:{...p.data,date:i,displayDate:l,timezoneOffset:r}}},getCellValue(e){var t;return(0,g.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:r(e.data.date)}}}function ge(e){var t,n,i,o,l;let r="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?r="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(r="YYYY-MM-DD HH:mm:ss.SSS");const a=null===(i=e.arrowType)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.timezone,s=(0,g.bb)(a)||(0,g.bb)(null===e||void 0===e||null===(l=e.columnTypeOptions)||void 0===l?void 0:l.timezone);return pe("datetime",e,s?r+"Z":r,1,"datetime-local",(e=>s?e.toISOString():e.toISOString().replace("Z","")),a)}function fe(e){var t,n;let i="HH:mm:ss";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(i="HH:mm:ss.SSS"),pe("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function be(e){return pe("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function ve(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=ee(e),void 0===n?Y($(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,g.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}ge.isEditableType=!0,fe.isEditableType=!0,be.isEditableType=!0,ve.isEditableType=!0;const ye=ve;function we(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function xe(e){const t=B.fu.getTypeName(e.arrowType);let n;"timedelta64[ns]"===t?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=X({step:we(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:n},e.columnTypeOptions),l=(0,g.le)(i.min_value)||i.min_value<0,r=(0,g.bb)(i.step)&&!Number.isNaN(i.step)?le(i.step):void 0,a={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:l,fixedDecimals:r,thousandSeparator:""},s=t=>{let n=te(t);if((0,g.le)(n))return!e.isRequired;if(Number.isNaN(n))return!1;let o=!1;return(0,g.bb)(i.max_value)&&n>i.max_value&&(n=i.max_value,o=!0),!((0,g.bb)(i.min_value)&&n<i.min_value)&&(!o||n)};return{...e,kind:"number",sortMode:"smart",validateInput:s,getCell(e,t){if(!0===t){const t=s(e);if(!1===t)return Y($(e),"Invalid input.");"number"===typeof t&&(e=t)}let n=te(e),o="";if((0,g.bb)(n)){if(Number.isNaN(n))return Y($(e),"The value cannot be interpreted as a number.");if((0,g.bb)(r)&&(l=n,n=0===(d=r)?Math.trunc(l):Math.trunc(l*10**d)/10**d),Number.isInteger(n)&&!Number.isSafeInteger(n))return Y($(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=ne(n,i.format,r)}catch(c){return Y($(n),(0,g.bb)(i.format)?"Failed to format the number based on the provided format configuration: (".concat(i.format,"). Error: ").concat(c):"Failed to format the number. Error: ".concat(c))}}var l,d;return{...a,data:n,displayData:o,isMissingValue:(0,g.le)(n),copyData:(0,g.le)(n)?"":$(n)}},getCellValue:e=>void 0===e.data?null:e.data}}xe.isEditableType=!0;const Ce=xe;function Ee(e){let t="string";const n=X({options:"bool"===B.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const l={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>$(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,g.bb)(e)&&""!==e&&(n=$(e)),t&&!l.data.allowedValues.includes(n)?Y($(n),"The value is not part of the allowed options."):{...l,isMissingValue:null===n,copyData:n||"",data:{...l.data,value:n}}},getCellValue(e){var n,i,o,l,r,a,s;return(0,g.le)(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(l=te(null===(r=e.data)||void 0===r?void 0:r.value))&&void 0!==l?l:null:"boolean"===t?null!==(a=ee(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==a?a:null:null===(o=e.data)||void 0===o?void 0:o.value}}}Ee.isEditableType=!0;const Se=Ee;function Me(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.le)(e)?[]:Q(e);return{...t,data:n,isMissingValue:(0,g.le)(e),copyData:(0,g.le)(e)?"":$(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,g.le)(e.data)||q(e)?null:e.data}}Me.isEditableType=!1;const ke=Me;function Te(e,t,n){const i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Re(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===B.fu.getTypeName(n)&&(o=!1),{id:"index-".concat(t),name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Ne(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,g.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===B.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,g.bb)(n)&&(i={options:n})}return{id:"column-".concat(n,"-").concat(t),name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function Ie(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?B.fu.getTypeName(e.arrowType):null;let l;if("object"===e.kind)l=e.getCell((0,g.bb)(t.content)?ae(B.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,g.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var r,a;let n;var s,d,c;if("time"===i&&(0,g.bb)(null===(r=t.field)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.unit))n=j().unix(B.fu.convertToSeconds(t.content,null!==(s=null===(d=t.field)||void 0===d||null===(c=d.type)||void 0===c?void 0:c.unit)&&void 0!==s?s:0)).utc().toDate();else n=j().utc(Number(t.content)).toDate();l=e.getCell(n)}else if("decimal"===i){const n=(0,g.le)(t.content)?null:B.fu.format(t.content,t.contentType,t.field);l=e.getCell(n)}else l=e.getCell(t.content);if(U(l))return l;if(!e.isEditable){if((0,g.bb)(t.displayContent)){var u;const e=ae(t.displayContent);l.kind===o.p6.Text||l.kind===o.p6.Number||l.kind===o.p6.Uri?l={...l,displayData:e}:l.kind===o.p6.Custom&&"date-picker-cell"===(null===(u=l.data)||void 0===u?void 0:u.kind)&&(l={...l,data:{...l.data,displayDate:e}})}n&&t.cssId&&(l=function(e,t,n){const i={},o=Te(t,"color",n);o&&(i.textDark=o);const l=Te(t,"background-color",n);return l&&(i.bgCell=l),"yellow"===l&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(l,t.cssId,n))}return l}function _e(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(a)}if(!(0,g.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(a){i=void 0}const l={kind:o.p6.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},r=i=>{if((0,g.le)(i))return!e.isRequired;const o=$(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:r,getCell(e,o){if((0,g.le)(e))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{}};const s=e;if("string"===typeof n)return Y($(s),n);if(o){if(!1===r(s))return Y($(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,g.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?decodeURI(n[1]):t}catch(a){return t}}(i,s):t.display_text||s),{...l,data:s,displayData:d,isMissingValue:(0,g.le)(s),onClickUri:e=>{window.open(s.startsWith("www.")?"https://".concat(s):s,"_blank","noopener,noreferrer"),e.preventDefault()},copyData:s}},getCellValue:e=>(0,g.le)(e.data)?null:e.data}}_e.isEditableType=!0;const Oe=_e;function De(e){const t={kind:o.p6.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.bb)(e)?[$(e)]:[];return{...t,data:n,isMissingValue:!(0,g.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}De.isEditableType=!1;const Ae=De;function Fe(e){const t=we(B.fu.getTypeName(e.arrowType)),n=X({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=ne(n.max_value,n.format)}catch(a){i=$(n.max_value)}const l=(0,g.le)(n.step)||Number.isNaN(n.step)?void 0:le(n.step),r={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,g.le)(e))return J();if((0,g.le)(n.min_value)||(0,g.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Y("Invalid min/max parameters","The min_value (".concat(n.min_value,") and max_value (").concat(n.max_value,") parameters must be valid numbers."));if((0,g.le)(n.step)||Number.isNaN(n.step))return Y("Invalid step parameter","The step parameter (".concat(n.step,") must be a valid number."));const t=te(e);if(Number.isNaN(t)||(0,g.le)(t))return Y($(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return Y($(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=ne(t,n.format,l)}catch(a){return Y($(t),(0,g.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(a):"Failed to format the number. Error: ".concat(a))}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...r,isMissingValue:(0,g.le)(e),copyData:String(t),data:{...r.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}}}Fe.isEditableType=!1;const ze=Fe;function Ve(e,t,n){const i=X({y_min:0,y_max:1},t.columnTypeOptions),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,g.le)(i.y_min)||(0,g.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return Y("Invalid min/max y-axis configuration","The y_min (".concat(i.y_min,") and y_max (").concat(i.y_max,") configuration options must be valid numbers."));if((0,g.le)(e))return J();const t=Q(e),n=[];let o=[];if(0===t.length)return J();let r=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER;for(let i=0;i<t.length;i++){const e=te(t[i]);if(Number.isNaN(e)||(0,g.le)(e))return Y($(t),"The value cannot be interpreted as a numeric array. ".concat($(e)," is not a number."));e>r&&(r=e),e<a&&(a=e),n.push(e)}return o=n.length>0&&(r>i.y_max||a<i.y_min)?n.map((e=>r-a===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-a)/(r-a))+(i.y_min||0))):n,{...l,copyData:n.join(","),data:{...l.data,values:o,displayValues:n.map((e=>ne(e)))},isMissingValue:(0,g.le)(e)}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}}}function He(e){return Ve("line_chart",e,"line")}function Le(e){return Ve("bar_chart",e,"bar")}function We(e){return Ve("area_chart",e,"area")}He.isEditableType=!1,Le.isEditableType=!1,We.isEditableType=!1;const je=new Map(Object.entries({object:ce,text:me,checkbox:ye,selectbox:Se,list:ke,number:Ce,link:Oe,datetime:ge,date:be,time:fe,line_chart:He,bar_chart:Le,area_chart:We,image:Ae,progress:ze})),Be=[],Pe="_index",Ze="_pos:",Ye={small:75,medium:200,large:400};function Ue(e){if(!(0,g.le)(e))return"number"===typeof e?e:e in Ye?Ye[e]:void 0}function qe(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Pe?n=t.get(e.name):t.has("".concat(Ze).concat(e.indexNumber))?n=t.get("".concat(Ze).concat(e.indexNumber)):e.isIndex&&t.has(Pe)&&(n=t.get(Pe)),n?z()({...e},{title:n.label,width:Ue(n.width),isEditable:(0,g.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function Je(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,g.bb)(n)&&(je.has(n)?i=je.get(n):(0,se.KE)("Unknown column type configured in column configuration: ".concat(n))),(0,g.le)(i)&&(i=function(e){let t=e?B.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?me:["datetime","datetimetz"].includes(t)?ge:"time"===t?fe:"date"===t?be:["object","bytes"].includes(t)?ce:["bool"].includes(t)?ye:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?Ce:"categorical"===t?Se:t.startsWith("list")?ke:ce):ce}(e.arrowType)),i}const Ke=function(e,t,n){const o=(0,f.u)(),l=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,se.H)(t),new Map}}(e.columns)),[e.columns]),r=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){const t=[],{dimensions:n}=e,i=n.headerColumns,o=n.dataColumns;if(0===i&&0===o)return t.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),t;for(let l=0;l<i;l++){const n={...Re(e,l),indexNumber:l};t.push(n)}for(let l=0;l<o;l++){const n={...Ne(e,l),indexNumber:l+i};t.push(n)}return t}(t).map((t=>{let i={...t,...qe(t,l),isStretched:r};const a=Je(i);return(e.editingMode===p.Eh.EditingMode.READ_ONLY||n||!1===a.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==p.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===p.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),a(i,o)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[ce({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,l,r,n,e.editingMode,e.columnOrder,o])}};function Ge(e){return e.isIndex?Pe:(0,g.le)(e.name)?"":e.name}const Xe=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const l={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(l[Ge(o)]=o.getCellValue(e))})),n.edited_rows[i]=l})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,l)=>{const r=t.get(n);if(r){const t=r.getCellValue(e);r.isRequired&&r.isEditable&&q(e)&&(o=!0),(0,g.bb)(t)&&(i[Ge(r)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Ge(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],l=o.get(e);if(l){const e=l.getCell(n);var r;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(r=this.editedCells.get(t))||void 0===r||r.set(l.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const n=new Map;t.forEach((e=>{n.set(e.indexNumber,e.getCell(null))})),Object.keys(e).forEach((t=>{const i=e[t],l=o.get(t);if(l){const e=l.getCell(i);e&&n.set(l.indexNumber,e)}})),this.addedRows.push(n)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map);this.editedCells.get(t).set(e,n)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,g.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var Qe=n(35704);const $e=function(){const e=(0,f.u)(),t=i.useMemo((()=>({editable:e=>'<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="'.concat(e.bgColor,'"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>')})),[]);return{theme:i.useMemo((()=>({accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,Qe.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Qe.DZ)(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:"".concat(e.fontSizes.sm),baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,Qe.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25})),[e]),tableBorderRadius:e.radii.default,headerIcons:t}};const et=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[l,r]=i;if(l>t.length-1)return Y("Column index out of bounds.","This should never happen. Please report this bug.");if(r>n-1)return Y("Row index out of bounds.","This should never happen. Please report this bug.");const a=t[l],s=a.indexNumber,d=o.current.getOriginalRowIndex(r),c=o.current.isAddedRow(d);if(a.isEditable||c){const e=o.current.getCell(s,d);if((0,g.bb)(e))return e;if(c)return Y("Error during cell creation.","This should never happen. Please report this bug. "+"No cell found for an added row: col=".concat(s,"; row=").concat(d))}try{return Ie(a,e.getCell(d+1,s),e.cssStyles)}catch(u){return Y("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(u))}}),[t,n,e,o])}};var tt=n(32700);const nt=function(e,t,n){const[o,l]=i.useState(),{getCellContent:r,getOriginalIndex:a}=(0,tt.fF)({columns:t.map((e=>G(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void l(void 0);t="desc"}l({column:G(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:a,getCellContent:r}};var it=n(62813),ot=n.n(it);const lt=function(e,t,n,l,r){const[a,s]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),d=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW)||e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_ROW)),c=d&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN)),m=u&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN),h=a.rows.length>0,g=a.columns.length>0,f=void 0!==a.current,b=i.useCallback((e=>{const t=!ot()(e.rows.toArray(),a.rows.toArray()),n=!ot()(e.columns.toArray(),a.columns.toArray()),i=!ot()(e.current,a.current);let o=d&&t||u&&n,c=e;if((d||u)&&void 0!==e.current&&i&&(c={...e,rows:a.rows,columns:a.columns},o=!1),t&&e.rows.length>0&&n&&0===e.columns.length&&(c={...c,columns:a.columns},o=!0),n&&e.columns.length>0&&t&&0===e.rows.length&&(c={...c,rows:a.rows},o=!0),n&&c.columns.length>=0){let e=c.columns;l.forEach(((t,n)=>{t.isIndex&&(e=e.remove(n))})),e.length<c.columns.length&&(c={...c,columns:e})}s(c),o&&r(c)}),[a,d,u,r,l]),v=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={columns:t?a.columns:o.EV.empty(),rows:e?a.rows:o.EV.empty(),current:void 0};s(n),(!e&&d||!t&&u)&&r(n)}),[a,d,u,r]);return{gridSelection:a,isRowSelectionActivated:d,isMultiRowSelectionActivated:c,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:m,isRowSelected:h,isColumnSelected:g,isCellSelected:f,clearSelection:v,processSelectionChange:b}},rt=",",at='"',st='"',dt="\n",ct="\ufeff",ut=new RegExp("[".concat([rt,at,dt].join(""),"]"));function mt(e){return e.map((e=>function(e){if((0,g.le)(e))return"";const t=$(e);if(ut.test(t))return"".concat(at).concat(t.replace(new RegExp(at,"g"),st+at)).concat(at);return t}(e))).join(rt)+dt}async function ht(e,t,n,i){const o=new TextEncoder;await e.write(o.encode(ct));const l=n.map((e=>e.name));await e.write(o.encode(mt(l)));for(let r=0;r<i;r++){const i=[];n.forEach(((e,n,o)=>{i.push(e.getCellValue(t([n,r])))})),await e.write(o.encode(mt(i)))}await e.close()}const pt=function(e,t,o,l){return{exportToCsv:i.useCallback((async()=>{const i=(new Date).toISOString().slice(0,16).replace(":","-"),r="".concat(i,"_export.csv");try{const i=await n.e(5345).then(n.bind(n,95345)),l=await i.showSaveFilePicker({suggestedName:r,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),a=await l.createWritable();await ht(a,e,t,o)}catch(a){if(a instanceof Error&&"AbortError"===a.name)return;try{(0,se.KE)("Failed to export data as CSV with FileSystem API, trying fallback method",a);let n="";const i=new WritableStream({write:async e=>{n+=new TextDecoder("utf-8").decode(e)},close:async()=>{}});await ht(i.getWriter(),e,t,o);const s=new Blob([n],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(s),c=document.createElement("a");l?c.setAttribute("target","_blank"):c.setAttribute("target","_self"),c.style.display="none",c.href=d,c.download=r,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(d)}catch(a){(0,se.H)("Failed to export data as CSV",a)}}}),[t,o,e,l])}};const gt=function(e,t,n,o,l,r,a,s,d){const c=i.useCallback(((t,i)=>{let[r,a]=t;const d=e[r];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(l(a)),m=o([r,a]),h=d.getCellValue(m),p=d.getCellValue(i);if(!U(m)&&p===h)return;const g=d.getCell(p,!0);U(g)?(0,se.KE)("Not applying the cell edit since it causes this error:\n ".concat(g.data)):(n.current.setCell(c,u,{...g,lastUpdated:performance.now()}),s())}),[e,n,l,o,s]),u=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i),a()}),[e,n,t,a]),m=i.useCallback((()=>{t||(u(),s())}),[u,s,t]),h=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(l(e))));return n.current.deleteRows(e),a(),d(),s(),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),c([o,i],n.getCell(null)))}return t.length>0&&(s(),r(t)),!1}return!0}),[e,n,t,r,l,s,c,d,a]),p=i.useCallback(((i,a)=>{const[d,c]=i,m=[];for(let h=0;h<a.length;h++){const i=a[h];if(h+c>=n.current.getNumRows()){if(t)break;u()}for(let t=0;t<i.length;t++){const r=i[t],a=h+c,s=t+d;if(s>=e.length)break;const u=e[s];if(u.isEditable){const e=u.getCell(r,!0);if((0,g.bb)(e)&&!U(e)){const t=u.indexNumber,i=n.current.getOriginalRowIndex(l(a)),r=u.getCellValue(o([s,a]));u.getCellValue(e)!==r&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,a]}))}}}m.length>0&&(s(),r(m))}return!1}),[e,n,t,l,o,u,s,r]),f=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:c,onPaste:p,onRowAppended:m,onDelete:h,validateCell:f}};const ft=function(e,t){const[n,o]=i.useState(),l=i.useRef(null),r=i.useCallback((n=>{if(clearTimeout(l.current),l.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],r=n.location[1];let a;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,g.bb)(s))a=s.help;else if("cell"===n.kind){const e=t([i,r]);s.isRequired&&s.isEditable&&q(e)?a="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(a=e.tooltip)}a&&(l.current=setTimeout((()=>{a&&o({content:a,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,l]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:r}};var bt=n(39806),vt=n(97613),yt=n(5527),wt=n(85e3),xt=n(37538);const Ct=function(e){return{drawCell:i.useCallback(((t,n)=>{const{cell:i,theme:o,ctx:l,rect:r}=t,a=t.col;if(q(i)&&a<e.length){const i=e[a];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)?n():(e=>{const{cell:t,theme:n,ctx:i}=e;(0,bt.L6)({...e,theme:{...n,textDark:n.textLight,headerFontFull:"".concat(n.headerFontStyle," ").concat(n.fontFamily),baseFontFull:"".concat(n.baseFontStyle," ").concat(n.fontFamily),markerFontFull:"".concat(n.markerFontStyle," ").concat(n.fontFamily)},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign),i.fillStyle=n.textDark})(t),void(i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(l,r,o))}n()}),[e]),customRenderers:i.useMemo((()=>[vt.Z,yt.Z,wt.Z,xt.ZP,...Be]),[])}};const Et=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,l)=>{e.id&&n(new Map(t).set(e.id,l))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},St=2,Mt=35,kt=50+St,Tt=2*Mt+St;const Rt=function(e,t,n,o,l){let r,a=function(e){return Math.max(e*Mt+St,Tt)}(t+1+(e.editingMode===p.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(a,400);e.height&&(s=Math.max(e.height,Tt),a=Math.max(e.height,a)),o&&(s=Math.min(s,o),a=Math.min(a,o),e.height||(s=a));let d=n;e.useContainerWidth?r=n:e.width&&(r=Math.min(Math.max(e.width,kt),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:r||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:r||"100%",height:c.height})}),[r]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(l){const t=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:a})}else u({width:r||"100%",height:s})}),[l]),{minHeight:Tt,maxHeight:a,minWidth:kt,maxWidth:d,resizableSize:c,setResizableSize:u}},Nt=(0,S.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),It=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,N.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,N.jsx)(Nt,{src:n})}):(0,N.jsx)(Nt,{src:n})};var _t=n(31572),Ot=n(13553),Dt=n(80152);const At=function(e){let{top:t,left:n,content:o,clearTooltip:l}=e;const[r,a]=i.useState(!0),s=(0,f.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{a(!1),l()}),[l,a]);return(0,N.jsx)(_t.Z,{content:(0,N.jsx)(Dt.Uo,{className:"stTooltipContent",children:(0,N.jsx)(y.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:Ot.r4.top,accessibilityType:Ot.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,M.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:(0,N.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Ft=(0,S.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.default},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(2739),n(24665);const zt=(0,h.Z)((function(e){let{element:t,data:n,width:h,height:f,disabled:b,widgetMgr:v,isFullScreen:y,disableFullscreenMode:w,expand:x,collapse:C,fragmentId:E}=e;const S=i.useRef(null),M=i.useRef(null),k=i.useRef(null),{theme:T,headerIcons:R,tableBorderRadius:D}=$e(),{libConfig:{enforceDownloadInNewTab:A=!1}}=i.useContext(O.E),[F,z]=i.useState(!0),[V,H]=i.useState(!1),[L,W]=i.useState(!1),[j,B]=i.useState(!1),P=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),Z=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]);(0,g.le)(t.editingMode)&&(t.editingMode=p.Eh.EditingMode.READ_ONLY);const{READ_ONLY:Y,DYNAMIC:U}=p.Eh.EditingMode,q=n.dimensions,J=Math.max(0,q.rows-1),X=0===J&&!(t.editingMode===U&&q.dataColumns>0),Q=J>15e4,$=i.useRef(new Xe(J)),[ee,te]=i.useState($.current.getNumRows());i.useEffect((()=>{$.current=new Xe(J),te($.current.getNumRows())}),[J]);const ne=i.useCallback((()=>{$.current=new Xe(J),te($.current.getNumRows())}),[J]),{columns:ie}=Ke(t,n,b);i.useEffect((()=>{if(t.editingMode===Y)return;const e=v.getStringValue({id:t.id,formId:t.formId});e&&($.current.fromJson(e,ie),te($.current.getNumRows()))}),[]);const{getCellContent:oe}=et(n,ie,ee,$),{columns:le,sortColumn:re,getOriginalIndex:ae,getCellContent:se}=nt(J,ie,oe),de=i.useCallback((0,g.Ds)(150,(e=>{const n={selection:{rows:[],columns:[]}};n.selection.rows=e.rows.toArray().map((e=>ae(e))),n.selection.columns=e.columns.toArray().map((e=>Ge(le[e])));const i=JSON.stringify(n),o=v.getStringValue({id:t.id,formId:t.formId});void 0!==o&&o===i||v.setStringValue({id:t.id,formId:t.formId},i,{fromUi:!0},E)})),[t.id,t.formId,v,E,ae,Ge]),{gridSelection:ce,isRowSelectionActivated:ue,isMultiRowSelectionActivated:me,isColumnSelectionActivated:he,isMultiColumnSelectionActivated:pe,isRowSelected:ge,isColumnSelected:fe,isCellSelected:be,clearSelection:ve,processSelectionChange:ye}=lt(t,X,b,le,de);i.useEffect((()=>{ve(!0,!0)}),[y]);const we=i.useCallback((e=>{var t;null===(t=M.current)||void 0===t||t.updateCells(e)}),[]);i.useEffect((()=>{if(!ue&&!he)return;const e=v.getStringValue({id:t.id,formId:t.formId});if(e){var n,i,l,r;const t=le.map((e=>Ge(e))),a=JSON.parse(e);let s=o.EV.empty(),d=o.EV.empty();if(null===(n=a.selection)||void 0===n||null===(i=n.rows)||void 0===i||i.forEach((e=>{s=s.add(e)})),null===(l=a.selection)||void 0===l||null===(r=l.columns)||void 0===r||r.forEach((e=>{d=d.add(t.indexOf(e))})),s.length>0||d.length>0){ye({rows:s,columns:d,current:void 0})}}}),[]);const xe=i.useCallback((()=>{ee!==$.current.getNumRows()&&te($.current.getNumRows())}),[ee]),Ce=i.useCallback((0,g.Ds)(150,(()=>{const e=$.current.toJson(le);let n=v.getStringValue({id:t.id,formId:t.formId});void 0===n&&(n=new Xe(0).toJson([])),e!==n&&v.setStringValue({id:t.id,formId:t.formId},e,{fromUi:!0},E)})),[t.id,t.formId,v,E,le,$.current]),{exportToCsv:Ee}=pt(se,le,ee,A),{onCellEdited:Se,onPaste:Me,onRowAppended:ke,onDelete:Te,validateCell:Re}=gt(le,t.editingMode!==U,$,se,ae,we,xe,Ce,ve),{tooltip:Ne,clearTooltip:Ie,onItemHovered:_e}=ft(le,se),{drawCell:Oe,customRenderers:De}=Ct(le),Ae=i.useMemo((()=>le.map((e=>G(e)))),[le]),{columns:Fe,onColumnResize:ze}=Et(Ae),{minHeight:Ve,maxHeight:He,minWidth:Le,maxWidth:We,resizableSize:je,setResizableSize:Be}=Rt(t,ee,h,f,y),Pe=i.useCallback((e=>{let[t,n]=e;return{...K(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(le.length-1,0)]}}),[le,T.textLight]);i.useEffect((()=>{if(!t.formId)return;const e=new m.K;return e.manageFormClearListener(v,t.formId,(()=>{ne(),ve()})),()=>{e.disconnect()}}),[t.formId,ne,ve,v]);const Ze=!X&&t.editingMode===U&&!b,Ye=X?0:le.filter((e=>e.isIndex)).length;return i.useEffect((()=>{setTimeout((()=>{if(k.current&&M.current){var e,t;const n=null===(e=k.current)||void 0===e||null===(t=e.querySelector(".dvn-stack"))||void 0===t?void 0:t.getBoundingClientRect();n&&(W(n.height>k.current.clientHeight),B(n.width>k.current.clientWidth))}}),1)}),[je,ee,Fe]),(0,N.jsxs)(Ft,{"data-testid":"stDataFrame",className:"stDataFrame",hasCustomizedScrollbars:Z,ref:k,onMouseDown:e=>{if(k.current&&Z){const t=k.current.getBoundingClientRect();j&&t.height-7<e.clientY-t.top&&e.stopPropagation(),L&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{F||P||e.currentTarget.contains(e.relatedTarget)||ve(!0,!0)},children:[(0,N.jsxs)(_,{isFullScreen:y,disableFullscreenMode:w,locked:ge&&!ue||be||P&&F,onExpand:x,onCollapse:C,target:Ft,children:[(ue&&ge||he&&fe)&&(0,N.jsx)(I,{label:"Clear selection",icon:a.x,onClick:()=>{ve(),Ie()}}),Ze&&ge&&(0,N.jsx)(I,{label:"Delete row(s)",icon:s.H,onClick:()=>{Te&&(Te(ce),Ie())}}),Ze&&!ge&&(0,N.jsx)(I,{label:"Add row",icon:d.m,onClick:()=>{ke&&(z(!0),ke(),Ie())}}),!Q&&!X&&(0,N.jsx)(I,{label:"Download as CSV",icon:c.k,onClick:()=>Ee()}),!X&&(0,N.jsx)(I,{label:"Search",icon:u.o,onClick:()=>{V?H(!1):(z(!0),H(!0)),Ie()}})]}),(0,N.jsx)(r.e,{"data-testid":"stDataFrameResizable",ref:S,defaultSize:je,style:{border:"1px solid ".concat(T.borderColor),borderRadius:"".concat(D)},minHeight:Ve,maxHeight:He,minWidth:Le,maxWidth:We,size:je,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Mt],snapGap:Mt/3,onResizeStop:(e,t,n,i)=>{S.current&&Be({width:S.current.size.width,height:He-S.current.size.height===St?S.current.size.height+St:S.current.size.height})},children:(0,N.jsx)(l.F,{className:"glideDataEditor",ref:M,columns:Fe,rows:X?1:ee,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:Mt,headerHeight:Mt,getCellContent:X?Pe:se,onColumnResize:P?void 0:ze,resizeIndicator:"header",freezeColumns:Ye,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:P?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:_e,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(H((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:V,onSearchClose:()=>{H(!1),Ie()},onHeaderClicked:(e,t)=>{X||Q||he||(ue&&ge&&ve(),re(e))},gridSelection:ce,onGridSelectionChange:e=>{(F||P)&&(ye(e),void 0!==Ne&&Ie())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&F?z(!1):"out-of-bounds"===e.kind||F||z(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...Z&&{paddingBottom:j?-6:void 0,paddingRight:L?-6:void 0}},drawCell:Oe,customRenderers:De,imageEditorOverride:It,headerIcons:R,validateCell:Re,onPaste:!1,...ue&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:me?"multi":"auto",rowSelect:b?"none":me?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...he&&{columnSelect:b?"none":pe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!X&&t.editingMode!==Y&&!b&&{fillHandle:!P,onCellEdited:Se,onPaste:Me,onDelete:Te},...!X&&t.editingMode===U&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:"multi",rowSelect:b?"none":"multi",onRowAppended:b?void 0:ke,onHeaderClicked:void 0}})}),Ne&&Ne.content&&(0,N.jsx)(At,{top:Ne.top,left:Ne.left,content:Ne.content,clearTooltip:Ie})]})}),!0)},87814:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8148],{23593:(e,t,n)=>{n.d(t,{Z:()=>b});var i=n(66845),o=n(13005),l=n.n(o),r=n(25621),a=n(82218),s=n(97781),d=n(46927),c=n(66694),u=n(1515);const m=(0,u.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:n}=e;const i=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:n.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:n.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:n.colors.fadedText60,borderRadius:"50%",...i,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:n.colors.bodyText,transition:"none"}}}),""),h=(0,u.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:n}=e;return{"&:hover":{[m]:{opacity:1,transform:"scale(1)",transition:"none"}},...n?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var p=n(40864);class g extends i.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels("2.875rem");return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:n}=this.state,{children:i,width:o,height:l,disableFullscreenMode:r}=this.props;let c=a.d,u=this.zoomIn,g="View fullscreen";return e&&(c=s.m,u=this.zoomOut,g="Exit fullscreen"),(0,p.jsxs)(h,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,p.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:u,title:g,isExpanded:e,children:(0,p.jsx)(d.Z,{content:c})}),i(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:l,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.E;const f=(0,r.b)(g);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class n extends i.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:n,height:i,disableFullscreenMode:o}=this.props;return(0,p.jsx)(f,{width:n,height:i,disableFullscreenMode:t||o,children:t=>{let{width:n,height:i,expanded:o,expand:l,collapse:r}=t;return(0,p.jsx)(e,{...this.props,width:n,height:i,isFullScreen:o,expand:l,collapse:r})}})}}}return n.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),l()(n,e)}},75064:(e,t,n)=>{n.r(t),n.d(t,{default:()=>zt});var i=n(66845),o=n(67930),l=n(78170),r=n(17330),a=n(20545),s=n(57463),d=n(97943),c=n(41342),u=n(17875),m=n(87814),h=n(23593),p=n(16295),g=n(50641),f=n(25621),b=n(34367),v=n(31011),y=n(63730),w=n(68411),x=n(9003),C=n(81354),E=n(46927),S=n(1515),M=n(27466);const k="-2.4rem",T=(0,S.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:"".concat(t.spacing.sm," 0 ").concat(t.spacing.sm," ").concat(t.spacing.sm),position:"absolute",top:n?k:"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:k},...i&&{["".concat(i,":hover &, ").concat(i,":active &, ").concat(i,":focus-visible &")]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:k}}}}}),""),R=(0,S.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,M.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var N=n(40864);function I(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const l=(0,f.u)(),r=n?t:"";return(0,N.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,N.jsx)(w.Z,{content:(0,N.jsx)(y.ZP,{source:t,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:w.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,N.jsxs)(x.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:C.nW.ELEMENT_TOOLBAR,children:[i&&(0,N.jsx)(E.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),r&&(0,N.jsx)("span",{children:r})]})})})}const _=e=>{let{onExpand:t,onCollapse:n,isFullScreen:i,locked:o,children:l,target:r,disableFullscreenMode:a}=e;return(0,N.jsx)(T,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:o||i,target:r,children:(0,N.jsxs)(R,{children:[l,t&&!a&&!i&&(0,N.jsx)(I,{label:"Fullscreen",icon:b.i,onClick:()=>t()}),n&&!a&&i&&(0,N.jsx)(I,{label:"Close fullscreen",icon:v.m,onClick:()=>n()})]})})};var O=n(66694),D=n(38145),A=n.n(D),F=n(96825),z=n.n(F),V=n(29724),H=n.n(V),L=n(52347),W=n(53608),j=n.n(W),B=(n(87717),n(55842),n(91191));const P=["true","t","yes","y","on","1"],Z=["false","f","no","n","off","0"];function Y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function U(e){return e.hasOwnProperty("isError")&&e.isError}function q(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function J(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function K(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function G(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function X(e,t){return(0,g.le)(e)?t||{}:(0,g.le)(t)?e||{}:z()(e,t)}function Q(e){if((0,g.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if("string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:$(e))):[$(t)]}catch(t){return[$(e)]}}function $(e){try{try{return A()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return"[".concat(typeof e,"]")}}function ee(e){if((0,g.le)(e))return null;if("boolean"===typeof e)return e;const t=$(e).toLowerCase().trim();return""===t?null:!!P.includes(t)||!Z.includes(t)&&void 0}function te(e){if((0,g.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=H().unformat(e.trim());if((0,g.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function ne(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,g.le)(t)||""===t?(0===n&&(e=Math.round(e)),H()(e).format((0,g.bb)(n)?"0,0.".concat("0".repeat(n)):"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):"duration[ns]"===t?j().duration(e/1e6,"milliseconds").humanize():t.startsWith("period[")?B.fu.formatPeriodType(BigInt(e),t):(0,L.sprintf)(t,e)}function ie(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function oe(e){if((0,g.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=j().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=j().utc(e);if(t.isValid())return t.toDate();const n=j().utc(e,[j().HTML5_FMT.TIME_MS,j().HTML5_FMT.TIME_SECONDS,j().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function le(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const re=new RegExp(/(\r\n|\n|\r)/gm);function ae(e){return-1!==e.indexOf("\n")?e.replace(re," "):e}var se=n(23849);function de(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,g.bb)(e)?$(e):null,i=(0,g.bb)(n)?ae(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,g.le)(e)}}catch(n){return Y($(e),"The value cannot be interpreted as a string. Error: ".concat(n))}},getCellValue:e=>void 0===e.data?null:e.data}}de.isEditableType=!1;const ce=de;function ue(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(r)}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},l=i=>{if((0,g.le)(i))return!e.isRequired;let o=$(i),l=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),l=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!l||o)};return{...e,kind:"text",sortMode:"default",validateInput:l,getCell(e,t){if("string"===typeof n)return Y($(e),n);if(t){const t=l(e);if(!1===t)return Y($(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,g.bb)(e)?$(e):null,n=(0,g.bb)(t)?ae(t):"";return{...i,isMissingValue:(0,g.le)(t),data:t,displayData:n}}catch(r){return Y("Incompatible value","The value cannot be interpreted as string. Error: ".concat(r))}},getCellValue:e=>void 0===e.data?null:e.data}}ue.isEditableType=!0;const me=ue;function he(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function pe(e,t,n,i,l,r,a){var s;const d=X({format:n,step:i,timezone:a},t.columnTypeOptions);let c,u,m;if((0,g.bb)(d.timezone))try{var h;c=(null===(h=he(j()(),d.timezone))||void 0===h?void 0:h.utcOffset())||void 0}catch(b){}(0,g.bb)(d.min_value)&&(u=oe(d.min_value)||void 0),(0,g.bb)(d.max_value)&&(m=oe(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:l,min:u,max:m}},f=e=>{const n=oe(e);return null===n?!t.isRequired:void 0!==n&&(!((0,g.bb)(u)&&r(n)<r(u))&&!((0,g.bb)(m)&&r(n)>r(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return Y($(e),"Invalid input.");t instanceof Date&&(e=t)}const i=oe(e);let o="",l="",r=c;if(void 0===i)return Y($(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=j().utc(i);if(!e.isValid())return Y($(i),"This should never happen. Please report this bug. \nError: ".concat(e.toString()));if(d.timezone){try{e=he(e,d.timezone)}catch(b){return Y(e.toISOString(),"Failed to adjust to the provided timezone: ".concat(d.timezone,". \nError: ").concat(b))}r=e.utcOffset()}try{l=ie(e,d.format||n)}catch(b){return Y(e.toISOString(),"Failed to format the date for rendering with: ".concat(d.format,". \nError: ").concat(b))}o=ie(e,n)}return{...p,copyData:o,isMissingValue:(0,g.le)(i),data:{...p.data,date:i,displayDate:l,timezoneOffset:r}}},getCellValue(e){var t;return(0,g.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:r(e.data.date)}}}function ge(e){var t,n,i,o,l;let r="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?r="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(r="YYYY-MM-DD HH:mm:ss.SSS");const a=null===(i=e.arrowType)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.timezone,s=(0,g.bb)(a)||(0,g.bb)(null===e||void 0===e||null===(l=e.columnTypeOptions)||void 0===l?void 0:l.timezone);return pe("datetime",e,s?r+"Z":r,1,"datetime-local",(e=>s?e.toISOString():e.toISOString().replace("Z","")),a)}function fe(e){var t,n;let i="HH:mm:ss";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(i="HH:mm:ss.SSS"),pe("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function be(e){return pe("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function ve(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=ee(e),void 0===n?Y($(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,g.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}ge.isEditableType=!0,fe.isEditableType=!0,be.isEditableType=!0,ve.isEditableType=!0;const ye=ve;function we(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function xe(e){const t=B.fu.getTypeName(e.arrowType);let n;"timedelta64[ns]"===t?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=X({step:we(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:n},e.columnTypeOptions),l=(0,g.le)(i.min_value)||i.min_value<0,r=(0,g.bb)(i.step)&&!Number.isNaN(i.step)?le(i.step):void 0,a={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:l,fixedDecimals:r,thousandSeparator:""},s=t=>{let n=te(t);if((0,g.le)(n))return!e.isRequired;if(Number.isNaN(n))return!1;let o=!1;return(0,g.bb)(i.max_value)&&n>i.max_value&&(n=i.max_value,o=!0),!((0,g.bb)(i.min_value)&&n<i.min_value)&&(!o||n)};return{...e,kind:"number",sortMode:"smart",validateInput:s,getCell(e,t){if(!0===t){const t=s(e);if(!1===t)return Y($(e),"Invalid input.");"number"===typeof t&&(e=t)}let n=te(e),o="";if((0,g.bb)(n)){if(Number.isNaN(n))return Y($(e),"The value cannot be interpreted as a number.");if((0,g.bb)(r)&&(l=n,n=0===(d=r)?Math.trunc(l):Math.trunc(l*10**d)/10**d),Number.isInteger(n)&&!Number.isSafeInteger(n))return Y($(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=ne(n,i.format,r)}catch(c){return Y($(n),(0,g.bb)(i.format)?"Failed to format the number based on the provided format configuration: (".concat(i.format,"). Error: ").concat(c):"Failed to format the number. Error: ".concat(c))}}var l,d;return{...a,data:n,displayData:o,isMissingValue:(0,g.le)(n),copyData:(0,g.le)(n)?"":$(n)}},getCellValue:e=>void 0===e.data?null:e.data}}xe.isEditableType=!0;const Ce=xe;function Ee(e){let t="string";const n=X({options:"bool"===B.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const l={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>$(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,g.bb)(e)&&""!==e&&(n=$(e)),t&&!l.data.allowedValues.includes(n)?Y($(n),"The value is not part of the allowed options."):{...l,isMissingValue:null===n,copyData:n||"",data:{...l.data,value:n}}},getCellValue(e){var n,i,o,l,r,a,s;return(0,g.le)(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(l=te(null===(r=e.data)||void 0===r?void 0:r.value))&&void 0!==l?l:null:"boolean"===t?null!==(a=ee(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==a?a:null:null===(o=e.data)||void 0===o?void 0:o.value}}}Ee.isEditableType=!0;const Se=Ee;function Me(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.le)(e)?[]:Q(e);return{...t,data:n,isMissingValue:(0,g.le)(e),copyData:(0,g.le)(e)?"":$(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,g.le)(e.data)||q(e)?null:e.data}}Me.isEditableType=!1;const ke=Me;function Te(e,t,n){const i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Re(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===B.fu.getTypeName(n)&&(o=!1),{id:"index-".concat(t),name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Ne(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,g.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===B.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,g.bb)(n)&&(i={options:n})}return{id:"column-".concat(n,"-").concat(t),name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function Ie(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?B.fu.getTypeName(e.arrowType):null;let l;if("object"===e.kind)l=e.getCell((0,g.bb)(t.content)?ae(B.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,g.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var r,a;let n;var s,d,c;if("time"===i&&(0,g.bb)(null===(r=t.field)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.unit))n=j().unix(B.fu.convertToSeconds(t.content,null!==(s=null===(d=t.field)||void 0===d||null===(c=d.type)||void 0===c?void 0:c.unit)&&void 0!==s?s:0)).utc().toDate();else n=j().utc(Number(t.content)).toDate();l=e.getCell(n)}else if("decimal"===i){const n=(0,g.le)(t.content)?null:B.fu.format(t.content,t.contentType,t.field);l=e.getCell(n)}else l=e.getCell(t.content);if(U(l))return l;if(!e.isEditable){if((0,g.bb)(t.displayContent)){var u;const e=ae(t.displayContent);l.kind===o.p6.Text||l.kind===o.p6.Number||l.kind===o.p6.Uri?l={...l,displayData:e}:l.kind===o.p6.Custom&&"date-picker-cell"===(null===(u=l.data)||void 0===u?void 0:u.kind)&&(l={...l,data:{...l.data,displayDate:e}})}n&&t.cssId&&(l=function(e,t,n){const i={},o=Te(t,"color",n);o&&(i.textDark=o);const l=Te(t,"background-color",n);return l&&(i.bgCell=l),"yellow"===l&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(l,t.cssId,n))}return l}function _e(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(a)}if(!(0,g.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(a){i=void 0}const l={kind:o.p6.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},r=i=>{if((0,g.le)(i))return!e.isRequired;const o=$(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:r,getCell(e,o){if((0,g.le)(e))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{}};const s=e;if("string"===typeof n)return Y($(s),n);if(o){if(!1===r(s))return Y($(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,g.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?decodeURI(n[1]):t}catch(a){return t}}(i,s):t.display_text||s),{...l,data:s,displayData:d,isMissingValue:(0,g.le)(s),onClickUri:e=>{window.open(s.startsWith("www.")?"https://".concat(s):s,"_blank","noopener,noreferrer"),e.preventDefault()},copyData:s}},getCellValue:e=>(0,g.le)(e.data)?null:e.data}}_e.isEditableType=!0;const Oe=_e;function De(e){const t={kind:o.p6.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.bb)(e)?[$(e)]:[];return{...t,data:n,isMissingValue:!(0,g.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}De.isEditableType=!1;const Ae=De;function Fe(e){const t=we(B.fu.getTypeName(e.arrowType)),n=X({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=ne(n.max_value,n.format)}catch(a){i=$(n.max_value)}const l=(0,g.le)(n.step)||Number.isNaN(n.step)?void 0:le(n.step),r={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,g.le)(e))return J();if((0,g.le)(n.min_value)||(0,g.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Y("Invalid min/max parameters","The min_value (".concat(n.min_value,") and max_value (").concat(n.max_value,") parameters must be valid numbers."));if((0,g.le)(n.step)||Number.isNaN(n.step))return Y("Invalid step parameter","The step parameter (".concat(n.step,") must be a valid number."));const t=te(e);if(Number.isNaN(t)||(0,g.le)(t))return Y($(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return Y($(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=ne(t,n.format,l)}catch(a){return Y($(t),(0,g.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(a):"Failed to format the number. Error: ".concat(a))}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...r,isMissingValue:(0,g.le)(e),copyData:String(t),data:{...r.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}}}Fe.isEditableType=!1;const ze=Fe;function Ve(e,t,n){const i=X({y_min:0,y_max:1},t.columnTypeOptions),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,g.le)(i.y_min)||(0,g.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return Y("Invalid min/max y-axis configuration","The y_min (".concat(i.y_min,") and y_max (").concat(i.y_max,") configuration options must be valid numbers."));if((0,g.le)(e))return J();const t=Q(e),n=[];let o=[];if(0===t.length)return J();let r=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER;for(let i=0;i<t.length;i++){const e=te(t[i]);if(Number.isNaN(e)||(0,g.le)(e))return Y($(t),"The value cannot be interpreted as a numeric array. ".concat($(e)," is not a number."));e>r&&(r=e),e<a&&(a=e),n.push(e)}return o=n.length>0&&(r>i.y_max||a<i.y_min)?n.map((e=>r-a===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-a)/(r-a))+(i.y_min||0))):n,{...l,copyData:n.join(","),data:{...l.data,values:o,displayValues:n.map((e=>ne(e)))},isMissingValue:(0,g.le)(e)}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}}}function He(e){return Ve("line_chart",e,"line")}function Le(e){return Ve("bar_chart",e,"bar")}function We(e){return Ve("area_chart",e,"area")}He.isEditableType=!1,Le.isEditableType=!1,We.isEditableType=!1;const je=new Map(Object.entries({object:ce,text:me,checkbox:ye,selectbox:Se,list:ke,number:Ce,link:Oe,datetime:ge,date:be,time:fe,line_chart:He,bar_chart:Le,area_chart:We,image:Ae,progress:ze})),Be=[],Pe="_index",Ze="_pos:",Ye={small:75,medium:200,large:400};function Ue(e){if(!(0,g.le)(e))return"number"===typeof e?e:e in Ye?Ye[e]:void 0}function qe(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Pe?n=t.get(e.name):t.has("".concat(Ze).concat(e.indexNumber))?n=t.get("".concat(Ze).concat(e.indexNumber)):e.isIndex&&t.has(Pe)&&(n=t.get(Pe)),n?z()({...e},{title:n.label,width:Ue(n.width),isEditable:(0,g.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function Je(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,g.bb)(n)&&(je.has(n)?i=je.get(n):(0,se.KE)("Unknown column type configured in column configuration: ".concat(n))),(0,g.le)(i)&&(i=function(e){let t=e?B.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?me:["datetime","datetimetz"].includes(t)?ge:"time"===t?fe:"date"===t?be:["object","bytes"].includes(t)?ce:["bool"].includes(t)?ye:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?Ce:"categorical"===t?Se:t.startsWith("list")?ke:ce):ce}(e.arrowType)),i}const Ke=function(e,t,n){const o=(0,f.u)(),l=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,se.H)(t),new Map}}(e.columns)),[e.columns]),r=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){const t=[],{dimensions:n}=e,i=n.headerColumns,o=n.dataColumns;if(0===i&&0===o)return t.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),t;for(let l=0;l<i;l++){const n={...Re(e,l),indexNumber:l};t.push(n)}for(let l=0;l<o;l++){const n={...Ne(e,l),indexNumber:l+i};t.push(n)}return t}(t).map((t=>{let i={...t,...qe(t,l),isStretched:r};const a=Je(i);return(e.editingMode===p.Eh.EditingMode.READ_ONLY||n||!1===a.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==p.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===p.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),a(i,o)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[ce({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,l,r,n,e.editingMode,e.columnOrder,o])}};function Ge(e){return e.isIndex?Pe:(0,g.le)(e.name)?"":e.name}const Xe=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const l={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(l[Ge(o)]=o.getCellValue(e))})),n.edited_rows[i]=l})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,l)=>{const r=t.get(n);if(r){const t=r.getCellValue(e);r.isRequired&&r.isEditable&&q(e)&&(o=!0),(0,g.bb)(t)&&(i[Ge(r)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Ge(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],l=o.get(e);if(l){const e=l.getCell(n);var r;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(r=this.editedCells.get(t))||void 0===r||r.set(l.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const n=new Map;t.forEach((e=>{n.set(e.indexNumber,e.getCell(null))})),Object.keys(e).forEach((t=>{const i=e[t],l=o.get(t);if(l){const e=l.getCell(i);e&&n.set(l.indexNumber,e)}})),this.addedRows.push(n)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map);this.editedCells.get(t).set(e,n)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,g.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var Qe=n(35704);const $e=function(){const e=(0,f.u)(),t=i.useMemo((()=>({editable:e=>'<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="'.concat(e.bgColor,'"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>')})),[]);return{theme:i.useMemo((()=>({accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,Qe.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Qe.DZ)(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:"".concat(e.fontSizes.sm),baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,Qe.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25})),[e]),tableBorderRadius:e.radii.default,headerIcons:t}};const et=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[l,r]=i;if(l>t.length-1)return Y("Column index out of bounds.","This should never happen. Please report this bug.");if(r>n-1)return Y("Row index out of bounds.","This should never happen. Please report this bug.");const a=t[l],s=a.indexNumber,d=o.current.getOriginalRowIndex(r),c=o.current.isAddedRow(d);if(a.isEditable||c){const e=o.current.getCell(s,d);if((0,g.bb)(e))return e;if(c)return Y("Error during cell creation.","This should never happen. Please report this bug. "+"No cell found for an added row: col=".concat(s,"; row=").concat(d))}try{return Ie(a,e.getCell(d+1,s),e.cssStyles)}catch(u){return Y("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(u))}}),[t,n,e,o])}};var tt=n(32700);const nt=function(e,t,n){const[o,l]=i.useState(),{getCellContent:r,getOriginalIndex:a}=(0,tt.fF)({columns:t.map((e=>G(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void l(void 0);t="desc"}l({column:G(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:a,getCellContent:r}};var it=n(62813),ot=n.n(it);const lt=function(e,t,n,l,r){const[a,s]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),d=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW)||e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_ROW)),c=d&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN)),m=u&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN),h=a.rows.length>0,g=a.columns.length>0,f=void 0!==a.current,b=i.useCallback((e=>{const t=!ot()(e.rows.toArray(),a.rows.toArray()),n=!ot()(e.columns.toArray(),a.columns.toArray()),i=!ot()(e.current,a.current);let o=d&&t||u&&n,c=e;if((d||u)&&void 0!==e.current&&i&&(c={...e,rows:a.rows,columns:a.columns},o=!1),t&&e.rows.length>0&&n&&0===e.columns.length&&(c={...c,columns:a.columns},o=!0),n&&e.columns.length>0&&t&&0===e.rows.length&&(c={...c,rows:a.rows},o=!0),n&&c.columns.length>=0){let e=c.columns;l.forEach(((t,n)=>{t.isIndex&&(e=e.remove(n))})),e.length<c.columns.length&&(c={...c,columns:e})}s(c),o&&r(c)}),[a,d,u,r,l]),v=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={columns:t?a.columns:o.EV.empty(),rows:e?a.rows:o.EV.empty(),current:void 0};s(n),(!e&&d||!t&&u)&&r(n)}),[a,d,u,r]);return{gridSelection:a,isRowSelectionActivated:d,isMultiRowSelectionActivated:c,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:m,isRowSelected:h,isColumnSelected:g,isCellSelected:f,clearSelection:v,processSelectionChange:b}},rt=",",at='"',st='"',dt="\n",ct="\ufeff",ut=new RegExp("[".concat([rt,at,dt].join(""),"]"));function mt(e){return e.map((e=>function(e){if((0,g.le)(e))return"";const t=$(e);if(ut.test(t))return"".concat(at).concat(t.replace(new RegExp(at,"g"),st+at)).concat(at);return t}(e))).join(rt)+dt}async function ht(e,t,n,i){const o=new TextEncoder;await e.write(o.encode(ct));const l=n.map((e=>e.name));await e.write(o.encode(mt(l)));for(let r=0;r<i;r++){const i=[];n.forEach(((e,n,o)=>{i.push(e.getCellValue(t([n,r])))})),await e.write(o.encode(mt(i)))}await e.close()}const pt=function(e,t,o,l){return{exportToCsv:i.useCallback((async()=>{const i=(new Date).toISOString().slice(0,16).replace(":","-"),r="".concat(i,"_export.csv");try{const i=await n.e(5345).then(n.bind(n,95345)),l=await i.showSaveFilePicker({suggestedName:r,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),a=await l.createWritable();await ht(a,e,t,o)}catch(a){if(a instanceof Error&&"AbortError"===a.name)return;try{(0,se.KE)("Failed to export data as CSV with FileSystem API, trying fallback method",a);let n="";const i=new WritableStream({write:async e=>{n+=new TextDecoder("utf-8").decode(e)},close:async()=>{}});await ht(i.getWriter(),e,t,o);const s=new Blob([n],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(s),c=document.createElement("a");l?c.setAttribute("target","_blank"):c.setAttribute("target","_self"),c.style.display="none",c.href=d,c.download=r,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(d)}catch(a){(0,se.H)("Failed to export data as CSV",a)}}}),[t,o,e,l])}};const gt=function(e,t,n,o,l,r,a,s,d){const c=i.useCallback(((t,i)=>{let[r,a]=t;const d=e[r];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(l(a)),m=o([r,a]),h=d.getCellValue(m),p=d.getCellValue(i);if(!U(m)&&p===h)return;const g=d.getCell(p,!0);U(g)?(0,se.KE)("Not applying the cell edit since it causes this error:\n ".concat(g.data)):(n.current.setCell(c,u,{...g,lastUpdated:performance.now()}),s())}),[e,n,l,o,s]),u=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i),a()}),[e,n,t,a]),m=i.useCallback((()=>{t||(u(),s())}),[u,s,t]),h=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(l(e))));return n.current.deleteRows(e),a(),d(),s(),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),c([o,i],n.getCell(null)))}return t.length>0&&(s(),r(t)),!1}return!0}),[e,n,t,r,l,s,c,d,a]),p=i.useCallback(((i,a)=>{const[d,c]=i,m=[];for(let h=0;h<a.length;h++){const i=a[h];if(h+c>=n.current.getNumRows()){if(t)break;u()}for(let t=0;t<i.length;t++){const r=i[t],a=h+c,s=t+d;if(s>=e.length)break;const u=e[s];if(u.isEditable){const e=u.getCell(r,!0);if((0,g.bb)(e)&&!U(e)){const t=u.indexNumber,i=n.current.getOriginalRowIndex(l(a)),r=u.getCellValue(o([s,a]));u.getCellValue(e)!==r&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,a]}))}}}m.length>0&&(s(),r(m))}return!1}),[e,n,t,l,o,u,s,r]),f=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:c,onPaste:p,onRowAppended:m,onDelete:h,validateCell:f}};const ft=function(e,t){const[n,o]=i.useState(),l=i.useRef(null),r=i.useCallback((n=>{if(clearTimeout(l.current),l.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],r=n.location[1];let a;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,g.bb)(s))a=s.help;else if("cell"===n.kind){const e=t([i,r]);s.isRequired&&s.isEditable&&q(e)?a="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(a=e.tooltip)}a&&(l.current=setTimeout((()=>{a&&o({content:a,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,l]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:r}};var bt=n(39806),vt=n(97613),yt=n(5527),wt=n(85e3),xt=n(37538);const Ct=function(e){return{drawCell:i.useCallback(((t,n)=>{const{cell:i,theme:o,ctx:l,rect:r}=t,a=t.col;if(q(i)&&a<e.length){const i=e[a];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)?n():(e=>{const{cell:t,theme:n,ctx:i}=e;(0,bt.L6)({...e,theme:{...n,textDark:n.textLight,headerFontFull:"".concat(n.headerFontStyle," ").concat(n.fontFamily),baseFontFull:"".concat(n.baseFontStyle," ").concat(n.fontFamily),markerFontFull:"".concat(n.markerFontStyle," ").concat(n.fontFamily)},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign),i.fillStyle=n.textDark})(t),void(i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(l,r,o))}n()}),[e]),customRenderers:i.useMemo((()=>[vt.Z,yt.Z,wt.Z,xt.ZP,...Be]),[])}};const Et=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,l)=>{e.id&&n(new Map(t).set(e.id,l))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},St=2,Mt=35,kt=50+St,Tt=2*Mt+St;const Rt=function(e,t,n,o,l){let r,a=function(e){return Math.max(e*Mt+St,Tt)}(t+1+(e.editingMode===p.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(a,400);e.height&&(s=Math.max(e.height,Tt),a=Math.max(e.height,a)),o&&(s=Math.min(s,o),a=Math.min(a,o),e.height||(s=a));let d=n;e.useContainerWidth?r=n:e.width&&(r=Math.min(Math.max(e.width,kt),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:r||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:r||"100%",height:c.height})}),[r]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(l){const t=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:a})}else u({width:r||"100%",height:s})}),[l]),{minHeight:Tt,maxHeight:a,minWidth:kt,maxWidth:d,resizableSize:c,setResizableSize:u}},Nt=(0,S.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),It=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,N.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,N.jsx)(Nt,{src:n})}):(0,N.jsx)(Nt,{src:n})};var _t=n(31572),Ot=n(13553),Dt=n(80152);const At=function(e){let{top:t,left:n,content:o,clearTooltip:l}=e;const[r,a]=i.useState(!0),s=(0,f.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{a(!1),l()}),[l,a]);return(0,N.jsx)(_t.Z,{content:(0,N.jsx)(Dt.Uo,{className:"stTooltipContent",children:(0,N.jsx)(y.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:Ot.r4.top,accessibilityType:Ot.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,M.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:(0,N.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Ft=(0,S.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.default},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(2739),n(24665);const zt=(0,h.Z)((function(e){let{element:t,data:n,width:h,height:f,disabled:b,widgetMgr:v,isFullScreen:y,disableFullscreenMode:w,expand:x,collapse:C,fragmentId:E}=e;const S=i.useRef(null),M=i.useRef(null),k=i.useRef(null),{theme:T,headerIcons:R,tableBorderRadius:D}=$e(),{libConfig:{enforceDownloadInNewTab:A=!1}}=i.useContext(O.E),[F,z]=i.useState(!0),[V,H]=i.useState(!1),[L,W]=i.useState(!1),[j,B]=i.useState(!1),P=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),Z=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]);(0,g.le)(t.editingMode)&&(t.editingMode=p.Eh.EditingMode.READ_ONLY);const{READ_ONLY:Y,DYNAMIC:U}=p.Eh.EditingMode,q=n.dimensions,J=Math.max(0,q.rows-1),X=0===J&&!(t.editingMode===U&&q.dataColumns>0),Q=J>15e4,$=i.useRef(new Xe(J)),[ee,te]=i.useState($.current.getNumRows());i.useEffect((()=>{$.current=new Xe(J),te($.current.getNumRows())}),[J]);const ne=i.useCallback((()=>{$.current=new Xe(J),te($.current.getNumRows())}),[J]),{columns:ie}=Ke(t,n,b);i.useEffect((()=>{if(t.editingMode===Y)return;const e=v.getStringValue({id:t.id,formId:t.formId});e&&($.current.fromJson(e,ie),te($.current.getNumRows()))}),[]);const{getCellContent:oe}=et(n,ie,ee,$),{columns:le,sortColumn:re,getOriginalIndex:ae,getCellContent:se}=nt(J,ie,oe),de=i.useCallback((0,g.Ds)(150,(e=>{const n={selection:{rows:[],columns:[]}};n.selection.rows=e.rows.toArray().map((e=>ae(e))),n.selection.columns=e.columns.toArray().map((e=>Ge(le[e])));const i=JSON.stringify(n),o=v.getStringValue({id:t.id,formId:t.formId});void 0!==o&&o===i||v.setStringValue({id:t.id,formId:t.formId},i,{fromUi:!0},E)})),[t.id,t.formId,v,E,ae,Ge]),{gridSelection:ce,isRowSelectionActivated:ue,isMultiRowSelectionActivated:me,isColumnSelectionActivated:he,isMultiColumnSelectionActivated:pe,isRowSelected:ge,isColumnSelected:fe,isCellSelected:be,clearSelection:ve,processSelectionChange:ye}=lt(t,X,b,le,de);i.useEffect((()=>{ve(!0,!0)}),[y]);const we=i.useCallback((e=>{var t;null===(t=M.current)||void 0===t||t.updateCells(e)}),[]);i.useEffect((()=>{if(!ue&&!he)return;const e=v.getStringValue({id:t.id,formId:t.formId});if(e){var n,i,l,r;const t=le.map((e=>Ge(e))),a=JSON.parse(e);let s=o.EV.empty(),d=o.EV.empty();if(null===(n=a.selection)||void 0===n||null===(i=n.rows)||void 0===i||i.forEach((e=>{s=s.add(e)})),null===(l=a.selection)||void 0===l||null===(r=l.columns)||void 0===r||r.forEach((e=>{d=d.add(t.indexOf(e))})),s.length>0||d.length>0){ye({rows:s,columns:d,current:void 0})}}}),[]);const xe=i.useCallback((()=>{ee!==$.current.getNumRows()&&te($.current.getNumRows())}),[ee]),Ce=i.useCallback((0,g.Ds)(150,(()=>{const e=$.current.toJson(le);let n=v.getStringValue({id:t.id,formId:t.formId});void 0===n&&(n=new Xe(0).toJson([])),e!==n&&v.setStringValue({id:t.id,formId:t.formId},e,{fromUi:!0},E)})),[t.id,t.formId,v,E,le,$.current]),{exportToCsv:Ee}=pt(se,le,ee,A),{onCellEdited:Se,onPaste:Me,onRowAppended:ke,onDelete:Te,validateCell:Re}=gt(le,t.editingMode!==U,$,se,ae,we,xe,Ce,ve),{tooltip:Ne,clearTooltip:Ie,onItemHovered:_e}=ft(le,se),{drawCell:Oe,customRenderers:De}=Ct(le),Ae=i.useMemo((()=>le.map((e=>G(e)))),[le]),{columns:Fe,onColumnResize:ze}=Et(Ae),{minHeight:Ve,maxHeight:He,minWidth:Le,maxWidth:We,resizableSize:je,setResizableSize:Be}=Rt(t,ee,h,f,y),Pe=i.useCallback((e=>{let[t,n]=e;return{...K(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(le.length-1,0)]}}),[le,T.textLight]);i.useEffect((()=>{if(!t.formId)return;const e=new m.K;return e.manageFormClearListener(v,t.formId,(()=>{ne(),ve()})),()=>{e.disconnect()}}),[t.formId,ne,ve,v]);const Ze=!X&&t.editingMode===U&&!b,Ye=X?0:le.filter((e=>e.isIndex)).length;return i.useEffect((()=>{setTimeout((()=>{if(k.current&&M.current){var e,t;const n=null===(e=k.current)||void 0===e||null===(t=e.querySelector(".dvn-stack"))||void 0===t?void 0:t.getBoundingClientRect();n&&(W(n.height>k.current.clientHeight),B(n.width>k.current.clientWidth))}}),1)}),[je,ee,Fe]),(0,N.jsxs)(Ft,{"data-testid":"stDataFrame",className:"stDataFrame",hasCustomizedScrollbars:Z,ref:k,onMouseDown:e=>{if(k.current&&Z){const t=k.current.getBoundingClientRect();j&&t.height-7<e.clientY-t.top&&e.stopPropagation(),L&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{F||P||e.currentTarget.contains(e.relatedTarget)||ve(!0,!0)},children:[(0,N.jsxs)(_,{isFullScreen:y,disableFullscreenMode:w,locked:ge&&!ue||be||P&&F,onExpand:x,onCollapse:C,target:Ft,children:[(ue&&ge||he&&fe)&&(0,N.jsx)(I,{label:"Clear selection",icon:a.x,onClick:()=>{ve(),Ie()}}),Ze&&ge&&(0,N.jsx)(I,{label:"Delete row(s)",icon:s.H,onClick:()=>{Te&&(Te(ce),Ie())}}),Ze&&!ge&&(0,N.jsx)(I,{label:"Add row",icon:d.m,onClick:()=>{ke&&(z(!0),ke(),Ie())}}),!Q&&!X&&(0,N.jsx)(I,{label:"Download as CSV",icon:c.k,onClick:()=>Ee()}),!X&&(0,N.jsx)(I,{label:"Search",icon:u.o,onClick:()=>{V?H(!1):(z(!0),H(!0)),Ie()}})]}),(0,N.jsx)(r.e,{"data-testid":"stDataFrameResizable",ref:S,defaultSize:je,style:{border:"1px solid ".concat(T.borderColor),borderRadius:"".concat(D)},minHeight:Ve,maxHeight:He,minWidth:Le,maxWidth:We,size:je,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Mt],snapGap:Mt/3,onResizeStop:(e,t,n,i)=>{S.current&&Be({width:S.current.size.width,height:He-S.current.size.height===St?S.current.size.height+St:S.current.size.height})},children:(0,N.jsx)(l.F,{className:"glideDataEditor",ref:M,columns:Fe,rows:X?1:ee,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:Mt,headerHeight:Mt,getCellContent:X?Pe:se,onColumnResize:P?void 0:ze,resizeIndicator:"header",freezeColumns:Ye,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:P?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:_e,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(H((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:V,onSearchClose:()=>{H(!1),Ie()},onHeaderClicked:(e,t)=>{X||Q||he||(ue&&ge&&ve(),re(e))},gridSelection:ce,onGridSelectionChange:e=>{(F||P)&&(ye(e),void 0!==Ne&&Ie())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&F?z(!1):"out-of-bounds"===e.kind||F||z(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...Z&&{paddingBottom:j?-6:void 0,paddingRight:L?-6:void 0}},drawCell:Oe,customRenderers:De,imageEditorOverride:It,headerIcons:R,validateCell:Re,onPaste:!1,...ue&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:me?"multi":"auto",rowSelect:b?"none":me?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...he&&{columnSelect:b?"none":pe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!X&&t.editingMode!==Y&&!b&&{fillHandle:!P,onCellEdited:Se,onPaste:Me,onDelete:Te},...!X&&t.editingMode===U&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:"multi",rowSelect:b?"none":"multi",onRowAppended:b?void 0:ke,onHeaderClicked:void 0}})}),Ne&&Ne.content&&(0,N.jsx)(At,{top:Ne.top,left:Ne.left,content:Ne.content,clearTooltip:Ie})]})}),!0)},87814:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){(0,i.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8691],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),s=r(50669),a=r(1515);const l=(0,r(7865).F4)(n||(n=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=t=>{let{dirty:e,value:r,maxLength:n,className:s,type:a="single",inForm:l}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&p("Press Enter to ".concat(t))}return n&&("chat"!==a||e)&&p("".concat(r.length,"/").concat(n),e&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){(0,n.bb)(this.formClearListener)&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},58691:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>w});var n=r(66845),o=r(70479),i=r.n(o),s=r(82534),a=r(25621),l=r(16295),u=r(87814),c=r(79986),d=r(98478),p=r(86659),h=r(8879),f=r(68411),m=r(50641),y=r(48266);const b=(0,r(1515).Z)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var g=r(40864);class v extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new u.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{widgetMgr:n,element:o,fragmentId:i}=e.props;n.setStringValue(o,e.state.value,t,i),r&&e.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||((0,m.$b)(this.props.element)?this.setState({dirty:!0,value:e},(()=>{this.commitWidgetValue({fromUi:!0},!1)})):this.setState({dirty:!0,value:e}))},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,m.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},this.id=i()("text_input_")}get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}getTypeString(){return this.props.element.type===l.oi.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:a,theme:l}=this.props,{placeholder:u}=n;return this.formClearHelper.manageFormClearListener(a,n.formId,this.onFormCleared),(0,g.jsxs)(b,{className:"row-widget stTextInput","data-testid":"stTextInput",width:o,children:[(0,g.jsx)(d.O,{label:n.label,disabled:i,labelVisibility:(0,m.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,g.jsx)(p.dT,{children:(0,g.jsx)(h.Z,{content:n.help,placement:f.u.TOP_RIGHT})})}),(0,g.jsx)(s.Z,{value:null!==r&&void 0!==r?r:"",placeholder:u,onBlur:this.onBlur,onChange:this.onChange,onKeyPress:this.onKeyPress,"aria-label":n.label,disabled:i,id:this.id,type:this.getTypeString(),autoComplete:n.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:l.lineHeights.inputWidget,paddingRight:l.spacing.sm,paddingLeft:l.spacing.sm,paddingBottom:l.spacing.sm,paddingTop:l.spacing.sm}},Root:{props:{"data-testid":"stTextInput-RootElement"},style:{height:l.sizes.minElementHeight,borderLeftWidth:l.sizes.borderWidth,borderRightWidth:l.sizes.borderWidth,borderTopWidth:l.sizes.borderWidth,borderBottomWidth:l.sizes.borderWidth}}}}),o>y.A.hideWidgetDetails&&(0,g.jsx)(c.Z,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,m.$b)({formId:n.formId})})]})}}const w=(0,a.b)(v)},82534:(t,e,r)=>{"use strict";r.d(e,{Z:()=>S});var n=r(66845),o=r(80318),i=r(32510),s=r(9656),a=r(98479),l=r(38254);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=["Root","StartEnhancer","EndEnhancer"],d=["startEnhancer","endEnhancer","overrides"];function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t,e)||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.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=w(t);if(e){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function j(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var O=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(w,t);var e,r,u,f=g(w);function w(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return j(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),j(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),j(v(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=w,(r=[{key:"render",value:function(){var t=this.props,e=t.startEnhancer,r=t.endEnhancer,u=t.overrides,f=u.Root,y=u.StartEnhancer,b=u.EndEnhancer,g=m(u,c),v=m(t,d),w=h((0,o.jb)(f,a.fC),2),j=w[0],O=w[1],S=h((0,o.jb)(y,a.Fp),2),E=S[0],P=S[1],x=h((0,o.jb)(b,a.Fp),2),W=x[0],I=x[1],T=(0,i.t)(this.props,this.state);return n.createElement(j,p({"data-baseweb":"input"},T,O,{$adjoined:F(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),C(e)&&n.createElement(E,p({},T,P,{$position:l.Xf.start}),"function"===typeof e?e(T):e),n.createElement(s.Z,p({},v,{overrides:g,adjoined:F(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),C(r)&&n.createElement(W,p({},T,I,{$position:l.Xf.end}),"function"===typeof r?r(T):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),w}(n.Component);function F(t,e){return C(t)&&C(e)?l.y4.both:C(t)?l.y4.left:C(e)?l.y4.right:l.y4.none}function C(t){return Boolean(t||0===t)}j(O,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.NO.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const S=O},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);
|