streamlit-nightly 1.41.2.dev20250114__py2.py3-none-any.whl → 1.41.2.dev20250115__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/commands/navigation.py +15 -14
- streamlit/elements/widgets/button.py +8 -7
- streamlit/navigation/page.py +6 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.xvAdcisp.js → FileDownload.esm.2W3WeZp2.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.Cwi_MzMn.js → FormClearHelper.BouJUO4t.js} +1 -1
- streamlit/static/static/js/{Hooks.ByXcZDtQ.js → Hooks.BsCM2VRj.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DQO_tWq8.js → InputInstructions.Czb180Te.js} +1 -1
- streamlit/static/static/js/{ProgressBar.D2tsAzsU.js → ProgressBar.DiAR_iBM.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.Cb1iQZTk.js → RenderInPortalIfExists.DrsDyygs.js} +1 -1
- streamlit/static/static/js/{Toolbar.FUQUVTZ-.js → Toolbar.Bl4mqr4u.js} +1 -1
- streamlit/static/static/js/{base-input.WPHkbJPl.js → base-input.BHMnVAOr.js} +4 -4
- streamlit/static/static/js/{createSuper.DjDIhar7.js → createSuper.BftCasOC.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.SmXlJABI.js → data-grid-overlay-editor.C_AfZV80.js} +1 -1
- streamlit/static/static/js/{downloader.CbRVsM5w.js → downloader.CkXPXM6R.js} +1 -1
- streamlit/static/static/js/{es6.C3ovyDQ0.js → es6.D2MIDSER.js} +2 -2
- streamlit/static/static/js/{getPrototypeOf.CVYsgVl7.js → getPrototypeOf.8KqRDNXH.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.COP9ZNW_.js → iframeResizer.contentWindow.DzzdqD8t.js} +1 -1
- streamlit/static/static/js/{index.CFwQY-KV.js → index.2gId-hkY.js} +1 -1
- streamlit/static/static/js/{index.DFD0XSVm.js → index.B3hBEIu8.js} +1 -1
- streamlit/static/static/js/{index.BMTeKekB.js → index.B56k54Px.js} +2 -2
- streamlit/static/static/js/{index.DFmc81Ae.js → index.B7TErKDq.js} +1 -1
- streamlit/static/static/js/{index.CkiEGMvI.js → index.BBMRAwlY.js} +1 -1
- streamlit/static/static/js/{index.CDXWGWmT.js → index.BOaF1pd3.js} +1 -1
- streamlit/static/static/js/{index.nDfHFYx0.js → index.BSBaMBDf.js} +1 -1
- streamlit/static/static/js/{index.CCIxkgVR.js → index.BWKboqrD.js} +1 -1
- streamlit/static/static/js/{index.BvkVMkqn.js → index.BZACNIPy.js} +1 -1
- streamlit/static/static/js/{index.V22boKfv.js → index.Bomzp8ws.js} +6 -6
- streamlit/static/static/js/{index.CANLiXfL.js → index.BpkKw-EE.js} +1 -1
- streamlit/static/static/js/{index.DW-SfHSH.js → index.BvFiU2Cj.js} +1 -1
- streamlit/static/static/js/{index.DTqVI4Zh.js → index.C3hZcowl.js} +1 -1
- streamlit/static/static/js/{index.BfnKXy8f.js → index.CGcb6vEw.js} +1 -1
- streamlit/static/static/js/{index.Cg6FfZbb.js → index.CIKFC12n.js} +1 -1
- streamlit/static/static/js/{index.BEVQJJoV.js → index.CQ7Y6jj1.js} +1 -1
- streamlit/static/static/js/{index.DLx08-Iq.js → index.CWnLDBO4.js} +1 -1
- streamlit/static/static/js/{index.DWmj29sp.js → index.CbXquzx4.js} +2 -2
- streamlit/static/static/js/{index.Br51_AlR.js → index.CcAtzCnX.js} +59 -59
- streamlit/static/static/js/{index.Cx7ma5cM.js → index.CdD4T5ia.js} +1 -1
- streamlit/static/static/js/{index.DQbNi2IT.js → index.CxVERd8N.js} +1 -1
- streamlit/static/static/js/{index.MeMRgb28.js → index.CyixjHVj.js} +1 -1
- streamlit/static/static/js/{index.D3tYsziH.js → index.DCPA8CBQ.js} +3 -3
- streamlit/static/static/js/{index.BH4vJGDU.js → index.DHthJf6z.js} +1 -1
- streamlit/static/static/js/{index.BPO6U_Ww.js → index.DOp8WWEB.js} +1 -1
- streamlit/static/static/js/{index.BGbkq72c.js → index.Dc5AjA6K.js} +1 -1
- streamlit/static/static/js/{index.D99Ft0yx.js → index.DdMp70lp.js} +1 -1
- streamlit/static/static/js/{index.DBsWPEgr.js → index.DoxwX9TA.js} +1 -1
- streamlit/static/static/js/{index.EqYXB49Q.js → index.DqFVIXyV.js} +1 -1
- streamlit/static/static/js/{index.CMo3Hx0K.js → index.DqwYtic0.js} +1 -1
- streamlit/static/static/js/{index.CEaPpXYi.js → index.DuBLm9ul.js} +1 -1
- streamlit/static/static/js/{index.CzGQCrp7.js → index.DxAYNSu8.js} +1 -1
- streamlit/static/static/js/{index.BbX6EljV.js → index.UG0Sy7w3.js} +1 -1
- streamlit/static/static/js/{index.CNpCQb9b.js → index.d8-RPUlf.js} +1 -1
- streamlit/static/static/js/{index.D0lyWwCG.js → index.qmgXiJ18.js} +1 -1
- streamlit/static/static/js/{index.DFwjNqMU.js → index.s016NW7I.js} +3 -3
- streamlit/static/static/js/{index.JwwxmOA5.js → index.xmd7bHOh.js} +2 -2
- streamlit/static/static/js/{input.CKba1ugc.js → input.D0WJMWBG.js} +1 -1
- streamlit/static/static/js/{memory.D29KuLLf.js → memory.BujUvzJS.js} +1 -1
- streamlit/static/static/js/{mergeWith.Cp23ZfqA.js → mergeWith.D78ew9Q8.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.D2BUXr0s.js → number-overlay-editor.p4lzzkCV.js} +1 -1
- streamlit/static/static/js/{sandbox.hJRvf-68.js → sandbox.DlA1rBd1.js} +1 -1
- streamlit/static/static/js/{slicedToArray.C2Uzm8dQ.js → slicedToArray.CJDXlgcX.js} +1 -1
- streamlit/static/static/js/{textarea.DOCot5Dk.js → textarea.DfgNwmCV.js} +2 -2
- streamlit/static/static/js/{timepicker.DzO-3wUS.js → timepicker.Dk2D15sb.js} +1 -1
- streamlit/static/static/js/{uniqueId.Drj6SPII.js → uniqueId.BfX7No7I.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.C2tMWgs5.js → useBasicWidgetState.Dg6_MitK.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.9A5YfOzJ.js → useOnInputChange.ZLxV0UFG.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CtPlgapz.js → withFullScreenWrapper.D8pjpwtz.js} +1 -1
- {streamlit_nightly-1.41.2.dev20250114.dist-info → streamlit_nightly-1.41.2.dev20250115.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.41.2.dev20250114.dist-info → streamlit_nightly-1.41.2.dev20250115.dist-info}/RECORD +73 -73
- {streamlit_nightly-1.41.2.dev20250114.data → streamlit_nightly-1.41.2.dev20250115.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.41.2.dev20250114.dist-info → streamlit_nightly-1.41.2.dev20250115.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.41.2.dev20250114.dist-info → streamlit_nightly-1.41.2.dev20250115.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250114.dist-info → streamlit_nightly-1.41.2.dev20250115.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.DxAYNSu8.js","./RenderInPortalIfExists.DrsDyygs.js","./index.DqwYtic0.js","./index.CcAtzCnX.js","./FormClearHelper.BouJUO4t.js","./withFullScreenWrapper.D8pjpwtz.js","./Toolbar.Bl4mqr4u.js","./mergeWith.D78ew9Q8.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./slicedToArray.CJDXlgcX.js","./getPrototypeOf.8KqRDNXH.js","./createSuper.BftCasOC.js","./FileDownload.esm.2W3WeZp2.js","../css/index.B26BQfSF.css","./index.DoxwX9TA.js","./threshold.B8r8f5kt.js","./value.iufjd77T.js","./timer.RueuYoQV.js","./index.CGcb6vEw.js","./useBasicWidgetState.Dg6_MitK.js","../css/index.CG16XVnL.css","./index.BBMRAwlY.js","./index.qmgXiJ18.js","./index.UG0Sy7w3.js","./index.CIKFC12n.js","./Hooks.BsCM2VRj.js","./index.xmd7bHOh.js","./index.DdMp70lp.js","./index.CxVERd8N.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.DiAR_iBM.js","./index.DuBLm9ul.js","./InputInstructions.Czb180Te.js","./inputUtils.CQWz5UKz.js","./textarea.DfgNwmCV.js","./base-input.BHMnVAOr.js","./index.B56k54Px.js","./index.B7TErKDq.js","./index.CdD4T5ia.js","./timepicker.Dk2D15sb.js","./input.D0WJMWBG.js","./index.B3hBEIu8.js","./index.Dc5AjA6K.js","./index.DCPA8CBQ.js","./index.BpkKw-EE.js","./index.CbXquzx4.js","./index.BSBaMBDf.js","./index.CWnLDBO4.js","./uniqueId.BfX7No7I.js","./useOnInputChange.ZLxV0UFG.js","./index.BWKboqrD.js","./index.s016NW7I.js","./index.2gId-hkY.js"])))=>i.map(i=>d[i]);
|
2
2
|
var lr=Object.defineProperty;var B1=tt=>{throw TypeError(tt)};var sr=(tt,nt,et)=>nt in tt?lr(tt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):tt[nt]=et;var In=(tt,nt,et)=>sr(tt,typeof nt!="symbol"?nt+"":nt,et),$1=(tt,nt,et)=>nt.has(tt)||B1("Cannot "+et);var _0=(tt,nt,et)=>($1(tt,nt,"read from private field"),et?et.call(tt):nt.get(tt)),Q0=(tt,nt,et)=>nt.has(tt)?B1("Cannot add the same private member more than once"):nt instanceof WeakSet?nt.add(tt):nt.set(tt,et),K0=(tt,nt,et,rt)=>($1(tt,nt,"write to private field"),rt?rt.call(tt,et):nt.set(tt,et),et),$0=(tt,nt,et)=>($1(tt,nt,"access private method"),et);function _mergeNamespaces(tt,nt){for(var et=0;et<nt.length;et++){const rt=nt[et];if(typeof rt!="string"&&!Array.isArray(rt)){for(const ot in rt)if(ot!=="default"&&!(ot in tt)){const at=Object.getOwnPropertyDescriptor(rt,ot);at&&Object.defineProperty(tt,ot,at.get?at:{enumerable:!0,get:()=>rt[ot]})}}}return Object.freeze(Object.defineProperty(tt,Symbol.toStringTag,{value:"Module"}))}(function(){const nt=document.createElement("link").relList;if(nt&&nt.supports&&nt.supports("modulepreload"))return;for(const ot of document.querySelectorAll('link[rel="modulepreload"]'))rt(ot);new MutationObserver(ot=>{for(const at of ot)if(at.type==="childList")for(const st of at.addedNodes)st.tagName==="LINK"&&st.rel==="modulepreload"&&rt(st)}).observe(document,{childList:!0,subtree:!0});function et(ot){const at={};return ot.integrity&&(at.integrity=ot.integrity),ot.referrerPolicy&&(at.referrerPolicy=ot.referrerPolicy),ot.crossOrigin==="use-credentials"?at.credentials="include":ot.crossOrigin==="anonymous"?at.credentials="omit":at.credentials="same-origin",at}function rt(ot){if(ot.ep)return;ot.ep=!0;const at=et(ot);fetch(ot.href,at)}})();var commonjsGlobal$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(tt){return tt&&tt.__esModule&&Object.prototype.hasOwnProperty.call(tt,"default")?tt.default:tt}function getAugmentedNamespace(tt){if(tt.__esModule)return tt;var nt=tt.default;if(typeof nt=="function"){var et=function rt(){return this instanceof rt?Reflect.construct(nt,arguments,this.constructor):nt.apply(this,arguments)};et.prototype=nt.prototype}else et={};return Object.defineProperty(et,"__esModule",{value:!0}),Object.keys(tt).forEach(function(rt){var ot=Object.getOwnPropertyDescriptor(tt,rt);Object.defineProperty(et,rt,ot.get?ot:{enumerable:!0,get:function(){return tt[rt]}})}),et}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
|
3
3
|
* @license React
|
4
4
|
* react.production.min.js
|
@@ -66,7 +66,7 @@ index signature as the original data.
|
|
66
66
|
|
67
67
|
In this case, \`add_rows()\` received \`${JSON.stringify(et)}\`
|
68
68
|
but was expecting \`${JSON.stringify(rt)}\`.
|
69
|
-
`)}return tt.map(et=>{if(et.pandas_type===PandasRangeIndexType){const{stop:rt,step:ot}=et.meta,{start:at,stop:st,step:ut}=nt[0].meta,ct=(st-at)/ut,pt=rt+ct*ot;return{...et,meta:{...et.meta,stop:pt}}}return et})}function concatDataTypes(tt,nt){return tt.length===0?nt:tt}function concat(tt,nt,et,rt,ot,at){const st=concatIndexes(nt,tt.index,ot,rt.index),ut=concatData(et,tt.data,at,rt.data),ct=concatTypes(tt,rt);return{index:st,data:ut,types:ct}}function isPandasRangeIndex(tt){return typeof tt=="object"&&tt.kind==="range"}function parsePandasSchema(tt){const nt=tt.schema.metadata.get("pandas");if(isNullOrUndefined$1(nt))throw new Error("Table schema is missing.");return JSON.parse(nt)}function getRawColumns(tt){return tt.columns.map(nt=>nt.field_name).filter(nt=>!tt.index_columns.includes(nt))}function parseIndexData(tt,nt){return nt.index_columns.map(et=>{if(isPandasRangeIndex(et)){const{start:ot,stop:at,step:st}=et;return range$1(ot,at,st)}const rt=tt.getChild(et);return rt instanceof Vector&&rt.type instanceof Null?null:rt}).filter(et=>et!==null)}function parseIndexNames(tt){return tt.index_columns.map(nt=>{if(isPandasRangeIndex(nt)){const{name:et}=nt;return et||""}return nt.startsWith("__index_level_")?"":nt})}function parseColumnNames(tt){const nt=tt.column_indexes.length>1;return unzip$2(tt.columns.map(et=>et.field_name).filter(et=>!tt.index_columns.includes(et)).map(et=>nt?JSON.parse(et.replace(/\(/g,"[").replace(/\)/g,"]").replace(/'/g,'"')):[et]))}function parseData(tt,nt,et){const rt=tt.numRows,ot=nt.length>0?nt[0].length:0;return rt===0||ot===0?tt.select([]):tt.select(et)}function parseColumnTypes(tt,nt){const et=parseIndexType(nt),rt=parseDataType(nt);return{index:et,data:rt}}function parseDataType(tt){return tt.columns.filter(nt=>!tt.index_columns.includes(nt.field_name)).map(nt=>({pandas_type:nt.pandas_type,numpy_type:nt.numpy_type,meta:nt.metadata}))}function parseIndexType(tt){return tt.index_columns.map(nt=>{if(isPandasRangeIndex(nt))return{pandas_type:PandasRangeIndexType,numpy_type:PandasRangeIndexType,meta:nt};const et=tt.columns.find(rt=>rt.field_name===nt);if(!et)throw new Error(`${nt} index not found.`);return{pandas_type:et.pandas_type,numpy_type:et.numpy_type,meta:et.metadata}})}function parseFields(tt){return Object.fromEntries((tt.fields||[]).map((nt,et)=>[nt.name.startsWith("__index_level_")?nt.name:String(et),nt]))}function parseArrowIpcBytes(tt){const nt=tableFromIPC(tt),et=parseFields(nt.schema),rt=parsePandasSchema(nt),ot=parseColumnNames(rt),at=parseIndexNames(rt),st=getRawColumns(rt),ut=parseData(nt,ot,st),ct=parseIndexData(nt,rt),pt=parseColumnTypes(nt,rt);return{columnNames:ot,fields:et,indexData:ct,indexNames:at,data:ut,columnTypes:pt}}var _a,DataFrameCellType;(function(tt){tt.BLANK="blank",tt.INDEX="index",tt.COLUMNS="columns",tt.DATA="data"})(DataFrameCellType||(DataFrameCellType={}));_a=L;class Quiver{constructor(nt){var pt;this[_a]=!0;const{indexData:et,columnNames:rt,data:ot,columnTypes:at,fields:st,indexNames:ut}=parseArrowIpcBytes(nt.data),ct=nt.styler?parseStyler(nt.styler):void 0;this._indexData=et,this._columnNames=rt,this._data=ot,this._columnTypes=at,this._fields=st,this._styler=ct,this._indexNames=ut,this._num_bytes=((pt=nt.data)==null?void 0:pt.length)??0}get indexData(){return this._indexData}get indexNames(){return this._indexNames}get columnNames(){return this._columnNames}get data(){return this._data}get columnTypes(){return this._columnTypes}get styler(){return this._styler}get dimensions(){var ut,ct;const nt=this._indexData.length||this.columnTypes.index.length||1,et=this._columnNames.length||1,rt=this._data.numRows||0,ot=this._data.numCols||((ct=(ut=this._columnNames)==null?void 0:ut[0])==null?void 0:ct.length)||0,at=et+rt,st=nt+ot;return{numHeaderRows:et,numIndexColumns:nt,numDataRows:rt,numDataColumns:ot,numRows:at,numColumns:st}}get hash(){const nt=[this.dimensions.numColumns,this.dimensions.numDataColumns,this.dimensions.numDataRows,this.dimensions.numIndexColumns,this.dimensions.numHeaderRows,this.dimensions.numRows,this._num_bytes,this._columnNames];return hashString(nt.join("-"))}getCell(nt,et){var yt,vt,At;const{numHeaderRows:rt,numIndexColumns:ot,numRows:at,numColumns:st}=this.dimensions;if(nt<0||nt>=at)throw new Error(`Row index is out of range: ${nt}`);if(et<0||et>=st)throw new Error(`Column index is out of range: ${et}`);const ut=nt<rt&&et<ot,ct=nt>=rt&&et<ot,pt=nt<rt&&et>=ot;if(ut){const St=["blank"];return et>0&&St.push(`level${nt}`),{type:"blank",cssClass:St.join(" "),content:""}}if(ct){const St=nt-rt,Et=(yt=this._styler)!=null&&yt.cssId?`${this._styler.cssId}level${et}_row${St}`:void 0,Tt=["row_heading",`level${et}`,`row${St}`].join(" "),Rt=this._columnTypes.index[et],Ct=this.getIndexValue(St,et);let wt=this._fields[`__index_level_${String(et)}__`];return wt===void 0&&(wt=this._fields[String(st-ot)]),{type:"index",cssId:Et,cssClass:Tt,content:Ct,contentType:Rt,field:wt}}if(pt){const St=et-ot;return{type:"columns",cssClass:["col_heading",`level${nt}`,`col${St}`].join(" "),content:this._columnNames[nt][St],contentType:{pandas_type:"unicode",numpy_type:"object"}}}const dt=nt-rt,ft=et-ot,bt=(vt=this._styler)!=null&&vt.cssId?`${this._styler.cssId}row${dt}_col${ft}`:void 0,ht=["data",`row${dt}`,`col${ft}`].join(" "),Mt=this._columnTypes.data[ft],mt=this._fields[String(ft)],Ot=this.getDataValue(dt,ft),zt=(At=this._styler)!=null&&At.displayValues?this._styler.displayValues.getCell(nt,et).content:void 0;return{type:"data",cssId:bt,cssClass:ht,content:Ot,contentType:Mt,displayContent:zt,field:mt}}getIndexValue(nt,et){const rt=this._indexData[et];return rt instanceof Vector?rt.get(nt):rt[nt]}getDataValue(nt,et){var rt;return(rt=this._data.getChildAt(et))==null?void 0:rt.get(nt)}getCategoricalOptions(nt){var ot,at;const{numDataColumns:et}=this.dimensions;if(nt<0||nt>=et)throw new Error(`Column index is out of range: ${nt}`);if(!(this._fields[String(nt)].type instanceof Dictionary))return;const rt=(at=(ot=this._data.getChildAt(nt))==null?void 0:ot.data[0])==null?void 0:at.dictionary;return notNullOrUndefined(rt)?convertVectorToList(rt):void 0}addRows(nt){if(this._styler||nt._styler)throw new Error("\nUnsupported operation. `add_rows()` does not support Pandas Styler objects.\n\nIf you do not need the Styler's styles, try passing the `.data` attribute of\nthe Styler object instead to concatenate just the underlying dataframe.\n\nFor example:\n```\nst.add_rows(my_styler.data)\n```\n");if(nt.dimensions.numDataRows===0)return fn(this,at=>at);if(this.dimensions.numDataRows===0)return fn(nt,at=>at);const{index:et,data:rt,types:ot}=concat(this._columnTypes,this._indexData,this._data,nt._columnTypes,nt._indexData,nt._data);return fn(this,at=>{at._indexData=et,at._data=rt,at._columnTypes=ot})}}function parseStyler(tt){return{uuid:tt.uuid,caption:tt.caption,cssStyles:tt.styles,cssId:tt.uuid?`T_${tt.uuid}`:void 0,displayValues:new Quiver({data:tt.displayValues})}}function ensureError(tt){return tt instanceof Error?tt:new Error(`${tt}`)}const NO_SCRIPT_RUN_ID="NO_SCRIPT_RUN_ID";class ElementNode{constructor(nt,et,rt,ot,at){this.element=nt,this.metadata=et,this.scriptRunId=rt,this.activeScriptHash=ot,this.fragmentId=at}get quiverElement(){if(this.lazyQuiverElement!==void 0)return this.lazyQuiverElement;if(this.element.type!=="arrowTable"&&this.element.type!=="arrowDataFrame")throw new Error(`elementType '${this.element.type}' is not a valid Quiver element!`);const nt=new Quiver(this.element[this.element.type]);return this.lazyQuiverElement=nt,nt}get vegaLiteChartElement(){if(this.lazyVegaLiteChartElement!==void 0)return this.lazyVegaLiteChartElement;if(this.element.type!=="arrowVegaLiteChart")throw new Error(`elementType '${this.element.type}' is not a valid VegaLiteChartElement!`);const nt=this.element.arrowVegaLiteChart,et=nt.data?new Quiver(nt.data):null,rt=nt.datasets.length>0?wrapDatasets(nt.datasets):[],ot={data:et,spec:nt.spec,datasets:rt,useContainerWidth:nt.useContainerWidth,vegaLiteTheme:nt.theme,id:nt.id,selectionMode:nt.selectionMode,formId:nt.formId};return this.lazyVegaLiteChartElement=ot,ot}getIn(){}setIn(){throw new Error("'setIn' cannot be called on an ElementNode")}filterMainScriptElements(nt){if(this.activeScriptHash===nt)return this}clearStaleNodes(nt,et,rt){return et&&et.length&&(!this.fragmentId||!rt||this.scriptRunId===nt)?this:this.scriptRunId===nt?this:void 0}getElements(nt){return isNullOrUndefined$1(nt)&&(nt=new Set),nt.add(this.element),nt}arrowAddRows(nt,et){const rt=this.element.type,ot=new ElementNode(this.element,this.metadata,et,this.activeScriptHash,this.fragmentId);switch(rt){case"arrowTable":case"arrowDataFrame":{ot.lazyQuiverElement=ElementNode.quiverAddRowsHelper(this.quiverElement,nt);break}case"arrowVegaLiteChart":{ot.lazyVegaLiteChartElement=ElementNode.vegaLiteChartAddRowsHelper(this.vegaLiteChartElement,nt);break}default:throw new Error(`elementType '${this.element.type}' is not a valid arrowAddRows target!`)}return ot}static quiverAddRowsHelper(nt,et){if(et.hasName)throw new Error("Add rows cannot be used with a named dataset for this element.");const rt=new Quiver(et.data);return nt.addRows(rt)}static vegaLiteChartAddRowsHelper(nt,et){const rt=et.hasName?et.name:null,ot=new Quiver(et.data);return fn(nt,at=>{const st=getNamedDataSet(at.datasets,rt);st?st.data=st.data.addRows(ot):at.data=at.data?at.data.addRows(ot):ot})}}function getNamedDataSet(tt,nt){return tt.length===1?tt[0]:tt.find(et=>et.hasName&&et.name===nt)}class BlockNode{constructor(nt,et,rt,ot,at,st){this.activeScriptHash=nt,this.children=et??[],this.deltaBlock=rt??new Block$2({}),this.scriptRunId=ot??NO_SCRIPT_RUN_ID,this.fragmentId=at,this.deltaMsgReceivedAt=st}get isEmpty(){return this.children.length===0}getIn(nt){if(nt.length===0)return;const et=nt[0];if(!(et<0||et>=this.children.length))return nt.length===1?this.children[et]:this.children[et].getIn(nt.slice(1))}setIn(nt,et,rt){if(nt.length===0)throw new Error("empty path!");const ot=nt[0];if(ot<0||ot>this.children.length)throw new Error(`Bad 'setIn' index ${ot} (should be between [0, ${this.children.length}])`);const at=this.children.slice();return nt.length===1?at[ot]=et:at[ot]=at[ot].setIn(nt.slice(1),et,rt),new BlockNode(this.activeScriptHash,at,this.deltaBlock,rt,this.fragmentId,this.deltaMsgReceivedAt)}filterMainScriptElements(nt){if(this.activeScriptHash!==nt)return;const et=this.children.map(rt=>rt.filterMainScriptElements(nt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,et,this.deltaBlock,this.scriptRunId,this.fragmentId,this.deltaMsgReceivedAt)}clearStaleNodes(nt,et,rt){if(!et||!et.length){if(this.scriptRunId!==nt)return}else{if(rt&&this.scriptRunId!==nt)return;this.fragmentId&&et.includes(this.fragmentId)&&this.scriptRunId===nt&&(rt=this.fragmentId)}const ot=this.children.map(at=>at.clearStaleNodes(nt,et,rt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,ot,this.deltaBlock,nt,this.fragmentId,this.deltaMsgReceivedAt)}getElements(nt){isNullOrUndefined$1(nt)&&(nt=new Set);for(const et of this.children)et.getElements(nt);return nt}}class AppRoot{static empty(nt="",et=!0,rt,ot){const at=[];let st;switch(getLoadingScreenType()){case LoadingScreenType.NONE:break;case LoadingScreenType.V1:et&&(st=makeElementWithInfoText("Please wait..."));break;default:st=makeAppSkeletonElement()}st&&at.push(new ElementNode(st,ForwardMsgMetadata.create({}),NO_SCRIPT_RUN_ID,nt));const ut=new BlockNode(nt,at,new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ct=rt||new BlockNode(nt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),pt=new BlockNode(nt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),dt=new BlockNode(nt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ft=ot?{logo:ot,activeScriptHash:nt,scriptRunId:NO_SCRIPT_RUN_ID}:null;return new AppRoot(nt,new BlockNode(nt,[ut,ct,pt,dt]),ft)}constructor(nt,et,rt=null){if(this.mainScriptHash=nt,this.root=et,this.appLogo=rt,this.root.children.length!==4||isNullOrUndefined$1(this.main)||isNullOrUndefined$1(this.sidebar)||isNullOrUndefined$1(this.event)||isNullOrUndefined$1(this.bottom))throw new Error(`Invalid root node children! ${et}`)}get main(){const[nt]=this.root.children;return nt}get sidebar(){const[,nt]=this.root.children;return nt}get event(){const[,,nt]=this.root.children;return nt}get bottom(){const[,,,nt]=this.root.children;return nt}get logo(){var nt;return((nt=this.appLogo)==null?void 0:nt.logo)??null}appRootWithLogo(nt,et){return new AppRoot(this.mainScriptHash,this.root,{logo:nt,...et})}applyDelta(nt,et,rt){const{deltaPath:ot,activeScriptHash:at}=rt;switch(et.type){case"newElement":{const st=et.newElement;return this.addElement(ot,nt,st,rt,at,et.fragmentId)}case"addBlock":{const st=Date.now();return this.addBlock(ot,et.addBlock,nt,at,et.fragmentId,st)}case"arrowAddRows":try{return this.arrowAddRows(ot,et.arrowAddRows,nt)}catch(st){const ut=makeElementWithErrorText(ensureError(st).message);return this.addElement(ot,nt,ut,rt,at)}default:throw new Error(`Unrecognized deltaType: '${et.type}'`)}}filterMainScriptElements(nt){var ct;const et=this.main.scriptRunId,rt=this.main.filterMainScriptElements(nt)||new BlockNode(nt),ot=this.sidebar.filterMainScriptElements(nt)||new BlockNode(nt),at=this.event.filterMainScriptElements(nt)||new BlockNode(nt),st=this.bottom.filterMainScriptElements(nt)||new BlockNode(nt),ut=((ct=this.appLogo)==null?void 0:ct.activeScriptHash)===nt?this.appLogo:null;return new AppRoot(nt,new BlockNode(nt,[rt,ot,at,st],new Block$2({allowEmpty:!0}),et),ut)}clearStaleNodes(nt,et){var ct;const rt=this.main.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),ot=this.sidebar.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),at=this.event.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),st=this.bottom.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),ut=((ct=this.appLogo)==null?void 0:ct.scriptRunId)===nt?this.appLogo:null;return new AppRoot(this.mainScriptHash,new BlockNode(this.mainScriptHash,[rt,ot,at,st],new Block$2({allowEmpty:!0}),nt),ut)}getElements(){const nt=new Set;return this.main.getElements(nt),this.sidebar.getElements(nt),this.event.getElements(nt),this.bottom.getElements(nt),nt}addElement(nt,et,rt,ot,at,st){const ut=new ElementNode(rt,ot,et,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(nt,ut,et),this.appLogo)}addBlock(nt,et,rt,ot,at,st){const ut=this.root.getIn(nt);let ct=[];ut instanceof BlockNode&&ut.deltaBlock.type===et.type&&(ct=ut.children);const pt=new BlockNode(ot,ct,et,rt,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(nt,pt,rt),this.appLogo)}arrowAddRows(nt,et,rt){const ot=this.root.getIn(nt);if(isNullOrUndefined$1(ot))throw new Error(`Can't arrowAddRows: invalid deltaPath: ${nt}`);const at=ot.arrowAddRows(et,rt);return new AppRoot(this.mainScriptHash,this.root.setIn(nt,at,rt),this.appLogo)}}function wrapDatasets(tt){return tt.map(nt=>({hasName:nt.hasName,name:nt.name,data:new Quiver(nt.data)}))}const IS_DEV_ENV=!1;var classnames={exports:{}};/*!
|
69
|
+
`)}return tt.map(et=>{if(et.pandas_type===PandasRangeIndexType){const{stop:rt,step:ot}=et.meta,{start:at,stop:st,step:ut}=nt[0].meta,ct=(st-at)/ut,pt=rt+ct*ot;return{...et,meta:{...et.meta,stop:pt}}}return et})}function concatDataTypes(tt,nt){return tt.length===0?nt:tt}function concat(tt,nt,et,rt,ot,at){const st=concatIndexes(nt,tt.index,ot,rt.index),ut=concatData(et,tt.data,at,rt.data),ct=concatTypes(tt,rt);return{index:st,data:ut,types:ct}}function isPandasRangeIndex(tt){return typeof tt=="object"&&tt.kind==="range"}function parsePandasSchema(tt){const nt=tt.schema.metadata.get("pandas");if(isNullOrUndefined$1(nt))throw new Error("Table schema is missing.");return JSON.parse(nt)}function getRawColumns(tt){return tt.columns.map(nt=>nt.field_name).filter(nt=>!tt.index_columns.includes(nt))}function parseIndexData(tt,nt){return nt.index_columns.map(et=>{if(isPandasRangeIndex(et)){const{start:ot,stop:at,step:st}=et;return range$1(ot,at,st)}const rt=tt.getChild(et);return rt instanceof Vector&&rt.type instanceof Null?null:rt}).filter(et=>et!==null)}function parseIndexNames(tt){return tt.index_columns.map(nt=>{if(isPandasRangeIndex(nt)){const{name:et}=nt;return et||""}return nt.startsWith("__index_level_")?"":nt})}function parseColumnNames(tt){const nt=tt.column_indexes.length>1;return unzip$2(tt.columns.map(et=>et.field_name).filter(et=>!tt.index_columns.includes(et)).map(et=>nt?JSON.parse(et.replace(/\(/g,"[").replace(/\)/g,"]").replace(/'/g,'"')):[et]))}function parseData(tt,nt,et){const rt=tt.numRows,ot=nt.length>0?nt[0].length:0;return rt===0||ot===0?tt.select([]):tt.select(et)}function parseColumnTypes(tt){const nt=parseIndexType(tt),et=parseDataType(tt);return{index:nt,data:et}}function parseDataType(tt){return tt.columns.filter(nt=>!tt.index_columns.includes(nt.field_name)).map(nt=>({pandas_type:nt.pandas_type,numpy_type:nt.numpy_type,meta:nt.metadata}))}function parseIndexType(tt){return tt.index_columns.map(nt=>{if(isPandasRangeIndex(nt))return{pandas_type:PandasRangeIndexType,numpy_type:PandasRangeIndexType,meta:nt};const et=tt.columns.find(rt=>rt.field_name===nt);if(!et)throw new Error(`${nt} index not found.`);return{pandas_type:et.pandas_type,numpy_type:et.numpy_type,meta:et.metadata}})}function parseFields(tt){return Object.fromEntries((tt.fields||[]).map((nt,et)=>[nt.name.startsWith("__index_level_")?nt.name:String(et),nt]))}function parseArrowIpcBytes(tt){const nt=tableFromIPC(tt),et=parseFields(nt.schema),rt=parsePandasSchema(nt),ot=parseColumnNames(rt),at=parseIndexNames(rt),st=getRawColumns(rt),ut=parseData(nt,ot,st),ct=parseIndexData(nt,rt),pt=parseColumnTypes(rt);return{columnNames:ot,fields:et,indexData:ct,indexNames:at,data:ut,columnTypes:pt}}var _a,DataFrameCellType;(function(tt){tt.INDEX="index",tt.DATA="data"})(DataFrameCellType||(DataFrameCellType={}));_a=L;class Quiver{constructor(nt){var pt;this[_a]=!0;const{indexData:et,columnNames:rt,data:ot,columnTypes:at,fields:st,indexNames:ut}=parseArrowIpcBytes(nt.data),ct=nt.styler?parseStyler(nt.styler):void 0;this._indexData=et,this._columnNames=rt,this._data=ot,this._columnTypes=at,this._fields=st,this._styler=ct,this._indexNames=ut,this._num_bytes=((pt=nt.data)==null?void 0:pt.length)??0}get indexData(){return this._indexData}get indexNames(){return this._indexNames}get columnNames(){return this._columnNames}get data(){return this._data}get columnTypes(){return this._columnTypes}get styler(){return this._styler}get dimensions(){var ut,ct;const nt=this._indexData.length||this.columnTypes.index.length||1,et=this._columnNames.length||1,rt=this._data.numRows||0,ot=this._data.numCols||((ct=(ut=this._columnNames)==null?void 0:ut[0])==null?void 0:ct.length)||0,at=et+rt,st=nt+ot;return{numHeaderRows:et,numIndexColumns:nt,numDataRows:rt,numDataColumns:ot,numRows:at,numColumns:st}}get hash(){const nt=[this.dimensions.numColumns,this.dimensions.numDataColumns,this.dimensions.numDataRows,this.dimensions.numIndexColumns,this.dimensions.numHeaderRows,this.dimensions.numRows,this._num_bytes,this._columnNames];return hashString(nt.join("-"))}getCell(nt,et){const{numIndexColumns:rt,numDataRows:ot,numColumns:at}=this.dimensions;if(nt<0||nt>=ot)throw new Error(`Row index is out of range: ${nt}`);if(et<0||et>=at)throw new Error(`Column index is out of range: ${et}`);if(et<rt){const ft=this.columnTypes.index[et],bt=this.getIndexValue(nt,et);let ht=this._fields[`__index_level_${String(et)}__`];return ht===void 0&&(ht=this._fields[String(at-rt)]),{type:"index",content:bt,contentType:ft,field:ht}}const ut=et-rt,ct=this.columnTypes.data[ut],pt=this._fields[String(ut)];return{type:"data",content:this.getDataValue(nt,ut),contentType:ct,field:pt}}getIndexValue(nt,et){const rt=this._indexData[et];return rt instanceof Vector?rt.get(nt):rt[nt]}getDataValue(nt,et){var rt;return(rt=this._data.getChildAt(et))==null?void 0:rt.get(nt)}getCategoricalOptions(nt){var ot,at;const{numDataColumns:et}=this.dimensions;if(nt<0||nt>=et)throw new Error(`Column index is out of range: ${nt}`);if(!(this._fields[String(nt)].type instanceof Dictionary))return;const rt=(at=(ot=this._data.getChildAt(nt))==null?void 0:ot.data[0])==null?void 0:at.dictionary;return notNullOrUndefined(rt)?convertVectorToList(rt):void 0}addRows(nt){if(this.styler||nt.styler)throw new Error("\nUnsupported operation. `add_rows()` does not support Pandas Styler objects.\n\nIf you do not need the Styler's styles, try passing the `.data` attribute of\nthe Styler object instead to concatenate just the underlying dataframe.\n\nFor example:\n```\nst.add_rows(my_styler.data)\n```\n");if(nt.dimensions.numDataRows===0)return fn(this,at=>at);if(this.dimensions.numDataRows===0)return fn(nt,at=>at);const{index:et,data:rt,types:ot}=concat(this._columnTypes,this._indexData,this._data,nt._columnTypes,nt._indexData,nt._data);return fn(this,at=>{at._indexData=et,at._data=rt,at._columnTypes=ot})}}function parseStyler(tt){return{uuid:tt.uuid,caption:tt.caption,cssStyles:tt.styles,cssId:tt.uuid?`T_${tt.uuid}`:void 0,displayValues:new Quiver({data:tt.displayValues})}}function ensureError(tt){return tt instanceof Error?tt:new Error(`${tt}`)}const NO_SCRIPT_RUN_ID="NO_SCRIPT_RUN_ID";class ElementNode{constructor(nt,et,rt,ot,at){this.element=nt,this.metadata=et,this.scriptRunId=rt,this.activeScriptHash=ot,this.fragmentId=at}get quiverElement(){if(this.lazyQuiverElement!==void 0)return this.lazyQuiverElement;if(this.element.type!=="arrowTable"&&this.element.type!=="arrowDataFrame")throw new Error(`elementType '${this.element.type}' is not a valid Quiver element!`);const nt=new Quiver(this.element[this.element.type]);return this.lazyQuiverElement=nt,nt}get vegaLiteChartElement(){if(this.lazyVegaLiteChartElement!==void 0)return this.lazyVegaLiteChartElement;if(this.element.type!=="arrowVegaLiteChart")throw new Error(`elementType '${this.element.type}' is not a valid VegaLiteChartElement!`);const nt=this.element.arrowVegaLiteChart,et=nt.data?new Quiver(nt.data):null,rt=nt.datasets.length>0?wrapDatasets(nt.datasets):[],ot={data:et,spec:nt.spec,datasets:rt,useContainerWidth:nt.useContainerWidth,vegaLiteTheme:nt.theme,id:nt.id,selectionMode:nt.selectionMode,formId:nt.formId};return this.lazyVegaLiteChartElement=ot,ot}getIn(){}setIn(){throw new Error("'setIn' cannot be called on an ElementNode")}filterMainScriptElements(nt){if(this.activeScriptHash===nt)return this}clearStaleNodes(nt,et,rt){return et&&et.length&&(!this.fragmentId||!rt||this.scriptRunId===nt)?this:this.scriptRunId===nt?this:void 0}getElements(nt){return isNullOrUndefined$1(nt)&&(nt=new Set),nt.add(this.element),nt}arrowAddRows(nt,et){const rt=this.element.type,ot=new ElementNode(this.element,this.metadata,et,this.activeScriptHash,this.fragmentId);switch(rt){case"arrowTable":case"arrowDataFrame":{ot.lazyQuiverElement=ElementNode.quiverAddRowsHelper(this.quiverElement,nt);break}case"arrowVegaLiteChart":{ot.lazyVegaLiteChartElement=ElementNode.vegaLiteChartAddRowsHelper(this.vegaLiteChartElement,nt);break}default:throw new Error(`elementType '${this.element.type}' is not a valid arrowAddRows target!`)}return ot}static quiverAddRowsHelper(nt,et){if(et.hasName)throw new Error("Add rows cannot be used with a named dataset for this element.");const rt=new Quiver(et.data);return nt.addRows(rt)}static vegaLiteChartAddRowsHelper(nt,et){const rt=et.hasName?et.name:null,ot=new Quiver(et.data);return fn(nt,at=>{const st=getNamedDataSet(at.datasets,rt);st?st.data=st.data.addRows(ot):at.data=at.data?at.data.addRows(ot):ot})}}function getNamedDataSet(tt,nt){return tt.length===1?tt[0]:tt.find(et=>et.hasName&&et.name===nt)}class BlockNode{constructor(nt,et,rt,ot,at,st){this.activeScriptHash=nt,this.children=et??[],this.deltaBlock=rt??new Block$2({}),this.scriptRunId=ot??NO_SCRIPT_RUN_ID,this.fragmentId=at,this.deltaMsgReceivedAt=st}get isEmpty(){return this.children.length===0}getIn(nt){if(nt.length===0)return;const et=nt[0];if(!(et<0||et>=this.children.length))return nt.length===1?this.children[et]:this.children[et].getIn(nt.slice(1))}setIn(nt,et,rt){if(nt.length===0)throw new Error("empty path!");const ot=nt[0];if(ot<0||ot>this.children.length)throw new Error(`Bad 'setIn' index ${ot} (should be between [0, ${this.children.length}])`);const at=this.children.slice();return nt.length===1?at[ot]=et:at[ot]=at[ot].setIn(nt.slice(1),et,rt),new BlockNode(this.activeScriptHash,at,this.deltaBlock,rt,this.fragmentId,this.deltaMsgReceivedAt)}filterMainScriptElements(nt){if(this.activeScriptHash!==nt)return;const et=this.children.map(rt=>rt.filterMainScriptElements(nt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,et,this.deltaBlock,this.scriptRunId,this.fragmentId,this.deltaMsgReceivedAt)}clearStaleNodes(nt,et,rt){if(!et||!et.length){if(this.scriptRunId!==nt)return}else{if(rt&&this.scriptRunId!==nt)return;this.fragmentId&&et.includes(this.fragmentId)&&this.scriptRunId===nt&&(rt=this.fragmentId)}const ot=this.children.map(at=>at.clearStaleNodes(nt,et,rt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,ot,this.deltaBlock,nt,this.fragmentId,this.deltaMsgReceivedAt)}getElements(nt){isNullOrUndefined$1(nt)&&(nt=new Set);for(const et of this.children)et.getElements(nt);return nt}}class AppRoot{static empty(nt="",et=!0,rt,ot){const at=[];let st;switch(getLoadingScreenType()){case LoadingScreenType.NONE:break;case LoadingScreenType.V1:et&&(st=makeElementWithInfoText("Please wait..."));break;default:st=makeAppSkeletonElement()}st&&at.push(new ElementNode(st,ForwardMsgMetadata.create({}),NO_SCRIPT_RUN_ID,nt));const ut=new BlockNode(nt,at,new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ct=rt||new BlockNode(nt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),pt=new BlockNode(nt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),dt=new BlockNode(nt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ft=ot?{logo:ot,activeScriptHash:nt,scriptRunId:NO_SCRIPT_RUN_ID}:null;return new AppRoot(nt,new BlockNode(nt,[ut,ct,pt,dt]),ft)}constructor(nt,et,rt=null){if(this.mainScriptHash=nt,this.root=et,this.appLogo=rt,this.root.children.length!==4||isNullOrUndefined$1(this.main)||isNullOrUndefined$1(this.sidebar)||isNullOrUndefined$1(this.event)||isNullOrUndefined$1(this.bottom))throw new Error(`Invalid root node children! ${et}`)}get main(){const[nt]=this.root.children;return nt}get sidebar(){const[,nt]=this.root.children;return nt}get event(){const[,,nt]=this.root.children;return nt}get bottom(){const[,,,nt]=this.root.children;return nt}get logo(){var nt;return((nt=this.appLogo)==null?void 0:nt.logo)??null}appRootWithLogo(nt,et){return new AppRoot(this.mainScriptHash,this.root,{logo:nt,...et})}applyDelta(nt,et,rt){const{deltaPath:ot,activeScriptHash:at}=rt;switch(et.type){case"newElement":{const st=et.newElement;return this.addElement(ot,nt,st,rt,at,et.fragmentId)}case"addBlock":{const st=Date.now();return this.addBlock(ot,et.addBlock,nt,at,et.fragmentId,st)}case"arrowAddRows":try{return this.arrowAddRows(ot,et.arrowAddRows,nt)}catch(st){const ut=makeElementWithErrorText(ensureError(st).message);return this.addElement(ot,nt,ut,rt,at)}default:throw new Error(`Unrecognized deltaType: '${et.type}'`)}}filterMainScriptElements(nt){var ct;const et=this.main.scriptRunId,rt=this.main.filterMainScriptElements(nt)||new BlockNode(nt),ot=this.sidebar.filterMainScriptElements(nt)||new BlockNode(nt),at=this.event.filterMainScriptElements(nt)||new BlockNode(nt),st=this.bottom.filterMainScriptElements(nt)||new BlockNode(nt),ut=((ct=this.appLogo)==null?void 0:ct.activeScriptHash)===nt?this.appLogo:null;return new AppRoot(nt,new BlockNode(nt,[rt,ot,at,st],new Block$2({allowEmpty:!0}),et),ut)}clearStaleNodes(nt,et){var ct;const rt=this.main.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),ot=this.sidebar.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),at=this.event.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),st=this.bottom.clearStaleNodes(nt,et)||new BlockNode(this.mainScriptHash),ut=((ct=this.appLogo)==null?void 0:ct.scriptRunId)===nt?this.appLogo:null;return new AppRoot(this.mainScriptHash,new BlockNode(this.mainScriptHash,[rt,ot,at,st],new Block$2({allowEmpty:!0}),nt),ut)}getElements(){const nt=new Set;return this.main.getElements(nt),this.sidebar.getElements(nt),this.event.getElements(nt),this.bottom.getElements(nt),nt}addElement(nt,et,rt,ot,at,st){const ut=new ElementNode(rt,ot,et,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(nt,ut,et),this.appLogo)}addBlock(nt,et,rt,ot,at,st){const ut=this.root.getIn(nt);let ct=[];ut instanceof BlockNode&&ut.deltaBlock.type===et.type&&(ct=ut.children);const pt=new BlockNode(ot,ct,et,rt,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(nt,pt,rt),this.appLogo)}arrowAddRows(nt,et,rt){const ot=this.root.getIn(nt);if(isNullOrUndefined$1(ot))throw new Error(`Can't arrowAddRows: invalid deltaPath: ${nt}`);const at=ot.arrowAddRows(et,rt);return new AppRoot(this.mainScriptHash,this.root.setIn(nt,at,rt),this.appLogo)}}function wrapDatasets(tt){return tt.map(nt=>({hasName:nt.hasName,name:nt.name,data:new Quiver(nt.data)}))}const IS_DEV_ENV=!1;var classnames={exports:{}};/*!
|
70
70
|
Copyright (c) 2018 Jed Watson.
|
71
71
|
Licensed under the MIT License (MIT), see
|
72
72
|
http://jedwatson.github.io/classnames
|
@@ -448,7 +448,7 @@ To create a submit button, use the \`st.form_submit_button()\` function.
|
|
448
448
|
For more information, refer to the [documentation for forms](https://docs.streamlit.io/develop/api-reference/execution-flow/st.form).`;function Form(tt){const{formId:nt,widgetMgr:et,hasSubmitButton:rt,children:ot,width:at,scriptRunState:st,clearOnSubmit:ut,enterToSubmit:ct,border:pt}=tt;reactExports.useEffect(()=>{et.setFormSubmitBehaviors(nt,ut,ct)},[et,nt,ut,ct]);const[dt,ft]=reactExports.useState(!1);rt&&dt?ft(!1):!rt&&!dt&&st===ScriptRunState.NOT_RUNNING&&ft(!0);let bt;return dt&&(bt=jsx$1(StyledErrorContainer,{children:jsx$1(AlertElement,{body:MISSING_SUBMIT_BUTTON_WARNING,kind:Kind.ERROR,width:at})})),jsxs(StyledForm,{className:"stForm","data-testid":"stForm",border:pt,children:[ot,bt]})}var ORIENTATION={vertical:"vertical",horizontal:"horizontal"},FILL={fixed:"fixed",intrinsic:"intrinsic"},getTabId=function tt(nt,et){return"tabs-".concat(nt,"-tab-").concat(et)},getTabPanelId=function tt(nt,et){return"tabs-".concat(nt,"-tabpanel-").concat(et)},isHorizontal=function tt(nt){return nt===ORIENTATION.horizontal},isVertical=function tt(nt){return nt===ORIENTATION.vertical},isRTL=function tt(nt){return nt==="rtl"},isIntrinsic=function tt(nt){return nt===FILL.intrinsic},isFixed=function tt(nt){return nt===FILL.fixed};function ownKeys$e(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$d(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$e(Object(et),!0).forEach(function(rt){_defineProperty$h(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$e(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$h(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var StyledRoot$1=styled("div",function(tt){tt.$theme;var nt=tt.$orientation,et=nt===void 0?ORIENTATION.horizontal:nt,rt={transform:"scale(1)"};return isVertical(et)&&(rt.display="flex"),rt});StyledRoot$1.displayName="StyledRoot";StyledRoot$1.displayName="StyledRoot";var StyledTabBar=styled("div",function(tt){var nt=tt.$hasEndEnhancer,et=tt.$orientation;return nt||!isHorizontal(et)?{display:"flex"}:{}});StyledTabBar.displayName="StyledTabBar";StyledTabBar.displayName="StyledTabBar";var StyledTabList=styled("div",function(tt){var nt=tt.$theme,et=tt.$fill,rt=et===void 0?FILL.intrinsic:et,ot=tt.$orientation,at=ot===void 0?ORIENTATION.horizontal:ot,st={position:"relative",display:"flex",flexWrap:"nowrap",flexGrow:1};return isHorizontal(at)?(st.flexDirection="row",st.paddingBottom="5px",st.marginBottom="-5px"):(st.flexDirection="column",isRTL(nt.direction)?(st.paddingLeft="5px",st.marginLeft="-5px"):(st.paddingRight="5px",st.marginRight="-5px")),isIntrinsic(rt)&&(st["::-webkit-scrollbar"]={display:"none"},st["-ms-overflow-style"]="none",st.scrollbarWidth="none",isHorizontal(at)?st.overflowX="scroll":st.overflowY="scroll"),st});StyledTabList.displayName="StyledTabList";StyledTabList.displayName="StyledTabList";var StyledTab=styled("button",function(tt){var nt=tt.$theme,et=tt.$orientation,rt=et===void 0?ORIENTATION.horizontal:et,ot=tt.$fill,at=ot===void 0?FILL.intrinsic:ot,st=tt.$focusVisible,ut=st===void 0?!1:st;tt.$isActive;var ct=_objectSpread$d({cursor:"pointer",WebkitAppearance:"none",marginLeft:"0",marginRight:"0",marginTop:"0",marginBottom:"0",boxSizing:"border-box",display:"inline-flex",alignItems:"center",paddingLeft:nt.sizing.scale600,paddingTop:nt.sizing.scale600,paddingRight:nt.sizing.scale600,paddingBottom:nt.sizing.scale600,borderLeftWidth:0,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none",color:nt.colors.contentPrimary,background:nt.colors.backgroundPrimary,transitionProperty:"background",transitionDuration:nt.animation.timing200,transitionTimingFunction:nt.animation.linearCurve,outline:"none",outlineOffset:"-3px",":disabled":{cursor:"not-allowed",color:nt.colors.contentStateDisabled},":hover":{background:nt.colors.backgroundSecondary},":disabled:hover":{background:"none"}},nt.typography.LabelSmall);return ut&&(ct.outline="3px solid ".concat(nt.colors.accent)),isFixed(at)&&(ct.flexGrow=1,ct.flexBasis=0),isHorizontal(rt)?ct.justifyContent="center":ct.justifyContent="flex-end",ct});StyledTab.displayName="StyledTab";StyledTab.displayName="StyledTab";var StyledEndEnhancerContainer=styled("div",function(tt){var nt=tt.$theme,et=nt.direction==="rtl"?"marginRight":"marginLeft";return _defineProperty$h({display:"flex",alignItems:"center",justifyContent:"flex-end"},et,nt.sizing.scale600)});StyledEndEnhancerContainer.displayName="StyledEndEnhancerContainer";StyledEndEnhancerContainer.displayName="StyledEndEnhancerContainer";var StyledArtworkContainer=styled("div",function(tt){var nt=tt.$theme;tt.$orientation;var et={display:"flex"};return isRTL(nt.direction)?et.marginLeft=nt.sizing.scale300:et.marginRight=nt.sizing.scale300,et});StyledArtworkContainer.displayName="StyledArtworkContainer";StyledArtworkContainer.displayName="StyledArtworkContainer";var StyledTabBorder=styled("div",function(tt){var nt=tt.$theme,et=tt.$orientation,rt=et===void 0?ORIENTATION.horizontal:et,ot={backgroundColor:nt.colors.borderOpaque,position:"relative"};return isHorizontal(rt)?ot.height="5px":ot.width="5px",ot});StyledTabBorder.displayName="StyledTabBorder";StyledTabBorder.displayName="StyledTabBorder";var StyledTabHighlight=styled("div",function(tt){var nt=tt.$theme,et=tt.$orientation,rt=et===void 0?ORIENTATION.horizontal:et,ot=tt.$length,at=ot===void 0?0:ot,st=tt.$distance,ut=st===void 0?0:st,ct=tt.$animate,pt=ct===void 0?!1:ct,dt={backgroundColor:nt.colors.borderSelected,position:"absolute",zIndex:1};return isHorizontal(rt)?(dt.bottom="0px",dt.left="0px",dt.height="5px",dt.width="".concat(at,"px"),dt.transform="translateX(".concat(ut,"px)")):(dt.transform="translateY(".concat(ut,"px)"),dt.width="5px",dt.height="".concat(at,"px"),isRTL(nt.direction)?dt.left="0px":dt.right="0px"),pt&&(dt.transitionProperty="all",dt.transitionDuration=nt.animation.timing400,dt.transitionTimingFunction=nt.animation.easeInOutQuinticCurve),dt});StyledTabHighlight.displayName="StyledTabHighlight";StyledTabHighlight.displayName="StyledTabHighlight";var StyledTabPanel=styled("div",function(tt){var nt=tt.$theme,et=tt.$pad,rt=et===void 0?!0:et,ot={flexGrow:1,outline:"none"};return rt&&(ot.paddingTop=nt.sizing.scale600,ot.paddingRight=nt.sizing.scale600,ot.paddingBottom=nt.sizing.scale600,ot.paddingLeft=nt.sizing.scale600),ot});StyledTabPanel.displayName="StyledTabPanel";StyledTabPanel.displayName="StyledTabPanel";var _excluded$g=["childKey","childIndex","activeKey","orientation","activeTabRef","updateHighlight","parseKeyDown","activateOnFocus","uid","disabled","sharedStylingProps","onChange"],_excluded2$3=["artwork","overrides","tabRef","onClick","title"],_excluded3=["childKey","childIndex","activeKey","uid","sharedStylingProps","renderAll"];function ownKeys$d(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$c(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$d(Object(et),!0).forEach(function(rt){_defineProperty$g(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$d(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$g(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}function _toConsumableArray$1(tt){return _arrayWithoutHoles$1(tt)||_iterableToArray$1(tt)||_unsupportedIterableToArray$f(tt)||_nonIterableSpread$1()}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
449
449
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _iterableToArray$1(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$1(tt){if(Array.isArray(tt))return _arrayLikeToArray$f(tt)}function _objectWithoutProperties$i(tt,nt){if(tt==null)return{};var et=_objectWithoutPropertiesLoose$g(tt,nt),rt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(tt);for(ot=0;ot<at.length;ot++)rt=at[ot],!(nt.indexOf(rt)>=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(et[rt]=tt[rt])}return et}function _objectWithoutPropertiesLoose$g(tt,nt){if(tt==null)return{};var et={},rt=Object.keys(tt),ot,at;for(at=0;at<rt.length;at++)ot=rt[at],!(nt.indexOf(ot)>=0)&&(et[ot]=tt[ot]);return et}function _extends$y(){return _extends$y=Object.assign?Object.assign.bind():function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_extends$y.apply(this,arguments)}function _slicedToArray$f(tt,nt){return _arrayWithHoles$f(tt)||_iterableToArrayLimit$f(tt,nt)||_unsupportedIterableToArray$f(tt,nt)||_nonIterableRest$f()}function _nonIterableRest$f(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
450
450
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$f(tt,nt){if(tt){if(typeof tt=="string")return _arrayLikeToArray$f(tt,nt);var et=Object.prototype.toString.call(tt).slice(8,-1);if(et==="Object"&&tt.constructor&&(et=tt.constructor.name),et==="Map"||et==="Set")return Array.from(tt);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return _arrayLikeToArray$f(tt,nt)}}function _arrayLikeToArray$f(tt,nt){(nt==null||nt>tt.length)&&(nt=tt.length);for(var et=0,rt=new Array(nt);et<nt;et++)rt[et]=tt[et];return rt}function _iterableToArrayLimit$f(tt,nt){var et=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(et!=null){var rt=[],ot=!0,at=!1,st,ut;try{for(et=et.call(tt);!(ot=(st=et.next()).done)&&(rt.push(st.value),!(nt&&rt.length===nt));ot=!0);}catch(ct){at=!0,ut=ct}finally{try{!ot&&et.return!=null&&et.return()}finally{if(at)throw ut}}return rt}}function _arrayWithHoles$f(tt){if(Array.isArray(tt))return tt}var KEYBOARD_ACTION={next:"next",previous:"previous"},getLayoutParams=function tt(nt,et){return nt?isVertical(et)?{length:nt.clientHeight,distance:nt.offsetTop}:{length:nt.clientWidth,distance:nt.offsetLeft}:{length:0,distance:0}},scrollParentToCentreTarget=function tt(nt){var et=nt.parentNode.getBoundingClientRect(),rt=et.x,ot=et.y,at=et.width,st=et.height,ut=nt.getBoundingClientRect(),ct=ut.x,pt=ut.y,dt=ut.width,ft=ut.height,bt={x:ct-rt+dt/2,y:pt-ot+ft/2},ht=nt.parentNode,Mt=ht.scrollLeft,mt=ht.scrollTop,Ot={x:Mt+bt.x-at/2,y:mt+bt.y-st/2};nt.parentNode.scroll(Ot.x,Ot.y)};function RenderEnhancer(tt){var nt=tt.Enhancer;return typeof nt=="string"?nt:reactIsExports$1.isValidElementType(nt)?reactExports.createElement(nt,null):nt}function Tabs$1(tt){var nt=tt.activeKey,et=nt===void 0?"0":nt,rt=tt.disabled,ot=rt===void 0?!1:rt,at=tt.children,st=tt.fill,ut=st===void 0?FILL.intrinsic:st,ct=tt.activateOnFocus,pt=ct===void 0?!0:ct,dt=tt.onChange,ft=tt.orientation,bt=ft===void 0?ORIENTATION.horizontal:ft,ht=tt.overrides,Mt=ht===void 0?{}:ht,mt=tt.renderAll,Ot=mt===void 0?!1:mt,zt=tt.uid,yt=zt===void 0?null:zt,vt=tt.endEnhancer,At=useUID(),St=yt||At,Et=Mt.Root,Tt=Mt.TabList,Rt=Mt.TabHighlight,Ct=Mt.TabBorder,wt=getOverrides(Et,StyledRoot$1),Lt=_slicedToArray$f(wt,2),Ht=Lt[0],jt=Lt[1],s0=getOverrides(Tt,StyledTabList),Ut=_slicedToArray$f(s0,2),Yt=Ut[0],O0=Ut[1],a0=getOverrides(Rt,StyledTabHighlight),b0=_slicedToArray$f(a0,2),kt=b0[0],o0=b0[1],qt=getOverrides(Ct,StyledTabBorder),Dt=_slicedToArray$f(qt,2),Bt=Dt[0],p0=Dt[1],r0=getOverrides(Mt.EndEnhancerContainer,StyledEndEnhancerContainer),l0=_slicedToArray$f(r0,2),f0=l0[0],i0=l0[1],$t=reactExports.useState(0),It=_slicedToArray$f($t,2),Vt=It[0],xt=It[1];reactExports.useEffect(function(){xt(Vt+1)},[et]);var Ft=reactExports.useRef(),Pt=reactExports.useState({length:0,distance:0}),Zt=_slicedToArray$f(Pt,2),Kt=Zt[0],n0=Zt[1],c0=reactExports.useCallback(function(){Ft.current&&n0(getLayoutParams(Ft.current,bt))},[Ft.current,bt]);reactExports.useEffect(c0,[Ft.current,bt]),reactExports.useEffect(function(){Ft.current&&(isHorizontal(bt)?Ft.current.parentNode.scrollWidth>Ft.current.parentNode.clientWidth:Ft.current.parentNode.scrollHeight>Ft.current.parentNode.clientHeight)&&(Vt>1?Ft.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}):scrollParentToCentreTarget(Ft.current))},[Ft.current]);var u0={$orientation:bt,$fill:ut},y0=useStyletron(),D0=_slicedToArray$f(y0,2),S0=D0[1],x0=reactExports.useCallback(function(m0){if(isHorizontal(bt))if(isRTL(S0.direction))switch(m0.keyCode){case 39:return KEYBOARD_ACTION.previous;case 37:return KEYBOARD_ACTION.next;default:return null}else switch(m0.keyCode){case 37:return KEYBOARD_ACTION.previous;case 39:return KEYBOARD_ACTION.next;default:return null}else switch(m0.keyCode){case 38:return KEYBOARD_ACTION.previous;case 40:return KEYBOARD_ACTION.next;default:return null}},[bt,S0.direction]);return reactExports.createElement(Ht,_extends$y({},u0,jt),reactExports.createElement(StyledTabBar,{$hasEndEnhancer:!!vt,$orientation:bt},reactExports.createElement(Yt,_extends$y({"data-baseweb":"tab-list",role:"tablist","aria-orientation":bt},u0,O0),reactExports.Children.map(at,function(m0,e0){if(m0)return reactExports.createElement(InternalTab,_extends$y({childKey:m0.key,childIndex:e0,activeKey:et,orientation:bt,activeTabRef:Ft,updateHighlight:c0,parseKeyDown:x0,activateOnFocus:pt,uid:St,disabled:ot,sharedStylingProps:u0,onChange:dt},m0.props))}),reactExports.createElement(kt,_extends$y({"data-baseweb":"tab-highlight",$length:Kt.length,$distance:Kt.distance,$animate:Vt>1,"aria-hidden":"true",role:"presentation"},u0,o0))),bt===ORIENTATION.horizontal&&vt!==null&&vt!==void 0&&reactExports.createElement(f0,_extends$y({},i0,{$orientation:bt}),reactExports.createElement(RenderEnhancer,{Enhancer:vt}))),reactExports.createElement(Bt,_extends$y({"data-baseweb":"tab-border","aria-hidden":"true",role:"presentation"},u0,p0)),reactExports.Children.map(at,function(m0,e0){if(m0)return reactExports.createElement(InternalTabPanel,_extends$y({childKey:m0.key,childIndex:e0,activeKey:et,uid:St,sharedStylingProps:u0,renderAll:Ot},m0.props))}))}function InternalTab(tt){var nt=tt.childKey,et=tt.childIndex,rt=tt.activeKey,ot=tt.orientation,at=tt.activeTabRef,st=tt.updateHighlight,ut=tt.parseKeyDown,ct=tt.activateOnFocus,pt=tt.uid,dt=tt.disabled,ft=tt.sharedStylingProps,bt=tt.onChange,ht=_objectWithoutProperties$i(tt,_excluded$g),Mt=nt||String(et),mt=Mt==rt,Ot=ht.artwork,zt=ht.overrides,yt=zt===void 0?{}:zt,vt=ht.tabRef,At=ht.onClick,St=ht.title,Et=_objectWithoutProperties$i(ht,_excluded2$3),Tt=reactExports.useRef();reactExports.useImperativeHandle(vt,function(){return mt?at.current:Tt.current});var Rt=reactExports.useRef({length:0,distance:0});reactExports.useEffect(function(){Rt.current=getLayoutParams(mt?at.current:Tt.current,ot)}),reactExports.useEffect(function(){if(window.ResizeObserver){var r0=new window.ResizeObserver(function(l0){if(l0[0]&&l0[0].target){var f0=getLayoutParams(l0[0].target,ot);(f0.length!==Rt.current.length||f0.distance!==Rt.current.distance)&&st()}});return r0.observe(mt?at.current:Tt.current),function(){r0.disconnect()}}},[rt,ot]),reactExports.useEffect(st,[St]);var Ct=yt.Tab,wt=yt.ArtworkContainer,Lt=getOverrides(Ct,StyledTab),Ht=_slicedToArray$f(Lt,2),jt=Ht[0],s0=Ht[1],Ut=getOverrides(wt,StyledArtworkContainer),Yt=_slicedToArray$f(Ut,2),O0=Yt[0],a0=Yt[1],b0=reactExports.useState(!1),kt=_slicedToArray$f(b0,2),o0=kt[0],qt=kt[1],Dt=reactExports.useCallback(function(r0){isFocusVisible(r0)&&qt(!0)},[]),Bt=reactExports.useCallback(function(r0){o0!==!1&&qt(!1)},[o0]),p0=reactExports.useCallback(function(r0){var l0=_toConsumableArray$1(r0.target.parentNode.childNodes).filter(function(It){return!It.disabled&&It.getAttribute("role")==="tab"});if(l0.length!==1){var f0=l0.indexOf(r0.target),i0=ut(r0);if(i0){var $t;i0===KEYBOARD_ACTION.previous?l0[f0-1]?$t=l0[f0-1]:$t=l0[l0.length-1]:i0===KEYBOARD_ACTION.next&&(l0[f0+1]?$t=l0[f0+1]:$t=l0[0]),$t&&($t.focus(),ct&&$t.click()),isVertical(ot)&&r0.preventDefault()}}});return reactExports.createElement(jt,_extends$y({"data-baseweb":"tab",key:Mt,id:getTabId(pt,Mt),role:"tab",onKeyDown:p0,"aria-selected":mt,"aria-controls":getTabPanelId(pt,Mt),tabIndex:mt?"0":"-1",ref:mt?at:Tt,disabled:!mt&&dt,type:"button",$focusVisible:o0,$isActive:mt},ft,Et,s0,{onClick:function(l0){typeof bt=="function"&&bt({activeKey:Mt}),typeof At=="function"&&At(l0)},onFocus:forkFocus(_objectSpread$c(_objectSpread$c({},Et),s0),Dt),onBlur:forkBlur(_objectSpread$c(_objectSpread$c({},Et),s0),Bt)}),Ot?reactExports.createElement(O0,_extends$y({"data-baseweb":"artwork-container"},ft,a0),reactExports.createElement(Ot,{size:20,color:"contentPrimary"})):null,St||Mt)}function InternalTabPanel(tt){var nt=tt.childKey,et=tt.childIndex,rt=tt.activeKey,ot=tt.uid,at=tt.sharedStylingProps,st=tt.renderAll,ut=_objectWithoutProperties$i(tt,_excluded3),ct=nt||String(et),pt=ct==rt,dt=ut.overrides,ft=dt===void 0?{}:dt,bt=ut.children,ht=ft.TabPanel,Mt=getOverrides(ht,StyledTabPanel),mt=_slicedToArray$f(Mt,2),Ot=mt[0],zt=mt[1];return reactExports.createElement(Ot,_extends$y({"data-baseweb":"tab-panel",key:ct,role:"tabpanel",id:getTabPanelId(ot,ct),"aria-labelledby":getTabId(ot,ct),hidden:!pt},at,zt),pt||st?bt:null)}function Tab(tt){return null}function shouldComponentBeEnabled(tt,nt){return tt!=="empty"||nt!==ScriptRunState.RUNNING}function isElementStale(tt,nt,et,rt){return nt===ScriptRunState.RERUN_REQUESTED?!0:nt===ScriptRunState.RUNNING?rt&&rt.length?!!(tt.fragmentId&&rt.includes(tt.fragmentId)&&tt.scriptRunId!==et):tt.scriptRunId!==et:!1}function isComponentStale(tt,nt,et,rt,ot){return!tt||isElementStale(nt,et,rt,ot)}function assignDividerColor(tt,nt){const et=getDividerColors(nt),rt=Object.keys(et),{blue:ot,green:at,orange:st,red:ut,violet:ct}=et,pt={blue:ot,green:at,orange:st,red:ut,violet:ct},dt=Object.keys(pt);let ft=0;Array.from(tt.getElements()).forEach(bt=>{var Mt;const ht=(Mt=bt.heading)==null?void 0:Mt.divider;if(bt.type==="heading"&&ht)if(ht==="auto"){const mt=dt[ft];bt.heading.divider=pt[mt],ft+=1,ft===dt.length&&(ft=0)}else rt.includes(ht)&&(bt.heading.divider=et[ht])})}function convertKeyToClassName(tt){return tt?"st-key-"+tt.trim().replace(/[^a-zA-Z0-9_-]/g,"-"):""}function getKeyFromId(tt){if(!tt||!isValidElementId(tt))return;const et=tt.split("-").slice(2).join("-");return et==="None"?void 0:et}const StyledTabContainer=newStyled("div",{target:"euv9o0k0"})(({theme:tt,isOverflowing:nt,tabHeight:et})=>({...nt?{position:"relative","::after":{content:'" "',position:"absolute",zIndex:tt.zIndices.priority,top:0,right:0,pointerEvents:"none",backgroundImage:`linear-gradient(to right, ${transparentize(tt.colors.bgColor,1)}, ${tt.colors.bgColor})`,width:tt.spacing.lg,height:et}}:{}}));function Tabs(tt){const{widgetsDisabled:nt,node:et,isStale:rt,scriptRunState:ot,scriptRunId:at}=tt,{fragmentIdsThisRun:st}=reactExports.useContext(LibContext);let ut=[];const[ct,pt]=reactExports.useState(0),[dt,ft]=reactExports.useState(et.children[0].deltaBlock.tab.label||"0"),bt=reactExports.useRef(null),ht=useTheme(),[Mt,mt]=reactExports.useState(!1);reactExports.useEffect(()=>{ut.indexOf(dt)===-1&&(pt(0),ft(ut[0]))},[ut]),reactExports.useEffect(()=>{if(bt.current){const{scrollWidth:vt,clientWidth:At}=bt.current;mt(vt>At)}const yt=ut.indexOf(dt);yt!==-1?(pt(yt),ft(ut[yt])):(pt(0),ft(ut[0]))},[et.children.length]);const Ot=ht.sizes.tabHeight,zt=ht.spacing.threeXS;return jsx$1(StyledTabContainer,{className:"stTabs","data-testid":"stTabs",isOverflowing:Mt,tabHeight:Ot,children:jsx$1(Tabs$1,{activateOnFocus:!0,activeKey:ct,onChange:({activeKey:yt})=>{pt(yt),ft(ut[yt])},renderAll:!0,disabled:nt,overrides:{TabHighlight:{style:()=>({backgroundColor:nt?ht.colors.fadedText40:ht.colors.primary,height:zt})},TabBorder:{style:()=>({backgroundColor:ht.colors.borderColorLight,height:zt})},TabList:{props:{ref:bt},style:()=>({gap:ht.spacing.lg,marginBottom:`-${zt}`,paddingBottom:zt,overflowY:"hidden",...rt&&STALE_STYLES})},Root:{style:()=>({transform:"none"})}},children:et.children.map((yt,vt)=>{var Ct,wt;vt===0&&(ut=[]);const At=isElementStale(yt,ot,at,st),St={...tt,isStale:rt||At,widgetsDisabled:nt,node:yt};let Et=vt.toString();(wt=(Ct=St.node.deltaBlock)==null?void 0:Ct.tab)!=null&&wt.label&&(Et=St.node.deltaBlock.tab.label),ut[vt]=Et;const Tt=ct.toString()===vt.toString(),Rt=vt===et.children.length-1;return jsx$1(Tab,{"data-testid":"stTab",title:jsx$1(StreamlitMarkdown$1,{source:Et,allowHTML:!1,isLabel:!0}),disabled:nt,overrides:{TabPanel:{style:()=>({paddingLeft:ht.spacing.none,paddingRight:ht.spacing.none,paddingBottom:ht.spacing.none,paddingTop:ht.spacing.lg})},Tab:{style:()=>({height:Ot,whiteSpace:"nowrap",paddingLeft:ht.spacing.none,paddingRight:ht.spacing.none,paddingTop:ht.spacing.none,paddingBottom:ht.spacing.none,fontSize:ht.fontSizes.sm,background:"transparent",color:nt?ht.colors.fadedText40:ht.colors.bodyText,":focus":{outline:"none",color:nt?ht.colors.fadedText40:ht.colors.primary,background:"none"},":hover":{color:nt?ht.colors.fadedText40:ht.colors.primary,background:"none"},...Tt?{color:nt?ht.colors.fadedText40:ht.colors.primary}:{},...Mt&&Rt?{paddingRight:`calc(${ht.spacing.lg} * 0.6)`}:{},...!rt&&At&&STALE_STYLES})}},children:tt.renderTabContent(St)},vt)})})})}var _excluded$f=["children","iconAttrs","iconVerticalAlign","iconViewBox","size","title"];function ownKeys$c(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$b(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$c(Object(et),!0).forEach(function(rt){_defineProperty$u(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$c(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}var EmotionIconBaseBase=reactExports.forwardRef(function(tt,nt){var et=tt.children,rt=tt.iconAttrs;tt.iconVerticalAlign;var ot=tt.iconViewBox,at=tt.size,st=tt.title,ut=_objectWithoutProperties$o(tt,_excluded$f),ct=_objectSpread$b(_objectSpread$b({viewBox:ot,height:tt.height!==void 0?tt.height:at,width:tt.width!==void 0?tt.width:at,"aria-hidden":st==null?"true":void 0,focusable:"false",role:st!=null?"img":void 0},rt),ut);return reactExports.createElement("svg",_extends$Q({},ct,{ref:nt}),st&&reactExports.createElement("title",{key:"icon-title"},st),et)}),EmotionIconBase=createStyled(EmotionIconBaseBase,{target:"ex0cdmw0"})("display:inline-block;vertical-align:",function(tt){return tt.iconVerticalAlign},";overflow:hidden;"),ArrowDownward=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),reactExports.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))});ArrowDownward.displayName="ArrowDownward";var ArrowUpward=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),reactExports.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}))});ArrowUpward.displayName="ArrowUpward";var Check=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),reactExports.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}))});Check.displayName="Check";var ChevronLeft=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),reactExports.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});ChevronLeft.displayName="ChevronLeft";var ChevronRight=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),reactExports.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});ChevronRight.displayName="ChevronRight";var ExpandLess=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),reactExports.createElement("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14l-6-6z"}))});ExpandLess.displayName="ExpandLess";var ExpandMore=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M24 24H0V0h24v24z",opacity:.87}),reactExports.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"}))});ExpandMore.displayName="ExpandMore";var Face=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),reactExports.createElement("path",{d:"M10.25 13a1.25 1.25 0 11-2.5 0 1.25 1.25 0 012.5 0zM15 11.75a1.25 1.25 0 100 2.5 1.25 1.25 0 000-2.5zm7 .25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c.46 0 .91-.05 1.34-.12C17.44 5.56 14.9 4 12 4c-.46 0-.91.05-1.34.12zM4.42 9.47a8.046 8.046 0 003.66-4.44 8.046 8.046 0 00-3.66 4.44zM20 12c0-.78-.12-1.53-.33-2.24-.7.15-1.42.24-2.17.24a10 10 0 01-7.76-3.69A10.016 10.016 0 014 11.86c.01.04 0 .09 0 .14 0 4.41 3.59 8 8 8s8-3.59 8-8z"}))});Face.displayName="Face";var SmartToy=reactExports.forwardRef(function(tt,nt){var et={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return reactExports.createElement(EmotionIconBase,_extends$Q({iconAttrs:et,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},tt,{ref:nt}),reactExports.createElement("rect",{width:24,height:24,fill:"none"}),reactExports.createElement("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3zm-2 10H6V7h12v12zm-9-6c-.83 0-1.5-.67-1.5-1.5S8.17 10 9 10s1.5.67 1.5 1.5S9.83 13 9 13zm7.5-1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM8 15h8v2H8v-2z"}))});SmartToy.displayName="SmartToy";const StyledPopoverButtonIcon=newStyled("div",{target:"e1cuvrbr0"})(({theme:tt})=>({marginLeft:tt.spacing.threeXS,marginRight:`calc(-${tt.iconSizes.lg} * 0.25)`})),Popover=({element:tt,empty:nt,width:et,children:rt})=>{const[ot,at]=React$1.useState(!1),st=React$1.useContext(IsSidebarContext),ut=useTheme(),ct=hasLightBackgroundColor(ut),pt=tt.help?et:!0;return jsx$1("div",{"data-testid":"stPopover",className:"stPopover",children:jsx$1(Popover$1,{triggerType:TRIGGER_TYPE.click,placement:PLACEMENT.bottomLeft,content:()=>rt,isOpen:ot,onClickOutside:()=>at(!1),onClick:()=>ot?at(!1):void 0,onEsc:()=>at(!1),ignoreBoundary:st,renderAll:!0,overrides:{Body:{props:{"data-testid":"stPopoverBody"},style:()=>({marginRight:ut.spacing.lg,marginBottom:ut.spacing.lg,maxHeight:"70vh",overflow:"auto",maxWidth:`calc(${ut.sizes.contentMaxWidth} - 2*${ut.spacing.lg})`,minWidth:tt.useContainerWidth?`${Math.max(et,160)}px`:ut.sizes.minPopupWidth,[`@media (max-width: ${ut.breakpoints.sm})`]:{maxWidth:`calc(100% - ${ut.spacing.threeXL})`},borderTopLeftRadius:ut.radii.xl,borderTopRightRadius:ut.radii.xl,borderBottomRightRadius:ut.radii.xl,borderBottomLeftRadius:ut.radii.xl,borderLeftWidth:ut.sizes.borderWidth,borderRightWidth:ut.sizes.borderWidth,borderTopWidth:ut.sizes.borderWidth,borderBottomWidth:ut.sizes.borderWidth,paddingRight:`calc(${ut.spacing.twoXL} - ${ut.sizes.borderWidth})`,paddingLeft:`calc(${ut.spacing.twoXL} - ${ut.sizes.borderWidth})`,paddingBottom:`calc(${ut.spacing.twoXL} - ${ut.sizes.borderWidth})`,paddingTop:`calc(${ut.spacing.twoXL} - ${ut.sizes.borderWidth})`,borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftColor:ut.colors.borderColor,borderRightColor:ut.colors.borderColor,borderTopColor:ut.colors.borderColor,borderBottomColor:ut.colors.borderColor,boxShadow:ct?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"})}},children:jsx$1("div",{children:jsx$1(BaseButtonTooltip,{help:tt.help,children:jsxs(BaseButton,{"data-testid":"stPopoverButton",kind:BaseButtonKind.SECONDARY,size:BaseButtonSize.SMALL,disabled:nt||tt.disabled,fluidWidth:tt.useContainerWidth?pt:!1,onClick:()=>at(!ot),children:[jsx$1(DynamicButtonLabel,{icon:tt.icon,label:tt.label}),jsx$1(StyledPopoverButtonIcon,{children:jsx$1(StyledIcon,{as:ot?ExpandLess:ExpandMore,color:"inherit","aria-hidden":"true",size:"lg",margin:ut.spacing.none,padding:ut.spacing.none})})]})})})})})},StyledChatMessageContainer=newStyled("div",{target:"e16gn19s0"})(({theme:tt,background:nt})=>{const et=hasLightBackgroundColor(tt);return{display:"flex",alignItems:"flex-start",gap:tt.spacing.sm,padding:tt.spacing.lg,paddingRight:nt?tt.spacing.lg:0,borderRadius:tt.radii.default,...nt?{backgroundColor:transparentize(et?tt.colors.gray20:tt.colors.gray90,.5)}:{}}}),StyledMessageContent=newStyled("div",{target:"e16gn19s1"})(({theme:tt})=>({color:tt.colors.bodyText,margin:"auto",flexGrow:1,minWidth:0})),StyledAvatarBackground=newStyled("div",{target:"e16gn19s2"})(({theme:tt})=>{const nt=hasLightBackgroundColor(tt);return{display:"flex",border:`${tt.sizes.borderWidth} solid ${nt?tt.colors.gray40:tt.colors.gray85}`,backgroundColor:nt?tt.colors.white:tt.colors.gray100,color:nt?tt.colors.gray90:tt.colors.white,lineHeight:tt.lineHeights.none,fontSize:tt.fontSizes.md,flexShrink:0,width:tt.sizes.chatAvatarSize,height:tt.sizes.chatAvatarSize,borderRadius:tt.radii.default,alignItems:"center",justifyContent:"center"}}),StyledAvatarIcon=newStyled("div",{target:"e16gn19s3"})(({theme:tt,background:nt})=>{const et=hasLightBackgroundColor(tt);return{display:"flex",width:tt.sizes.chatAvatarSize,height:tt.sizes.chatAvatarSize,flexShrink:0,borderRadius:tt.radii.default,alignItems:"center",justifyContent:"center",backgroundColor:nt,color:et?tt.colors.white:tt.colors.gray100}}),StyledAvatarImage=newStyled("img",{target:"e16gn19s4"})(({theme:tt})=>({width:tt.sizes.chatAvatarSize,height:tt.sizes.chatAvatarSize,flexShrink:0,borderRadius:tt.radii.default,objectFit:"cover",display:"flex"}));function ChatMessageAvatar(tt){const{avatar:nt,avatarType:et,name:rt,endpoints:ot}=tt,at=useTheme();if(nt)switch(et){case Block$2.ChatMessage.AvatarType.IMAGE:return jsx$1(StyledAvatarImage,{src:ot.buildMediaURL(nt),alt:`${rt} avatar`});case Block$2.ChatMessage.AvatarType.EMOJI:return jsx$1(StyledAvatarBackground,{children:nt});case Block$2.ChatMessage.AvatarType.ICON:if(nt==="user")return jsx$1(StyledAvatarIcon,{"data-testid":"stChatMessageAvatarUser",background:at.colors.red60,children:jsx$1(Icon$2,{content:Face,size:"lg"})});if(nt==="assistant")return jsx$1(StyledAvatarIcon,{"data-testid":"stChatMessageAvatarAssistant",background:at.colors.orange60,children:jsx$1(Icon$2,{content:SmartToy,size:"lg"})});if(nt.startsWith(":material"))return jsx$1(StyledAvatarBackground,{"data-testid":"stChatMessageAvatarCustom",children:jsx$1(DynamicIcon,{size:"lg",iconValue:nt,color:at.colors.bodyText})})}return jsx$1(StyledAvatarBackground,{children:rt?rt.charAt(0).toUpperCase():"🧑💻"})}const ChatMessage=({endpoints:tt,element:nt,children:et})=>{const{avatar:rt,avatarType:ot,name:at}=nt;return jsxs(StyledChatMessageContainer,{className:"stChatMessage","data-testid":"stChatMessage",background:["user","human"].includes(at.toLowerCase()),children:[jsx$1(ChatMessageAvatar,{name:at,avatar:rt,avatarType:ot,endpoints:tt}),jsx$1(StyledMessageContent,{"data-testid":"stChatMessageContent","aria-label":`Chat message from ${at}`,children:et})]})};var SIZE$2={default:"default",full:"full",auto:"auto"},SIZE_WIDTHS={default:"500px",full:"100%",auto:"auto"},ROLE={dialog:"dialog",alertdialog:"alertdialog"},CLOSE_SOURCE={closeButton:"closeButton",backdrop:"backdrop",escape:"escape"};function ownKeys$b(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$a(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$b(Object(et),!0).forEach(function(rt){_defineProperty$f(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$b(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$f(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}function getSizeStyles(tt){var nt={maxWidth:"100%",width:null};return typeof tt=="number"?nt.width="".concat(tt,"px"):SIZE$2[tt]?nt.width=SIZE_WIDTHS[tt]:typeof tt=="string"&&(nt.width=tt),tt===SIZE$2.full&&(nt.alignSelf="stretch"),nt}var Root$3=styled("div",function(tt){var nt=tt.$isOpen;return{position:"fixed",overflow:"auto",right:0,bottom:0,top:0,left:0,pointerEvents:nt?"auto":"none"}});Root$3.displayName="Root";Root$3.displayName="Root";var DialogContainer=styled("div",function(tt){var nt=tt.$animate,et=tt.$isOpen,rt=tt.$isVisible,ot=tt.$theme,at={transitionProperty:"opacity",transitionDuration:ot.animation.timing400,transitionTimingFunction:ot.animation.easeOutCurve};return _objectSpread$a({display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minHeight:"100%",userSelect:"none",pointerEvents:"auto",backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",opacity:rt&&et?1:0},nt?at:null)});DialogContainer.displayName="DialogContainer";DialogContainer.displayName="DialogContainer";var Dialog$1=styled("div",function(tt){var nt=tt.$animate,et=tt.$isOpen,rt=tt.$isVisible,ot=tt.$size,at=tt.$theme;return _objectSpread$a(_objectSpread$a(_objectSpread$a({position:"relative",backgroundColor:at.colors.backgroundPrimary,borderTopLeftRadius:at.borders.radius500,borderTopRightRadius:at.borders.radius500,borderBottomRightRadius:at.borders.radius500,borderBottomLeftRadius:at.borders.radius500,marginLeft:at.sizing.scale600,marginTop:at.sizing.scale600,marginRight:at.sizing.scale600,marginBottom:at.sizing.scale600},getSizeStyles(ot)),{},{opacity:rt&&et?1:0,transform:rt?"translateY(0)":"translateY(20px)"},nt?{transitionProperty:"opacity, transform",transitionDuration:at.animation.timing400,transitionTimingFunction:at.animation.easeOutCurve}:null),{},{userSelect:"text",pointerEvents:et?"all":"none",":focus":{outline:"none"}})});Dialog$1.displayName="Dialog";Dialog$1.displayName="Dialog";var Close=styled("button",function(tt){var nt,et=tt.$theme,rt=tt.$isFocusVisible,ot=et.direction==="rtl"?"left":"right";return nt={background:"transparent",outline:0,paddingLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,color:et.colors.modalCloseColor,transitionProperty:"color, border-color",transitionDuration:et.animation.timing200,borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:"transparent",":hover":{color:et.colors.modalCloseColorHover},":focus":{outline:rt?"3px solid ".concat(et.colors.accent):"none"},position:"absolute",top:et.sizing.scale500},_defineProperty$f(nt,ot,et.sizing.scale500),_defineProperty$f(nt,"width",et.sizing.scale800),_defineProperty$f(nt,"height",et.sizing.scale800),_defineProperty$f(nt,"display","flex"),_defineProperty$f(nt,"justifyContent","center"),_defineProperty$f(nt,"alignItems","center"),_defineProperty$f(nt,"cursor","pointer"),nt});Close.displayName="Close";Close.displayName="Close";var ModalHeader$1=styled("div",function(tt){var nt,et=tt.$theme,rt=et.direction==="rtl"?"marginRight":"marginLeft",ot=et.direction==="rtl"?"marginLeft":"marginRight";return _objectSpread$a(_objectSpread$a({},et.typography.font550),{},(nt={color:et.colors.contentPrimary,marginTop:et.sizing.scale900,marginBottom:et.sizing.scale600},_defineProperty$f(nt,rt,et.sizing.scale800),_defineProperty$f(nt,ot,et.sizing.scale900),nt))});ModalHeader$1.displayName="ModalHeader";ModalHeader$1.displayName="ModalHeader";var ModalBody$2=styled("div",function(tt){var nt=tt.$theme;return _objectSpread$a(_objectSpread$a({},nt.typography.font200),{},{color:nt.colors.contentSecondary,marginTop:nt.sizing.scale600,marginLeft:nt.sizing.scale800,marginRight:nt.sizing.scale800,marginBottom:nt.sizing.scale700})});ModalBody$2.displayName="ModalBody";ModalBody$2.displayName="ModalBody";var ModalFooter$1=styled("div",function(tt){var nt=tt.$theme;return _objectSpread$a(_objectSpread$a({},nt.typography.font200),{},{marginTop:nt.sizing.scale700,marginLeft:nt.sizing.scale800,marginRight:nt.sizing.scale800,paddingTop:nt.sizing.scale500,paddingBottom:nt.sizing.scale500,textAlign:nt.direction==="rtl"?"left":"right"})});ModalFooter$1.displayName="ModalFooter";ModalFooter$1.displayName="ModalFooter";function CloseIcon(){return reactExports.createElement("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{stroke:"currentColor"},xmlns:"http://www.w3.org/2000/svg"},reactExports.createElement("path",{d:"M9 1L5 5M1 9L5 5M5 5L1 1M5 5L9 9",strokeWidth:"2",strokeLinecap:"round"}))}function _typeof$8(tt){"@babel/helpers - typeof";return _typeof$8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$8(tt)}function _extends$x(){return _extends$x=Object.assign?Object.assign.bind():function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_extends$x.apply(this,arguments)}function _slicedToArray$e(tt,nt){return _arrayWithHoles$e(tt)||_iterableToArrayLimit$e(tt,nt)||_unsupportedIterableToArray$e(tt,nt)||_nonIterableRest$e()}function _nonIterableRest$e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
451
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$e(tt,nt){if(tt){if(typeof tt=="string")return _arrayLikeToArray$e(tt,nt);var et=Object.prototype.toString.call(tt).slice(8,-1);if(et==="Object"&&tt.constructor&&(et=tt.constructor.name),et==="Map"||et==="Set")return Array.from(tt);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return _arrayLikeToArray$e(tt,nt)}}function _arrayLikeToArray$e(tt,nt){(nt==null||nt>tt.length)&&(nt=tt.length);for(var et=0,rt=new Array(nt);et<nt;et++)rt[et]=tt[et];return rt}function _iterableToArrayLimit$e(tt,nt){var et=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(et!=null){var rt=[],ot=!0,at=!1,st,ut;try{for(et=et.call(tt);!(ot=(st=et.next()).done)&&(rt.push(st.value),!(nt&&rt.length===nt));ot=!0);}catch(ct){at=!0,ut=ct}finally{try{!ot&&et.return!=null&&et.return()}finally{if(at)throw ut}}return rt}}function _arrayWithHoles$e(tt){if(Array.isArray(tt))return tt}function _classCallCheck$g(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$e(tt,nt,et){return nt&&_defineProperties$6(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$g(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$6(tt,nt)}function _setPrototypeOf$6(tt,nt){return _setPrototypeOf$6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$6(tt,nt)}function _createSuper$5(tt){var nt=_isNativeReflectConstruct$5();return function(){var rt=_getPrototypeOf$6(tt),ot;if(nt){var at=_getPrototypeOf$6(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$g(this,ot)}}function _possibleConstructorReturn$g(tt,nt){if(nt&&(_typeof$8(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$6(tt)}function _assertThisInitialized$6(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$5(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$6(tt){return _getPrototypeOf$6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$6(tt)}function _defineProperty$e(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var Modal$1=function(tt){_inherits$g(et,tt);var nt=_createSuper$5(et);function et(){var rt;_classCallCheck$g(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return rt=nt.call.apply(nt,[this].concat(at)),_defineProperty$e(_assertThisInitialized$6(rt),"animateOutTimer",void 0),_defineProperty$e(_assertThisInitialized$6(rt),"animateStartTimer",void 0),_defineProperty$e(_assertThisInitialized$6(rt),"dialogContainerRef",reactExports.createRef()),_defineProperty$e(_assertThisInitialized$6(rt),"lastFocus",null),_defineProperty$e(_assertThisInitialized$6(rt),"lastMountNodeOverflowStyle",null),_defineProperty$e(_assertThisInitialized$6(rt),"rootRef",reactExports.createRef()),_defineProperty$e(_assertThisInitialized$6(rt),"state",{isVisible:!1,mounted:!1,isFocusVisible:!1}),_defineProperty$e(_assertThisInitialized$6(rt),"handleFocus",function(ut){isFocusVisible(ut)&&rt.setState({isFocusVisible:!0})}),_defineProperty$e(_assertThisInitialized$6(rt),"handleBlur",function(ut){rt.state.isFocusVisible!==!1&&rt.setState({isFocusVisible:!1})}),_defineProperty$e(_assertThisInitialized$6(rt),"onEscape",function(){rt.props.closeable&&rt.triggerClose(CLOSE_SOURCE.escape)}),_defineProperty$e(_assertThisInitialized$6(rt),"onDocumentClick",function(ut){ut.target&&ut.target instanceof HTMLElement&&ut.target.contains(rt.dialogContainerRef.current)&&rt.onBackdropClick()}),_defineProperty$e(_assertThisInitialized$6(rt),"onBackdropClick",function(){rt.props.closeable&&rt.triggerClose(CLOSE_SOURCE.backdrop)}),_defineProperty$e(_assertThisInitialized$6(rt),"onCloseClick",function(){rt.triggerClose(CLOSE_SOURCE.closeButton)}),_defineProperty$e(_assertThisInitialized$6(rt),"animateOutComplete",function(){rt.setState({isVisible:!1})}),rt}return _createClass$e(et,[{key:"componentDidMount",value:function(){this.setState({mounted:!0})}},{key:"componentWillUnmount",value:function(){this.resetMountNodeScroll(),this.clearTimers()}},{key:"componentDidUpdate",value:function(ot,at){var st=this.props.isOpen;(st!==ot.isOpen||st&&this.state.mounted&&!at.mounted)&&(st?this.didOpen():this.didClose())}},{key:"disableMountNodeScroll",value:function(){var ot=this.getMountNode();this.lastMountNodeOverflowStyle=ot.style.overflow||"",ot.style.overflow="hidden"}},{key:"resetMountNodeScroll",value:function(){var ot=this.getMountNode(),at=this.lastMountNodeOverflowStyle;ot&&at!==null&&(ot.style.overflow==="hidden"&&(ot.style.overflow=at||""),this.lastMountNodeOverflowStyle=null)}},{key:"clearTimers",value:function(){this.animateOutTimer&&clearTimeout(this.animateOutTimer),this.animateStartTimer&&cancelAnimationFrame(this.animateStartTimer)}},{key:"didOpen",value:function(){var ot=this,at=this.rootRef.current;at&&(at.scrollTop=0),this.clearTimers(),this.disableMountNodeScroll(),this.animateStartTimer=requestAnimationFrame(function(){ot.setState({isVisible:!0})})}},{key:"didClose",value:function(){this.resetMountNodeScroll(),this.animateOutTimer=setTimeout(this.animateOutComplete,500)}},{key:"triggerClose",value:function(ot){this.props.onClose&&ot&&this.props.onClose({closeSource:ot})}},{key:"getSharedProps",value:function(){var ot=this.props,at=ot.animate,st=ot.isOpen,ut=ot.size,ct=ot.role,pt=ot.closeable;return{$animate:at,$isVisible:this.state.isVisible,$isOpen:!!st,$size:ut,$role:ct,$closeable:!!pt,$isFocusVisible:this.state.isFocusVisible}}},{key:"getMountNode",value:function(){var ot=this.props.mountNode;return ot||document.body}},{key:"getChildren",value:function(){var ot=this.props.children;return typeof ot=="function"?ot():ot}},{key:"renderModal",value:function(){var ot=this,at=this.props,st=at.overrides,ut=st===void 0?{}:st,ct=at.closeable,pt=at.role,dt=at.autoFocus,ft=at.focusLock,bt=at.returnFocus,ht=ut.Root,Mt=ut.Dialog,mt=ut.DialogContainer,Ot=ut.Close,zt=getOverrides(ht,Root$3),yt=_slicedToArray$e(zt,2),vt=yt[0],At=yt[1],St=getOverrides(mt,DialogContainer),Et=_slicedToArray$e(St,2),Tt=Et[0],Rt=Et[1],Ct=getOverrides(Mt,Dialog$1),wt=_slicedToArray$e(Ct,2),Lt=wt[0],Ht=wt[1],jt=getOverrides(Ot,Close),s0=_slicedToArray$e(jt,2),Ut=s0[0],Yt=s0[1],O0=this.getSharedProps(),a0=this.getChildren();return reactExports.createElement(LocaleContext.Consumer,null,function(b0){return reactExports.createElement(FocusLockCombination,{disabled:!ft,crossFrame:!1,returnFocus:bt,autoFocus:dt},reactExports.createElement(vt,_extends$x({"data-baseweb":"modal",ref:ot.rootRef},O0,At),reactExports.createElement(Tt,_extends$x({ref:ot.dialogContainerRef},O0,Rt),reactExports.createElement(Lt,_extends$x({tabIndex:-1,"aria-modal":!0,"aria-label":"dialog",role:pt},O0,Ht),a0,ct?reactExports.createElement(Ut,_extends$x({"aria-label":b0.modal.close,onClick:ot.onCloseClick},O0,Yt,{onFocus:forkFocus(Yt,ot.handleFocus),onBlur:forkBlur(Yt,ot.handleBlur)}),reactExports.createElement(CloseIcon,null)):null))))})}},{key:"render",value:function(){return!this.state.mounted||!this.props.isOpen&&!this.state.isVisible?null:reactExports.createElement(Layer,{onEscape:this.onEscape,onDocumentClick:this.onDocumentClick,mountNode:this.props.mountNode},this.renderModal())}}]),et}(reactExports.Component);_defineProperty$e(Modal$1,"defaultProps",{animate:!0,autoFocus:!0,focusLock:!0,returnFocus:!0,closeable:!0,name:"dialog",isOpen:!1,overrides:{},role:ROLE.dialog,size:SIZE$2.default});const StyledModalButton=newStyled("span",{target:"egf28ua0"})(({theme:tt})=>({marginRight:tt.spacing.twoXS}));function ModalHeader({children:tt}){const{genericFonts:nt,fontSizes:et,spacing:rt,fontWeights:ot,lineHeights:at}=useTheme();return jsx$1(ModalHeader$1,{style:{marginTop:rt.none,marginLeft:rt.none,marginRight:rt.none,marginBottom:rt.none,paddingTop:rt.twoXL,paddingRight:rt.twoXL,paddingBottom:rt.md,paddingLeft:rt.twoXL,fontFamily:nt.bodyFont,fontSize:et.xl,fontWeight:ot.bold,margin:rt.none,lineHeight:at.small,textTransform:"none",display:"flex",alignItems:"center",maxHeight:"80vh",flexDirection:"row"},children:tt})}function ModalBody$1({children:tt}){const{colors:nt,fontSizes:et,spacing:rt}=useTheme();return jsx$1(ModalBody$2,{style:{marginTop:rt.none,marginLeft:rt.none,marginRight:rt.none,marginBottom:rt.none,paddingTop:rt.md,paddingRight:rt.twoXL,paddingBottom:rt.twoXL,paddingLeft:rt.twoXL,color:nt.bodyText,fontSize:et.md},children:tt})}function ModalFooter({children:tt}){const{spacing:nt}=useTheme();return jsx$1(ModalFooter$1,{style:{marginTop:nt.none,marginLeft:nt.none,marginRight:nt.none,marginBottom:nt.none,paddingTop:nt.md,paddingRight:nt.md,paddingBottom:nt.md,paddingLeft:nt.md},children:jsx$1("div",{children:tt})})}const ModalButton=tt=>jsx$1(StyledModalButton,{children:jsx$1(BaseButton,{...tt})});function calculateModalSize(tt,nt,et){return tt==="full"&&nt&&et?`calc(${nt} + ${et})`:tt==="auto"?SIZE$2.auto:SIZE$2.default}function Modal(tt){const{spacing:nt,radii:et,colors:rt,sizes:ot}=useTheme(),at={Root:{style:{background:rt.darkenedBgMix25},props:{className:"stDialog","data-testid":"stDialog"}},DialogContainer:{style:{alignItems:"start",paddingTop:nt.threeXL}},Dialog:{style:{borderBottomRightRadius:et.xxl,borderBottomLeftRadius:et.xxl,borderTopRightRadius:et.xxl,borderTopLeftRadius:et.xxl,minWidth:ot.minPopupWidth}},Close:{style:{top:`calc(${nt.twoXL} + .375rem)`,right:nt.twoXL}}},st=calculateModalSize(tt.size,ot.contentMaxWidth,nt.lg),ut=merge$6(at,tt.overrides),ct={...tt,size:st};return jsx$1(Modal$1,{...ct,overrides:ut})}const Dialog=({element:tt,deltaMsgReceivedAt:nt,children:et})=>{const{title:rt,dismissible:ot,width:at,isOpen:st}=tt,[ut,ct]=reactExports.useState(!1);return reactExports.useEffect(()=>{notNullOrUndefined(st)&&ct(st)},[st,nt]),ut?jsxs(Modal,{isOpen:!0,closeable:ot,onClose:()=>ct(!1),size:at===Block$2.Dialog.DialogWidth.LARGE?"full":"default",children:[jsx$1(ModalHeader,{children:rt}),jsx$1(ModalBody$1,{children:et})]}):jsx$1(Fragment,{})};function DialogWithProvider(tt){return jsx$1(IsDialogContext.Provider,{value:!0,children:jsx$1(Dialog,{...tt})})}const StyledExpandableContainer=newStyled("div",{target:"e4awi7d0"})({}),BORDER_SIZE=1,StyledDetails=newStyled("details",{target:"e4awi7d1"})(({isStale:tt,theme:nt})=>({marginBottom:0,marginTop:0,width:"100%",borderStyle:"solid",borderWidth:nt.sizes.borderWidth,borderColor:nt.colors.borderColor,borderRadius:nt.radii.default,...tt?{borderColor:nt.colors.borderColorLight,transition:`border ${STALE_TRANSITION_PARAMS}`}:{}})),StyledSummaryHeading=newStyled("span",{target:"e4awi7d2"})(({theme:tt})=>({display:"flex",gap:tt.spacing.sm,alignItems:"center",flexGrow:1})),StyledSummary=newStyled("summary",{target:"e4awi7d3"})(({theme:tt,empty:nt,isStale:et})=>({position:"relative",display:"flex",width:"100%","&:focus-visible":{outline:`${tt.sizes.borderWidth} solid ${tt.colors.primary}`,outlineOffset:`-${tt.sizes.borderWidth}`,borderRadius:tt.radii.default},fontSize:tt.fontSizes.sm,paddingLeft:tt.spacing.lg,paddingRight:tt.spacing.lg,paddingTop:tt.spacing.md,paddingBottom:tt.spacing.md,cursor:"pointer",listStyleType:"none","&::-webkit-details-marker":{display:"none"},"&:hover":{color:nt?void 0:tt.colors.primary},"&:hover svg":{fill:nt?void 0:tt.colors.primary},...nt&&{cursor:"default"},...et&&STALE_STYLES})),StyledDetailsPanel=newStyled("div",{target:"e4awi7d4"})(({theme:tt})=>({paddingBottom:tt.spacing.lg,paddingLeft:tt.spacing.lg,paddingRight:tt.spacing.lg})),ExpanderIcon=tt=>{const{icon:nt}=tt,{activeTheme:et}=React$1.useContext(LibContext),rt={size:"lg",margin:"0",padding:"0"},ot={":material/check:":"stExpanderIconCheck",":material/error:":"stExpanderIconError"};if(nt==="spinner"){const at=!isPresetTheme(et);return jsx$1(StyledSpinnerIcon,{usingCustomTheme:at,"data-testid":"stExpanderIconSpinner",...rt})}return nt?jsx$1(DynamicIcon,{color:"inherit",iconValue:nt,testid:ot[nt]||"stExpanderIcon",...rt}):jsx$1(Fragment,{})},Expander=({element:tt,isStale:nt,empty:et,children:rt})=>{const{label:ot,expanded:at}=tt,[st,ut]=reactExports.useState(at||!1),ct=reactExports.useRef(null),pt=reactExports.useRef(null),dt=reactExports.useRef(null),ft=reactExports.useRef(null),bt=reactExports.useRef(null);reactExports.useEffect(()=>{notNullOrUndefined(at)&&(ut(at),ct.current&&(ct.current.open=at))},[ot,at]);const ht=Ot=>{ct.current&&(ct.current.open=Ot,dt.current=null,ct.current.style.height="",ct.current.style.overflow="")},Mt=(Ot,zt,yt)=>{const vt=yt>zt;dt.current&&(dt.current.cancel(),ft.current&&(clearTimeout(ft.current),ft.current=null));const At=Ot.animate({height:[`${zt}px`,`${yt}px`]},{duration:500,easing:"cubic-bezier(0.23, 1, 0.32, 1)"});At.addEventListener("finish",()=>ht(vt)),dt.current=At};return jsx$1(StyledExpandableContainer,{className:"stExpander","data-testid":"stExpander",children:jsxs(StyledDetails,{isStale:nt,ref:ct,children:[jsxs(StyledSummary,{onClick:Ot=>{if(Ot.preventDefault(),et)return;ut(!st);const zt=ct.current;if(!zt||!pt.current)return;zt.style.overflow="hidden";const yt=zt.getBoundingClientRect().height,vt=pt.current.getBoundingClientRect().height;st?Mt(zt,yt,vt+2*BORDER_SIZE):(zt.style.height=`${yt}px`,zt.open=!0,window.requestAnimationFrame(()=>{Mt(zt,yt,vt+2*BORDER_SIZE+5),ft.current=setTimeout(()=>{if(!bt.current)return;const At=bt.current.getBoundingClientRect().height;Mt(zt,yt,vt+At+2*BORDER_SIZE)},100)}))},empty:et,ref:pt,isStale:nt,children:[jsxs(StyledSummaryHeading,{children:[tt.icon&&jsx$1(ExpanderIcon,{icon:tt.icon}),jsx$1(StreamlitMarkdown$1,{source:ot,allowHTML:!1,isLabel:!0})]}),et?jsx$1(Fragment,{}):jsx$1(StyledIcon,{as:st?ExpandLess:ExpandMore,color:"inherit","aria-hidden":"true","data-testid":"stExpanderToggleIcon",size:"lg",margin:"",padding:""})]}),et?jsx$1(Fragment,{}):jsx$1(StyledDetailsPanel,{"data-testid":"stExpanderDetails",ref:bt,children:rt})]})})};function debounce$2(tt,nt){let et=0,rt=null;return(...ot)=>{const at=Date.now();at-et>nt?(tt(...ot),et=at):(rt&&clearTimeout(rt),rt=setTimeout(()=>{tt(...ot),et=Date.now()},Math.max(0,nt-at+et)))}}const DEFAULT_DEBOUNCE_MS=100;function useScrollSpy(tt,nt){const et=reactExports.useRef(nt),rt=reactExports.useMemo(()=>debounce$2(at=>{et.current(at)},DEFAULT_DEBOUNCE_MS),[et]),ot=reactExports.useCallback(at=>{at.timeStampLow=Date.now(),rt(at)},[rt]);reactExports.useLayoutEffect(()=>tt?(tt.addEventListener("scroll",ot,{passive:!0}),ot({target:tt}),()=>tt.removeEventListener("scroll",ot)):()=>{},[ot,tt])}function squareStepper(tt,nt){const et=Math.sign(nt-tt),rt=Math.sqrt(Math.abs(nt-tt)),ot=tt+rt*et;return et>0?Math.min(nt,ot):Math.max(nt,ot)}function step(tt,nt,et,rt){let ot=tt;for(let at=0;at<rt;at++)ot=et(ot,nt);return ot}function useScrollAnimation(tt,nt,et){const rt=reactExports.useRef(0),ot=reactExports.useCallback((st,ut,ct=Date.now())=>{cancelAnimationFrame(rt.current),rt.current=requestAnimationFrame(()=>{if(tt){const pt=tt.scrollHeight-tt.offsetHeight;let dt=step(st,pt,squareStepper,(Date.now()-ct)/5);Math.abs(pt-dt)<1.5&&(dt=pt),tt.scrollTop=dt,pt===dt?nt():ot(st,ut+1,ct)}})},[rt,nt,tt]),at=reactExports.useCallback(()=>{cancelAnimationFrame(rt.current),nt()},[nt]);reactExports.useLayoutEffect(()=>{if(!(!tt||!et))return ot(tt.scrollTop,1),tt?(tt.addEventListener("pointerdown",at,{passive:!0}),tt.addEventListener("wheel",at,{passive:!0}),()=>{tt.removeEventListener("pointerdown",at),tt.removeEventListener("wheel",at),cancelAnimationFrame(rt.current)}):()=>cancelAnimationFrame(rt.current)},[ot,rt,at,tt,et])}function useStateRef(tt){const[nt,et]=reactExports.useState(tt),rt=reactExports.useRef(tt);return rt.current=nt,[nt,et,rt]}const DEFAULT_BOTTOM_THRESHOLD=1,SCROLL_DECISION_DURATION=34,MIN_CHECK_INTERVAL=17;function setImmediateInterval(tt,nt){return tt(),setInterval(tt,nt)}function isAtBottom({scrollHeight:tt,offsetHeight:nt,scrollTop:et}){return tt-et-nt<DEFAULT_BOTTOM_THRESHOLD}function useScrollToBottom(){const tt=reactExports.useRef(null),[nt,et,rt]=useStateRef(!1),[ot,at,st]=useStateRef(!0),ut=reactExports.useRef(0),ct=reactExports.useRef(0),pt=reactExports.useRef(0),dt=reactExports.useCallback(()=>{ut.current=Date.now(),st.current||et(!1),at(!1)},[ut,st,at,et]),ft=reactExports.useCallback(({timeStampLow:bt})=>{const{current:ht}=tt,Mt=st.current;if(bt<=ut.current||!ht)return;const mt=isAtBottom(ht),{offsetHeight:Ot,scrollHeight:zt}=ht,{current:yt}=ct,{current:vt}=pt,At=Ot!==yt,St=zt!==vt;if(At&&(ct.current=Ot),St&&(pt.current=zt),!At&&!St){const Et=Mt||mt;rt.current!==Et&&et(Et)}else rt.current&&(at(!0),et(!0))},[ut,ct,pt,st,rt,at,et]);return reactExports.useEffect(()=>{if(tt.current){let bt=0;const ht=setImmediateInterval(()=>{const{current:Mt}=tt,mt=st.current;rt.current&&Mt?isAtBottom(Mt)?bt=0:bt?Date.now()-bt>SCROLL_DECISION_DURATION&&(mt||(at(!0),et(!0)),bt=0):bt=Date.now():Mt&&Mt.scrollHeight<=Mt.offsetHeight&&!rt.current&&et(!0)},MIN_CHECK_INTERVAL);return()=>clearInterval(ht)}},[tt,nt,ot,st,rt,et,at]),reactExports.useEffect(()=>{const bt=tt.current;if(bt){const ht=()=>{pt.current=bt.scrollHeight};return bt.addEventListener("focus",ht,{capture:!0,passive:!0}),()=>bt.removeEventListener("focus",ht)}},[tt]),useScrollSpy(tt.current,ft),useScrollAnimation(tt.current,dt,ot),tt}var FUNC_ERROR_TEXT$3="Expected a function",NAN$1=NaN,symbolTag$3="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex$1=/^[-+]0x[0-9a-f]+$/i,reIsBinary$1=/^0b[01]+$/i,reIsOctal$1=/^0o[0-7]+$/i,freeParseInt$1=parseInt,freeGlobal$1=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,freeSelf$1=typeof self=="object"&&self&&self.Object===Object&&self,root$3=freeGlobal$1||freeSelf$1||Function("return this")(),objectProto$i=Object.prototype,objectToString$1=objectProto$i.toString,nativeMax$2=Math.max,nativeMin$1=Math.min,now$3=function(){return root$3.Date.now()};function debounce$1(tt,nt,et){var rt,ot,at,st,ut,ct,pt=0,dt=!1,ft=!1,bt=!0;if(typeof tt!="function")throw new TypeError(FUNC_ERROR_TEXT$3);nt=toNumber$1(nt)||0,isObject$5(et)&&(dt=!!et.leading,ft="maxWait"in et,at=ft?nativeMax$2(toNumber$1(et.maxWait)||0,nt):at,bt="trailing"in et?!!et.trailing:bt);function ht(Et){var Tt=rt,Rt=ot;return rt=ot=void 0,pt=Et,st=tt.apply(Rt,Tt),st}function Mt(Et){return pt=Et,ut=setTimeout(zt,nt),dt?ht(Et):st}function mt(Et){var Tt=Et-ct,Rt=Et-pt,Ct=nt-Tt;return ft?nativeMin$1(Ct,at-Rt):Ct}function Ot(Et){var Tt=Et-ct,Rt=Et-pt;return ct===void 0||Tt>=nt||Tt<0||ft&&Rt>=at}function zt(){var Et=now$3();if(Ot(Et))return yt(Et);ut=setTimeout(zt,mt(Et))}function yt(Et){return ut=void 0,bt&&rt?ht(Et):(rt=ot=void 0,st)}function vt(){ut!==void 0&&clearTimeout(ut),pt=0,rt=ct=ot=ut=void 0}function At(){return ut===void 0?st:yt(now$3())}function St(){var Et=now$3(),Tt=Ot(Et);if(rt=arguments,ot=this,ct=Et,Tt){if(ut===void 0)return Mt(ct);if(ft)return ut=setTimeout(zt,nt),ht(ct)}return ut===void 0&&(ut=setTimeout(zt,nt)),st}return St.cancel=vt,St.flush=At,St}function isObject$5(tt){var nt=typeof tt;return!!tt&&(nt=="object"||nt=="function")}function isObjectLike$2(tt){return!!tt&&typeof tt=="object"}function isSymbol$2(tt){return typeof tt=="symbol"||isObjectLike$2(tt)&&objectToString$1.call(tt)==symbolTag$3}function toNumber$1(tt){if(typeof tt=="number")return tt;if(isSymbol$2(tt))return NAN$1;if(isObject$5(tt)){var nt=typeof tt.valueOf=="function"?tt.valueOf():tt;tt=isObject$5(nt)?nt+"":nt}if(typeof tt!="string")return tt===0?tt:+tt;tt=tt.replace(reTrim,"");var et=reIsBinary$1.test(tt);return et||reIsOctal$1.test(tt)?freeParseInt$1(tt.slice(2),et?2:8):reIsBadHex$1.test(tt)?NAN$1:+tt}var lodash_debounce=debounce$1;const _debounce=getDefaultExportFromCjs$1(lodash_debounce);function debounceRender(tt,nt,et){class rt extends reactExports.Component{constructor(){super(...arguments),this.updateDebounced=_debounce(this.forceUpdate,nt,et)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return React$1.createElement(tt,Object.assign({},this.props))}}return rt.displayName=`debounceRender(${tt.displayName||tt.name||"Component"})`,hoistNonReactStatics$2(rt,tt)}var baseSlice$1=_baseSlice;function castSlice$1(tt,nt,et){var rt=tt.length;return et=et===void 0?rt:et,!nt&&et>=rt?tt:baseSlice$1(tt,nt,et)}var _castSlice=castSlice$1;function baseFindIndex$1(tt,nt,et,rt){for(var ot=tt.length,at=et+(rt?1:-1);rt?at--:++at<ot;)if(nt(tt[at],at,tt))return at;return-1}var _baseFindIndex=baseFindIndex$1;function baseIsNaN$1(tt){return tt!==tt}var _baseIsNaN=baseIsNaN$1;function strictIndexOf$1(tt,nt,et){for(var rt=et-1,ot=tt.length;++rt<ot;)if(tt[rt]===nt)return rt;return-1}var _strictIndexOf=strictIndexOf$1,baseFindIndex=_baseFindIndex,baseIsNaN=_baseIsNaN,strictIndexOf=_strictIndexOf;function baseIndexOf$2(tt,nt,et){return nt===nt?strictIndexOf(tt,nt,et):baseFindIndex(tt,baseIsNaN,et)}var _baseIndexOf=baseIndexOf$2,baseIndexOf$1=_baseIndexOf;function charsEndIndex$1(tt,nt){for(var et=tt.length;et--&&baseIndexOf$1(nt,tt[et],0)>-1;);return et}var _charsEndIndex=charsEndIndex$1,baseToString$1=_baseToString,castSlice=_castSlice,charsEndIndex=_charsEndIndex,stringToArray=_stringToArray,toString$3=toString_1,trimmedEndIndex$1=_trimmedEndIndex;function trimEnd(tt,nt,et){if(tt=toString$3(tt),tt&&(et||nt===void 0))return tt.slice(0,trimmedEndIndex$1(tt)+1);if(!tt||!(nt=baseToString$1(nt)))return tt;var rt=stringToArray(tt),ot=charsEndIndex(rt,stringToArray(nt))+1;return castSlice(rt,0,ot).join("")}var trimEnd_1=trimEnd;const trimEnd$1=getDefaultExportFromCjs$1(trimEnd_1);var momentTimezone$1={exports:{}},momentTimezone={exports:{}};//! moment.js
|
451
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$e(tt,nt){if(tt){if(typeof tt=="string")return _arrayLikeToArray$e(tt,nt);var et=Object.prototype.toString.call(tt).slice(8,-1);if(et==="Object"&&tt.constructor&&(et=tt.constructor.name),et==="Map"||et==="Set")return Array.from(tt);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return _arrayLikeToArray$e(tt,nt)}}function _arrayLikeToArray$e(tt,nt){(nt==null||nt>tt.length)&&(nt=tt.length);for(var et=0,rt=new Array(nt);et<nt;et++)rt[et]=tt[et];return rt}function _iterableToArrayLimit$e(tt,nt){var et=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(et!=null){var rt=[],ot=!0,at=!1,st,ut;try{for(et=et.call(tt);!(ot=(st=et.next()).done)&&(rt.push(st.value),!(nt&&rt.length===nt));ot=!0);}catch(ct){at=!0,ut=ct}finally{try{!ot&&et.return!=null&&et.return()}finally{if(at)throw ut}}return rt}}function _arrayWithHoles$e(tt){if(Array.isArray(tt))return tt}function _classCallCheck$g(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$e(tt,nt,et){return nt&&_defineProperties$6(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$g(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$6(tt,nt)}function _setPrototypeOf$6(tt,nt){return _setPrototypeOf$6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$6(tt,nt)}function _createSuper$5(tt){var nt=_isNativeReflectConstruct$5();return function(){var rt=_getPrototypeOf$6(tt),ot;if(nt){var at=_getPrototypeOf$6(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$g(this,ot)}}function _possibleConstructorReturn$g(tt,nt){if(nt&&(_typeof$8(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$6(tt)}function _assertThisInitialized$6(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$5(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$6(tt){return _getPrototypeOf$6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$6(tt)}function _defineProperty$e(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var Modal$1=function(tt){_inherits$g(et,tt);var nt=_createSuper$5(et);function et(){var rt;_classCallCheck$g(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return rt=nt.call.apply(nt,[this].concat(at)),_defineProperty$e(_assertThisInitialized$6(rt),"animateOutTimer",void 0),_defineProperty$e(_assertThisInitialized$6(rt),"animateStartTimer",void 0),_defineProperty$e(_assertThisInitialized$6(rt),"dialogContainerRef",reactExports.createRef()),_defineProperty$e(_assertThisInitialized$6(rt),"lastFocus",null),_defineProperty$e(_assertThisInitialized$6(rt),"lastMountNodeOverflowStyle",null),_defineProperty$e(_assertThisInitialized$6(rt),"rootRef",reactExports.createRef()),_defineProperty$e(_assertThisInitialized$6(rt),"state",{isVisible:!1,mounted:!1,isFocusVisible:!1}),_defineProperty$e(_assertThisInitialized$6(rt),"handleFocus",function(ut){isFocusVisible(ut)&&rt.setState({isFocusVisible:!0})}),_defineProperty$e(_assertThisInitialized$6(rt),"handleBlur",function(ut){rt.state.isFocusVisible!==!1&&rt.setState({isFocusVisible:!1})}),_defineProperty$e(_assertThisInitialized$6(rt),"onEscape",function(){rt.props.closeable&&rt.triggerClose(CLOSE_SOURCE.escape)}),_defineProperty$e(_assertThisInitialized$6(rt),"onDocumentClick",function(ut){ut.target&&ut.target instanceof HTMLElement&&ut.target.contains(rt.dialogContainerRef.current)&&rt.onBackdropClick()}),_defineProperty$e(_assertThisInitialized$6(rt),"onBackdropClick",function(){rt.props.closeable&&rt.triggerClose(CLOSE_SOURCE.backdrop)}),_defineProperty$e(_assertThisInitialized$6(rt),"onCloseClick",function(){rt.triggerClose(CLOSE_SOURCE.closeButton)}),_defineProperty$e(_assertThisInitialized$6(rt),"animateOutComplete",function(){rt.setState({isVisible:!1})}),rt}return _createClass$e(et,[{key:"componentDidMount",value:function(){this.setState({mounted:!0})}},{key:"componentWillUnmount",value:function(){this.resetMountNodeScroll(),this.clearTimers()}},{key:"componentDidUpdate",value:function(ot,at){var st=this.props.isOpen;(st!==ot.isOpen||st&&this.state.mounted&&!at.mounted)&&(st?this.didOpen():this.didClose())}},{key:"disableMountNodeScroll",value:function(){var ot=this.getMountNode();this.lastMountNodeOverflowStyle=ot.style.overflow||"",ot.style.overflow="hidden"}},{key:"resetMountNodeScroll",value:function(){var ot=this.getMountNode(),at=this.lastMountNodeOverflowStyle;ot&&at!==null&&(ot.style.overflow==="hidden"&&(ot.style.overflow=at||""),this.lastMountNodeOverflowStyle=null)}},{key:"clearTimers",value:function(){this.animateOutTimer&&clearTimeout(this.animateOutTimer),this.animateStartTimer&&cancelAnimationFrame(this.animateStartTimer)}},{key:"didOpen",value:function(){var ot=this,at=this.rootRef.current;at&&(at.scrollTop=0),this.clearTimers(),this.disableMountNodeScroll(),this.animateStartTimer=requestAnimationFrame(function(){ot.setState({isVisible:!0})})}},{key:"didClose",value:function(){this.resetMountNodeScroll(),this.animateOutTimer=setTimeout(this.animateOutComplete,500)}},{key:"triggerClose",value:function(ot){this.props.onClose&&ot&&this.props.onClose({closeSource:ot})}},{key:"getSharedProps",value:function(){var ot=this.props,at=ot.animate,st=ot.isOpen,ut=ot.size,ct=ot.role,pt=ot.closeable;return{$animate:at,$isVisible:this.state.isVisible,$isOpen:!!st,$size:ut,$role:ct,$closeable:!!pt,$isFocusVisible:this.state.isFocusVisible}}},{key:"getMountNode",value:function(){var ot=this.props.mountNode;return ot||document.body}},{key:"getChildren",value:function(){var ot=this.props.children;return typeof ot=="function"?ot():ot}},{key:"renderModal",value:function(){var ot=this,at=this.props,st=at.overrides,ut=st===void 0?{}:st,ct=at.closeable,pt=at.role,dt=at.autoFocus,ft=at.focusLock,bt=at.returnFocus,ht=ut.Root,Mt=ut.Dialog,mt=ut.DialogContainer,Ot=ut.Close,zt=getOverrides(ht,Root$3),yt=_slicedToArray$e(zt,2),vt=yt[0],At=yt[1],St=getOverrides(mt,DialogContainer),Et=_slicedToArray$e(St,2),Tt=Et[0],Rt=Et[1],Ct=getOverrides(Mt,Dialog$1),wt=_slicedToArray$e(Ct,2),Lt=wt[0],Ht=wt[1],jt=getOverrides(Ot,Close),s0=_slicedToArray$e(jt,2),Ut=s0[0],Yt=s0[1],O0=this.getSharedProps(),a0=this.getChildren();return reactExports.createElement(LocaleContext.Consumer,null,function(b0){return reactExports.createElement(FocusLockCombination,{disabled:!ft,crossFrame:!1,returnFocus:bt,autoFocus:dt},reactExports.createElement(vt,_extends$x({"data-baseweb":"modal",ref:ot.rootRef},O0,At),reactExports.createElement(Tt,_extends$x({ref:ot.dialogContainerRef},O0,Rt),reactExports.createElement(Lt,_extends$x({tabIndex:-1,"aria-modal":!0,"aria-label":"dialog",role:pt},O0,Ht),a0,ct?reactExports.createElement(Ut,_extends$x({"aria-label":b0.modal.close,onClick:ot.onCloseClick},O0,Yt,{onFocus:forkFocus(Yt,ot.handleFocus),onBlur:forkBlur(Yt,ot.handleBlur)}),reactExports.createElement(CloseIcon,null)):null))))})}},{key:"render",value:function(){return!this.state.mounted||!this.props.isOpen&&!this.state.isVisible?null:reactExports.createElement(Layer,{onEscape:this.onEscape,onDocumentClick:this.onDocumentClick,mountNode:this.props.mountNode},this.renderModal())}}]),et}(reactExports.Component);_defineProperty$e(Modal$1,"defaultProps",{animate:!0,autoFocus:!0,focusLock:!0,returnFocus:!0,closeable:!0,name:"dialog",isOpen:!1,overrides:{},role:ROLE.dialog,size:SIZE$2.default});const StyledModalButton=newStyled("span",{target:"egf28ua0"})(({theme:tt})=>({marginRight:tt.spacing.twoXS}));function ModalHeader({children:tt}){const{genericFonts:nt,fontSizes:et,spacing:rt,fontWeights:ot,lineHeights:at}=useTheme();return jsx$1(ModalHeader$1,{style:{marginTop:rt.none,marginLeft:rt.none,marginRight:rt.none,marginBottom:rt.none,paddingTop:rt.twoXL,paddingRight:rt.twoXL,paddingBottom:rt.md,paddingLeft:rt.twoXL,fontFamily:nt.bodyFont,fontSize:et.xl,fontWeight:ot.bold,margin:rt.none,lineHeight:at.small,textTransform:"none",display:"flex",alignItems:"center",maxHeight:"80vh",flexDirection:"row"},children:tt})}function ModalBody$1({children:tt}){const{colors:nt,fontSizes:et,spacing:rt}=useTheme();return jsx$1(ModalBody$2,{style:{marginTop:rt.none,marginLeft:rt.none,marginRight:rt.none,marginBottom:rt.none,paddingTop:rt.md,paddingRight:rt.twoXL,paddingBottom:rt.twoXL,paddingLeft:rt.twoXL,color:nt.bodyText,fontSize:et.md},children:tt})}function ModalFooter({children:tt}){const{spacing:nt}=useTheme();return jsx$1(ModalFooter$1,{style:{marginTop:nt.none,marginLeft:nt.none,marginRight:nt.none,marginBottom:nt.none,paddingTop:nt.md,paddingRight:nt.md,paddingBottom:nt.md,paddingLeft:nt.md},children:jsx$1("div",{children:tt})})}const ModalButton=tt=>jsx$1(StyledModalButton,{children:jsx$1(BaseButton,{...tt})});function calculateModalSize(tt,nt,et){return tt==="full"&&nt&&et?`calc(${nt} + ${et})`:tt==="auto"?SIZE$2.auto:SIZE$2.default}function Modal(tt){const{spacing:nt,radii:et,colors:rt,sizes:ot}=useTheme(),at={Root:{style:{background:rt.darkenedBgMix25},props:{className:"stDialog","data-testid":"stDialog"}},DialogContainer:{style:{alignItems:"start",paddingTop:nt.threeXL}},Dialog:{style:{borderBottomRightRadius:et.xxl,borderBottomLeftRadius:et.xxl,borderTopRightRadius:et.xxl,borderTopLeftRadius:et.xxl,minWidth:ot.minPopupWidth}},Close:{style:{top:`calc(${nt.twoXL} + .375rem)`,right:nt.twoXL}}},st=calculateModalSize(tt.size,ot.contentMaxWidth,nt.lg),ut=merge$6(at,tt.overrides),ct={...tt,size:st};return jsx$1(Modal$1,{...ct,overrides:ut})}const Dialog=({element:tt,deltaMsgReceivedAt:nt,children:et})=>{const{title:rt,dismissible:ot,width:at,isOpen:st}=tt,[ut,ct]=reactExports.useState(!1);return reactExports.useEffect(()=>{notNullOrUndefined(st)&&ct(st)},[st,nt]),ut?jsxs(Modal,{isOpen:!0,closeable:ot,onClose:()=>ct(!1),size:at===Block$2.Dialog.DialogWidth.LARGE?"full":"default",children:[jsx$1(ModalHeader,{children:rt}),jsx$1(ModalBody$1,{children:et})]}):jsx$1(Fragment,{})};function DialogWithProvider(tt){return jsx$1(IsDialogContext.Provider,{value:!0,children:jsx$1(Dialog,{...tt})})}const StyledExpandableContainer=newStyled("div",{target:"e4awi7d0"})({}),BORDER_SIZE=1,StyledDetails=newStyled("details",{target:"e4awi7d1"})(({isStale:tt,theme:nt})=>({marginBottom:0,marginTop:0,width:"100%",borderStyle:"solid",borderWidth:nt.sizes.borderWidth,borderColor:nt.colors.borderColor,borderRadius:nt.radii.default,...tt?{borderColor:nt.colors.borderColorLight,transition:`border ${STALE_TRANSITION_PARAMS}`}:{}})),StyledSummaryHeading=newStyled("span",{target:"e4awi7d2"})(({theme:tt})=>({display:"flex",gap:tt.spacing.sm,alignItems:"center",flexGrow:1})),StyledSummary=newStyled("summary",{target:"e4awi7d3"})(({theme:tt,empty:nt,isStale:et})=>({position:"relative",display:"flex",width:"100%","&:focus-visible":{outline:`${tt.sizes.borderWidth} solid ${tt.colors.primary}`,outlineOffset:`-${tt.sizes.borderWidth}`,borderRadius:tt.radii.default},fontSize:tt.fontSizes.sm,paddingLeft:tt.spacing.lg,paddingRight:tt.spacing.lg,paddingTop:tt.spacing.md,paddingBottom:tt.spacing.md,cursor:"pointer",listStyleType:"none","&::-webkit-details-marker":{display:"none"},"&:hover":{color:nt?void 0:tt.colors.primary},"&:hover svg":{fill:nt?void 0:tt.colors.primary},...nt&&{cursor:"default"},...et&&STALE_STYLES})),StyledDetailsPanel=newStyled("div",{target:"e4awi7d4"})(({theme:tt})=>({paddingBottom:tt.spacing.lg,paddingLeft:tt.spacing.lg,paddingRight:tt.spacing.lg})),ExpanderIcon=tt=>{const{icon:nt}=tt,{activeTheme:et}=React$1.useContext(LibContext),rt={size:"lg",margin:"0",padding:"0"},ot={":material/check:":"stExpanderIconCheck",":material/error:":"stExpanderIconError"};if(nt==="spinner"){const at=!isPresetTheme(et);return jsx$1(StyledSpinnerIcon,{usingCustomTheme:at,"data-testid":"stExpanderIconSpinner",...rt})}return nt?jsx$1(DynamicIcon,{color:"inherit",iconValue:nt,testid:ot[nt]||"stExpanderIcon",...rt}):jsx$1(Fragment,{})},Expander=({element:tt,isStale:nt,empty:et,children:rt})=>{const{label:ot,expanded:at}=tt,[st,ut]=reactExports.useState(at||!1),ct=reactExports.useRef(null),pt=reactExports.useRef(null),dt=reactExports.useRef(null),ft=reactExports.useRef(null),bt=reactExports.useRef(null);reactExports.useEffect(()=>{notNullOrUndefined(at)&&(ut(at),ct.current&&(ct.current.open=at))},[ot,at]);const ht=Ot=>{ct.current&&(ct.current.open=Ot,dt.current=null,ct.current.style.height="",ct.current.style.overflow="")},Mt=(Ot,zt,yt)=>{const vt=yt>zt;dt.current&&(dt.current.cancel(),ft.current&&(clearTimeout(ft.current),ft.current=null));const At=Ot.animate({height:[`${zt}px`,`${yt}px`]},{duration:500,easing:"cubic-bezier(0.23, 1, 0.32, 1)"});At.addEventListener("finish",()=>ht(vt)),dt.current=At};return jsx$1(StyledExpandableContainer,{className:"stExpander","data-testid":"stExpander",children:jsxs(StyledDetails,{isStale:nt,ref:ct,children:[jsxs(StyledSummary,{onClick:Ot=>{if(Ot.preventDefault(),et)return;ut(!st);const zt=ct.current;if(!zt||!pt.current)return;zt.style.overflow="hidden";const yt=zt.getBoundingClientRect().height,vt=pt.current.getBoundingClientRect().height;st?Mt(zt,yt,vt+2*BORDER_SIZE):(zt.style.height=`${yt}px`,zt.open=!0,window.requestAnimationFrame(()=>{Mt(zt,yt,vt+2*BORDER_SIZE+5),ft.current=setTimeout(()=>{if(!bt.current)return;const At=bt.current.getBoundingClientRect().height;Mt(zt,yt,vt+At+2*BORDER_SIZE)},100)}))},empty:et,ref:pt,isStale:nt,children:[jsxs(StyledSummaryHeading,{children:[tt.icon&&jsx$1(ExpanderIcon,{icon:tt.icon}),jsx$1(StreamlitMarkdown$1,{source:ot,allowHTML:!1,isLabel:!0})]}),et?jsx$1(Fragment,{}):jsx$1(StyledIcon,{as:st?ExpandLess:ExpandMore,color:"inherit","aria-hidden":"true","data-testid":"stExpanderToggleIcon",size:"lg",margin:"",padding:""})]}),et?jsx$1(Fragment,{}):jsx$1(StyledDetailsPanel,{"data-testid":"stExpanderDetails",ref:bt,children:rt})]})})};function debounce$2(tt,nt){let et=0,rt=null;return(...ot)=>{const at=Date.now();at-et>nt?(tt(...ot),et=at):(rt&&clearTimeout(rt),rt=setTimeout(()=>{tt(...ot),et=Date.now()},Math.max(0,nt-at+et)))}}const DEFAULT_DEBOUNCE_MS=100;function useScrollSpy(tt,nt){const et=reactExports.useRef(nt),rt=reactExports.useMemo(()=>debounce$2(at=>{et.current(at)},DEFAULT_DEBOUNCE_MS),[et]),ot=reactExports.useCallback(at=>{at.timeStampLow=Date.now(),rt(at)},[rt]);reactExports.useLayoutEffect(()=>tt?(tt.addEventListener("scroll",ot,{passive:!0}),ot({target:tt}),()=>tt.removeEventListener("scroll",ot)):()=>{},[ot,tt])}function squareStepper(tt,nt){const et=Math.sign(nt-tt),rt=Math.sqrt(Math.abs(nt-tt)),ot=tt+rt*et;return et>0?Math.min(nt,ot):Math.max(nt,ot)}function step(tt,nt,et,rt){let ot=tt;for(let at=0;at<rt;at++)ot=et(ot,nt);return ot}function useScrollAnimation(tt,nt,et){const rt=reactExports.useRef(0),ot=reactExports.useCallback((st,ut,ct=Date.now())=>{cancelAnimationFrame(rt.current),rt.current=requestAnimationFrame(()=>{if(tt){const pt=tt.scrollHeight-tt.offsetHeight;let dt=step(st,pt,squareStepper,(Date.now()-ct)/5);Math.abs(pt-dt)<1.5&&(dt=pt),tt.scrollTop=dt,pt===dt?nt():ot(st,ut+1,ct)}})},[rt,nt,tt]),at=reactExports.useCallback(()=>{cancelAnimationFrame(rt.current),nt()},[nt]);reactExports.useLayoutEffect(()=>{if(!(!tt||!et))return ot(tt.scrollTop,1),tt?(tt.addEventListener("pointerdown",at,{passive:!0}),tt.addEventListener("wheel",at,{passive:!0}),()=>{tt.removeEventListener("pointerdown",at),tt.removeEventListener("wheel",at),cancelAnimationFrame(rt.current)}):()=>cancelAnimationFrame(rt.current)},[ot,rt,at,tt,et])}function useStateRef(tt){const[nt,et]=reactExports.useState(tt),rt=reactExports.useRef(tt);return rt.current=nt,[nt,et,rt]}const DEFAULT_BOTTOM_THRESHOLD=1,SCROLL_DECISION_DURATION=34,MIN_CHECK_INTERVAL=17;function setImmediateInterval(tt,nt){return tt(),setInterval(tt,nt)}function isAtBottom({scrollHeight:tt,offsetHeight:nt,scrollTop:et}){return tt-et-nt<DEFAULT_BOTTOM_THRESHOLD}function useScrollToBottom(){const tt=reactExports.useRef(null),[nt,et,rt]=useStateRef(!1),[ot,at,st]=useStateRef(!0),ut=reactExports.useRef(0),ct=reactExports.useRef(0),pt=reactExports.useRef(0),dt=reactExports.useCallback(()=>{ut.current=Date.now(),st.current||et(!1),at(!1)},[ut,st,at,et]),ft=reactExports.useCallback(({timeStampLow:bt})=>{const{current:ht}=tt,Mt=st.current;if(bt<=ut.current||!ht)return;const mt=isAtBottom(ht),{offsetHeight:Ot,scrollHeight:zt}=ht,{current:yt}=ct,{current:vt}=pt,At=Ot!==yt,St=zt!==vt;if(At&&(ct.current=Ot),St&&(pt.current=zt),!At&&!St){const Et=Mt||mt;rt.current!==Et&&et(Et)}else rt.current&&(at(!0),et(!0))},[ut,ct,pt,st,rt,at,et]);return reactExports.useEffect(()=>{if(tt.current){let bt=0;const ht=setImmediateInterval(()=>{const{current:Mt}=tt,mt=st.current;rt.current&&Mt?isAtBottom(Mt)?bt=0:bt?Date.now()-bt>SCROLL_DECISION_DURATION&&(mt||(at(!0),et(!0)),bt=0):bt=Date.now():Mt&&Mt.scrollHeight<=Mt.offsetHeight&&!rt.current&&et(!0)},MIN_CHECK_INTERVAL);return()=>clearInterval(ht)}},[tt,nt,ot,st,rt,et,at]),reactExports.useEffect(()=>{const bt=tt.current;if(bt){const ht=()=>{pt.current=bt.scrollHeight};return bt.addEventListener("focus",ht,{capture:!0,passive:!0}),()=>bt.removeEventListener("focus",ht)}},[tt]),useScrollSpy(tt.current,ft),useScrollAnimation(tt.current,dt,ot),tt}var FUNC_ERROR_TEXT$3="Expected a function",NAN$1=NaN,symbolTag$3="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex$1=/^[-+]0x[0-9a-f]+$/i,reIsBinary$1=/^0b[01]+$/i,reIsOctal$1=/^0o[0-7]+$/i,freeParseInt$1=parseInt,freeGlobal$1=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,freeSelf$1=typeof self=="object"&&self&&self.Object===Object&&self,root$3=freeGlobal$1||freeSelf$1||Function("return this")(),objectProto$i=Object.prototype,objectToString$1=objectProto$i.toString,nativeMax$2=Math.max,nativeMin$1=Math.min,now$3=function(){return root$3.Date.now()};function debounce$1(tt,nt,et){var rt,ot,at,st,ut,ct,pt=0,dt=!1,ft=!1,bt=!0;if(typeof tt!="function")throw new TypeError(FUNC_ERROR_TEXT$3);nt=toNumber$1(nt)||0,isObject$5(et)&&(dt=!!et.leading,ft="maxWait"in et,at=ft?nativeMax$2(toNumber$1(et.maxWait)||0,nt):at,bt="trailing"in et?!!et.trailing:bt);function ht(Et){var Tt=rt,Rt=ot;return rt=ot=void 0,pt=Et,st=tt.apply(Rt,Tt),st}function Mt(Et){return pt=Et,ut=setTimeout(zt,nt),dt?ht(Et):st}function mt(Et){var Tt=Et-ct,Rt=Et-pt,Ct=nt-Tt;return ft?nativeMin$1(Ct,at-Rt):Ct}function Ot(Et){var Tt=Et-ct,Rt=Et-pt;return ct===void 0||Tt>=nt||Tt<0||ft&&Rt>=at}function zt(){var Et=now$3();if(Ot(Et))return yt(Et);ut=setTimeout(zt,mt(Et))}function yt(Et){return ut=void 0,bt&&rt?ht(Et):(rt=ot=void 0,st)}function vt(){ut!==void 0&&clearTimeout(ut),pt=0,rt=ct=ot=ut=void 0}function At(){return ut===void 0?st:yt(now$3())}function St(){var Et=now$3(),Tt=Ot(Et);if(rt=arguments,ot=this,ct=Et,Tt){if(ut===void 0)return Mt(ct);if(ft)return ut=setTimeout(zt,nt),ht(ct)}return ut===void 0&&(ut=setTimeout(zt,nt)),st}return St.cancel=vt,St.flush=At,St}function isObject$5(tt){var nt=typeof tt;return!!tt&&(nt=="object"||nt=="function")}function isObjectLike$2(tt){return!!tt&&typeof tt=="object"}function isSymbol$2(tt){return typeof tt=="symbol"||isObjectLike$2(tt)&&objectToString$1.call(tt)==symbolTag$3}function toNumber$1(tt){if(typeof tt=="number")return tt;if(isSymbol$2(tt))return NAN$1;if(isObject$5(tt)){var nt=typeof tt.valueOf=="function"?tt.valueOf():tt;tt=isObject$5(nt)?nt+"":nt}if(typeof tt!="string")return tt===0?tt:+tt;tt=tt.replace(reTrim,"");var et=reIsBinary$1.test(tt);return et||reIsOctal$1.test(tt)?freeParseInt$1(tt.slice(2),et?2:8):reIsBadHex$1.test(tt)?NAN$1:+tt}var lodash_debounce=debounce$1;const _debounce=getDefaultExportFromCjs$1(lodash_debounce);function debounceRender(tt,nt,et){class rt extends reactExports.Component{constructor(){super(...arguments),this.updateDebounced=_debounce(this.forceUpdate,nt,et)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return React$1.createElement(tt,Object.assign({},this.props))}}return rt.displayName=`debounceRender(${tt.displayName||tt.name||"Component"})`,hoistNonReactStatics$2(rt,tt)}function getStyledHeaders(tt){var ot;const{numHeaderRows:nt,numIndexColumns:et}=tt.dimensions,rt=[];for(let at=0;at<nt;at++){const st=[];for(let ut=0;ut<et;ut++){const ct=["blank","index_name"];ut>0&&ct.push(`level${at}`),st.push({name:"",cssClass:ct.join(" ")})}for(let ut=0;ut<((ot=tt.columnNames[at])==null?void 0:ot.length);ut++)st.push({name:tt.columnNames[at][ut],cssClass:`col_heading level${at} col${ut}`});rt.push(st)}return rt}function getStyledCell(tt,nt,et){var dt;if(!tt.styler||!tt.styler.cssId)return;const{numIndexColumns:rt,numDataRows:ot,numColumns:at}=tt.dimensions;if(nt<0||nt>=ot)throw new Error(`Row index is out of range: ${nt}`);if(et<0||et>=at)throw new Error(`Column index is out of range: ${et}`);if(et<rt){const ft=["row_heading",`level${et}`,`row${nt}`].join(" ");return{cssId:`${tt.styler.cssId}level${et}_row${nt}`,cssClass:ft,displayContent:void 0}}const ut=et-rt,ct=["data",`row${nt}`,`col${ut}`].join(" "),pt=(dt=tt.styler)!=null&&dt.displayValues?tt.styler.displayValues.getCell(nt,et).content:void 0;return{cssId:`${tt.styler.cssId}row${nt}_col${ut}`,cssClass:ct,displayContent:pt}}var baseSlice$1=_baseSlice;function castSlice$1(tt,nt,et){var rt=tt.length;return et=et===void 0?rt:et,!nt&&et>=rt?tt:baseSlice$1(tt,nt,et)}var _castSlice=castSlice$1;function baseFindIndex$1(tt,nt,et,rt){for(var ot=tt.length,at=et+(rt?1:-1);rt?at--:++at<ot;)if(nt(tt[at],at,tt))return at;return-1}var _baseFindIndex=baseFindIndex$1;function baseIsNaN$1(tt){return tt!==tt}var _baseIsNaN=baseIsNaN$1;function strictIndexOf$1(tt,nt,et){for(var rt=et-1,ot=tt.length;++rt<ot;)if(tt[rt]===nt)return rt;return-1}var _strictIndexOf=strictIndexOf$1,baseFindIndex=_baseFindIndex,baseIsNaN=_baseIsNaN,strictIndexOf=_strictIndexOf;function baseIndexOf$2(tt,nt,et){return nt===nt?strictIndexOf(tt,nt,et):baseFindIndex(tt,baseIsNaN,et)}var _baseIndexOf=baseIndexOf$2,baseIndexOf$1=_baseIndexOf;function charsEndIndex$1(tt,nt){for(var et=tt.length;et--&&baseIndexOf$1(nt,tt[et],0)>-1;);return et}var _charsEndIndex=charsEndIndex$1,baseToString$1=_baseToString,castSlice=_castSlice,charsEndIndex=_charsEndIndex,stringToArray=_stringToArray,toString$3=toString_1,trimmedEndIndex$1=_trimmedEndIndex;function trimEnd(tt,nt,et){if(tt=toString$3(tt),tt&&(et||nt===void 0))return tt.slice(0,trimmedEndIndex$1(tt)+1);if(!tt||!(nt=baseToString$1(nt)))return tt;var rt=stringToArray(tt),ot=charsEndIndex(rt,stringToArray(nt))+1;return castSlice(rt,0,ot).join("")}var trimEnd_1=trimEnd;const trimEnd$1=getDefaultExportFromCjs$1(trimEnd_1);var momentTimezone$1={exports:{}},momentTimezone={exports:{}};//! moment.js
|
452
452
|
//! version : 2.30.1
|
453
453
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
454
454
|
//! license : MIT
|
@@ -642,7 +642,7 @@ hooks.version="2.30.1";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min
|
|
642
642
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
643
643
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
644
644
|
* SOFTWARE.
|
645
|
-
*/const VERSION$1="2.5.0",globalState=requireGlobalState(),validator$1=requireValidating(),loader=loading(numbro),unformatter=requireUnformatting();let formatter=formatting(numbro),manipulate=manipulating(numbro);const parsing=parsing$2;class Numbro{constructor(nt){this._value=nt}clone(){return numbro(this._value)}format(nt={}){return formatter.format(this,nt)}formatCurrency(nt){return typeof nt=="string"&&(nt=parsing.parseFormat(nt)),nt=formatter.formatOrDefault(nt,globalState.currentCurrencyDefaultFormat()),nt.output="currency",formatter.format(this,nt)}formatTime(nt={}){return nt.output="time",formatter.format(this,nt)}binaryByteUnits(){return formatter.getBinaryByteUnit(this)}decimalByteUnits(){return formatter.getDecimalByteUnit(this)}byteUnits(){return formatter.getByteUnit(this)}difference(nt){return manipulate.difference(this,nt)}add(nt){return manipulate.add(this,nt)}subtract(nt){return manipulate.subtract(this,nt)}multiply(nt){return manipulate.multiply(this,nt)}divide(nt){return manipulate.divide(this,nt)}set(nt){return manipulate.set(this,normalizeInput(nt))}value(){return this._value}valueOf(){return this._value}}function normalizeInput(tt){let nt=tt;return numbro.isNumbro(tt)?nt=tt._value:typeof tt=="string"?nt=numbro.unformat(tt):isNaN(tt)&&(nt=NaN),nt}function numbro(tt){return new Numbro(normalizeInput(tt))}numbro.version=VERSION$1;numbro.isNumbro=function(tt){return tt instanceof Numbro};numbro.language=globalState.currentLanguage;numbro.registerLanguage=globalState.registerLanguage;numbro.setLanguage=globalState.setLanguage;numbro.languages=globalState.languages;numbro.languageData=globalState.languageData;numbro.zeroFormat=globalState.setZeroFormat;numbro.defaultFormat=globalState.currentDefaults;numbro.setDefaults=globalState.setDefaults;numbro.defaultCurrencyFormat=globalState.currentCurrencyDefaultFormat;numbro.validate=validator$1.validate;numbro.loadLanguagesInNode=loader.loadLanguagesInNode;numbro.unformat=unformatter.unformat;numbro.BigNumber=manipulate.BigNumber;var numbro_1=numbro,numbro$1=getDefaultExportFromCjs(numbro_1);const WEEKDAY_SHORT=["SUN","MON","TUE","WED","THU","FRI","SAT"],formatMs=tt=>moment$1("19700101","YYYYMMDD").add(tt,"ms").format("YYYY-MM-DD HH:mm:ss.SSS"),formatSec=tt=>moment$1("19700101","YYYYMMDD").add(tt,"s").format("YYYY-MM-DD HH:mm:ss"),formatMin=tt=>moment$1("19700101","YYYYMMDD").add(tt,"m").format("YYYY-MM-DD HH:mm"),formatHours=tt=>moment$1("19700101","YYYYMMDD").add(tt,"h").format("YYYY-MM-DD HH:mm"),formatDay=tt=>moment$1("19700101","YYYYMMDD").add(tt,"d").format("YYYY-MM-DD"),formatMonth=tt=>moment$1("19700101","YYYYMMDD").add(tt,"M").format("YYYY-MM"),formatYear=tt=>moment$1("19700101","YYYYMMDD").add(tt,"y").format("YYYY"),formatWeeks=(tt,nt)=>{if(!nt)throw new Error('Frequency "W" requires parameter');const et=WEEKDAY_SHORT.indexOf(nt);if(et<0)throw new Error(`Invalid value: ${nt}. Supported values: ${JSON.stringify(WEEKDAY_SHORT)}`);const rt=moment$1("19700101","YYYYMMDD").add(tt,"w").day(et-6).format("YYYY-MM-DD"),ot=moment$1("19700101","YYYYMMDD").add(tt,"w").day(et).format("YYYY-MM-DD");return`${rt}/${ot}`},formatQuarter=tt=>moment$1("19700101","YYYYMMDD").add(tt,"Q").endOf("quarter").format("YYYY[Q]Q"),PERIOD_TYPE_FORMATTERS={L:formatMs,ms:formatMs,S:formatSec,s:formatSec,T:formatMin,min:formatMin,H:formatHours,h:formatHours,D:formatDay,M:formatMonth,W:formatWeeks,Q:formatQuarter,Y:formatYear,A:formatYear};function convertTimestampToSeconds(tt,nt){let et;if(nt===TimeUnit.MILLISECOND)et=1e3;else if(nt===TimeUnit.MICROSECOND)et=1e3*1e3;else if(nt===TimeUnit.NANOSECOND)et=1e3*1e3*1e3;else return Number(tt);return typeof tt=="bigint"&&!Number.isSafeInteger(Number(tt))?Number(tt/BigInt(et)):Number(tt)/et}function convertTimeToDate(tt,nt){var rt;const et=convertTimestampToSeconds(tt,((rt=nt==null?void 0:nt.type)==null?void 0:rt.unit)??TimeUnit.SECOND);return moment$1.unix(et).utc().toDate()}function formatTime(tt,nt){const et=convertTimeToDate(tt,nt);return moment$1(et).utc().format(et.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function formatDate(tt){const nt="YYYY-MM-DD";return tt instanceof Date||typeof tt=="number"&&Number.isFinite(tt)?moment$1.utc(tt).format(nt):String(tt)}function formatDatetime(tt,nt){var ot;if(!(tt instanceof Date||typeof tt=="number"&&Number.isFinite(tt)))return String(tt);let et=moment$1.utc(tt);const rt=(ot=nt==null?void 0:nt.type)==null?void 0:ot.timezone;return rt?(moment$1.tz.zone(rt)?et=et.tz(rt):et=et.utcOffset(rt),et.format("YYYY-MM-DD HH:mm:ssZ")):et.format("YYYY-MM-DD HH:mm:ss")}function formatDuration(tt,nt){var et;return moment$1.duration(convertTimestampToSeconds(tt,((et=nt==null?void 0:nt.type)==null?void 0:et.unit)??TimeUnit.NANOSECOND),"seconds").humanize()}function formatDecimal(tt,nt){var ut;const et=((ut=nt==null?void 0:nt.type)==null?void 0:ut.scale)||0;let rt=util$4.bigNumToString(new util$4.BN(tt)).padStart(et,"0");if(et===0)return rt;let ot="";rt.startsWith("-")&&(ot="-",rt=rt.slice(1));const at=rt.slice(0,-et)||"0",st=trimEnd$1(rt.slice(-et),"0")||"";return`${ot}${at}`+(st?`.${st}`:"")}function formatPeriodFromFreq(tt,nt){const[et,rt]=nt.split("-",2),ot=PERIOD_TYPE_FORMATTERS[et];if(!ot)return String(tt);const at=Number(tt);return Number.isSafeInteger(at)?ot(at,rt):String(tt)}function formatPeriod(tt,nt){if(isNullOrUndefined$1(nt))return String(tt);const et=nt.metadata.get("ARROW:extension:name"),rt=nt.metadata.get("ARROW:extension:metadata");if(isNullOrUndefined$1(et)||isNullOrUndefined$1(rt)||et!=="pandas.period")return String(tt);const ot=JSON.parse(rt),{freq:at}=ot;return formatPeriodFromFreq(tt,at)}function formatObject(tt,nt){return(nt==null?void 0:nt.type)instanceof Struct?JSON.stringify(tt,(et,rt)=>{if(notNullOrUndefined(rt))return typeof rt=="bigint"?Number(rt):rt}):JSON.stringify(tt,(et,rt)=>typeof rt=="bigint"?Number(rt):rt)}function formatFloat(tt){return Number.isFinite(tt)?numbro$1(tt).format("0,0.0000"):String(tt)}function formatInterval(tt,nt){var rt,ot,at,st;const et=nt&&nt.metadata.get("ARROW:extension:name");if(et&&et==="pandas.interval"){const ut=JSON.parse(nt.metadata.get("ARROW:extension:metadata")),{subtype:ct,closed:pt}=ut,dt=tt.toJSON(),ft=pt==="both"||pt==="left"?"[":"(",bt=pt==="both"||pt==="right"?"]":")",ht=format(dt.left,{pandas_type:ct,numpy_type:ct},(ot=(rt=nt.type)==null?void 0:rt.children)==null?void 0:ot[0]),Mt=format(dt.right,{pandas_type:ct,numpy_type:ct},(st=(at=nt.type)==null?void 0:at.children)==null?void 0:st[1]);return`${ft+ht}, ${Mt+bt}`}return String(tt)}function format(tt,nt,et){const rt=et&&et.metadata.get("ARROW:extension:name"),ot=et==null?void 0:et.type;if(isNullOrUndefined$1(tt))return"<NA>";const at=tt instanceof Date||Number.isFinite(tt);return at&&isDateType(nt)?formatDate(tt):typeof tt=="bigint"&&isTimeType(nt)?formatTime(Number(tt),et):at&&(isDatetimeType(nt)||ot instanceof Timestamp_)?formatDatetime(tt,et):isPeriodType(nt)||rt==="pandas.period"?formatPeriod(tt,et):isIntervalType(nt)||rt==="pandas.interval"?formatInterval(tt,et):isDurationType(nt)?formatDuration(tt,et):isDecimalType(nt)?formatDecimal(tt,et):(isFloatType(nt)||ot instanceof Float)&&Number.isFinite(tt)?formatFloat(tt):isObjectType(nt)||isListType(nt)?formatObject(tt,et):String(tt)}const StyledTableContainer=newStyled("div",{target:"e1gjw8bx0"})(({theme:tt})=>({fontSize:tt.fontSizes.md,fontFamily:tt.genericFonts.bodyFont,lineHeight:tt.lineHeights.small,captionSide:"bottom","& caption":{fontFamily:tt.genericFonts.bodyFont,fontSize:tt.fontSizes.sm,paddingTop:tt.spacing.sm,paddingBottom:0,color:tt.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"}})),StyledTableBorder=newStyled("div",{target:"e1gjw8bx1"})(({theme:tt})=>({border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,borderRadius:tt.radii.default,overflow:["auto","overlay"]})),StyledTable=newStyled("table",{target:"e1gjw8bx2"})(({theme:tt})=>({width:tt.sizes.full,color:tt.colors.bodyText,borderSpacing:0})),styleCellFunction=tt=>({borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,"tbody tr:last-child &":{borderBottom:"none"},borderRight:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,"&:last-child":{borderRight:"none"},verticalAlign:"middle",padding:`${tt.spacing.twoXS} ${tt.spacing.xs}`,fontWeight:tt.fontWeights.normal}),StyledTableCell=newStyled("td",{target:"e1gjw8bx3"})(({theme:tt})=>styleCellFunction(tt)),StyledTableCellHeader=newStyled("th",{target:"e1gjw8bx4"})(({theme:tt})=>({...styleCellFunction(tt),textAlign:"inherit",color:tt.colors.fadedText60})),StyledEmptyTableCell=newStyled(StyledTableCell,{target:"e1gjw8bx5"})(({theme:tt})=>({color:tt.colors.darkGray,fontStyle:"italic",fontSize:tt.fontSizes.md,textAlign:"center"}));function ArrowTable(tt){const nt=tt.element,{cssId:et,cssStyles:rt,caption:ot}=nt.styler??{},{numHeaderRows:at,numRows:st,numColumns:ut}=nt.dimensions,ct=range$1(st),pt=ct.slice(0,at),dt=ct.slice(at);return jsxs(StyledTableContainer,{className:"stTable","data-testid":"stTable",children:[rt&&jsx$1("style",{children:rt}),jsx$1(StyledTableBorder,{children:jsxs(StyledTable,{id:et,"data-testid":"stTableStyledTable",children:[pt.length>0&&jsx$1("thead",{children:pt.map(ft=>generateTableRow(nt,ft,ut))}),jsx$1("tbody",{children:dt.length===0?jsx$1("tr",{children:jsx$1(StyledEmptyTableCell,{"data-testid":"stTableStyledEmptyTableCell",colSpan:ut||1,children:"empty"})}):dt.map(ft=>generateTableRow(nt,ft,ut))})]})}),ot&&jsx$1("caption",{children:ot})]})}function generateTableRow(tt,nt,et){return jsx$1("tr",{children:range$1(et).map(rt=>generateTableCell(tt,nt,rt))},nt)}function generateTableCell(tt,nt,et){const{type:rt,cssId:ot,cssClass:at,content:st,contentType:ut,displayContent:ct,field:pt}=tt.getCell(nt,et),dt=ct||format(st,ut,pt),ft={textAlign:isNumericType(ut)?"right":"left"};switch(rt){case"blank":return jsx$1(StyledTableCellHeader,{className:at,children:" "},et);case"index":return jsx$1(StyledTableCellHeader,{scope:"row",id:ot,className:at,children:dt},et);case"columns":return jsx$1(StyledTableCellHeader,{scope:"col",className:at,style:ft,children:dt},et);case"data":return jsx$1(StyledTableCell,{id:ot,style:ft,children:dt},et);default:throw new Error(`Cannot parse type "${rt}".`)}}const StyledDocSummary=newStyled("span",{target:"e1e4p6eq0"})(({theme:tt})=>({"& > *":{marginRight:tt.spacing.sm}})),StyledDocName=newStyled("span",{target:"e1e4p6eq1"})(({theme:tt})=>({fontWeight:tt.fontWeights.bold})),StyledDocType=newStyled("span",{target:"e1e4p6eq2"})(({theme:tt})=>({color:tt.colors.docStringTypeText})),StyledDocValue=newStyled("span",{target:"e1e4p6eq3"})(),StyledDocContainer=newStyled("span",{target:"e1e4p6eq4"})(({theme:tt})=>({display:"flex",flexDirection:"column",borderRadius:tt.radii.default,border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,fontFamily:tt.genericFonts.codeFont,fontSize:tt.fontSizes.sm})),StyledDocHeader=newStyled("div",{target:"e1e4p6eq5"})(({theme:tt})=>({padding:`${tt.spacing.sm} ${tt.spacing.lg}`,backgroundColor:tt.colors.docStringContainerBackground,borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,borderTopLeftRadius:tt.radii.default,borderTopRightRadius:tt.radii.default,fontSize:tt.fontSizes.sm,overflow:["auto","overlay"]})),StyledDocString=newStyled("div",{target:"e1e4p6eq6"})(({theme:tt})=>({whiteSpace:"pre",overflow:["auto","overlay"],maxHeight:"30.5rem",padding:`${tt.spacing.sm} ${tt.spacing.lg}`,fontSize:tt.fontSizes.sm,"&:not(:last-child)":{borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`}})),StyledMembersTable=newStyled("table",{target:"e1e4p6eq7"})(({theme:tt})=>({width:"100%",fontSize:tt.fontSizes.twoSm,backgroundColor:tt.colors.docStringContainerBackground,tableLayout:"fixed",borderCollapse:"collapse"})),StyledMembersRow=newStyled("tr",{target:"e1e4p6eq8"})(({theme:tt})=>({"&:not(:last-child)":{borderBottom:`${tt.sizes.borderWidth} dotted ${tt.colors.borderColorLight}`}})),StyledMembersSummaryCell=newStyled("td",{target:"e1e4p6eq9"})(({theme:tt})=>({width:"30%",overflow:["auto","overlay"],padding:`${tt.spacing.sm} ${tt.spacing.lg}`,"& > *":{marginRight:tt.spacing.sm}})),StyledMembersDetailsCell=newStyled("td",{target:"e1e4p6eq10"})(({theme:tt})=>({width:"70%",overflow:["auto","overlay"],padding:`${tt.spacing.sm} ${tt.spacing.lg}`}));function DocString({width:tt,element:nt}){const{name:et,type:rt,value:ot,docString:at,members:st}=nt;return jsxs(StyledDocContainer,{className:"stHelp","data-testid":"stHelp",width:tt,children:[jsx$1(StyledDocHeader,{children:jsxs(StyledDocSummary,{children:[et?jsx$1(StyledDocName,{"data-testid":"stHelpName",children:et}):null,rt?jsx$1(StyledDocType,{"data-testid":"stHelpType",children:rt}):null,ot?jsx$1(StyledDocValue,{"data-testid":"stHelpValue",children:ot}):null]})}),jsx$1(StyledDocString,{"data-testid":"stHelpDoc",children:at||"No docs available"}),st.length>0?jsx$1(StyledMembersTable,{"data-testid":"stHelpMembersTable",children:st.map(ut=>jsx$1(Member,{member:ut},ut.name))}):null]})}function Member({member:tt}){const{name:nt,type:et,value:rt,docString:ot}=tt;return jsxs(StyledMembersRow,{"data-testid":"stHelpMember",children:[jsxs(StyledMembersSummaryCell,{children:[nt?jsx$1(StyledDocName,{"data-testid":"stHelpMemberDocName",children:nt}):null,et?jsx$1(StyledDocType,{"data-testid":"stHelpMemberDocType",children:et}):null]}),jsx$1(StyledMembersDetailsCell,{children:rt?jsx$1(StyledDocValue,{"data-testid":"stHelpMemberDocValue",children:rt}):jsx$1(StyledDocValue,{"data-testid":"stHelpMemberDocString",children:ot||"No docs available"})})]})}const StyledStackTraceRow=newStyled("div",{target:"e1msg78q0"})(({theme:tt})=>({marginTop:tt.spacing.sm,"&:first-of-type":{marginTop:0}})),StyledMessageType=newStyled("span",{target:"e1msg78q1"})(({theme:tt})=>({fontWeight:tt.fontWeights.bold})),StyledStackTraceTitle=newStyled("div",{target:"e1msg78q2"})(({theme:tt})=>({marginTop:`calc(${tt.spacing.sm} + ${tt.spacing.xl})`,marginBottom:tt.spacing.sm})),StyledStackTraceContent=newStyled("div",{target:"e1msg78q3"})({display:"inline-block",minWidth:"100%"}),StyledExceptionMessage=newStyled("div",{target:"e1msg78q4"})({wordWrap:"break-word"});function isNonEmptyString(tt){return notNullOrUndefined(tt)&&tt!==""}function ExceptionMessage({type:tt,message:nt,messageIsMarkdown:et}){if(et){let rt=nt??"";return tt.length!==0&&(rt=`**${tt}**: ${rt}`),jsx$1(StreamlitMarkdown$1,{source:rt,allowHTML:!1})}return jsxs(Fragment,{children:[jsx$1(StyledMessageType,{children:tt}),tt.length!==0&&": ",isNonEmptyString(nt)?nt:null]})}function StackTrace({stackTrace:tt}){return jsxs(Fragment,{children:[jsx$1(StyledStackTraceTitle,{children:"Traceback:"}),jsx$1(StyledStackTrace,{children:jsx$1(StyledStackTraceContent,{children:jsx$1(StyledCode,{children:tt.map((nt,et)=>jsx$1(StyledStackTraceRow,{"data-testid":"stExceptionTraceRow",children:nt},et))})})})]})}function ExceptionElement({element:tt,width:nt}){return jsx$1("div",{className:"stException","data-testid":"stException",children:jsxs(AlertContainer,{kind:tt.isWarning?Kind.WARNING:Kind.ERROR,width:nt,children:[jsx$1(StyledExceptionMessage,{"data-testid":"stExceptionMessage",children:jsx$1(ExceptionMessage,{type:tt.type,message:tt.message,messageIsMarkdown:tt.messageIsMarkdown})}),tt.stackTrace&&tt.stackTrace.length>0?jsx$1(StackTrace,{stackTrace:tt.stackTrace}):null]})})}var Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,unicode={Space_Separator,ID_Start,ID_Continue},util$3={isSpaceSeparator(tt){return typeof tt=="string"&&unicode.Space_Separator.test(tt)},isIdStartChar(tt){return typeof tt=="string"&&(tt>="a"&&tt<="z"||tt>="A"&&tt<="Z"||tt==="$"||tt==="_"||unicode.ID_Start.test(tt))},isIdContinueChar(tt){return typeof tt=="string"&&(tt>="a"&&tt<="z"||tt>="A"&&tt<="Z"||tt>="0"&&tt<="9"||tt==="$"||tt==="_"||tt===""||tt===""||unicode.ID_Continue.test(tt))},isDigit(tt){return typeof tt=="string"&&/[0-9]/.test(tt)},isHexDigit(tt){return typeof tt=="string"&&/[0-9A-Fa-f]/.test(tt)}};let source,parseState,stack,pos,line,column,token$1,key,root$2;var parse$2=function tt(nt,et){source=String(nt),parseState="start",stack=[],pos=0,line=1,column=0,token$1=void 0,key=void 0,root$2=void 0;do token$1=lex(),parseStates[parseState]();while(token$1.type!=="eof");return typeof et=="function"?internalize({"":root$2},"",et):root$2};function internalize(tt,nt,et){const rt=tt[nt];if(rt!=null&&typeof rt=="object")if(Array.isArray(rt))for(let ot=0;ot<rt.length;ot++){const at=String(ot),st=internalize(rt,at,et);st===void 0?delete rt[at]:Object.defineProperty(rt,at,{value:st,writable:!0,enumerable:!0,configurable:!0})}else for(const ot in rt){const at=internalize(rt,ot,et);at===void 0?delete rt[ot]:Object.defineProperty(rt,ot,{value:at,writable:!0,enumerable:!0,configurable:!0})}return et.call(tt,nt,rt)}let lexState,buffer,doubleQuote,sign,c;function lex(){for(lexState="default",buffer="",doubleQuote=!1,sign=1;;){c=peek();const tt=lexStates[lexState]();if(tt)return tt}}function peek(){if(source[pos])return String.fromCodePoint(source.codePointAt(pos))}function read(){const tt=peek();return tt===`
|
645
|
+
*/const VERSION$1="2.5.0",globalState=requireGlobalState(),validator$1=requireValidating(),loader=loading(numbro),unformatter=requireUnformatting();let formatter=formatting(numbro),manipulate=manipulating(numbro);const parsing=parsing$2;class Numbro{constructor(nt){this._value=nt}clone(){return numbro(this._value)}format(nt={}){return formatter.format(this,nt)}formatCurrency(nt){return typeof nt=="string"&&(nt=parsing.parseFormat(nt)),nt=formatter.formatOrDefault(nt,globalState.currentCurrencyDefaultFormat()),nt.output="currency",formatter.format(this,nt)}formatTime(nt={}){return nt.output="time",formatter.format(this,nt)}binaryByteUnits(){return formatter.getBinaryByteUnit(this)}decimalByteUnits(){return formatter.getDecimalByteUnit(this)}byteUnits(){return formatter.getByteUnit(this)}difference(nt){return manipulate.difference(this,nt)}add(nt){return manipulate.add(this,nt)}subtract(nt){return manipulate.subtract(this,nt)}multiply(nt){return manipulate.multiply(this,nt)}divide(nt){return manipulate.divide(this,nt)}set(nt){return manipulate.set(this,normalizeInput(nt))}value(){return this._value}valueOf(){return this._value}}function normalizeInput(tt){let nt=tt;return numbro.isNumbro(tt)?nt=tt._value:typeof tt=="string"?nt=numbro.unformat(tt):isNaN(tt)&&(nt=NaN),nt}function numbro(tt){return new Numbro(normalizeInput(tt))}numbro.version=VERSION$1;numbro.isNumbro=function(tt){return tt instanceof Numbro};numbro.language=globalState.currentLanguage;numbro.registerLanguage=globalState.registerLanguage;numbro.setLanguage=globalState.setLanguage;numbro.languages=globalState.languages;numbro.languageData=globalState.languageData;numbro.zeroFormat=globalState.setZeroFormat;numbro.defaultFormat=globalState.currentDefaults;numbro.setDefaults=globalState.setDefaults;numbro.defaultCurrencyFormat=globalState.currentCurrencyDefaultFormat;numbro.validate=validator$1.validate;numbro.loadLanguagesInNode=loader.loadLanguagesInNode;numbro.unformat=unformatter.unformat;numbro.BigNumber=manipulate.BigNumber;var numbro_1=numbro,numbro$1=getDefaultExportFromCjs(numbro_1);const WEEKDAY_SHORT=["SUN","MON","TUE","WED","THU","FRI","SAT"],formatMs=tt=>moment$1("19700101","YYYYMMDD").add(tt,"ms").format("YYYY-MM-DD HH:mm:ss.SSS"),formatSec=tt=>moment$1("19700101","YYYYMMDD").add(tt,"s").format("YYYY-MM-DD HH:mm:ss"),formatMin=tt=>moment$1("19700101","YYYYMMDD").add(tt,"m").format("YYYY-MM-DD HH:mm"),formatHours=tt=>moment$1("19700101","YYYYMMDD").add(tt,"h").format("YYYY-MM-DD HH:mm"),formatDay=tt=>moment$1("19700101","YYYYMMDD").add(tt,"d").format("YYYY-MM-DD"),formatMonth=tt=>moment$1("19700101","YYYYMMDD").add(tt,"M").format("YYYY-MM"),formatYear=tt=>moment$1("19700101","YYYYMMDD").add(tt,"y").format("YYYY"),formatWeeks=(tt,nt)=>{if(!nt)throw new Error('Frequency "W" requires parameter');const et=WEEKDAY_SHORT.indexOf(nt);if(et<0)throw new Error(`Invalid value: ${nt}. Supported values: ${JSON.stringify(WEEKDAY_SHORT)}`);const rt=moment$1("19700101","YYYYMMDD").add(tt,"w").day(et-6).format("YYYY-MM-DD"),ot=moment$1("19700101","YYYYMMDD").add(tt,"w").day(et).format("YYYY-MM-DD");return`${rt}/${ot}`},formatQuarter=tt=>moment$1("19700101","YYYYMMDD").add(tt,"Q").endOf("quarter").format("YYYY[Q]Q"),PERIOD_TYPE_FORMATTERS={L:formatMs,ms:formatMs,S:formatSec,s:formatSec,T:formatMin,min:formatMin,H:formatHours,h:formatHours,D:formatDay,M:formatMonth,W:formatWeeks,Q:formatQuarter,Y:formatYear,A:formatYear};function convertTimestampToSeconds(tt,nt){let et;if(nt===TimeUnit.MILLISECOND)et=1e3;else if(nt===TimeUnit.MICROSECOND)et=1e3*1e3;else if(nt===TimeUnit.NANOSECOND)et=1e3*1e3*1e3;else return Number(tt);return typeof tt=="bigint"&&!Number.isSafeInteger(Number(tt))?Number(tt/BigInt(et)):Number(tt)/et}function convertTimeToDate(tt,nt){var rt;const et=convertTimestampToSeconds(tt,((rt=nt==null?void 0:nt.type)==null?void 0:rt.unit)??TimeUnit.SECOND);return moment$1.unix(et).utc().toDate()}function formatTime(tt,nt){const et=convertTimeToDate(tt,nt);return moment$1(et).utc().format(et.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function formatDate(tt){const nt="YYYY-MM-DD";return tt instanceof Date||typeof tt=="number"&&Number.isFinite(tt)?moment$1.utc(tt).format(nt):String(tt)}function formatDatetime(tt,nt){var ot;if(!(tt instanceof Date||typeof tt=="number"&&Number.isFinite(tt)))return String(tt);let et=moment$1.utc(tt);const rt=(ot=nt==null?void 0:nt.type)==null?void 0:ot.timezone;return rt?(moment$1.tz.zone(rt)?et=et.tz(rt):et=et.utcOffset(rt),et.format("YYYY-MM-DD HH:mm:ssZ")):et.format("YYYY-MM-DD HH:mm:ss")}function formatDuration(tt,nt){var et;return moment$1.duration(convertTimestampToSeconds(tt,((et=nt==null?void 0:nt.type)==null?void 0:et.unit)??TimeUnit.NANOSECOND),"seconds").humanize()}function formatDecimal(tt,nt){var ut;const et=((ut=nt==null?void 0:nt.type)==null?void 0:ut.scale)||0;let rt=util$4.bigNumToString(new util$4.BN(tt)).padStart(et,"0");if(et===0)return rt;let ot="";rt.startsWith("-")&&(ot="-",rt=rt.slice(1));const at=rt.slice(0,-et)||"0",st=trimEnd$1(rt.slice(-et),"0")||"";return`${ot}${at}`+(st?`.${st}`:"")}function formatPeriodFromFreq(tt,nt){const[et,rt]=nt.split("-",2),ot=PERIOD_TYPE_FORMATTERS[et];if(!ot)return String(tt);const at=Number(tt);return Number.isSafeInteger(at)?ot(at,rt):String(tt)}function formatPeriod(tt,nt){if(isNullOrUndefined$1(nt))return String(tt);const et=nt.metadata.get("ARROW:extension:name"),rt=nt.metadata.get("ARROW:extension:metadata");if(isNullOrUndefined$1(et)||isNullOrUndefined$1(rt)||et!=="pandas.period")return String(tt);const ot=JSON.parse(rt),{freq:at}=ot;return formatPeriodFromFreq(tt,at)}function formatObject(tt,nt){return(nt==null?void 0:nt.type)instanceof Struct?JSON.stringify(tt,(et,rt)=>{if(notNullOrUndefined(rt))return typeof rt=="bigint"?Number(rt):rt}):JSON.stringify(tt,(et,rt)=>typeof rt=="bigint"?Number(rt):rt)}function formatFloat(tt){return Number.isFinite(tt)?numbro$1(tt).format("0,0.0000"):String(tt)}function formatInterval(tt,nt){var rt,ot,at,st;const et=nt&&nt.metadata.get("ARROW:extension:name");if(et&&et==="pandas.interval"){const ut=JSON.parse(nt.metadata.get("ARROW:extension:metadata")),{subtype:ct,closed:pt}=ut,dt=tt.toJSON(),ft=pt==="both"||pt==="left"?"[":"(",bt=pt==="both"||pt==="right"?"]":")",ht=format(dt.left,{pandas_type:ct,numpy_type:ct},(ot=(rt=nt.type)==null?void 0:rt.children)==null?void 0:ot[0]),Mt=format(dt.right,{pandas_type:ct,numpy_type:ct},(st=(at=nt.type)==null?void 0:at.children)==null?void 0:st[1]);return`${ft+ht}, ${Mt+bt}`}return String(tt)}function format(tt,nt,et){const rt=et&&et.metadata.get("ARROW:extension:name"),ot=et==null?void 0:et.type;if(isNullOrUndefined$1(tt))return"<NA>";const at=tt instanceof Date||Number.isFinite(tt);return at&&isDateType(nt)?formatDate(tt):typeof tt=="bigint"&&isTimeType(nt)?formatTime(Number(tt),et):at&&(isDatetimeType(nt)||ot instanceof Timestamp_)?formatDatetime(tt,et):isPeriodType(nt)||rt==="pandas.period"?formatPeriod(tt,et):isIntervalType(nt)||rt==="pandas.interval"?formatInterval(tt,et):isDurationType(nt)?formatDuration(tt,et):isDecimalType(nt)?formatDecimal(tt,et):(isFloatType(nt)||ot instanceof Float)&&Number.isFinite(tt)?formatFloat(tt):isObjectType(nt)||isListType(nt)?formatObject(tt,et):String(tt)}const StyledTableContainer=newStyled("div",{target:"e1rblae10"})(({theme:tt})=>({fontSize:tt.fontSizes.md,fontFamily:tt.genericFonts.bodyFont,lineHeight:tt.lineHeights.small,captionSide:"bottom"})),StyledTableCaption=newStyled("div",{target:"e1rblae11"})(({theme:tt})=>({fontFamily:tt.genericFonts.bodyFont,fontSize:tt.fontSizes.sm,paddingTop:tt.spacing.sm,paddingBottom:0,color:tt.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),StyledTableBorder=newStyled("div",{target:"e1rblae12"})(({theme:tt})=>({border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,borderRadius:tt.radii.default,overflow:["auto","overlay"]})),StyledTable=newStyled("table",{target:"e1rblae13"})(({theme:tt})=>({width:tt.sizes.full,color:tt.colors.bodyText,borderSpacing:0})),styleCellFunction=tt=>({borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,"tbody tr:last-child &":{borderBottom:"none"},borderRight:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,"&:last-child":{borderRight:"none"},verticalAlign:"middle",padding:`${tt.spacing.twoXS} ${tt.spacing.xs}`,fontWeight:tt.fontWeights.normal}),StyledTableCell=newStyled("td",{target:"e1rblae14"})(({theme:tt})=>styleCellFunction(tt)),StyledTableCellHeader=newStyled("th",{target:"e1rblae15"})(({theme:tt})=>({...styleCellFunction(tt),textAlign:"inherit",color:tt.colors.fadedText60})),StyledEmptyTableCell=newStyled(StyledTableCell,{target:"e1rblae16"})(({theme:tt})=>({color:tt.colors.darkGray,fontStyle:"italic",fontSize:tt.fontSizes.md,textAlign:"center"}));function ArrowTable(tt){const nt=tt.element,{cssId:et,cssStyles:rt,caption:ot}=nt.styler??{},{numHeaderRows:at,numDataRows:st,numColumns:ut}=nt.dimensions,ct=range$1(st);return jsxs(StyledTableContainer,{className:"stTable","data-testid":"stTable",children:[rt&&jsx$1("style",{children:rt}),jsx$1(StyledTableBorder,{children:jsxs(StyledTable,{id:et,"data-testid":"stTableStyledTable",children:[at>0&&generateTableHeader(nt),jsx$1("tbody",{children:ct.length===0?jsx$1("tr",{children:jsx$1(StyledEmptyTableCell,{"data-testid":"stTableStyledEmptyTableCell",colSpan:ut||1,children:"empty"})}):ct.map(pt=>generateTableRow(nt,pt,ut))})]})}),ot&&jsx$1(StyledTableCaption,{children:ot})]})}function generateTableHeader(tt){return jsx$1("thead",{children:getStyledHeaders(tt).map((nt,et)=>jsx$1("tr",{children:nt.map((rt,ot)=>jsx$1(StyledTableCellHeader,{className:rt.cssClass,scope:"col",children:rt.name||" "},ot))},et))})}function generateTableRow(tt,nt,et){return jsx$1("tr",{children:range$1(et).map(rt=>generateTableCell(tt,nt,rt))},nt)}function generateTableCell(tt,nt,et){const{type:rt,content:ot,contentType:at,field:st}=tt.getCell(nt,et),ut=getStyledCell(tt,nt,et),ct=(ut==null?void 0:ut.displayContent)||format(ot,at,st),pt={textAlign:isNumericType(at)?"right":"left"};switch(rt){case DataFrameCellType.INDEX:return jsx$1(StyledTableCellHeader,{scope:"row",id:ut==null?void 0:ut.cssId,className:ut==null?void 0:ut.cssClass,children:ct},et);case DataFrameCellType.DATA:return jsx$1(StyledTableCell,{id:ut==null?void 0:ut.cssId,className:ut==null?void 0:ut.cssClass,style:pt,children:ct},et);default:throw new Error(`Cannot parse type "${rt}".`)}}const ArrowTable$1=reactExports.memo(ArrowTable),StyledDocSummary=newStyled("span",{target:"e1e4p6eq0"})(({theme:tt})=>({"& > *":{marginRight:tt.spacing.sm}})),StyledDocName=newStyled("span",{target:"e1e4p6eq1"})(({theme:tt})=>({fontWeight:tt.fontWeights.bold})),StyledDocType=newStyled("span",{target:"e1e4p6eq2"})(({theme:tt})=>({color:tt.colors.docStringTypeText})),StyledDocValue=newStyled("span",{target:"e1e4p6eq3"})(),StyledDocContainer=newStyled("span",{target:"e1e4p6eq4"})(({theme:tt})=>({display:"flex",flexDirection:"column",borderRadius:tt.radii.default,border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,fontFamily:tt.genericFonts.codeFont,fontSize:tt.fontSizes.sm})),StyledDocHeader=newStyled("div",{target:"e1e4p6eq5"})(({theme:tt})=>({padding:`${tt.spacing.sm} ${tt.spacing.lg}`,backgroundColor:tt.colors.docStringContainerBackground,borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`,borderTopLeftRadius:tt.radii.default,borderTopRightRadius:tt.radii.default,fontSize:tt.fontSizes.sm,overflow:["auto","overlay"]})),StyledDocString=newStyled("div",{target:"e1e4p6eq6"})(({theme:tt})=>({whiteSpace:"pre",overflow:["auto","overlay"],maxHeight:"30.5rem",padding:`${tt.spacing.sm} ${tt.spacing.lg}`,fontSize:tt.fontSizes.sm,"&:not(:last-child)":{borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColorLight}`}})),StyledMembersTable=newStyled("table",{target:"e1e4p6eq7"})(({theme:tt})=>({width:"100%",fontSize:tt.fontSizes.twoSm,backgroundColor:tt.colors.docStringContainerBackground,tableLayout:"fixed",borderCollapse:"collapse"})),StyledMembersRow=newStyled("tr",{target:"e1e4p6eq8"})(({theme:tt})=>({"&:not(:last-child)":{borderBottom:`${tt.sizes.borderWidth} dotted ${tt.colors.borderColorLight}`}})),StyledMembersSummaryCell=newStyled("td",{target:"e1e4p6eq9"})(({theme:tt})=>({width:"30%",overflow:["auto","overlay"],padding:`${tt.spacing.sm} ${tt.spacing.lg}`,"& > *":{marginRight:tt.spacing.sm}})),StyledMembersDetailsCell=newStyled("td",{target:"e1e4p6eq10"})(({theme:tt})=>({width:"70%",overflow:["auto","overlay"],padding:`${tt.spacing.sm} ${tt.spacing.lg}`}));function DocString({width:tt,element:nt}){const{name:et,type:rt,value:ot,docString:at,members:st}=nt;return jsxs(StyledDocContainer,{className:"stHelp","data-testid":"stHelp",width:tt,children:[jsx$1(StyledDocHeader,{children:jsxs(StyledDocSummary,{children:[et?jsx$1(StyledDocName,{"data-testid":"stHelpName",children:et}):null,rt?jsx$1(StyledDocType,{"data-testid":"stHelpType",children:rt}):null,ot?jsx$1(StyledDocValue,{"data-testid":"stHelpValue",children:ot}):null]})}),jsx$1(StyledDocString,{"data-testid":"stHelpDoc",children:at||"No docs available"}),st.length>0?jsx$1(StyledMembersTable,{"data-testid":"stHelpMembersTable",children:st.map(ut=>jsx$1(Member,{member:ut},ut.name))}):null]})}function Member({member:tt}){const{name:nt,type:et,value:rt,docString:ot}=tt;return jsxs(StyledMembersRow,{"data-testid":"stHelpMember",children:[jsxs(StyledMembersSummaryCell,{children:[nt?jsx$1(StyledDocName,{"data-testid":"stHelpMemberDocName",children:nt}):null,et?jsx$1(StyledDocType,{"data-testid":"stHelpMemberDocType",children:et}):null]}),jsx$1(StyledMembersDetailsCell,{children:rt?jsx$1(StyledDocValue,{"data-testid":"stHelpMemberDocValue",children:rt}):jsx$1(StyledDocValue,{"data-testid":"stHelpMemberDocString",children:ot||"No docs available"})})]})}const StyledStackTraceRow=newStyled("div",{target:"e1msg78q0"})(({theme:tt})=>({marginTop:tt.spacing.sm,"&:first-of-type":{marginTop:0}})),StyledMessageType=newStyled("span",{target:"e1msg78q1"})(({theme:tt})=>({fontWeight:tt.fontWeights.bold})),StyledStackTraceTitle=newStyled("div",{target:"e1msg78q2"})(({theme:tt})=>({marginTop:`calc(${tt.spacing.sm} + ${tt.spacing.xl})`,marginBottom:tt.spacing.sm})),StyledStackTraceContent=newStyled("div",{target:"e1msg78q3"})({display:"inline-block",minWidth:"100%"}),StyledExceptionMessage=newStyled("div",{target:"e1msg78q4"})({wordWrap:"break-word"});function isNonEmptyString(tt){return notNullOrUndefined(tt)&&tt!==""}function ExceptionMessage({type:tt,message:nt,messageIsMarkdown:et}){if(et){let rt=nt??"";return tt.length!==0&&(rt=`**${tt}**: ${rt}`),jsx$1(StreamlitMarkdown$1,{source:rt,allowHTML:!1})}return jsxs(Fragment,{children:[jsx$1(StyledMessageType,{children:tt}),tt.length!==0&&": ",isNonEmptyString(nt)?nt:null]})}function StackTrace({stackTrace:tt}){return jsxs(Fragment,{children:[jsx$1(StyledStackTraceTitle,{children:"Traceback:"}),jsx$1(StyledStackTrace,{children:jsx$1(StyledStackTraceContent,{children:jsx$1(StyledCode,{children:tt.map((nt,et)=>jsx$1(StyledStackTraceRow,{"data-testid":"stExceptionTraceRow",children:nt},et))})})})]})}function ExceptionElement({element:tt,width:nt}){return jsx$1("div",{className:"stException","data-testid":"stException",children:jsxs(AlertContainer,{kind:tt.isWarning?Kind.WARNING:Kind.ERROR,width:nt,children:[jsx$1(StyledExceptionMessage,{"data-testid":"stExceptionMessage",children:jsx$1(ExceptionMessage,{type:tt.type,message:tt.message,messageIsMarkdown:tt.messageIsMarkdown})}),tt.stackTrace&&tt.stackTrace.length>0?jsx$1(StackTrace,{stackTrace:tt.stackTrace}):null]})})}var Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,unicode={Space_Separator,ID_Start,ID_Continue},util$3={isSpaceSeparator(tt){return typeof tt=="string"&&unicode.Space_Separator.test(tt)},isIdStartChar(tt){return typeof tt=="string"&&(tt>="a"&&tt<="z"||tt>="A"&&tt<="Z"||tt==="$"||tt==="_"||unicode.ID_Start.test(tt))},isIdContinueChar(tt){return typeof tt=="string"&&(tt>="a"&&tt<="z"||tt>="A"&&tt<="Z"||tt>="0"&&tt<="9"||tt==="$"||tt==="_"||tt===""||tt===""||unicode.ID_Continue.test(tt))},isDigit(tt){return typeof tt=="string"&&/[0-9]/.test(tt)},isHexDigit(tt){return typeof tt=="string"&&/[0-9A-Fa-f]/.test(tt)}};let source,parseState,stack,pos,line,column,token$1,key,root$2;var parse$2=function tt(nt,et){source=String(nt),parseState="start",stack=[],pos=0,line=1,column=0,token$1=void 0,key=void 0,root$2=void 0;do token$1=lex(),parseStates[parseState]();while(token$1.type!=="eof");return typeof et=="function"?internalize({"":root$2},"",et):root$2};function internalize(tt,nt,et){const rt=tt[nt];if(rt!=null&&typeof rt=="object")if(Array.isArray(rt))for(let ot=0;ot<rt.length;ot++){const at=String(ot),st=internalize(rt,at,et);st===void 0?delete rt[at]:Object.defineProperty(rt,at,{value:st,writable:!0,enumerable:!0,configurable:!0})}else for(const ot in rt){const at=internalize(rt,ot,et);at===void 0?delete rt[ot]:Object.defineProperty(rt,ot,{value:at,writable:!0,enumerable:!0,configurable:!0})}return et.call(tt,nt,rt)}let lexState,buffer,doubleQuote,sign,c;function lex(){for(lexState="default",buffer="",doubleQuote=!1,sign=1;;){c=peek();const tt=lexStates[lexState]();if(tt)return tt}}function peek(){if(source[pos])return String.fromCodePoint(source.codePointAt(pos))}function read(){const tt=peek();return tt===`
|
646
646
|
`?(line++,column=0):tt?column+=tt.length:column++,tt&&(pos+=tt.length),tt}const lexStates={default(){switch(c){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
647
647
|
`:case"\r":case"\u2028":case"\u2029":read();return;case"/":read(),lexState="comment";return;case void 0:return read(),newToken("eof")}if(util$3.isSpaceSeparator(c)){read();return}return lexStates[parseState]()},comment(){switch(c){case"*":read(),lexState="multiLineComment";return;case"/":read(),lexState="singleLineComment";return}throw invalidChar(read())},multiLineComment(){switch(c){case"*":read(),lexState="multiLineCommentAsterisk";return;case void 0:throw invalidChar(read())}read()},multiLineCommentAsterisk(){switch(c){case"*":read();return;case"/":read(),lexState="default";return;case void 0:throw invalidChar(read())}read(),lexState="multiLineComment"},singleLineComment(){switch(c){case`
|
648
648
|
`:case"\r":case"\u2028":case"\u2029":read(),lexState="default";return;case void 0:return read(),newToken("eof")}read()},value(){switch(c){case"{":case"[":return newToken("punctuator",read());case"n":return read(),literal("ull"),newToken("null",null);case"t":return read(),literal("rue"),newToken("boolean",!0);case"f":return read(),literal("alse"),newToken("boolean",!1);case"-":case"+":read()==="-"&&(sign=-1),lexState="sign";return;case".":buffer=read(),lexState="decimalPointLeading";return;case"0":buffer=read(),lexState="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":buffer=read(),lexState="decimalInteger";return;case"I":return read(),literal("nfinity"),newToken("numeric",1/0);case"N":return read(),literal("aN"),newToken("numeric",NaN);case'"':case"'":doubleQuote=read()==='"',buffer="",lexState="string";return}throw invalidChar(read())},identifierNameStartEscape(){if(c!=="u")throw invalidChar(read());read();const tt=unicodeEscape();switch(tt){case"$":case"_":break;default:if(!util$3.isIdStartChar(tt))throw invalidIdentifier();break}buffer+=tt,lexState="identifierName"},identifierName(){switch(c){case"$":case"_":case"":case"":buffer+=read();return;case"\\":read(),lexState="identifierNameEscape";return}if(util$3.isIdContinueChar(c)){buffer+=read();return}return newToken("identifier",buffer)},identifierNameEscape(){if(c!=="u")throw invalidChar(read());read();const tt=unicodeEscape();switch(tt){case"$":case"_":case"":case"":break;default:if(!util$3.isIdContinueChar(tt))throw invalidIdentifier();break}buffer+=tt,lexState="identifierName"},sign(){switch(c){case".":buffer=read(),lexState="decimalPointLeading";return;case"0":buffer=read(),lexState="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":buffer=read(),lexState="decimalInteger";return;case"I":return read(),literal("nfinity"),newToken("numeric",sign*(1/0));case"N":return read(),literal("aN"),newToken("numeric",NaN)}throw invalidChar(read())},zero(){switch(c){case".":buffer+=read(),lexState="decimalPoint";return;case"e":case"E":buffer+=read(),lexState="decimalExponent";return;case"x":case"X":buffer+=read(),lexState="hexadecimal";return}return newToken("numeric",sign*0)},decimalInteger(){switch(c){case".":buffer+=read(),lexState="decimalPoint";return;case"e":case"E":buffer+=read(),lexState="decimalExponent";return}if(util$3.isDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},decimalPointLeading(){if(util$3.isDigit(c)){buffer+=read(),lexState="decimalFraction";return}throw invalidChar(read())},decimalPoint(){switch(c){case"e":case"E":buffer+=read(),lexState="decimalExponent";return}if(util$3.isDigit(c)){buffer+=read(),lexState="decimalFraction";return}return newToken("numeric",sign*Number(buffer))},decimalFraction(){switch(c){case"e":case"E":buffer+=read(),lexState="decimalExponent";return}if(util$3.isDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},decimalExponent(){switch(c){case"+":case"-":buffer+=read(),lexState="decimalExponentSign";return}if(util$3.isDigit(c)){buffer+=read(),lexState="decimalExponentInteger";return}throw invalidChar(read())},decimalExponentSign(){if(util$3.isDigit(c)){buffer+=read(),lexState="decimalExponentInteger";return}throw invalidChar(read())},decimalExponentInteger(){if(util$3.isDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},hexadecimal(){if(util$3.isHexDigit(c)){buffer+=read(),lexState="hexadecimalInteger";return}throw invalidChar(read())},hexadecimalInteger(){if(util$3.isHexDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},string(){switch(c){case"\\":read(),buffer+=escape();return;case'"':if(doubleQuote)return read(),newToken("string",buffer);buffer+=read();return;case"'":if(!doubleQuote)return read(),newToken("string",buffer);buffer+=read();return;case`
|
@@ -680,7 +680,7 @@ If this is an installed component that works locally, the app may be having trou
|
|
680
680
|
|
681
681
|
For more troubleshooting help, please see the [Streamlit Component docs](${COMPONENT_DEVELOPER_URL}) or visit our [forums](${COMMUNITY_URL}).`,et}function tryParseArgs(tt,nt,et,rt){if(!rt)try{return parseArgs(tt,nt)}catch(ot){const at=ensureError(ot);et(at)}return[{},[]]}function compareDataframeArgs(tt,nt){return tt===nt||tt.length===nt.length&&tt.every((et,rt)=>{const ot=nt[rt];return et.key===ot.key&&et.value===ot.value})}function ComponentInstance(tt){const[nt,et]=reactExports.useState(),{disabled:rt,element:ot,registry:at,theme:st,widgetMgr:ut,width:ct,fragmentId:pt}=tt,{componentName:dt,jsonArgs:ft,specialArgs:bt,url:ht}=ot,[Mt,mt]=tryParseArgs(ft,bt,et,nt),Ot=reactExports.useRef({args:{},dataframeArgs:[]}),zt=compareDataframeArgs(Ot.current.dataframeArgs,mt);Ot.current.args=Mt,Ot.current.dataframeArgs=mt;const[yt,vt]=reactExports.useState(),[At,St]=reactExports.useState(isNaN(Mt.height)?void 0:Mt.height),Et=reactExports.useRef(!1),Tt=reactExports.useRef(null),Rt=reactExports.useRef(),Ct=useTimeout(()=>logWarning(getWarnMessage(dt,ht)),COMPONENT_READY_WARNING_TIME_MS/4),wt=useTimeout(()=>vt(!0),COMPONENT_READY_WARNING_TIME_MS);if(reactExports.useEffect(()=>{Et.current&&sendRenderMessage(Ot.current.args,Ot.current.dataframeArgs,rt,st,Tt.current??void 0)},[rt,At,zt,ft,st,ct]),reactExports.useEffect(()=>{const jt=Ut=>{Ut!==void 0&&Ut!==At&&(isNullOrUndefined$1(Tt.current)||(Tt.current.height=Ut.toString(),St(Ut)))},s0=()=>{sendRenderMessage(Ot.current.args,Ot.current.dataframeArgs,rt,st,Tt.current??void 0),Ct(),wt(),Et.current=!0,vt(!1)};Rt.current={isReady:()=>Et.current,element:ot,widgetMgr:ut,setComponentError:et,componentReadyCallback:s0,frameHeightCallback:jt,fragmentId:pt}},[dt,rt,ot,At,zt,yt,ft,st,ut,wt,Ct,pt]),reactExports.useEffect(()=>{var s0;const jt=((s0=Tt.current)==null?void 0:s0.contentWindow)??void 0;if(jt)return at.registerListener(jt,createIframeMessageHandler(Rt)),()=>{jt&&at.deregisterListener(jt)}},[at,dt]),nt)return jsx$1(ErrorElement,{name:nt.name,message:nt.message});const Lt=!Et.current&&!yt&&At!==0&&jsx$1(Skeleton,{element:Skeleton$1.create({height:At,style:Skeleton$1.SkeletonStyle.ELEMENT})}),Ht=!Et.current&&yt?jsx$1(AlertElement,{width:ct,body:getWarnMessage(dt,ht),kind:Kind.WARNING}):null;return jsxs(Fragment,{children:[Lt,Ht,jsx$1(StyledComponentIframe,{className:"stCustomComponentV1","data-testid":"stCustomComponentV1",allow:DEFAULT_IFRAME_FEATURE_POLICY,ref:Tt,src:getSrc(dt,at,ht),width:ct,height:At??0,scrolling:"no",sandbox:DEFAULT_IFRAME_SANDBOX_POLICY,title:dt,componentReady:Et.current})]})}const ComponentInstance$1=withTheme(ComponentInstance);class ComponentRegistry{constructor(nt){this.msgListeners=new Map,this.registerListener=(et,rt)=>{this.msgListeners.has(et),this.msgListeners.set(et,rt)},this.deregisterListener=et=>{this.msgListeners.delete(et)},this.getComponentURL=(et,rt)=>this.endpoints.buildComponentURL(et,rt),this.onMessageEvent=et=>{if(isNullOrUndefined$1(et.data)||!et.data.hasOwnProperty("isStreamlitMessage"))return;if(isNullOrUndefined$1(et.source)){logWarning("Received component message with no eventSource!",et.data);return}const rt=this.msgListeners.get(et.source);if(isNullOrUndefined$1(rt)||typeof rt!="function"){logWarning("Received component message for unregistered ComponentInstance!",et.data);return}const{type:ot}=et.data;if(isNullOrUndefined$1(ot)){logWarning("Received Streamlit message with no type!",et.data);return}rt(ot,et.data)},this.endpoints=nt,window.addEventListener("message",this.onMessageEvent)}}const Maybe=reactExports.memo(function tt({children:nt}){return jsx$1(Fragment,{children:nt})},(tt,nt)=>!(tt.enable||nt.enable));function makeMarkdownHeading(tt,nt){switch(tt.toLowerCase()){case Tags.H1:return`# ${nt}`;case Tags.H2:return`## ${nt}`;case Tags.H3:return`### ${nt}`;default:throw new Error(`Unrecognized tag for header: ${tt}`)}}function Heading(tt){const{width:nt,element:et}=tt,{tag:rt,anchor:ot,body:at,help:st,hideAnchor:ut,divider:ct}=et,pt=React$1.useContext(IsSidebarContext),dt=React$1.useContext(IsDialogContext),[ft,...bt]=at.split(`
|
682
682
|
`);return jsxs("div",{style:{width:nt},className:"stHeading","data-testid":"stHeading",children:[jsxs(StyledStreamlitMarkdown,{isCaption:!1,isInSidebarOrDialog:pt||dt,style:{width:nt},"data-testid":"stMarkdownContainer",children:[jsx$1(HeadingWithActionElements,{anchor:ot,help:st,hideAnchor:ut,tag:rt,children:jsx$1(RenderedMarkdown,{allowHTML:!1,source:makeMarkdownHeading(rt,ft),overrideComponents:{p:reactExports.Fragment,h1:reactExports.Fragment,h2:reactExports.Fragment,h3:reactExports.Fragment,h4:reactExports.Fragment,h5:reactExports.Fragment,h6:reactExports.Fragment}})}),bt.length>0&&jsx$1(RenderedMarkdown,{source:bt.join(`
|
683
|
-
`),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e1kzzvq90"})(({width:tt,theme:nt})=>({width:tt,display:"flex",alignItems:"center",minHeight:nt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e1kzzvq91"})(({visibility:tt})=>({display:tt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:tt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(tt,nt){let et=nt.spacing.lg;return tt==="medium"?et=nt.spacing.threeXL:tt==="large"&&(et=nt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"e1kefhzc0"})(({theme:tt,gap:nt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(nt,tt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e1kefhzc1"})(({theme:tt,isStale:nt,width:et,elementType:rt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:tt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${tt.spacing.lg}`,zIndex:tt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${tt.spacing.xs}`,marginBottom:`-${tt.spacing.xs}`},...nt&&rt!=="skeleton"&&STALE_STYLES,...rt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(rt)?{marginBottom:`-${tt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e1kefhzc2"})(({theme:tt,weight:nt,gap:et,showBorder:rt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=nt*100,ut=translateGapWidth(et,tt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${tt.breakpoints.columns})`]:{minWidth:`calc(100% - ${tt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:tt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginTop:tt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...rt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e1kefhzc3"})(({width:tt,theme:nt})=>({width:tt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:nt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e1kefhzc4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e1kefhzc5"})(({theme:tt,border:nt,height:et})=>({...nt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.CDXWGWmT.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.CzGQCrp7.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.CMo3Hx0K.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.Br51_AlR.js").then(tt=>tt.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),ArrowVegaLiteChart=React$1.lazy(()=>__vitePreload(()=>import("./index.DBsWPEgr.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.CNpCQb9b.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BvkVMkqn.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BfnKXy8f.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CkiEGMvI.js"),__vite__mapDeps([22,18,17,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.BPO6U_Ww.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.D0lyWwCG.js"),__vite__mapDeps([23,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.BH4vJGDU.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.DW-SfHSH.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BbX6EljV.js"),__vite__mapDeps([24,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.BEVQJJoV.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Cg6FfZbb.js"),__vite__mapDeps([25,4,6,26,9,13]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.DTqVI4Zh.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.JwwxmOA5.js"),__vite__mapDeps([27,20,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.D99Ft0yx.js"),__vite__mapDeps([28,9]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DQbNi2IT.js"),__vite__mapDeps([29,4,30,31]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CEaPpXYi.js"),__vite__mapDeps([32,33,34,35,36]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.BMTeKekB.js"),__vite__mapDeps([37,20,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.DFmc81Ae.js"),__vite__mapDeps([38,20,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Cx7ma5cM.js"),__vite__mapDeps([39,20,4,40,11,12,41,36]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.EqYXB49Q.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.DFD0XSVm.js"),__vite__mapDeps([42,20,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.BGbkq72c.js"),__vite__mapDeps([43,31]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.MeMRgb28.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.D3tYsziH.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.CANLiXfL.js"),__vite__mapDeps([45,20,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.DWmj29sp.js"),__vite__mapDeps([46,8,20,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.nDfHFYx0.js"),__vite__mapDeps([47,4,31,26,30]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.DLx08-Iq.js"),__vite__mapDeps([48,49,50,34,33,20,4,35,36]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CCIxkgVR.js"),__vite__mapDeps([51,49,50,34,20,4,33,41,36]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DFwjNqMU.js"),__vite__mapDeps([52,20,4,40,11,12]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CFwQY-KV.js"),__vite__mapDeps([53,8,49,4,33,41,36]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(tt,nt){return tt?jsx$1(Fragment,{}):nt}const RawElementNodeRenderer=tt=>{const{node:nt}=tt;if(!nt)throw new Error("ElementNode not found.");const et={width:tt.width,disableFullscreenMode:tt.disableFullscreenMode},rt={...et,widgetMgr:tt.widgetMgr,disabled:tt.widgetsDisabled,fragmentId:nt.fragmentId};switch(nt.element.type){case"alert":{const at=nt.element.alert;return jsx$1(AlertElement,{icon:at.icon,body:at.body,kind:getAlertElementKind(at.format),...et})}case"arrowTable":return jsx$1(ArrowTable,{element:nt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:nt.element.audio,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"balloons":return hideIfStale(tt.isStale,jsx$1(Balloons,{scriptRunId:tt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:nt.element.bokehChart,...et});case"code":{const at=nt.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:at.language,showLineNumbers:at.showLineNumbers,wrapLines:at.wrapLines,height:at.height,children:at.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:nt.element.deckGlJsonChart,...rt});case"docString":return jsx$1(DocString,{element:nt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement,{element:nt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:nt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:nt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:nt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:nt.element.imgs,endpoints:tt.endpoints,...et});case"json":return jsx$1(Json,{element:nt.element.json,...et});case"markdown":return jsx$1(Markdown,{element:nt.element.markdown,...et});case"metric":return jsx$1(Metric,{element:nt.element.metric});case"html":return jsx$1(Html,{element:nt.element.html,...et});case"pageLink":{const at=nt.element.pageLink,st=rt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:nt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:nt.element.skeleton});case"snow":return hideIfStale(tt.isStale,jsx$1(Snow,{scriptRunId:tt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:nt.element.spinner,...et});case"text":return jsx$1(TextElement,{element:nt.element.text,...et});case"video":return jsx$1(Video,{element:nt.element.video,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"toast":{const at=nt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},nt.scriptRunId)}case"arrowDataFrame":{const at=nt.element.arrowDataFrame;return rt.disabled=rt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:nt.quiverElement,...at.id&&{key:at.id},...rt})}case"arrowVegaLiteChart":const ot=nt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...rt},ot.id||void 0);case"audioInput":{const at=nt.element.audioInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:tt.uploadClient,element:at,...rt},at.id)}case"button":{const at=nt.element.button;if(rt.disabled=rt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=tt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...rt})}return jsx$1(Button,{element:at,...rt})}case"buttonGroup":{const at=nt.element.buttonGroup;return rt.disabled=rt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...rt},at.id)}case"downloadButton":{const at=nt.element.downloadButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:tt.endpoints,element:at,...rt},at.id)}case"cameraInput":{const at=nt.element.cameraInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"chatInput":{const at=nt.element.chatInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(ChatInput,{element:at,...rt},at.id)}case"checkbox":{const at=nt.element.checkbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...rt},at.id)}case"colorPicker":{const at=nt.element.colorPicker;return rt.disabled=rt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...rt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:tt.componentRegistry,element:nt.element.componentInstance,...rt});case"dateInput":{const at=nt.element.dateInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(DateInput,{element:at,...rt},at.id)}case"fileUploader":{const at=nt.element.fileUploader;return rt.disabled=rt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"linkButton":{const at=nt.element.linkButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...rt})}case"multiselect":{const at=nt.element.multiselect;return rt.disabled=rt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...rt},at.id)}case"numberInput":{const at=nt.element.numberInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...rt},at.id)}case"plotlyChart":{const at=nt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...rt},at.id)}case"radio":{const at=nt.element.radio;return rt.disabled=rt.disabled||at.disabled,jsx$1(Radio,{element:at,...rt},at.id)}case"selectbox":{const at=nt.element.selectbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...rt},at.id)}case"slider":{const at=nt.element.slider;return rt.disabled=rt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...rt},at.id)}case"textArea":{const at=nt.element.textArea;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextArea,{element:at,...rt},at.id)}case"textInput":{const at=nt.element.textInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextInput,{element:at,...rt},at.id)}case"timeInput":{const at=nt.element.timeInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...rt},at.id)}default:throw new Error(`Unrecognized Element type ${nt.element.type}`)}},ElementNodeRenderer=tt=>{const{isFullScreen:nt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:rt,width:ot}=tt,at=rt.element.type||"",st=shouldComponentBeEnabled(at,tt.scriptRunState),ut=isComponentStale(st,rt,tt.scriptRunState,tt.scriptRunId,et),ct=getElementId(rt.element),pt=getKeyFromId(ct);return jsx$1(Maybe,{enable:st,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(pt)),"data-testid":"stElementContainer","data-stale":ut,isStale:ut&&!nt,width:ot,elementType:at,children:jsx$1(ErrorBoundary,{width:ot,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...tt,isStale:ut})})})})})},BlockNodeRenderer=tt=>{const{node:nt}=tt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(nt.isEmpty&&!nt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const rt=shouldComponentBeEnabled("",tt.scriptRunState),ot=isComponentStale(rt,nt,tt.scriptRunState,tt.scriptRunId,et),at={...tt,node:nt},st=tt.disableFullscreenMode||notNullOrUndefined(nt.deltaBlock.dialog)||notNullOrUndefined(nt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(nt.deltaBlock.dialog)return jsx$1(DialogWithProvider,{element:nt.deltaBlock.dialog,deltaMsgReceivedAt:nt.deltaMsgReceivedAt,children:ut});if(nt.deltaBlock.expandable)return jsx$1(Expander,{empty:nt.isEmpty,isStale:ot,element:nt.deltaBlock.expandable,children:ut});if(nt.deltaBlock.popover)return jsx$1(Popover,{empty:nt.isEmpty,element:nt.deltaBlock.popover,width:tt.width,children:ut});if(nt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=nt.deltaBlock.form,bt=tt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:tt.width,hasSubmitButton:ht,scriptRunState:tt.scriptRunState,widgetMgr:tt.widgetMgr,border:ft,children:ut})}if(nt.deltaBlock.chatMessage)return jsx$1(ChatMessage,{element:nt.deltaBlock.chatMessage,endpoints:tt.endpoints,children:ut});if(nt.deltaBlock.column)return jsx$1(StyledColumn,{weight:nt.deltaBlock.column.weight??0,gap:nt.deltaBlock.column.gap??"",verticalAlignment:nt.deltaBlock.column.verticalAlignment??void 0,showBorder:nt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(nt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs,{...pt})}return ut},ChildRenderer=tt=>{const{libConfig:nt}=reactExports.useContext(LibContext);assignDividerColor(tt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:tt.node.children&&tt.node.children.map((rt,ot)=>{const at=nt.disableFullscreenMode||tt.disableFullscreenMode;if(rt instanceof ElementNode){const st={...tt,disableFullscreenMode:at,node:rt},ut=getElementId(rt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(rt instanceof BlockNode){const st={...tt,disableFullscreenMode:at,node:rt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${rt}`)})})};function ScrollToBottomVerticalBlockWrapper(tt){const{border:nt,height:et,children:rt}=tt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:nt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:rt})}const VerticalBlock=tt=>{var ft,bt;const nt=reactExports.useRef(null),[et,rt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{rt(ht.target.getBoundingClientRect().width||-1)})}),[rt]),at=((ft=tt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=tt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&tt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(nt.current&&ot.observe(nt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...tt,width:et},dt=getKeyFromId(tt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:nt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=tt=>{var et;const nt=((et=tt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:nt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...tt})})};function LayoutBlock(tt){return tt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...tt}):jsx$1(VerticalBlock,{...tt})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:tt})=>({position:"fixed",top:0,left:0,zIndex:tt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:tt})=>{const nt=reactExports.useRef(null),et=reactExports.useCallback(()=>nt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[tt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:nt})]})};function ThemeProvider({theme:tt,baseuiTheme:nt,children:et}){return jsx$1(ThemeProvider$1,{theme:nt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:tt,children:et})})}function toCodePoint(tt,nt){const et=[];let rt=0,ot=0,at=0;for(;at<tt.length;)rt=tt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(rt-56320)).toString(16)),ot=0):55296<=rt&&rt<=56319?ot=rt:et.push(rt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="";function grabTheRightIcon(tt){return toCodePoint(tt.indexOf(U200D)<0?tt.replace(UFE0Fg,""):tt)}function iconToUrl(tt){const nt=/^:(.+)\/(.+):$/,et=tt.match(nt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(tt,nt,et){const rt=extractEmoji(tt);let ot;rt&&!tt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(rt)}.png`:tt.startsWith(":material")?ot=iconToUrl(tt):ot=et.buildMediaURL(tt),overwriteFavicon(ot),nt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(tt){const nt=document.querySelector("link[rel='shortcut icon']");nt&&(nt.href=tt)}function extractEmoji(tt){const nt=tt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(nt))?nodeEmoji$1.get(nt):nodeEmoji$1.hasEmoji(tt)?tt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(tt,nt){return tt&&baseFor$1(tt,nt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(tt){return typeof tt=="function"?tt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(tt,nt){return tt&&baseForOwn$3(tt,castFunction$1(nt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(tt){return this.__data__.set(tt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(tt){return this.__data__.has(tt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(tt){var nt=-1,et=tt==null?0:tt.length;for(this.__data__=new MapCache$1;++nt<et;)this.add(tt[nt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(tt,nt){for(var et=-1,rt=tt==null?0:tt.length;++et<rt;)if(nt(tt[et],et,tt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(tt,nt){return tt.has(nt)}var _cacheHas=cacheHas$3,SetCache$2=_SetCache,arraySome$1=_arraySome,cacheHas$2=_cacheHas,COMPARE_PARTIAL_FLAG$b=1,COMPARE_UNORDERED_FLAG$7=2;function equalArrays$3(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=tt.length,ct=nt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(tt),dt=at.get(nt);if(pt&&dt)return pt==nt&&dt==tt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(tt,nt),at.set(nt,tt);++ft<ut;){var Mt=tt[ft],mt=nt[ft];if(rt)var Ot=st?rt(mt,Mt,ft,nt,tt,at):rt(Mt,mt,ft,tt,nt,at);if(Ot!==void 0){if(Ot)continue;bt=!1;break}if(ht){if(!arraySome$1(nt,function(zt,yt){if(!cacheHas$2(ht,yt)&&(Mt===zt||ot(Mt,zt,et,rt,at)))return ht.push(yt)})){bt=!1;break}}else if(!(Mt===mt||ot(Mt,mt,et,rt,at))){bt=!1;break}}return at.delete(tt),at.delete(nt),bt}var _equalArrays=equalArrays$3,Symbol$2=_Symbol,Uint8Array$2=_Uint8Array,eq$1=eq_1,equalArrays$2=_equalArrays,mapToArray$1=_mapToArray,setToArray$1=_setToArray,COMPARE_PARTIAL_FLAG$a=1,COMPARE_UNORDERED_FLAG$6=2,boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$2="[object Error]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function equalByTag$2(tt,nt,et,rt,ot,at,st){switch(et){case dataViewTag$3:if(tt.byteLength!=nt.byteLength||tt.byteOffset!=nt.byteOffset)return!1;tt=tt.buffer,nt=nt.buffer;case arrayBufferTag$2:return!(tt.byteLength!=nt.byteLength||!at(new Uint8Array$2(tt),new Uint8Array$2(nt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+tt,+nt);case errorTag$2:return tt.name==nt.name&&tt.message==nt.message;case regexpTag$2:case stringTag$2:return tt==nt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=rt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),tt.size!=nt.size&&!ct)return!1;var pt=st.get(tt);if(pt)return pt==nt;rt|=COMPARE_UNORDERED_FLAG$6,st.set(tt,nt);var dt=equalArrays$2(ut(tt),ut(nt),rt,ot,at,st);return st.delete(tt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(tt)==symbolValueOf$1.call(nt)}return!1}var _equalByTag=equalByTag$2,getAllKeys$1=_getAllKeys,COMPARE_PARTIAL_FLAG$9=1,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty;function equalObjects$2(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(tt),ct=ut.length,pt=getAllKeys$1(nt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in nt:hasOwnProperty$f.call(nt,bt)))return!1}var ht=at.get(tt),Mt=at.get(nt);if(ht&&Mt)return ht==nt&&Mt==tt;var mt=!0;at.set(tt,nt),at.set(nt,tt);for(var Ot=st;++ft<ct;){bt=ut[ft];var zt=tt[bt],yt=nt[bt];if(rt)var vt=st?rt(yt,zt,bt,nt,tt,at):rt(zt,yt,bt,tt,nt,at);if(!(vt===void 0?zt===yt||ot(zt,yt,et,rt,at):vt)){mt=!1;break}Ot||(Ot=bt=="constructor")}if(mt&&!Ot){var At=tt.constructor,St=nt.constructor;At!=St&&"constructor"in tt&&"constructor"in nt&&!(typeof At=="function"&&At instanceof At&&typeof St=="function"&&St instanceof St)&&(mt=!1)}return at.delete(tt),at.delete(nt),mt}var _equalObjects=equalObjects$2,Stack$2=_Stack,equalArrays$1=_equalArrays,equalByTag$1=_equalByTag,equalObjects$1=_equalObjects,getTag$1=_getTag,isArray$7=isArray_1,isBuffer$2=isBufferExports,isTypedArray$2=isTypedArray_1,COMPARE_PARTIAL_FLAG$8=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$4="[object Object]",objectProto$g=Object.prototype,hasOwnProperty$e=objectProto$g.hasOwnProperty;function baseIsEqualDeep$2(tt,nt,et,rt,ot,at){var st=isArray$7(tt),ut=isArray$7(nt),ct=st?arrayTag$2:getTag$1(tt),pt=ut?arrayTag$2:getTag$1(nt);ct=ct==argsTag$3?objectTag$4:ct,pt=pt==argsTag$3?objectTag$4:pt;var dt=ct==objectTag$4,ft=pt==objectTag$4,bt=ct==pt;if(bt&&isBuffer$2(tt)){if(!isBuffer$2(nt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(tt)?equalArrays$1(tt,nt,et,rt,ot,at):equalByTag$1(tt,nt,ct,et,rt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(tt,"__wrapped__"),Mt=ft&&hasOwnProperty$e.call(nt,"__wrapped__");if(ht||Mt){var mt=ht?tt.value():tt,Ot=Mt?nt.value():nt;return at||(at=new Stack$2),ot(mt,Ot,et,rt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(tt,nt,et,rt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(tt,nt,et,rt,ot){return tt===nt?!0:tt==null||nt==null||!isObjectLike$1(tt)&&!isObjectLike$1(nt)?tt!==tt&&nt!==nt:baseIsEqualDeep$1(tt,nt,et,rt,baseIsEqual$4,ot)}var _baseIsEqual=baseIsEqual$4,Stack$1=_Stack,baseIsEqual$3=_baseIsEqual,COMPARE_PARTIAL_FLAG$7=1,COMPARE_UNORDERED_FLAG$5=2;function baseIsMatch$2(tt,nt,et,rt){var ot=et.length,at=ot,st=!rt;if(tt==null)return!at;for(tt=Object(tt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==tt[ut[0]]:!(ut[0]in tt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=tt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in tt))return!1}else{var ft=new Stack$1;if(rt)var bt=rt(pt,dt,ct,tt,nt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,rt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(tt){return tt===tt&&!isObject$3(tt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(tt){for(var nt=keys$1(tt),et=nt.length;et--;){var rt=nt[et],ot=tt[rt];nt[et]=[rt,ot,isStrictComparable$2(ot)]}return nt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(tt,nt){return function(et){return et==null?!1:et[tt]===nt&&(nt!==void 0||tt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(tt){var nt=getMatchData$1(tt);return nt.length==1&&nt[0][2]?matchesStrictComparable$2(nt[0][0],nt[0][1]):function(et){return et===tt||baseIsMatch$1(et,tt,nt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(tt,nt){return tt!=null&&nt in Object(tt)}var _baseHasIn=baseHasIn$2,castPath$3=_castPath,isArguments$1=isArguments_1,isArray$6=isArray_1,isIndex$2=_isIndex,isLength$1=isLength_1,toKey$4=_toKey;function hasPath$2(tt,nt,et){nt=castPath$3(nt,tt);for(var rt=-1,ot=nt.length,at=!1;++rt<ot;){var st=toKey$4(nt[rt]);if(!(at=tt!=null&&et(tt,st)))break;tt=tt[st]}return at||++rt!=ot?at:(ot=tt==null?0:tt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(tt)||isArguments$1(tt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(tt,nt){return tt!=null&&hasPath$1(tt,nt,baseHasIn$1)}var hasIn_1=hasIn$3,baseIsEqual$2=_baseIsEqual,get$2=get_1,hasIn$2=hasIn_1,isKey$2=_isKey,isStrictComparable$1=_isStrictComparable,matchesStrictComparable$1=_matchesStrictComparable,toKey$3=_toKey,COMPARE_PARTIAL_FLAG$6=1,COMPARE_UNORDERED_FLAG$4=2;function baseMatchesProperty$2(tt,nt){return isKey$2(tt)&&isStrictComparable$1(nt)?matchesStrictComparable$1(toKey$3(tt),nt):function(et){var rt=get$2(et,tt);return rt===void 0&&rt===nt?hasIn$2(et,tt):baseIsEqual$2(nt,rt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(tt){return function(nt){return baseGet$3(nt,tt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(tt){return isKey$1(tt)?baseProperty$1(toKey$2(tt)):basePropertyDeep$1(tt)}var property_1=property$2,baseMatches$1=_baseMatches,baseMatchesProperty$1=_baseMatchesProperty,identity$2=identity_1,isArray$5=isArray_1,property$1=property_1;function baseIteratee$5(tt){return typeof tt=="function"?tt:tt==null?identity$2:typeof tt=="object"?isArray$5(tt)?baseMatchesProperty$1(tt[0],tt[1]):baseMatches$1(tt):property$1(tt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(tt,nt){return function(et,rt){if(et==null)return et;if(!isArrayLike$2(et))return tt(et,rt);for(var ot=et.length,at=nt?ot:-1,st=Object(et);(nt?at--:++at<ot)&&rt(st[at],at,st)!==!1;);return et}}var _createBaseEach=createBaseEach$2,baseForOwn$2=_baseForOwn,createBaseEach$1=_createBaseEach,baseEach$3=createBaseEach$1(baseForOwn$2),_baseEach=baseEach$3,baseEach$2=_baseEach,isArrayLike$1=isArrayLike_1;function baseMap$3(tt,nt){var et=-1,rt=isArrayLike$1(tt)?Array(tt.length):[];return baseEach$2(tt,function(ot,at,st){rt[++et]=nt(ot,at,st)}),rt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(tt,nt){var et=isArray$4(tt)?arrayMap$3:baseMap$2;return et(tt,baseIteratee$4(nt))}var map_1=map$1;Object.defineProperty(flattenNames$1,"__esModule",{value:!0});flattenNames$1.flattenNames=void 0;var _isString2=isString_1,_isString3=_interopRequireDefault$7(_isString2),_forOwn2$2=forOwn_1,_forOwn3$2=_interopRequireDefault$7(_forOwn2$2),_isPlainObject2=isPlainObject_1,_isPlainObject3=_interopRequireDefault$7(_isPlainObject2),_map2=map_1,_map3=_interopRequireDefault$7(_map2);function _interopRequireDefault$7(tt){return tt&&tt.__esModule?tt:{default:tt}}var flattenNames=flattenNames$1.flattenNames=function tt(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(nt,function(rt){Array.isArray(rt)?tt(rt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(rt)?(0,_forOwn3$2.default)(rt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(rt)&&et.push(rt)}),et};flattenNames$1.default=flattenNames;var mergeClasses$1={};Object.defineProperty(mergeClasses$1,"__esModule",{value:!0});mergeClasses$1.mergeClasses=void 0;var _forOwn2$1=forOwn_1,_forOwn3$1=_interopRequireDefault$6(_forOwn2$1),_cloneDeep2=cloneDeep_1,_cloneDeep3=_interopRequireDefault$6(_cloneDeep2),_extends$w=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$6(tt){return tt&&tt.__esModule?tt:{default:tt}}var mergeClasses=mergeClasses$1.mergeClasses=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],rt=nt.default&&(0,_cloneDeep3.default)(nt.default)||{};return et.map(function(ot){var at=nt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){rt[ut]||(rt[ut]={}),rt[ut]=_extends$w({},rt[ut],at[ut])}),ot}),rt};mergeClasses$1.default=mergeClasses;var autoprefix$1={};Object.defineProperty(autoprefix$1,"__esModule",{value:!0});autoprefix$1.autoprefix=void 0;var _forOwn2=forOwn_1,_forOwn3=_interopRequireDefault$5(_forOwn2),_extends$v=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$5(tt){return tt&&tt.__esModule?tt:{default:tt}}var transforms={borderRadius:function tt(nt){return{msBorderRadius:nt,MozBorderRadius:nt,OBorderRadius:nt,WebkitBorderRadius:nt,borderRadius:nt}},boxShadow:function tt(nt){return{msBoxShadow:nt,MozBoxShadow:nt,OBoxShadow:nt,WebkitBoxShadow:nt,boxShadow:nt}},userSelect:function tt(nt){return{WebkitTouchCallout:nt,KhtmlUserSelect:nt,MozUserSelect:nt,msUserSelect:nt,WebkitUserSelect:nt,userSelect:nt}},flex:function tt(nt){return{WebkitBoxFlex:nt,MozBoxFlex:nt,WebkitFlex:nt,msFlex:nt,flex:nt}},flexBasis:function tt(nt){return{WebkitFlexBasis:nt,flexBasis:nt}},justifyContent:function tt(nt){return{WebkitJustifyContent:nt,justifyContent:nt}},transition:function tt(nt){return{msTransition:nt,MozTransition:nt,OTransition:nt,WebkitTransition:nt,transition:nt}},transform:function tt(nt){return{msTransform:nt,MozTransform:nt,OTransform:nt,WebkitTransform:nt,transform:nt}},absolute:function tt(nt){var et=nt&&nt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function tt(nt,et){var rt=et[nt];return rt||{extend:nt}}},autoprefix=autoprefix$1.autoprefix=function tt(nt){var et={};return(0,_forOwn3.default)(nt,function(rt,ot){var at={};(0,_forOwn3.default)(rt,function(st,ut){var ct=transforms[ut];ct?at=_extends$v({},at,ct(st)):at[ut]=st}),et[ot]=at}),et};autoprefix$1.default=autoprefix;var hover$1={};Object.defineProperty(hover$1,"__esModule",{value:!0});hover$1.hover=void 0;var _extends$u=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$f(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$f(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var hover=hover$1.hover=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$f(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$f(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$f(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={hover:!1},ut.handleMouseOver=function(){return ut.setState({hover:!0})},ut.handleMouseOut=function(){return ut.setState({hover:!1})},ut.render=function(){return _react2$3.default.createElement(et,{onMouseOver:ut.handleMouseOver,onMouseOut:ut.handleMouseOut},_react2$3.default.createElement(nt,_extends$u({},ut.props,ut.state)))},st),_possibleConstructorReturn$f(ut,ct)}return ot}(_react2$3.default.Component)};hover$1.default=hover;var active$1={};Object.defineProperty(active$1,"__esModule",{value:!0});active$1.active=void 0;var _extends$t=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$e(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$e(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var active=active$1.active=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$e(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$e(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$e(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={active:!1},ut.handleMouseDown=function(){return ut.setState({active:!0})},ut.handleMouseUp=function(){return ut.setState({active:!1})},ut.render=function(){return _react2$2.default.createElement(et,{onMouseDown:ut.handleMouseDown,onMouseUp:ut.handleMouseUp},_react2$2.default.createElement(nt,_extends$t({},ut.props,ut.state)))},st),_possibleConstructorReturn$e(ut,ct)}return ot}(_react2$2.default.Component)};active$1.default=active;var loop={};Object.defineProperty(loop,"__esModule",{value:!0});var loopable=function tt(nt,et){var rt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;rt[st]=ut};return nt===0&&ot("first-child"),nt===et-1&&ot("last-child"),(nt===0||nt%2===0)&&ot("even"),Math.abs(nt%2)===1&&ot("odd"),ot("nth-child",nt),rt};loop.default=loopable;Object.defineProperty(lib$2,"__esModule",{value:!0});lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=handleHover=lib$2.handleHover=lib$2.hover=void 0;var _flattenNames=flattenNames$1,_flattenNames2=_interopRequireDefault$2(_flattenNames),_mergeClasses=mergeClasses$1,_mergeClasses2=_interopRequireDefault$2(_mergeClasses),_autoprefix=autoprefix$1,_autoprefix2=_interopRequireDefault$2(_autoprefix),_hover2=hover$1,_hover3=_interopRequireDefault$2(_hover2),_active=active$1,_active2=_interopRequireDefault$2(_active),_loop2=loop,_loop3=_interopRequireDefault$2(_loop2);function _interopRequireDefault$2(tt){return tt&&tt.__esModule?tt:{default:tt}}lib$2.hover=_hover3.default;var handleHover=lib$2.handleHover=_hover3.default;lib$2.handleActive=_active2.default;lib$2.loop=_loop3.default;var ReactCSS=lib$2.ReactCSS=function tt(nt){for(var et=arguments.length,rt=Array(et>1?et-1:0),ot=1;ot<et;ot++)rt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(rt),st=(0,_mergeClasses2.default)(nt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function tt(nt,et,rt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof nt.pageX=="number"?nt.pageX:nt.touches[0].pageX,pt=typeof nt.pageY=="number"?nt.pageY:nt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(rt==="vertical"){var bt=void 0;if(ft<0?bt=0:ft>ut?bt=1:bt=Math.round(ft*100/ut)/100,et.a!==bt)return{h:et.h,s:et.s,l:et.l,a:bt,source:"rgb"}}else{var ht=void 0;if(dt<0?ht=0:dt>st?ht=1:ht=Math.round(dt*100/st)/100,ot!==ht)return{h:et.h,s:et.s,l:et.l,a:ht,source:"rgb"}}return null},checkboardCache={},render=function tt(nt,et,rt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=rt*2,at.height=rt*2;var st=at.getContext("2d");return st?(st.fillStyle=nt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,rt,rt),st.translate(rt,rt),st.fillRect(0,0,rt,rt),at.toDataURL()):null},get$1=function tt(nt,et,rt,ot){var at=nt+"-"+et+"-"+rt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(nt,et,rt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},Checkboard=function tt(nt){var et=nt.white,rt=nt.grey,ot=nt.size,at=nt.renderers,st=nt.borderRadius,ut=nt.boxShadow,ct=nt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,rt,ot,at.canvas)+") center left"}}});return reactExports.isValidElement(ct)?React$1.cloneElement(ct,_extends$s({},ct.props,{style:_extends$s({},ct.props.style,pt.grid)})):React$1.createElement("div",{style:pt.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$r=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_createClass$d=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _classCallCheck$d(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$d(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var Alpha=function(tt){_inherits$d(nt,tt);function nt(){var et,rt,ot,at;_classCallCheck$d(this,nt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(rt=(ot=_possibleConstructorReturn$d(this,(et=nt.__proto__||Object.getPrototypeOf(nt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$2(pt,ot.props.hsl,ot.props.direction,ot.props.a,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},ot.unbindEventListeners=function(){window.removeEventListener("mousemove",ot.handleChange),window.removeEventListener("mouseup",ot.handleMouseUp)},rt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(nt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var rt=this,ot=this.props.rgb,at=_default$2({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
|
683
|
+
`),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e1kzzvq90"})(({width:tt,theme:nt})=>({width:tt,display:"flex",alignItems:"center",minHeight:nt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e1kzzvq91"})(({visibility:tt})=>({display:tt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:tt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(tt,nt){let et=nt.spacing.lg;return tt==="medium"?et=nt.spacing.threeXL:tt==="large"&&(et=nt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"e1kefhzc0"})(({theme:tt,gap:nt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(nt,tt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e1kefhzc1"})(({theme:tt,isStale:nt,width:et,elementType:rt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:tt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${tt.spacing.lg}`,zIndex:tt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${tt.spacing.xs}`,marginBottom:`-${tt.spacing.xs}`},...nt&&rt!=="skeleton"&&STALE_STYLES,...rt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(rt)?{marginBottom:`-${tt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e1kefhzc2"})(({theme:tt,weight:nt,gap:et,showBorder:rt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=nt*100,ut=translateGapWidth(et,tt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${tt.breakpoints.columns})`]:{minWidth:`calc(100% - ${tt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:tt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginTop:tt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...rt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e1kefhzc3"})(({width:tt,theme:nt})=>({width:tt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:nt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e1kefhzc4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e1kefhzc5"})(({theme:tt,border:nt,height:et})=>({...nt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.BOaF1pd3.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.DxAYNSu8.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.DqwYtic0.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.CcAtzCnX.js").then(tt=>tt.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),ArrowVegaLiteChart=React$1.lazy(()=>__vitePreload(()=>import("./index.DoxwX9TA.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.d8-RPUlf.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BZACNIPy.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CGcb6vEw.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BBMRAwlY.js"),__vite__mapDeps([22,18,17,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.DOp8WWEB.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.qmgXiJ18.js"),__vite__mapDeps([23,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.DHthJf6z.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.BvFiU2Cj.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.UG0Sy7w3.js"),__vite__mapDeps([24,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.CQ7Y6jj1.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CIKFC12n.js"),__vite__mapDeps([25,4,6,26,9,13]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.C3hZcowl.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.xmd7bHOh.js"),__vite__mapDeps([27,20,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.DdMp70lp.js"),__vite__mapDeps([28,9]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CxVERd8N.js"),__vite__mapDeps([29,4,30,31]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DuBLm9ul.js"),__vite__mapDeps([32,33,34,35,36]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.B56k54Px.js"),__vite__mapDeps([37,20,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.B7TErKDq.js"),__vite__mapDeps([38,20,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CdD4T5ia.js"),__vite__mapDeps([39,20,4,40,11,12,41,36]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.DqFVIXyV.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.B3hBEIu8.js"),__vite__mapDeps([42,20,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.Dc5AjA6K.js"),__vite__mapDeps([43,31]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.CyixjHVj.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.DCPA8CBQ.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.BpkKw-EE.js"),__vite__mapDeps([45,20,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.CbXquzx4.js"),__vite__mapDeps([46,8,20,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.BSBaMBDf.js"),__vite__mapDeps([47,4,31,26,30]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.CWnLDBO4.js"),__vite__mapDeps([48,49,50,34,33,20,4,35,36]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BWKboqrD.js"),__vite__mapDeps([51,49,50,34,20,4,33,41,36]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.s016NW7I.js"),__vite__mapDeps([52,20,4,40,11,12]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.2gId-hkY.js"),__vite__mapDeps([53,8,49,4,33,41,36]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(tt,nt){return tt?jsx$1(Fragment,{}):nt}const RawElementNodeRenderer=tt=>{const{node:nt}=tt;if(!nt)throw new Error("ElementNode not found.");const et={width:tt.width,disableFullscreenMode:tt.disableFullscreenMode},rt={...et,widgetMgr:tt.widgetMgr,disabled:tt.widgetsDisabled,fragmentId:nt.fragmentId};switch(nt.element.type){case"alert":{const at=nt.element.alert;return jsx$1(AlertElement,{icon:at.icon,body:at.body,kind:getAlertElementKind(at.format),...et})}case"arrowTable":return jsx$1(ArrowTable$1,{element:nt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:nt.element.audio,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"balloons":return hideIfStale(tt.isStale,jsx$1(Balloons,{scriptRunId:tt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:nt.element.bokehChart,...et});case"code":{const at=nt.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:at.language,showLineNumbers:at.showLineNumbers,wrapLines:at.wrapLines,height:at.height,children:at.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:nt.element.deckGlJsonChart,...rt});case"docString":return jsx$1(DocString,{element:nt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement,{element:nt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:nt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:nt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:nt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:nt.element.imgs,endpoints:tt.endpoints,...et});case"json":return jsx$1(Json,{element:nt.element.json,...et});case"markdown":return jsx$1(Markdown,{element:nt.element.markdown,...et});case"metric":return jsx$1(Metric,{element:nt.element.metric});case"html":return jsx$1(Html,{element:nt.element.html,...et});case"pageLink":{const at=nt.element.pageLink,st=rt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:nt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:nt.element.skeleton});case"snow":return hideIfStale(tt.isStale,jsx$1(Snow,{scriptRunId:tt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:nt.element.spinner,...et});case"text":return jsx$1(TextElement,{element:nt.element.text,...et});case"video":return jsx$1(Video,{element:nt.element.video,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"toast":{const at=nt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},nt.scriptRunId)}case"arrowDataFrame":{const at=nt.element.arrowDataFrame;return rt.disabled=rt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:nt.quiverElement,...at.id&&{key:at.id},...rt})}case"arrowVegaLiteChart":const ot=nt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...rt},ot.id||void 0);case"audioInput":{const at=nt.element.audioInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:tt.uploadClient,element:at,...rt},at.id)}case"button":{const at=nt.element.button;if(rt.disabled=rt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=tt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...rt})}return jsx$1(Button,{element:at,...rt})}case"buttonGroup":{const at=nt.element.buttonGroup;return rt.disabled=rt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...rt},at.id)}case"downloadButton":{const at=nt.element.downloadButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:tt.endpoints,element:at,...rt},at.id)}case"cameraInput":{const at=nt.element.cameraInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"chatInput":{const at=nt.element.chatInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(ChatInput,{element:at,...rt},at.id)}case"checkbox":{const at=nt.element.checkbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...rt},at.id)}case"colorPicker":{const at=nt.element.colorPicker;return rt.disabled=rt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...rt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:tt.componentRegistry,element:nt.element.componentInstance,...rt});case"dateInput":{const at=nt.element.dateInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(DateInput,{element:at,...rt},at.id)}case"fileUploader":{const at=nt.element.fileUploader;return rt.disabled=rt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"linkButton":{const at=nt.element.linkButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...rt})}case"multiselect":{const at=nt.element.multiselect;return rt.disabled=rt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...rt},at.id)}case"numberInput":{const at=nt.element.numberInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...rt},at.id)}case"plotlyChart":{const at=nt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...rt},at.id)}case"radio":{const at=nt.element.radio;return rt.disabled=rt.disabled||at.disabled,jsx$1(Radio,{element:at,...rt},at.id)}case"selectbox":{const at=nt.element.selectbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...rt},at.id)}case"slider":{const at=nt.element.slider;return rt.disabled=rt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...rt},at.id)}case"textArea":{const at=nt.element.textArea;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextArea,{element:at,...rt},at.id)}case"textInput":{const at=nt.element.textInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextInput,{element:at,...rt},at.id)}case"timeInput":{const at=nt.element.timeInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...rt},at.id)}default:throw new Error(`Unrecognized Element type ${nt.element.type}`)}},ElementNodeRenderer=tt=>{const{isFullScreen:nt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:rt,width:ot}=tt,at=rt.element.type||"",st=shouldComponentBeEnabled(at,tt.scriptRunState),ut=isComponentStale(st,rt,tt.scriptRunState,tt.scriptRunId,et),ct=getElementId(rt.element),pt=getKeyFromId(ct);return jsx$1(Maybe,{enable:st,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(pt)),"data-testid":"stElementContainer","data-stale":ut,isStale:ut&&!nt,width:ot,elementType:at,children:jsx$1(ErrorBoundary,{width:ot,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...tt,isStale:ut})})})})})},BlockNodeRenderer=tt=>{const{node:nt}=tt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(nt.isEmpty&&!nt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const rt=shouldComponentBeEnabled("",tt.scriptRunState),ot=isComponentStale(rt,nt,tt.scriptRunState,tt.scriptRunId,et),at={...tt,node:nt},st=tt.disableFullscreenMode||notNullOrUndefined(nt.deltaBlock.dialog)||notNullOrUndefined(nt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(nt.deltaBlock.dialog)return jsx$1(DialogWithProvider,{element:nt.deltaBlock.dialog,deltaMsgReceivedAt:nt.deltaMsgReceivedAt,children:ut});if(nt.deltaBlock.expandable)return jsx$1(Expander,{empty:nt.isEmpty,isStale:ot,element:nt.deltaBlock.expandable,children:ut});if(nt.deltaBlock.popover)return jsx$1(Popover,{empty:nt.isEmpty,element:nt.deltaBlock.popover,width:tt.width,children:ut});if(nt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=nt.deltaBlock.form,bt=tt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:tt.width,hasSubmitButton:ht,scriptRunState:tt.scriptRunState,widgetMgr:tt.widgetMgr,border:ft,children:ut})}if(nt.deltaBlock.chatMessage)return jsx$1(ChatMessage,{element:nt.deltaBlock.chatMessage,endpoints:tt.endpoints,children:ut});if(nt.deltaBlock.column)return jsx$1(StyledColumn,{weight:nt.deltaBlock.column.weight??0,gap:nt.deltaBlock.column.gap??"",verticalAlignment:nt.deltaBlock.column.verticalAlignment??void 0,showBorder:nt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(nt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs,{...pt})}return ut},ChildRenderer=tt=>{const{libConfig:nt}=reactExports.useContext(LibContext);assignDividerColor(tt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:tt.node.children&&tt.node.children.map((rt,ot)=>{const at=nt.disableFullscreenMode||tt.disableFullscreenMode;if(rt instanceof ElementNode){const st={...tt,disableFullscreenMode:at,node:rt},ut=getElementId(rt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(rt instanceof BlockNode){const st={...tt,disableFullscreenMode:at,node:rt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${rt}`)})})};function ScrollToBottomVerticalBlockWrapper(tt){const{border:nt,height:et,children:rt}=tt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:nt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:rt})}const VerticalBlock=tt=>{var ft,bt;const nt=reactExports.useRef(null),[et,rt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{rt(ht.target.getBoundingClientRect().width||-1)})}),[rt]),at=((ft=tt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=tt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&tt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(nt.current&&ot.observe(nt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...tt,width:et},dt=getKeyFromId(tt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:nt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=tt=>{var et;const nt=((et=tt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:nt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...tt})})};function LayoutBlock(tt){return tt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...tt}):jsx$1(VerticalBlock,{...tt})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:tt})=>({position:"fixed",top:0,left:0,zIndex:tt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:tt})=>{const nt=reactExports.useRef(null),et=reactExports.useCallback(()=>nt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[tt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:nt})]})};function ThemeProvider({theme:tt,baseuiTheme:nt,children:et}){return jsx$1(ThemeProvider$1,{theme:nt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:tt,children:et})})}function toCodePoint(tt,nt){const et=[];let rt=0,ot=0,at=0;for(;at<tt.length;)rt=tt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(rt-56320)).toString(16)),ot=0):55296<=rt&&rt<=56319?ot=rt:et.push(rt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="";function grabTheRightIcon(tt){return toCodePoint(tt.indexOf(U200D)<0?tt.replace(UFE0Fg,""):tt)}function iconToUrl(tt){const nt=/^:(.+)\/(.+):$/,et=tt.match(nt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(tt,nt,et){const rt=extractEmoji(tt);let ot;rt&&!tt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(rt)}.png`:tt.startsWith(":material")?ot=iconToUrl(tt):ot=et.buildMediaURL(tt),overwriteFavicon(ot),nt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(tt){const nt=document.querySelector("link[rel='shortcut icon']");nt&&(nt.href=tt)}function extractEmoji(tt){const nt=tt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(nt))?nodeEmoji$1.get(nt):nodeEmoji$1.hasEmoji(tt)?tt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(tt,nt){return tt&&baseFor$1(tt,nt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(tt){return typeof tt=="function"?tt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(tt,nt){return tt&&baseForOwn$3(tt,castFunction$1(nt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(tt){return this.__data__.set(tt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(tt){return this.__data__.has(tt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(tt){var nt=-1,et=tt==null?0:tt.length;for(this.__data__=new MapCache$1;++nt<et;)this.add(tt[nt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(tt,nt){for(var et=-1,rt=tt==null?0:tt.length;++et<rt;)if(nt(tt[et],et,tt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(tt,nt){return tt.has(nt)}var _cacheHas=cacheHas$3,SetCache$2=_SetCache,arraySome$1=_arraySome,cacheHas$2=_cacheHas,COMPARE_PARTIAL_FLAG$b=1,COMPARE_UNORDERED_FLAG$7=2;function equalArrays$3(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=tt.length,ct=nt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(tt),dt=at.get(nt);if(pt&&dt)return pt==nt&&dt==tt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(tt,nt),at.set(nt,tt);++ft<ut;){var Mt=tt[ft],mt=nt[ft];if(rt)var Ot=st?rt(mt,Mt,ft,nt,tt,at):rt(Mt,mt,ft,tt,nt,at);if(Ot!==void 0){if(Ot)continue;bt=!1;break}if(ht){if(!arraySome$1(nt,function(zt,yt){if(!cacheHas$2(ht,yt)&&(Mt===zt||ot(Mt,zt,et,rt,at)))return ht.push(yt)})){bt=!1;break}}else if(!(Mt===mt||ot(Mt,mt,et,rt,at))){bt=!1;break}}return at.delete(tt),at.delete(nt),bt}var _equalArrays=equalArrays$3,Symbol$2=_Symbol,Uint8Array$2=_Uint8Array,eq$1=eq_1,equalArrays$2=_equalArrays,mapToArray$1=_mapToArray,setToArray$1=_setToArray,COMPARE_PARTIAL_FLAG$a=1,COMPARE_UNORDERED_FLAG$6=2,boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$2="[object Error]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function equalByTag$2(tt,nt,et,rt,ot,at,st){switch(et){case dataViewTag$3:if(tt.byteLength!=nt.byteLength||tt.byteOffset!=nt.byteOffset)return!1;tt=tt.buffer,nt=nt.buffer;case arrayBufferTag$2:return!(tt.byteLength!=nt.byteLength||!at(new Uint8Array$2(tt),new Uint8Array$2(nt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+tt,+nt);case errorTag$2:return tt.name==nt.name&&tt.message==nt.message;case regexpTag$2:case stringTag$2:return tt==nt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=rt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),tt.size!=nt.size&&!ct)return!1;var pt=st.get(tt);if(pt)return pt==nt;rt|=COMPARE_UNORDERED_FLAG$6,st.set(tt,nt);var dt=equalArrays$2(ut(tt),ut(nt),rt,ot,at,st);return st.delete(tt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(tt)==symbolValueOf$1.call(nt)}return!1}var _equalByTag=equalByTag$2,getAllKeys$1=_getAllKeys,COMPARE_PARTIAL_FLAG$9=1,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty;function equalObjects$2(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(tt),ct=ut.length,pt=getAllKeys$1(nt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in nt:hasOwnProperty$f.call(nt,bt)))return!1}var ht=at.get(tt),Mt=at.get(nt);if(ht&&Mt)return ht==nt&&Mt==tt;var mt=!0;at.set(tt,nt),at.set(nt,tt);for(var Ot=st;++ft<ct;){bt=ut[ft];var zt=tt[bt],yt=nt[bt];if(rt)var vt=st?rt(yt,zt,bt,nt,tt,at):rt(zt,yt,bt,tt,nt,at);if(!(vt===void 0?zt===yt||ot(zt,yt,et,rt,at):vt)){mt=!1;break}Ot||(Ot=bt=="constructor")}if(mt&&!Ot){var At=tt.constructor,St=nt.constructor;At!=St&&"constructor"in tt&&"constructor"in nt&&!(typeof At=="function"&&At instanceof At&&typeof St=="function"&&St instanceof St)&&(mt=!1)}return at.delete(tt),at.delete(nt),mt}var _equalObjects=equalObjects$2,Stack$2=_Stack,equalArrays$1=_equalArrays,equalByTag$1=_equalByTag,equalObjects$1=_equalObjects,getTag$1=_getTag,isArray$7=isArray_1,isBuffer$2=isBufferExports,isTypedArray$2=isTypedArray_1,COMPARE_PARTIAL_FLAG$8=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$4="[object Object]",objectProto$g=Object.prototype,hasOwnProperty$e=objectProto$g.hasOwnProperty;function baseIsEqualDeep$2(tt,nt,et,rt,ot,at){var st=isArray$7(tt),ut=isArray$7(nt),ct=st?arrayTag$2:getTag$1(tt),pt=ut?arrayTag$2:getTag$1(nt);ct=ct==argsTag$3?objectTag$4:ct,pt=pt==argsTag$3?objectTag$4:pt;var dt=ct==objectTag$4,ft=pt==objectTag$4,bt=ct==pt;if(bt&&isBuffer$2(tt)){if(!isBuffer$2(nt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(tt)?equalArrays$1(tt,nt,et,rt,ot,at):equalByTag$1(tt,nt,ct,et,rt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(tt,"__wrapped__"),Mt=ft&&hasOwnProperty$e.call(nt,"__wrapped__");if(ht||Mt){var mt=ht?tt.value():tt,Ot=Mt?nt.value():nt;return at||(at=new Stack$2),ot(mt,Ot,et,rt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(tt,nt,et,rt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(tt,nt,et,rt,ot){return tt===nt?!0:tt==null||nt==null||!isObjectLike$1(tt)&&!isObjectLike$1(nt)?tt!==tt&&nt!==nt:baseIsEqualDeep$1(tt,nt,et,rt,baseIsEqual$4,ot)}var _baseIsEqual=baseIsEqual$4,Stack$1=_Stack,baseIsEqual$3=_baseIsEqual,COMPARE_PARTIAL_FLAG$7=1,COMPARE_UNORDERED_FLAG$5=2;function baseIsMatch$2(tt,nt,et,rt){var ot=et.length,at=ot,st=!rt;if(tt==null)return!at;for(tt=Object(tt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==tt[ut[0]]:!(ut[0]in tt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=tt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in tt))return!1}else{var ft=new Stack$1;if(rt)var bt=rt(pt,dt,ct,tt,nt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,rt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(tt){return tt===tt&&!isObject$3(tt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(tt){for(var nt=keys$1(tt),et=nt.length;et--;){var rt=nt[et],ot=tt[rt];nt[et]=[rt,ot,isStrictComparable$2(ot)]}return nt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(tt,nt){return function(et){return et==null?!1:et[tt]===nt&&(nt!==void 0||tt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(tt){var nt=getMatchData$1(tt);return nt.length==1&&nt[0][2]?matchesStrictComparable$2(nt[0][0],nt[0][1]):function(et){return et===tt||baseIsMatch$1(et,tt,nt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(tt,nt){return tt!=null&&nt in Object(tt)}var _baseHasIn=baseHasIn$2,castPath$3=_castPath,isArguments$1=isArguments_1,isArray$6=isArray_1,isIndex$2=_isIndex,isLength$1=isLength_1,toKey$4=_toKey;function hasPath$2(tt,nt,et){nt=castPath$3(nt,tt);for(var rt=-1,ot=nt.length,at=!1;++rt<ot;){var st=toKey$4(nt[rt]);if(!(at=tt!=null&&et(tt,st)))break;tt=tt[st]}return at||++rt!=ot?at:(ot=tt==null?0:tt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(tt)||isArguments$1(tt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(tt,nt){return tt!=null&&hasPath$1(tt,nt,baseHasIn$1)}var hasIn_1=hasIn$3,baseIsEqual$2=_baseIsEqual,get$2=get_1,hasIn$2=hasIn_1,isKey$2=_isKey,isStrictComparable$1=_isStrictComparable,matchesStrictComparable$1=_matchesStrictComparable,toKey$3=_toKey,COMPARE_PARTIAL_FLAG$6=1,COMPARE_UNORDERED_FLAG$4=2;function baseMatchesProperty$2(tt,nt){return isKey$2(tt)&&isStrictComparable$1(nt)?matchesStrictComparable$1(toKey$3(tt),nt):function(et){var rt=get$2(et,tt);return rt===void 0&&rt===nt?hasIn$2(et,tt):baseIsEqual$2(nt,rt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(tt){return function(nt){return baseGet$3(nt,tt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(tt){return isKey$1(tt)?baseProperty$1(toKey$2(tt)):basePropertyDeep$1(tt)}var property_1=property$2,baseMatches$1=_baseMatches,baseMatchesProperty$1=_baseMatchesProperty,identity$2=identity_1,isArray$5=isArray_1,property$1=property_1;function baseIteratee$5(tt){return typeof tt=="function"?tt:tt==null?identity$2:typeof tt=="object"?isArray$5(tt)?baseMatchesProperty$1(tt[0],tt[1]):baseMatches$1(tt):property$1(tt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(tt,nt){return function(et,rt){if(et==null)return et;if(!isArrayLike$2(et))return tt(et,rt);for(var ot=et.length,at=nt?ot:-1,st=Object(et);(nt?at--:++at<ot)&&rt(st[at],at,st)!==!1;);return et}}var _createBaseEach=createBaseEach$2,baseForOwn$2=_baseForOwn,createBaseEach$1=_createBaseEach,baseEach$3=createBaseEach$1(baseForOwn$2),_baseEach=baseEach$3,baseEach$2=_baseEach,isArrayLike$1=isArrayLike_1;function baseMap$3(tt,nt){var et=-1,rt=isArrayLike$1(tt)?Array(tt.length):[];return baseEach$2(tt,function(ot,at,st){rt[++et]=nt(ot,at,st)}),rt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(tt,nt){var et=isArray$4(tt)?arrayMap$3:baseMap$2;return et(tt,baseIteratee$4(nt))}var map_1=map$1;Object.defineProperty(flattenNames$1,"__esModule",{value:!0});flattenNames$1.flattenNames=void 0;var _isString2=isString_1,_isString3=_interopRequireDefault$7(_isString2),_forOwn2$2=forOwn_1,_forOwn3$2=_interopRequireDefault$7(_forOwn2$2),_isPlainObject2=isPlainObject_1,_isPlainObject3=_interopRequireDefault$7(_isPlainObject2),_map2=map_1,_map3=_interopRequireDefault$7(_map2);function _interopRequireDefault$7(tt){return tt&&tt.__esModule?tt:{default:tt}}var flattenNames=flattenNames$1.flattenNames=function tt(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(nt,function(rt){Array.isArray(rt)?tt(rt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(rt)?(0,_forOwn3$2.default)(rt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(rt)&&et.push(rt)}),et};flattenNames$1.default=flattenNames;var mergeClasses$1={};Object.defineProperty(mergeClasses$1,"__esModule",{value:!0});mergeClasses$1.mergeClasses=void 0;var _forOwn2$1=forOwn_1,_forOwn3$1=_interopRequireDefault$6(_forOwn2$1),_cloneDeep2=cloneDeep_1,_cloneDeep3=_interopRequireDefault$6(_cloneDeep2),_extends$w=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$6(tt){return tt&&tt.__esModule?tt:{default:tt}}var mergeClasses=mergeClasses$1.mergeClasses=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],rt=nt.default&&(0,_cloneDeep3.default)(nt.default)||{};return et.map(function(ot){var at=nt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){rt[ut]||(rt[ut]={}),rt[ut]=_extends$w({},rt[ut],at[ut])}),ot}),rt};mergeClasses$1.default=mergeClasses;var autoprefix$1={};Object.defineProperty(autoprefix$1,"__esModule",{value:!0});autoprefix$1.autoprefix=void 0;var _forOwn2=forOwn_1,_forOwn3=_interopRequireDefault$5(_forOwn2),_extends$v=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$5(tt){return tt&&tt.__esModule?tt:{default:tt}}var transforms={borderRadius:function tt(nt){return{msBorderRadius:nt,MozBorderRadius:nt,OBorderRadius:nt,WebkitBorderRadius:nt,borderRadius:nt}},boxShadow:function tt(nt){return{msBoxShadow:nt,MozBoxShadow:nt,OBoxShadow:nt,WebkitBoxShadow:nt,boxShadow:nt}},userSelect:function tt(nt){return{WebkitTouchCallout:nt,KhtmlUserSelect:nt,MozUserSelect:nt,msUserSelect:nt,WebkitUserSelect:nt,userSelect:nt}},flex:function tt(nt){return{WebkitBoxFlex:nt,MozBoxFlex:nt,WebkitFlex:nt,msFlex:nt,flex:nt}},flexBasis:function tt(nt){return{WebkitFlexBasis:nt,flexBasis:nt}},justifyContent:function tt(nt){return{WebkitJustifyContent:nt,justifyContent:nt}},transition:function tt(nt){return{msTransition:nt,MozTransition:nt,OTransition:nt,WebkitTransition:nt,transition:nt}},transform:function tt(nt){return{msTransform:nt,MozTransform:nt,OTransform:nt,WebkitTransform:nt,transform:nt}},absolute:function tt(nt){var et=nt&&nt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function tt(nt,et){var rt=et[nt];return rt||{extend:nt}}},autoprefix=autoprefix$1.autoprefix=function tt(nt){var et={};return(0,_forOwn3.default)(nt,function(rt,ot){var at={};(0,_forOwn3.default)(rt,function(st,ut){var ct=transforms[ut];ct?at=_extends$v({},at,ct(st)):at[ut]=st}),et[ot]=at}),et};autoprefix$1.default=autoprefix;var hover$1={};Object.defineProperty(hover$1,"__esModule",{value:!0});hover$1.hover=void 0;var _extends$u=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$f(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$f(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var hover=hover$1.hover=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$f(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$f(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$f(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={hover:!1},ut.handleMouseOver=function(){return ut.setState({hover:!0})},ut.handleMouseOut=function(){return ut.setState({hover:!1})},ut.render=function(){return _react2$3.default.createElement(et,{onMouseOver:ut.handleMouseOver,onMouseOut:ut.handleMouseOut},_react2$3.default.createElement(nt,_extends$u({},ut.props,ut.state)))},st),_possibleConstructorReturn$f(ut,ct)}return ot}(_react2$3.default.Component)};hover$1.default=hover;var active$1={};Object.defineProperty(active$1,"__esModule",{value:!0});active$1.active=void 0;var _extends$t=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$e(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$e(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var active=active$1.active=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$e(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$e(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$e(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={active:!1},ut.handleMouseDown=function(){return ut.setState({active:!0})},ut.handleMouseUp=function(){return ut.setState({active:!1})},ut.render=function(){return _react2$2.default.createElement(et,{onMouseDown:ut.handleMouseDown,onMouseUp:ut.handleMouseUp},_react2$2.default.createElement(nt,_extends$t({},ut.props,ut.state)))},st),_possibleConstructorReturn$e(ut,ct)}return ot}(_react2$2.default.Component)};active$1.default=active;var loop={};Object.defineProperty(loop,"__esModule",{value:!0});var loopable=function tt(nt,et){var rt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;rt[st]=ut};return nt===0&&ot("first-child"),nt===et-1&&ot("last-child"),(nt===0||nt%2===0)&&ot("even"),Math.abs(nt%2)===1&&ot("odd"),ot("nth-child",nt),rt};loop.default=loopable;Object.defineProperty(lib$2,"__esModule",{value:!0});lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=handleHover=lib$2.handleHover=lib$2.hover=void 0;var _flattenNames=flattenNames$1,_flattenNames2=_interopRequireDefault$2(_flattenNames),_mergeClasses=mergeClasses$1,_mergeClasses2=_interopRequireDefault$2(_mergeClasses),_autoprefix=autoprefix$1,_autoprefix2=_interopRequireDefault$2(_autoprefix),_hover2=hover$1,_hover3=_interopRequireDefault$2(_hover2),_active=active$1,_active2=_interopRequireDefault$2(_active),_loop2=loop,_loop3=_interopRequireDefault$2(_loop2);function _interopRequireDefault$2(tt){return tt&&tt.__esModule?tt:{default:tt}}lib$2.hover=_hover3.default;var handleHover=lib$2.handleHover=_hover3.default;lib$2.handleActive=_active2.default;lib$2.loop=_loop3.default;var ReactCSS=lib$2.ReactCSS=function tt(nt){for(var et=arguments.length,rt=Array(et>1?et-1:0),ot=1;ot<et;ot++)rt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(rt),st=(0,_mergeClasses2.default)(nt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function tt(nt,et,rt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof nt.pageX=="number"?nt.pageX:nt.touches[0].pageX,pt=typeof nt.pageY=="number"?nt.pageY:nt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(rt==="vertical"){var bt=void 0;if(ft<0?bt=0:ft>ut?bt=1:bt=Math.round(ft*100/ut)/100,et.a!==bt)return{h:et.h,s:et.s,l:et.l,a:bt,source:"rgb"}}else{var ht=void 0;if(dt<0?ht=0:dt>st?ht=1:ht=Math.round(dt*100/st)/100,ot!==ht)return{h:et.h,s:et.s,l:et.l,a:ht,source:"rgb"}}return null},checkboardCache={},render=function tt(nt,et,rt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=rt*2,at.height=rt*2;var st=at.getContext("2d");return st?(st.fillStyle=nt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,rt,rt),st.translate(rt,rt),st.fillRect(0,0,rt,rt),at.toDataURL()):null},get$1=function tt(nt,et,rt,ot){var at=nt+"-"+et+"-"+rt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(nt,et,rt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},Checkboard=function tt(nt){var et=nt.white,rt=nt.grey,ot=nt.size,at=nt.renderers,st=nt.borderRadius,ut=nt.boxShadow,ct=nt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,rt,ot,at.canvas)+") center left"}}});return reactExports.isValidElement(ct)?React$1.cloneElement(ct,_extends$s({},ct.props,{style:_extends$s({},ct.props.style,pt.grid)})):React$1.createElement("div",{style:pt.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$r=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_createClass$d=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _classCallCheck$d(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$d(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var Alpha=function(tt){_inherits$d(nt,tt);function nt(){var et,rt,ot,at;_classCallCheck$d(this,nt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(rt=(ot=_possibleConstructorReturn$d(this,(et=nt.__proto__||Object.getPrototypeOf(nt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$2(pt,ot.props.hsl,ot.props.direction,ot.props.a,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},ot.unbindEventListeners=function(){window.removeEventListener("mousemove",ot.handleChange),window.removeEventListener("mouseup",ot.handleMouseUp)},rt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(nt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var rt=this,ot=this.props.rgb,at=_default$2({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
|
684
684
|
rgba(`+ot.r+","+ot.g+","+ot.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:ot.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
|
685
685
|
rgba(`+ot.r+","+ot.g+","+ot.b+", 1) 100%)"},pointer:{left:0,top:ot.a*100+"%"}},overwrite:_extends$r({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return React$1.createElement("div",{style:at.alpha},React$1.createElement("div",{style:at.checkboard},React$1.createElement(Checkboard,{renderers:this.props.renderers})),React$1.createElement("div",{style:at.gradient}),React$1.createElement("div",{style:at.container,ref:function(ut){return rt.container=ut},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React$1.createElement("div",{style:at.pointer},this.props.pointer?React$1.createElement(this.props.pointer,this.props):React$1.createElement("div",{style:at.slider}))))}}]),nt}(reactExports.PureComponent||reactExports.Component),_createClass$c=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _defineProperty$d(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}function _classCallCheck$c(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$c(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var DEFAULT_ARROW_OFFSET=1,UP_KEY_CODE=38,DOWN_KEY_CODE=40,VALID_KEY_CODES=[UP_KEY_CODE,DOWN_KEY_CODE],isValidKeyCode=function tt(nt){return VALID_KEY_CODES.indexOf(nt)>-1},getNumberValue=function tt(nt){return Number(String(nt).replace(/%/g,""))},idCounter=1,EditableInput=function(tt){_inherits$c(nt,tt);function nt(et){_classCallCheck$c(this,nt);var rt=_possibleConstructorReturn$c(this,(nt.__proto__||Object.getPrototypeOf(nt)).call(this));return rt.handleBlur=function(){rt.state.blurValue&&rt.setState({value:rt.state.blurValue,blurValue:null})},rt.handleChange=function(ot){rt.setUpdatedValue(ot.target.value,ot)},rt.handleKeyDown=function(ot){var at=getNumberValue(ot.target.value);if(!isNaN(at)&&isValidKeyCode(ot.keyCode)){var st=rt.getArrowOffset(),ut=ot.keyCode===UP_KEY_CODE?at+st:at-st;rt.setUpdatedValue(ut,ot)}},rt.handleDrag=function(ot){if(rt.props.dragLabel){var at=Math.round(rt.props.value+ot.movementX);at>=0&&at<=rt.props.dragMax&&rt.props.onChange&&rt.props.onChange(rt.getValueObjectWithLabel(at),ot)}},rt.handleMouseDown=function(ot){rt.props.dragLabel&&(ot.preventDefault(),rt.handleDrag(ot),window.addEventListener("mousemove",rt.handleDrag),window.addEventListener("mouseup",rt.handleMouseUp))},rt.handleMouseUp=function(){rt.unbindEventListeners()},rt.unbindEventListeners=function(){window.removeEventListener("mousemove",rt.handleDrag),window.removeEventListener("mouseup",rt.handleMouseUp)},rt.state={value:String(et.value).toUpperCase(),blurValue:String(et.value).toUpperCase()},rt.inputId="rc-editable-input-"+idCounter++,rt}return _createClass$c(nt,[{key:"componentDidUpdate",value:function(rt,ot){this.props.value!==this.state.value&&(rt.value!==this.props.value||ot.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(rt){return _defineProperty$d({},this.props.label,rt)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||DEFAULT_ARROW_OFFSET}},{key:"setUpdatedValue",value:function(rt,ot){var at=this.props.label?this.getValueObjectWithLabel(rt):rt;this.props.onChange&&this.props.onChange(at,ot),this.setState({value:rt})}},{key:"render",value:function(){var rt=this,ot=_default$2({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return React$1.createElement("div",{style:ot.wrap},React$1.createElement("input",{id:this.inputId,style:ot.input,ref:function(st){return rt.input=st},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?React$1.createElement("label",{htmlFor:this.inputId,style:ot.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),nt}(reactExports.PureComponent||reactExports.Component),calculateChange$1=function tt(nt,et,rt,ot){var at=ot.clientWidth,st=ot.clientHeight,ut=typeof nt.pageX=="number"?nt.pageX:nt.touches[0].pageX,ct=typeof nt.pageY=="number"?nt.pageY:nt.touches[0].pageY,pt=ut-(ot.getBoundingClientRect().left+window.pageXOffset),dt=ct-(ot.getBoundingClientRect().top+window.pageYOffset);if(et==="vertical"){var ft=void 0;if(dt<0)ft=359;else if(dt>st)ft=0;else{var bt=-(dt*100/st)+100;ft=360*bt/100}if(rt.h!==ft)return{h:ft,s:rt.s,l:rt.l,a:rt.a,source:"hsl"}}else{var ht=void 0;if(pt<0)ht=0;else if(pt>at)ht=359;else{var Mt=pt*100/at;ht=360*Mt/100}if(rt.h!==ht)return{h:ht,s:rt.s,l:rt.l,a:rt.a,source:"hsl"}}return null},_createClass$b=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _classCallCheck$b(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$b(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$b(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var Hue=function(tt){_inherits$b(nt,tt);function nt(){var et,rt,ot,at;_classCallCheck$b(this,nt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(rt=(ot=_possibleConstructorReturn$b(this,(et=nt.__proto__||Object.getPrototypeOf(nt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$1(pt,ot.props.direction,ot.props.hsl,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},rt),_possibleConstructorReturn$b(ot,at)}return _createClass$b(nt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var rt=this,ot=this.props.direction,at=ot===void 0?"horizontal":ot,st=_default$2({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:at==="vertical"});return React$1.createElement("div",{style:st.hue},React$1.createElement("div",{className:"hue-"+at,style:st.container,ref:function(ct){return rt.container=ct},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React$1.createElement("style",null,`
|
686
686
|
.hue-horizontal {
|
@@ -795,4 +795,4 @@ not been pushed to GitHub. Please add it to continue.
|
|
795
795
|
`):" "+renderReason(at[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+st,"ERR_NOT_SUPPORT")}return rt},adapters:knownAdapters};function throwIfCancellationRequested(tt){if(tt.cancelToken&&tt.cancelToken.throwIfRequested(),tt.signal&&tt.signal.aborted)throw new CanceledError(null,tt)}function dispatchRequest(tt){return throwIfCancellationRequested(tt),tt.headers=AxiosHeaders.from(tt.headers),tt.data=transformData.call(tt,tt.transformRequest),["post","put","patch"].indexOf(tt.method)!==-1&&tt.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(tt.adapter||defaults.adapter)(tt).then(function(rt){return throwIfCancellationRequested(tt),rt.data=transformData.call(tt,tt.transformResponse,rt),rt.headers=AxiosHeaders.from(rt.headers),rt},function(rt){return isCancel(rt)||(throwIfCancellationRequested(tt),rt&&rt.response&&(rt.response.data=transformData.call(tt,tt.transformResponse,rt.response),rt.response.headers=AxiosHeaders.from(rt.response.headers))),Promise.reject(rt)})}const VERSION="1.7.9",validators$1={};["object","boolean","number","function","string","symbol"].forEach((tt,nt)=>{validators$1[tt]=function(rt){return typeof rt===tt||"a"+(nt<1?"n ":" ")+tt}});const deprecatedWarnings={};validators$1.transitional=function tt(nt,et,rt){function ot(at,st){return"[Axios v"+VERSION+"] Transitional option '"+at+"'"+st+(rt?". "+rt:"")}return(at,st,ut)=>{if(nt===!1)throw new AxiosError(ot(st," has been removed"+(et?" in "+et:"")),AxiosError.ERR_DEPRECATED);return et&&!deprecatedWarnings[st]&&(deprecatedWarnings[st]=!0,console.warn(ot(st," has been deprecated since v"+et+" and will be removed in the near future"))),nt?nt(at,st,ut):!0}};validators$1.spelling=function tt(nt){return(et,rt)=>(console.warn(`${rt} is likely a misspelling of ${nt}`),!0)};function assertOptions(tt,nt,et){if(typeof tt!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const rt=Object.keys(tt);let ot=rt.length;for(;ot-- >0;){const at=rt[ot],st=nt[at];if(st){const ut=tt[at],ct=ut===void 0||st(ut,at,tt);if(ct!==!0)throw new AxiosError("option "+at+" must be "+ct,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(et!==!0)throw new AxiosError("Unknown option "+at,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(nt){this.defaults=nt,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(nt,et){try{return await this._request(nt,et)}catch(rt){if(rt instanceof Error){let ot={};Error.captureStackTrace?Error.captureStackTrace(ot):ot=new Error;const at=ot.stack?ot.stack.replace(/^.+\n/,""):"";try{rt.stack?at&&!String(rt.stack).endsWith(at.replace(/^.+\n.+\n/,""))&&(rt.stack+=`
|
796
796
|
`+at):rt.stack=at}catch{}}throw rt}}_request(nt,et){typeof nt=="string"?(et=et||{},et.url=nt):et=nt||{},et=mergeConfig(this.defaults,et);const{transitional:rt,paramsSerializer:ot,headers:at}=et;rt!==void 0&&validator.assertOptions(rt,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),ot!=null&&(utils$1.isFunction(ot)?et.paramsSerializer={serialize:ot}:validator.assertOptions(ot,{encode:validators.function,serialize:validators.function},!0)),validator.assertOptions(et,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),et.method=(et.method||this.defaults.method||"get").toLowerCase();let st=at&&utils$1.merge(at.common,at[et.method]);at&&utils$1.forEach(["delete","get","head","post","put","patch","common"],Mt=>{delete at[Mt]}),et.headers=AxiosHeaders.concat(st,at);const ut=[];let ct=!0;this.interceptors.request.forEach(function(mt){typeof mt.runWhen=="function"&&mt.runWhen(et)===!1||(ct=ct&&mt.synchronous,ut.unshift(mt.fulfilled,mt.rejected))});const pt=[];this.interceptors.response.forEach(function(mt){pt.push(mt.fulfilled,mt.rejected)});let dt,ft=0,bt;if(!ct){const Mt=[dispatchRequest.bind(this),void 0];for(Mt.unshift.apply(Mt,ut),Mt.push.apply(Mt,pt),bt=Mt.length,dt=Promise.resolve(et);ft<bt;)dt=dt.then(Mt[ft++],Mt[ft++]);return dt}bt=ut.length;let ht=et;for(ft=0;ft<bt;){const Mt=ut[ft++],mt=ut[ft++];try{ht=Mt(ht)}catch(Ot){mt.call(this,Ot);break}}try{dt=dispatchRequest.call(this,ht)}catch(Mt){return Promise.reject(Mt)}for(ft=0,bt=pt.length;ft<bt;)dt=dt.then(pt[ft++],pt[ft++]);return dt}getUri(nt){nt=mergeConfig(this.defaults,nt);const et=buildFullPath(nt.baseURL,nt.url);return buildURL(et,nt.params,nt.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function tt(nt){Axios.prototype[nt]=function(et,rt){return this.request(mergeConfig(rt||{},{method:nt,url:et,data:(rt||{}).data}))}});utils$1.forEach(["post","put","patch"],function tt(nt){function et(rt){return function(at,st,ut){return this.request(mergeConfig(ut||{},{method:nt,headers:rt?{"Content-Type":"multipart/form-data"}:{},url:at,data:st}))}}Axios.prototype[nt]=et(),Axios.prototype[nt+"Form"]=et(!0)});class CancelToken{constructor(nt){if(typeof nt!="function")throw new TypeError("executor must be a function.");let et;this.promise=new Promise(function(at){et=at});const rt=this;this.promise.then(ot=>{if(!rt._listeners)return;let at=rt._listeners.length;for(;at-- >0;)rt._listeners[at](ot);rt._listeners=null}),this.promise.then=ot=>{let at;const st=new Promise(ut=>{rt.subscribe(ut),at=ut}).then(ot);return st.cancel=function(){rt.unsubscribe(at)},st},nt(function(at,st,ut){rt.reason||(rt.reason=new CanceledError(at,st,ut),et(rt.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(nt){if(this.reason){nt(this.reason);return}this._listeners?this._listeners.push(nt):this._listeners=[nt]}unsubscribe(nt){if(!this._listeners)return;const et=this._listeners.indexOf(nt);et!==-1&&this._listeners.splice(et,1)}toAbortSignal(){const nt=new AbortController,et=rt=>{nt.abort(rt)};return this.subscribe(et),nt.signal.unsubscribe=()=>this.unsubscribe(et),nt.signal}static source(){let nt;return{token:new CancelToken(function(ot){nt=ot}),cancel:nt}}}function spread(tt){return function(et){return tt.apply(null,et)}}function isAxiosError(tt){return utils$1.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([tt,nt])=>{HttpStatusCode[nt]=tt});function createInstance(tt){const nt=new Axios(tt),et=bind(Axios.prototype.request,nt);return utils$1.extend(et,Axios.prototype,nt,{allOwnKeys:!0}),utils$1.extend(et,nt,null,{allOwnKeys:!0}),et.create=function(ot){return createInstance(mergeConfig(tt,ot))},et}const axios=createInstance(defaults);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function tt(nt){return Promise.all(nt)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=tt=>formDataToJSON(utils$1.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;function doInitPings(tt,nt,et,rt,ot){const at=new Resolver;let st=0,ut=0,ct=()=>{};const pt=()=>{ut++,ut>=tt.length&&(ut=0),ct()},dt=ht=>{const Mt=Math.random()*.4-.2,mt=st===1?nt:nt*2**(st-1)*(1+Mt),Ot=Math.min(et,mt);rt(st,ht,Ot),window.setTimeout(pt,Ot)},ft=()=>{const ht=tt[ut];new URL(buildHttpUri(ht,"")).hostname==="localhost"?dt(jsx$1(StreamlitMarkdown$1,{source:"\nIs Streamlit still running? If you accidentally stopped Streamlit, just restart it in your terminal:\n\n```bash\nstreamlit run yourscript.py\n```\n ",allowHTML:!1})):dt("Connection failed with status 0.")},bt=()=>{dt(jsxs(reactExports.Fragment,{children:[jsx$1("p",{children:"Cannot connect to Streamlit (HTTP status: 403)."}),jsxs("p",{children:["If you are trying to access a Streamlit app running on another server, this could be due to the app's"," ",jsx$1("a",{href:CORS_ERROR_MESSAGE_DOCUMENTATION_LINK,children:"CORS"})," settings."]})]}))};return ct=()=>{const ht=tt[ut],Mt=buildHttpUri(ht,SERVER_PING_PATH),mt=buildHttpUri(ht,HOST_CONFIG_PATH);ut===0&&st++,Promise.all([axios.get(Mt,{timeout:PING_TIMEOUT_MS}),axios.get(mt,{timeout:PING_TIMEOUT_MS})]).then(([Ot,zt])=>{ot(zt.data),at.resolve(ut)}).catch(Ot=>{if(Ot.code==="ECONNABORTED")return dt("Connection timed out.");if(Ot.response){const{data:zt,status:yt}=Ot.response;return yt===0?ft():yt===403?bt():dt(`Connection failed with status ${yt}, and response "${zt}".`)}return Ot.request?ft():dt(Ot.message)})},ct(),at.promise}class WebsocketConnection{constructor(nt){this.uriIndex=0,this.lastDispatchedMessageIndex=-1,this.nextMessageIndex=0,this.messageQueue={},this.state=ConnectionState.INITIAL,this.args=nt,this.cache=new ForwardMsgCache(nt.endpoints),this.stepFsm("INITIALIZED")}getBaseUriParts(){if(this.state===ConnectionState.CONNECTED)return this.args.baseUriPartsList[this.uriIndex]}disconnect(){this.setFsmState(ConnectionState.DISCONNECTED_FOREVER)}setFsmState(nt,et){switch(this.state=nt,this.state){case ConnectionState.PINGING_SERVER:this.pingServer();break}switch(this.args.onConnectionStateChange(nt,et),this.state){case ConnectionState.CONNECTING:this.connectToWebSocket();break;case ConnectionState.DISCONNECTED_FOREVER:this.closeConnection();break}}stepFsm(nt,et){if(logMessage(LOG,`State: ${this.state}; Event: ${nt}`),nt==="FATAL_ERROR"&&this.state!==ConnectionState.DISCONNECTED_FOREVER){this.setFsmState(ConnectionState.DISCONNECTED_FOREVER,et);return}switch(this.state){case ConnectionState.INITIAL:if(nt==="INITIALIZED"){this.setFsmState(ConnectionState.PINGING_SERVER);return}break;case ConnectionState.CONNECTING:if(nt==="CONNECTION_SUCCEEDED"){this.setFsmState(ConnectionState.CONNECTED);return}if(nt==="CONNECTION_TIMED_OUT"||nt==="CONNECTION_ERROR"||nt==="CONNECTION_CLOSED"){this.setFsmState(ConnectionState.PINGING_SERVER);return}break;case ConnectionState.CONNECTED:if(nt==="CONNECTION_CLOSED"||nt==="CONNECTION_ERROR"){this.setFsmState(ConnectionState.PINGING_SERVER);return}break;case ConnectionState.PINGING_SERVER:if(nt==="SERVER_PING_SUCCEEDED"){this.setFsmState(ConnectionState.CONNECTING);return}break;case ConnectionState.DISCONNECTED_FOREVER:logWarning(LOG,`Discarding ${nt} while in ${ConnectionState.DISCONNECTED_FOREVER}`);return}throw new Error(`Unsupported state transition.
|
797
797
|
State: ${this.state}
|
798
|
-
Event: ${nt}`)}async pingServer(){this.uriIndex=await doInitPings(this.args.baseUriPartsList,PING_MINIMUM_RETRY_PERIOD_MS,PING_MAXIMUM_RETRY_PERIOD_MS,this.args.onRetry,this.args.onHostConfigResp),this.stepFsm("SERVER_PING_SUCCEEDED")}async getSessionTokens(){var rt,ot;const nt=await this.args.claimHostAuthToken(),et=getCookie("_streamlit_xsrf");return this.args.resetHostAuthToken(),[nt??et??"PLACEHOLDER_AUTH_TOKEN",...(rt=this.args.sessionInfo.last)!=null&&rt.sessionId?[(ot=this.args.sessionInfo.last)==null?void 0:ot.sessionId]:[]]}async connectToWebSocket(){const nt=buildWsUri(this.args.baseUriPartsList[this.uriIndex],WEBSOCKET_STREAM_PATH);if(notNullOrUndefined(this.websocket))throw new Error("Websocket already exists");const et=await this.getSessionTokens();this.websocket=new WebSocket(nt,["streamlit",...et]),this.websocket.binaryType="arraybuffer",this.setConnectionTimeout(nt);const rt=this.websocket,ot=()=>rt===this.websocket;this.websocket.addEventListener("message",at=>{ot()&&this.handleMessage(at.data).catch(st=>{const ut=`Failed to process a Websocket message (${st})`;logError(LOG,ut),this.stepFsm("FATAL_ERROR",ut)})}),this.websocket.addEventListener("open",()=>{ot()&&this.stepFsm("CONNECTION_SUCCEEDED")}),this.websocket.addEventListener("close",()=>{ot()&&(this.closeConnection(),this.stepFsm("CONNECTION_CLOSED"))}),this.websocket.addEventListener("error",()=>{ot()&&(logError(LOG,"WebSocket onerror"),this.closeConnection(),this.stepFsm("CONNECTION_ERROR"))})}setConnectionTimeout(nt){if(notNullOrUndefined(this.wsConnectionTimeoutId))throw new Error("WS timeout is already set");const et=this.websocket;this.wsConnectionTimeoutId=window.setTimeout(()=>{if(et===this.websocket&&!isNullOrUndefined$1(this.wsConnectionTimeoutId)){if(isNullOrUndefined$1(this.websocket)){this.closeConnection(),this.stepFsm("FATAL_ERROR","Null Websocket in setConnectionTimeout");return}this.websocket.readyState===0&&(this.closeConnection(),this.stepFsm("CONNECTION_TIMED_OUT"))}},WEBSOCKET_TIMEOUT_MS),logMessage(LOG,`Set WS timeout ${this.wsConnectionTimeoutId}`)}closeConnection(){this.websocket&&(this.websocket.close(),this.websocket=void 0),notNullOrUndefined(this.wsConnectionTimeoutId)&&(logMessage(LOG,`Clearing WS timeout ${this.wsConnectionTimeoutId}`),window.clearTimeout(this.wsConnectionTimeoutId),this.wsConnectionTimeoutId=void 0)}sendMessage(nt){if(!this.websocket)return;const et=BackMsg.create(nt),rt=BackMsg.encode(et).finish();this.websocket.send(rt)}incrementMessageCacheRunCount(nt){this.cache.incrementRunCount(nt)}async handleMessage(nt){const et=this.nextMessageIndex;this.nextMessageIndex+=1,PerformanceEvents.record({name:"BeginHandleMessage",messageIndex:et});const rt=new Uint8Array(nt),ot=ForwardMsg.decode(rt);for(PerformanceEvents.record({name:"DecodedMessage",messageIndex:et,messageType:ot.type,len:nt.byteLength}),this.messageQueue[et]=await this.cache.processMessagePayload(ot,rt),PerformanceEvents.record({name:"GotCachedPayload",messageIndex:et});this.lastDispatchedMessageIndex+1 in this.messageQueue;){const at=this.lastDispatchedMessageIndex+1;this.args.onMessage(this.messageQueue[at]),PerformanceEvents.record({name:"DispatchedMessage",messageIndex:at,messageType:this.messageQueue[at].type}),delete this.messageQueue[at],this.lastDispatchedMessageIndex=at}}}const RETRY_COUNT_FOR_WARNING=6;class ConnectionManager{constructor(nt){this.connectionState=ConnectionState.INITIAL,this.setConnectionState=(et,rt)=>{this.connectionState!==et&&(this.connectionState=et,this.props.connectionStateChanged(et)),rt&&this.props.onConnectionError(rt)},this.showRetryError=(et,rt,ot)=>{et===RETRY_COUNT_FOR_WARNING&&this.props.onConnectionError(rt)},this.props=nt,this.connect()}isConnected(){return this.connectionState===ConnectionState.CONNECTED}getBaseUriParts(){if(this.connection instanceof WebsocketConnection)return this.connection.getBaseUriParts()}sendMessage(nt){this.connection instanceof WebsocketConnection&&this.isConnected()?this.connection.sendMessage(nt):logError(`Cannot send message when server is disconnected: ${nt}`)}incrementMessageCacheRunCount(nt){this.connection instanceof WebsocketConnection&&this.connection.incrementMessageCacheRunCount(nt)}async connect(){try{this.connection=await this.connectToRunningServer()}catch(nt){const et=ensureError(nt);logError(et.message),this.setConnectionState(ConnectionState.DISCONNECTED_FOREVER,et.message)}}disconnect(){var nt;(nt=this.connection)==null||nt.disconnect()}connectToRunningServer(){const nt=getPossibleBaseUris();return new WebsocketConnection({sessionInfo:this.props.sessionInfo,endpoints:this.props.endpoints,baseUriPartsList:nt,onMessage:this.props.onMessage,onConnectionStateChange:this.setConnectionState,onRetry:this.showRetryError,claimHostAuthToken:this.props.claimHostAuthToken,resetHostAuthToken:this.props.resetHostAuthToken,onHostConfigResp:this.props.onHostConfigResp})}}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(nt){this.onSessionEvent.emit(nt)}}const MEDIA_ENDPOINT="/media",UPLOAD_FILE_ENDPOINT="/_stcore/upload_file",COMPONENT_ENDPOINT_BASE="/component",FORWARD_MSG_CACHE_ENDPOINT="/_stcore/message";class DefaultStreamlitEndpoints{constructor(nt){this.getServerUri=nt.getServerUri,this.csrfEnabled=nt.csrfEnabled}buildComponentURL(nt,et){return buildHttpUri(this.requireServerUri(),`${COMPONENT_ENDPOINT_BASE}/${nt}/${et}`)}setFileUploadClientConfig({prefix:nt,headers:et}){this.fileUploadClientConfig={prefix:nt,headers:et}}buildMediaURL(nt){return nt.startsWith(MEDIA_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildFileUploadURL(nt){return this.fileUploadClientConfig?makePath(this.fileUploadClientConfig.prefix,nt):nt.startsWith(UPLOAD_FILE_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildAppPageURL(nt,et){const rt=et.urlPathname,ot=et.isDefault?"":rt;if(notNullOrUndefined(nt)&&nt.length>0)return`${nt}/${ot}`;const{port:at,protocol:st}=window.location,{basePath:ut,host:ct}=this.requireServerUri(),pt=at?`:${at}`:"",dt=ut?`${ut}/`:"";return`${st}//${ct}${pt}/${dt}${ot}`}async uploadFileUploaderFile(nt,et,rt,ot,at){const st=new FormData;st.append(et.name,et);const ut=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{cancelToken:at,method:"PUT",data:st,responseType:"text",headers:ut,onUploadProgress:ot}).then(()=>{})}getAdditionalHeaders(){let nt={};return this.fileUploadClientConfig&&(nt={...nt,...this.fileUploadClientConfig.headers}),nt}async deleteFileAtURL(nt,et){const rt=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{method:"DELETE",data:{sessionId:et},headers:rt}).then(()=>{})}async fetchCachedForwardMsg(nt){const et=this.requireServerUri(),rt=await axios.request({url:buildHttpUri(et,`${FORWARD_MSG_CACHE_ENDPOINT}?hash=${nt}`),method:"GET",responseType:"arraybuffer"});return new Uint8Array(rt.data)}requireServerUri(){const nt=this.getServerUri();if(notNullOrUndefined(nt))return this.cachedServerUri=nt,nt;if(notNullOrUndefined(this.cachedServerUri))return this.cachedServerUri;throw new Error("not connected to a server!")}csrfRequest(nt,et){if(et.url=nt,this.csrfEnabled){const rt=getCookie("_streamlit_xsrf");notNullOrUndefined(rt)&&(et.headers={"X-Xsrftoken":rt,...et.headers||{}},et.withCredentials=!0)}return axios.request(et)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(tt,nt,et,rt){if(!isObject(tt))return tt;nt=castPath$1(nt,tt);for(var ot=-1,at=nt.length,st=at-1,ut=tt;ut!=null&&++ot<at;){var ct=toKey(nt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return tt;if(ot!=st){var dt=ut[ct];pt=rt?rt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(nt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return tt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(tt,nt,et){for(var rt=-1,ot=nt.length,at={};++rt<ot;){var st=nt[rt],ut=baseGet(tt,st);et(ut,st)&&baseSet(at,castPath(st,tt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(tt,nt){return basePickBy(tt,nt,function(et,rt){return hasIn(tt,rt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(tt,nt){return tt==null?{}:basePick(tt,nt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json";class MetricsManager{constructor(nt){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=et=>{this.appHash=et},this.setMetricsConfig=(et="")=>{this.metricsUrl=et},this.sessionInfo=nt}async initialize({gatherUsageStats:nt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=nt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(logError("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),logAlways("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(nt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([nt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(nt,et))}setMetadata(nt){this.metadata=nt}async requestDefaultMetricsConfig(){const nt=localStorageAvailable();if(nt){const et=window.localStorage.getItem("stMetricsConfig");if(et){this.metricsUrl=et;return}}try{const et=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!et.ok)this.metricsUrl=void 0,logError("Failed to fetch metrics config: ",et.status);else{const rt=await et.json();this.metricsUrl=rt.url??void 0,nt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){logError("Failed to fetch metrics config:",et)}}send(nt,et={}){const rt=this.buildEventProto(nt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(nt,rt):this.track(rt)}sendPendingEvents(){this.pendingEvents.forEach(([nt,et])=>{this.send(nt,et)}),this.pendingEvents=[]}async track(nt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt.toJSON())});await fetch(et)}postMessageEvent(nt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:nt,data:et})}buildEventProto(nt,et){const rt=new MetricsEvent({event:nt,anonymousId:this.anonymousId,...this.getHostTrackingData(),...this.getInstallationData(),reportHash:this.appHash,dev:IS_DEV_ENV,source:"browser",streamlitVersion:this.sessionInfo.current.streamlitVersion,isHello:this.sessionInfo.isHello,...this.getContextData()});if(nt==="menuClick")rt.label=et.label;else if(nt==="pageProfile")return new MetricsEvent({...rt,...et});return rt}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick$1(this.metadata,["hostedAt","owner","repo","branch","mainModule","creatorId"]):{}}getContextData(){return{contextPageUrl:window.location.href,contextPageTitle:document.title,contextPagePath:window.location.pathname,contextPageReferrer:document.referrer,contextPageSearch:window.location.search,contextLocale:window.navigator.language,contextUserAgent:window.navigator.userAgent}}getAnonymousId(){if(!this.actuallySendMetrics)return;const nt="ajs_anonymous_id",et=localStorageAvailable(),rt=getCookie(nt),ot=et?window.localStorage.getItem(nt):null,at=new Date;at.setFullYear(new Date().getFullYear()+1),rt?(this.anonymousId=rt,et&&window.localStorage.setItem(nt,rt)):ot?(this.anonymousId=JSON.parse(ot),setCookie(nt,this.anonymousId,at)):(this.anonymousId=v4(),setCookie(nt,this.anonymousId,at),et&&window.localStorage.setItem(nt,this.anonymousId))}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:tt})=>{const nt=hasLightBackgroundColor(tt);return{position:"absolute",background:tt.colors.bgColor,color:tt.colors.bodyText,top:tt.spacing.none,left:tt.spacing.none,right:tt.spacing.none,bottom:tt.spacing.none,colorScheme:nt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:tt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:tt,toggleRecordAudio:nt,recordAudio:et,startRecording:rt})=>{const[ot,at]=reactExports.useState(et),st=reactExports.useCallback(ct=>{const{checked:pt}=ct.target;pt!==ot&&(at(pt),nt())},[ot,nt]),ut=reactExports.useCallback(()=>{rt(),tt()},[rt,tt]);return jsxs(Modal,{isOpen:!0,onClose:tt,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsxs(ModalBody$1,{children:[jsx$1("p",{children:"This will record a video with the contents of your screen, so you can easily share what you're seeing with others."}),jsx$1("p",{children:jsxs(StyledRecordAudioLabel,{"data-testid":"stScreencastAudioCheckbox",children:[jsx$1("input",{type:"checkbox",name:"recordAudio",checked:ot,onChange:st})," ","Also record audio"]})}),jsx$1(StyledInstruction,{"data-testid":"stScreencastInstruction",children:jsx$1(StreamlitMarkdown$1,{source:"Press `Esc` any time to stop recording.",allowHTML:!1})})]}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ut,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:tt})=>({width:tt.sizes.full,borderRadius:tt.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:tt})=>({display:"flex",flexDirection:"column",width:tt.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:tt})=>({display:"flex",flexDirection:"row",paddingTop:tt.spacing.md,paddingBottom:tt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:tt})=>({paddingRight:tt.spacing.lg,textAlign:"right",color:tt.colors.gray,fontWeight:tt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:tt})=>({flex:1,paddingRight:tt.spacing.lg,marginRight:"6em",[`@media (max-width: ${tt.breakpoints.sm})`]:{marginRight:tt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:tt})=>({marginTop:tt.spacing.sm,marginBottom:tt.spacing.none,fontSize:tt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:tt})=>({marginTop:tt.spacing.twoXS})),VideoRecordedDialog=({onClose:tt,videoBlob:nt,fileName:et})=>{const rt=URL.createObjectURL(nt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",rt),at.setAttribute("download",`${et}.webm`),at.click(),tt()};return jsxs(Modal,{isOpen:!0,onClose:tt,overrides:{Dialog:{style:{width:"80vw"}}},children:[jsx$1(ModalHeader,{children:"Next steps"}),jsx$1(ModalBody$1,{children:jsxs(StyledDialogContainer,{"data-testid":"stVideoRecordedDialog",children:[jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 1"}),jsxs(StyledSecondColumn,{children:[jsx$1("p",{children:"Preview your video below:"}),jsx$1(StyledVideo,{src:rt,controls:!0})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 2"}),jsxs(StyledSecondColumn,{children:[jsx$1(StyledDownloadButtonContainer,{children:jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:ot,children:"Save video to disk"})}),jsxs(StyledVideoFormatInstructions,{children:["This video is encoded in the"," ",jsx$1("a",{href:"https://www.webmproject.org/",children:"WebM format"}),", which is only supported by newer video players. You can also play it by dragging the file directly into your browser."]})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 3"}),jsxs(StyledSecondColumn,{children:["Share your video with the world on Twitter, LinkedIn, YouTube, or just plain email!"," ",jsx$1("span",{role:"img","aria-label":"Happy",children:"😀"})]})]})]})})]})},StyledScreenCastWarningDialog=newStyled("div",{target:"e1o5y2010"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1o5y2011"})(({theme:tt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:tt.spacing.twoXL,marginLeft:tt.spacing.sm,fontSize:tt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:tt})=>({margin:tt.spacing.none})),UnsupportedBrowserDialog=({onClose:tt})=>jsxs(Modal,{isOpen:!0,onClose:tt,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsx$1(ModalBody$1,{children:jsxs(StyledScreenCastWarningDialog,{"data-testid":"stUnsupportedBrowserDialog",children:[jsx$1(StyledUnsupportedScreenCastIcon,{children:jsx$1("span",{role:"img","aria-label":"Alien Monster",children:"👾"})}),jsx$1(StyledUnsupportedScreenCastExplanation,{children:"Due to limitations with some browsers, this feature is only supported on recent desktop versions of Chrome, Firefox, and Edge."})]})})]}),UnsupportedBrowserDialog$1=reactExports.memo(UnsupportedBrowserDialog),screencastCounterAnimation=keyframes("0%{opacity:0;}25%{opacity:1;}100%{opacity:0;}"),StyledCountdown=newStyled("div",{target:"evez3ra0"})(({theme:tt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:tt.sizes.full,height:tt.sizes.full,fontSize:"40vh",color:tt.colors.red,fontWeight:tt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${tt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:tt,endCallback:nt})=>{const[et,rt]=reactExports.useState(tt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&rt(at),at===0&&nt()},children:jsx$1("span",{children:et})},`frame${et}`)};function withScreencast(tt){const et=class et extends reactExports.PureComponent{constructor(){super(...arguments),this.state={fileName:"streamlit-screencast",recordAudio:!1,currentState:this.props.testOverride||"OFF"},this.toggleRecordAudio=()=>{const{recordAudio:ot}=this.state;this.setState({recordAudio:!ot})},this.showDialog=ot=>{const{currentState:at}=this.state;ScreenCastRecorder.isSupportedBrowser()?at==="OFF"?this.setState({fileName:ot,currentState:"SETUP"}):this.stopRecording().catch(st=>logWarning(`withScreencast.stopRecording threw an error: ${st}`)):this.setState({currentState:"UNSUPPORTED"})},this.startRecording=async()=>{const{recordAudio:ot}=this.state;this.recorder=new ScreenCastRecorder({recordAudio:ot,onErrorOrStop:()=>this.stopRecording()});try{await this.recorder.initialize()}catch{this.setState({currentState:"UNSUPPORTED"});return}this.setState({currentState:"COUNTDOWN"})},this.stopRecording=async()=>{let ot;const{currentState:at}=this.state;at==="OFF"||isNullOrUndefined$1(this.recorder)||(at==="COUNTDOWN"&&this.setState({currentState:"OFF"}),at==="RECORDING"&&(this.recorder.getState()==="inactive"?this.setState({currentState:"OFF"}):(ot=await this.recorder.stop(),this.setState({outputBlob:ot,currentState:"PREVIEW_FILE"}))))},this.onCountdownEnd=async()=>{if(isNullOrUndefined$1(this.recorder))throw new Error("Countdown finished but recorder is null");this.recorder.start()?this.setState({currentState:"RECORDING"}):this.stopRecording().catch(at=>logWarning(`withScreencast.stopRecording threw an error: ${at}`))},this.getScreenCastProps=()=>({currentState:this.state.currentState,toggleRecordAudio:this.toggleRecordAudio,startRecording:this.showDialog,stopRecording:this.stopRecording}),this.closeDialog=()=>{this.setState({currentState:"OFF"})},this.render=()=>{const{outputBlob:ot,fileName:at,recordAudio:st,currentState:ut}=this.state;return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(tt,{...this.props,screenCast:this.getScreenCastProps()}),ut==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:this.closeDialog}),ut==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:st,onClose:this.closeDialog,startRecording:this.startRecording,toggleRecordAudio:this.toggleRecordAudio}),ut==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:this.onCountdownEnd}),ut==="PREVIEW_FILE"&&ot&&jsx$1(VideoRecordedDialog,{onClose:this.closeDialog,videoBlob:ot,fileName:at})]})}}};et.displayName=`withScreencast(${tt.displayName||tt.name})`;let nt=et;return hoistNonReactStatics$2(nt,tt)}const showDevelopmentOptions=(tt,nt)=>nt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==nt||Config.ToolbarMode.MINIMAL==nt?!1:tt||isLocalhost();function getTitle(tt){return tt||"Streamlit"}class StrategyV1{constructor(nt){this.appNav=nt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(nt){var st,ut;this.appPages=nt.appPages,this.currentPageScriptHash=nt.pageScriptHash,this.hideSidebarNav=((st=nt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],rt=et.urlPathname??"",ot=((ut=this.appPages.find(ct=>ct.pageScriptHash===this.currentPageScriptHash))==null?void 0:ut.urlPathname)??"",at=et.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(rt,ot,at),document.title=getTitle(ot??""),[{hideSidebarNav:this.hideSidebarNav,appPages:this.appPages,currentPageScriptHash:this.currentPageScriptHash},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:this.appPages}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:at?"":ot,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged(nt){const{appPages:et}=nt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(nt){var ot;const{pageName:et}=nt;this.appNav.onPageNotFound(et);const rt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=rt,[{currentPageScriptHash:rt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:rt})}]}handleNavigation(nt){}findPageByUrlPath(nt){return this.appPages.length===0?null:this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(nt,et,rt){return AppRoot.empty(et,!1,rt,nt.logo)}}class StrategyV2{constructor(nt){this.appNav=nt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(nt){var et;return this.mainScriptHash=nt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=nt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(nt){}handlePageNotFound(nt){const{pageName:et}=nt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(nt){const{sections:et,position:rt,appPages:ot}=nt;this.appPages=ot,this.hideSidebarNav=rt===Navigation.Position.HIDDEN;const at=nt.pageScriptHash,st=ot.find(pt=>pt.pageScriptHash===at),ut=ot.find(pt=>pt.isDefault);this.mainPage=ut;const ct=st.urlPathname;if(!this.appNav.isPageTitleSet){const pt=getTitle(st.pageName);document.title=pt,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:st.pageName??""})}return!this.appNav.isPageIconSet&&st.icon&&this.appNav.onPageIconChange(st.icon),this.appNav.onUpdatePageUrl(ut.urlPathname??"",ct,st.isDefault??!1),[{appPages:ot,navSections:et,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:nt.expanded,currentPageScriptHash:at},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:ot}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:st.isDefault?"":ct,currentPageScriptHash:at})}]}findPageByUrlPath(nt){return this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(nt,et,rt){return nt.filterMainScriptElements(et)}}class AppNavigation{constructor(nt,et,rt,ot){this.hostCommunicationMgr=nt,this.onUpdatePageUrl=et,this.onPageNotFound=rt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(nt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(nt)}handleNavigation(nt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(nt)}handlePagesChanged(nt){return this.strategy.handlePagesChanged(nt)}handlePageNotFound(nt){return this.strategy.handlePageNotFound(nt)}findPageByUrlPath(nt){return this.strategy.findPageByUrlPath(nt)}handlePageConfigChanged(nt){this.isPageIconSet=!!nt.favicon,this.isPageTitleSet=!!nt.title}clearPageElements(nt,et,rt){return this.strategy.clearPageElements(nt,et,rt)}}const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>";class App extends reactExports.PureComponent{constructor(nt){super(nt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(rt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:rt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(rt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);rt===at.name&&ut?this.props.theme.setTheme(at):rt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=rt=>{if(logMessage(`Connection state changed from ${this.state.connectionState} to ${rt}`),rt===ConnectionState.CONNECTED){const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(this.widgetMgr.sendUpdateWidgetsMessage(void 0),this.setState({dialog:null})),this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_CONNECTED"})}else this.state.connectionState===ConnectionState.CONNECTED&&this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_DISCONNECTED",attemptingToReconnect:rt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:rt})},this.handleGitInfoChanged=rt=>{this.setState({gitInfo:rt})},this.handleCustomParentMessage=rt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:rt.message}):logError("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=rt=>{const ot=(at,st,ut)=>{const ct=at[st];if(ct in ut)return ut[ct](at[ct]);throw new Error(`Cannot handle ${st} "${ct}".`)};try{ot(rt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,rt.metadata),pageConfigChanged:at=>this.handlePageConfigChanged(at),pageInfoChanged:at=>this.handlePageInfoChanged(at),pagesChanged:at=>this.handlePagesChanged(at),pageNotFound:at=>this.handlePageNotFound(at),gitInfoChanged:at=>this.handleGitInfoChanged(at),scriptFinished:at=>this.handleScriptFinished(at),pageProfile:at=>this.handlePageProfileMsg(at),autoRerun:at=>this.handleAutoRerun(at),fileUrlsResponse:at=>this.uploadClient.onFileURLsResponse(at),parentMessage:at=>this.handleCustomParentMessage(at),logo:at=>this.handleLogo(at,rt.metadata),navigation:at=>this.handleNavigation(at),authRedirect:at=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:at.url}):window.location.href=at.url}})}catch(at){const st=ensureError(at);logError(st),this.showError("Bad message format",st.message)}},this.handleLogo=(rt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(rt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=rt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=rt;this.appNavigation.handlePageConfigChanged(rt),ot&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:ot}),document.title=ot),at&&this.onPageIconChanged(at),st!==this.state.layout&&this.setState(pt=>({layout:st,userSettings:{...pt.userSettings,wideMode:st===PageConfig.Layout.WIDE}})),ut!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ut})),this.setState({menuItems:ct})},this.handlePageInfoChanged=rt=>{const{queryString:ot}=rt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=rt=>{const ot=rt?`You have requested page /${rt}, but no corresponding file was found in the app's pages/ directory`:"The page that you have requested does not seem to exist";this.showError("Page not found",`${ot}. Running the app's main page.`)},this.handlePageNotFound=rt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(rt))},this.onPageIconChanged=rt=>{handleFavicon(rt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=rt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(rt))},this.handleNavigation=rt=>{this.maybeSetState(this.appNavigation.handleNavigation(rt))},this.handlePageProfileMsg=rt=>{var st,ut,ct;const ot=PageProfile.toObject(rt),at=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...ot,isFragmentRun:!!ot.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(st=this.state.appPages)==null?void 0:st.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ct=(ut=this.props.theme)==null?void 0:ut.activeTheme)==null?void 0:ct.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:at})},this.handleAutoRerun=rt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(rt.fragmentId,!0)},rt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=rt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,notNullOrUndefined(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!rt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=rt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(rt),rt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:rt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(rt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{basePath:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?rt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",Mt=`${ut?`/${ut}`:""}/${dt}${bt}`;window.history.pushState({},"",Mt)}}},this.handleNewSession=rt=>{const ot=rt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(rt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=rt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Mt=rt.config,mt=rt.customTheme;this.processThemeInput(mt),this.setState({allowRunOnSave:Mt.allowRunOnSave,hideTopBar:Mt.hideTopBar,toolbarMode:Mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(rt)),this.onPageIconChanged("./favicon.png")}const ht=hashString(this.sessionInfo.current.installationId+pt);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(ht),this.metricsMgr.enqueue("updateReport"),at===ht&&st===ft?this.setState({scriptRunId:ut}):this.clearAppState(ht,ut,ct,bt)},this.handleOneTimeInitialization=rt=>{const ot=rt.initialize,at=rt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(rt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:rt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===rt;isNullOrUndefined$1(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=rt=>{this.props.theme.setTheme(rt),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(rt.emotion)})},this.createThemeHash=rt=>{if(!rt)return"hash_for_undefined_custom_theme";const ot=Object.entries(rt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=rt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=rt;if(this.setState({userSettings:rt}),ot!==at&&this.isServerConnected()){const st=new BackMsg({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(rt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,rt,ot),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const at=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,at&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugShutdownRuntime:!0});rt.type="debugShutdownRuntime",this.sendBackMsg(rt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugDisconnectWebsocket:!0});rt.type="debugDisconnectWebsocket",this.sendBackMsg(rt)}},this.debugClearForwardMsgCache=()=>{var rt,ot;isLocalhost()&&((ot=(rt=this.connectionManager)==null?void 0:rt.connection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(rt=>{clearInterval(rt)}),this.setState({autoReruns:[]})},this.rerunScript=(rt=!1)=>{if(this.closeDialog(),!this.isServerConnected()){logError("Cannot rerun script when disconnected from server.");return}this.state.scriptRunState===ScriptRunState.RUNNING||this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),rt===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){logError("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg({loadGitInfo:!0}))},this.onPageChange=rt=>{const{elements:ot,mainScriptHash:at}=this.state;this.cleanupAutoReruns();const st=this.appNavigation.clearPageElements(ot,at,void 0),ut=new Set(Array.from(st.getElements()).map(ct=>getElementId(ct)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ut),void 0,rt)},this.isAppInReadyState=rt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&rt.scriptRunState===ScriptRunState.RUNNING&&rt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(rt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){logError("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{basePath:pt}=ut;let dt=this.getQueryString(),ft="";at?at!=ct&&(dt=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:dt})):ct?at=ct:(ft=extractPageNameFromPathName(document.location.pathname,pt),at=""),this.sendBackMsg(new BackMsg({rerunScript:{queryString:dt,widgetStates:rt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}})),PerformanceEvents.record({name:"RequestedRerun",scriptRunState:this.state.scriptRunState})},this.stopScript=()=>{if(!this.isServerConnected()){logError("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const rt=new BackMsg({stopScript:!0});rt.type="stopScript",this.sendBackMsg(rt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const rt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(rt)}else logError("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const rt={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((ot=this.state.dialog)==null?void 0:ot.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const rt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const rt=new BackMsg({clearCache:!0});rt.type="clearCache",this.sendBackMsg(rt)}else logError("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const rt=new BackMsg({appHeartbeat:!0});rt.type="appHeartbeat",this.sendBackMsg(rt)}else logError("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=rt=>{this.connectionManager?this.connectionManager.sendMessage(rt):logError(`Not connected. Cannot send back message: ${rt}`)},this.handleConnectionError=rt=>{this.showError("Connection error",rt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(rt=!0)=>{const ot={type:DialogType.SETTINGS,isServerConnected:this.isServerConnected(),settings:this.state.userSettings,allowRunOnSave:this.state.allowRunOnSave,onSave:this.saveSettings,onClose:()=>{},developerMode:showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),openThemeCreator:this.openThemeCreatorDialog,animateModal:rt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:rt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:rt==null?void 0:rt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:rt}=this.state;if(rt!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let ot;try{const at=getIFrameEnclosingApp(this.embeddingId);at&&at.contentWindow?ot=at.contentWindow.window:ot=window}catch{ot=window}finally{ot||(ot=window),ot.print()}},this.screencastCallback=()=>{const{scriptName:rt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${rt}-${at}`)},this.handleFullScreen=rt=>{this.setState({isFullScreen:rt})},this.setLibConfig=rt=>{this.setState({libConfig:rt})},this.setAppConfig=rt=>{this.setState({appConfig:rt})},this.addScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(rt)}))},this.removeScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,rt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:rt}=this.state,ot=rt&&rt.length>0?rt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:rt}=this.state;return rt&&(rt==null?void 0:rt.length)>0},this.showDeployButton=()=>showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&!this.isInCloudEnvironment()&&this.sessionInfo.isSet&&!this.sessionInfo.isHello,this.deployButtonClicked=()=>{this.metricsMgr.enqueue("menuClick",{label:"deployButtonInApp"}),this.sendLoadGitInfoBackMsg(),this.openDeployDialog()},this.requestFileURLs=(rt,ot)=>{if(this.isServerConnected()){const at=new BackMsg({fileUrlsRequest:{requestId:rt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=rt=>{switch(rt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=rt=>{rt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(nt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(nt.theme.activeTheme.emotion))),this.state={connectionState:ConnectionState.INITIAL,elements:AppRoot.empty("",!0),isFullScreen:!1,scriptName:"",scriptRunId:INITIAL_SCRIPT_RUN_ID,appHash:null,scriptRunState:ScriptRunState.NOT_RUNNING,userSettings:{wideMode:!1,runOnSave:!1},layout:PageConfig.Layout.CENTERED,initialSidebarState:PageConfig.SidebarState.AUTO,menuItems:void 0,allowRunOnSave:!0,scriptFinishedHandlers:[],themeHash:et,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,expandSidebarNav:!1,toolbarMode:Config.ToolbarMode.MINIMAL,latestRunTime:performance.now(),fragmentIdsThisRun:[],isOwner:!1,hostMenuItems:[],hostToolbarItems:[],hostHideSidebarNav:!1,sidebarChevronDownshift:0,pageLinkBaseUrl:"",queryParams:"",deployedAppMetadata:{},libConfig:{},appConfig:{},autoReruns:[],inputsDisabled:!1},this.connectionManager=null,this.widgetMgr=new WidgetStateManager({sendRerunBackMsg:this.sendRerunBackMsg,formsDataChanged:rt=>this.setState({formsData:rt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:nt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:rt=>{this.setState({inputsDisabled:rt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:rt=>this.setState({isOwner:rt}),fileUploadClientConfigChanged:rt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(rt)},hostMenuItemsChanged:rt=>{this.setState({hostMenuItems:rt})},hostToolbarItemsChanged:rt=>{this.setState({hostToolbarItems:rt})},hostHideSidebarNavChanged:rt=>{this.setState({hostHideSidebarNav:rt})},sidebarChevronDownshiftChanged:rt=>{this.setState({sidebarChevronDownshift:rt})},pageLinkBaseUrlChanged:rt=>{this.setState({pageLinkBaseUrl:rt})},queryParamsChanged:rt=>{this.setState({queryParams:rt})},deployedAppMetadataChanged:rt=>{this.setState({deployedAppMetadata:rt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var rt;(rt=this.connectionManager)==null||rt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:rt=>this.widgetMgr.setFormsWithUploadsInProgress(rt),requestFileURLs:this.requestFileURLs}),this.componentRegistry=new ComponentRegistry(this.endpoints),this.pendingElementsTimerRunning=!1,this.pendingElementsBuffer=this.state.elements,this.appNavigation=new AppNavigation(this.hostCommunicationMgr,this.maybeUpdatePageUrl,this.onPageNotFound,this.onPageIconChanged),window.streamlitDebug={clearForwardMsgCache:this.debugClearForwardMsgCache,disconnectWebsocket:this.debugDisconnectWebsocket,shutdownRuntime:this.debugShutdownRuntime}}initializeConnectionManager(){this.connectionManager=new ConnectionManager({sessionInfo:this.sessionInfo,endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:nt=>{const{allowedOrigins:et,useExternalAuthToken:rt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=nt,pt={allowedOrigins:et,useExternalAuthToken:rt,enableCustomParentMessages:at},dt={mapboxToken:st,disableFullscreenMode:ot,enforceDownloadInNewTab:ut};this.metricsMgr.setMetricsConfig(ct),this.hostCommunicationMgr.setAllowedOrigins(pt),this.setAppConfig(pt),this.setLibConfig(dt)}})}componentDidMount(){this.initializeConnectionManager(),mark(this.state.scriptRunState),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}),isScrollingHidden()&&document.body.classList.add("embedded"),isInChildFrame()&&(window.iFrameResizer={heightCalculationMethod:()=>{const nt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(nt).map(rt=>Math.ceil(rt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.COP9ZNW_.js").then(nt=>nt.i),[],import.meta.url)),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(this.props.theme.activeTheme.emotion)}),this.metricsMgr.enqueue("viewReport"),window.addEventListener("popstate",this.onHistoryChange,!1)}componentDidUpdate(nt,et){window.prerenderReady===!1&&this.isAppInReadyState(et)&&(window.prerenderReady=!0),this.state.scriptRunState!==et.scriptRunState&&(mark(this.state.scriptRunState),this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&measure("script-run-cycle",ScriptRunState.RUNNING,ScriptRunState.NOT_RUNNING),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}))}componentWillUnmount(){var nt;(nt=this.connectionManager)==null||nt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(nt,et){logError(et);const rt={type:DialogType.WARNING,title:nt,msg:et,onClose:()=>{}};this.openDialog(rt)}hasStreamlitVersionChanged(nt){if(this.sessionInfo.isSet){const et=this.sessionInfo.current.streamlitVersion,{environmentInfo:rt}=nt;if(notNullOrUndefined(rt)&¬NullOrUndefined(rt.streamlitVersion))return et!=rt.streamlitVersion}return!1}maybeSetState(nt){if(nt){const[et,rt]=nt;this.setState(et,rt)}}processThemeInput(nt){const et=this.createThemeHash(nt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const rt=!isPresetTheme(this.props.theme.activeTheme);if(nt){const ot=createTheme(CUSTOM_THEME_NAME,nt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||rt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),rt&&this.setAndSendTheme(getHostSpecifiedTheme())}handleScriptFinished(nt){if(nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:rt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(rt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(rt=>getElementId(rt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&nt!==ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(nt,et,rt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:rt,appHash:nt,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,ot,ut)},()=>{this.pendingElementsBuffer=this.state.elements;const ct=new Set(Array.from(this.state.elements.getElements()).map(pt=>getElementId(pt)).filter(notUndefined));this.widgetMgr.removeInactive(ct)})}openDialog(nt){this.setState({dialog:nt})}render(){const{allowRunOnSave:nt,connectionState:et,dialog:rt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,expandSidebarNav:ht,currentPageScriptHash:Mt,hostHideSidebarNav:mt,pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,hostMenuItems:yt,hostToolbarItems:vt,libConfig:At,appConfig:St,inputsDisabled:Et,appPages:Tt,navSections:Rt}=this.state,Ct=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),wt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),Lt=rt?StreamlitDialog({...rt,onClose:this.closeDialog}):null,Ht=Et||et!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:at,wideMode:dt.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,gitInfo:this.state.gitInfo,appConfig:St},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ut,setFullScreen:this.handleFullScreen,addScriptFinishedHandler:this.addScriptFinishedHandler,removeScriptFinishedHandler:this.removeScriptFinishedHandler,activeTheme:this.props.theme.activeTheme,setTheme:this.setAndSendTheme,availableThemes:this.props.theme.availableThemes,addThemes:this.props.theme.addThemes,onPageChange:this.onPageChange,currentPageScriptHash:Mt,libConfig:At,fragmentIdsThisRun:this.state.fragmentIdsThisRun,locale:window.navigator.language},children:jsx$1(ReactHotkeys,{keyName:"r,c,esc",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,children:jsxs(StyledApp,{className:wt,"data-testid":"stApp","data-test-script-state":ct==INITIAL_SCRIPT_RUN_ID?"initial":pt,"data-test-connection-state":et,children:[jsxs(Header,{children:[!ft&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:et,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:pt,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:nt}),jsx$1(ToolbarActions,{hostToolbarItems:vt,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,metricsMgr:this.metricsMgr})]}),this.showDeployButton()&&jsx$1(DeployButton,{onClick:this.deployButtonClicked.bind(this)}),jsx$1(MainMenu$1,{isServerConnected:this.isServerConnected(),quickRerunCallback:this.rerunScript,clearCacheCallback:this.openClearCacheDialog,settingsCallback:this.settingsCallback,aboutCallback:this.aboutCallback,printCallback:this.printCallback,screencastCallback:this.screencastCallback,screenCastState:this.props.screenCast.currentState,hostMenuItems:yt,developmentMode:Ct,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:st,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:ot,scriptRunId:ct,scriptRunState:pt,widgetMgr:this.widgetMgr,widgetsDisabled:Ht,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:Tt,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Mt,hideSidebarNav:bt||mt,expandSidebarNav:ht}),Lt]})})})})}}const AppWithScreencast=withScreencast(App);function useThemeManager(){const tt=getDefaultTheme(),[nt,et]=reactExports.useState(tt),[rt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(tt)?[]:[tt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==nt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,nt]),pt=reactExports.useCallback(()=>{nt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[nt.name,at,ct]),dt=reactExports.useCallback(ft=>{ft.fontFaces&&ot(ft.fontFaces);const bt=new CustomThemeConfig(ft),ht=createTheme(CUSTOM_THEME_NAME,bt);ct(ht)},[ot,ct]);return reactExports.useEffect(()=>{const ft=window.matchMedia("(prefers-color-scheme: dark)");return ft.addEventListener("change",pt),window.addEventListener("afterprint",pt),()=>{window.removeEventListener("afterprint",pt),ft.removeEventListener("change",pt)}},[nt,at,pt]),[{setTheme:ct,activeTheme:nt,addThemes:ut,availableThemes:at,setImportedTheme:dt},rt]}const ThemedApp=({streamlitExecutionStartedAt:tt})=>{const[nt,et]=useThemeManager(),{activeTheme:rt}=nt,ot=rt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:rt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreencast,{theme:nt,streamlitExecutionStartedAt:tt})]})})})},streamlitExecutionStartedAt=Date.now(),engine=new StyletronClient({prefix:"st-"});ReactDOM.render(jsx$1(Provider$1,{value:engine,children:jsx$1(ThemedApp,{streamlitExecutionStartedAt})}),document.getElementById("root"));export{convertTimeToDate as $,isNullOrUndefined$1 as A,merge$6 as B,numbro$1 as C,notNullOrUndefined as D,EmotionIconBase as E,Fragment as F,hooks as G,getTimezone as H,moment$1 as I,isIntegerType as J,isUnsignedIntegerType as K,isDurationType as L,isPeriodType as M,format as N,isBooleanType as O,PortalContext as P,_baseKeys as Q,React$1 as R,_getTag as S,isArguments_1 as T,isArray_1 as U,isArrayLike_1 as V,isBufferExports as W,_isPrototype as X,isTypedArray_1 as Y,isTimeType as Z,_extends$Q as _,range$1 as a,DEFAULT_IFRAME_SANDBOX_POLICY as a$,isDecimalType as a0,isStringType as a1,isEmptyType as a2,isDatetimeType as a3,isDateType as a4,isObjectType as a5,isBytesType as a6,isNumericType as a7,isCategoricalType as a8,isListType as a9,getGray30 as aA,getCategoricalColorsArray as aB,getDivergingColorsArray as aC,getSequentialColorsArray as aD,getBlue80 as aE,debounce$4 as aF,Global as aG,_baseMerge as aH,_createAssigner as aI,withTheme as aJ,DynamicIcon as aK,toaster as aL,Kind as aM,AlertElement as aN,_assertThisInitialized$e as aO,StyledInlineCode as aP,ErrorElement as aQ,axios as aR,Skeleton$1 as aS,Skeleton as aT,hoistNonReactStatics$2 as aU,ensureError as aV,lib$3 as aW,parseToRgba as aX,DeckGlJsonChart$1 as aY,_unsupportedIterableToArray$l as aZ,DEFAULT_IFRAME_FEATURE_POLICY as a_,isRangeIndexType as aa,useTheme as ab,Arrow$2 as ac,logError as ad,isArray$k as ae,_defineProperty$u as af,_objectWithoutProperties$o as ag,_typeof$g as ah,jsx as ai,css$2 as aj,_toConsumableArray$3 as ak,transparentize as al,convertRemToPx as am,mix$1 as an,logWarning as ao,isEqual$1 as ap,StyledTooltipContentWrapper as aq,StreamlitMarkdown$1 as ar,PLACEMENT as as,ACCESSIBILITY_TYPE as at,hasLightBackgroundColor as au,Popover$1 as av,LibContext as aw,jsxs as ax,Resizable as ay,getGray70 as az,reactDomExports as b,toPropertyKey as b$,darken as b0,BaseButtonSize as b1,BaseButtonKind as b2,BaseButtonTooltip as b3,DynamicButtonLabel as b4,IsSidebarContext as b5,Placement as b6,getGray90 as b7,getIncreasingGreen as b8,getDecreasingRed as b9,isFocusVisible as bA,getOverride as bB,getOverrideProps as bC,Checkbox$1 as bD,StyledContent as bE,StyledCheckbox$1 as bF,BaseColorPicker$1 as bG,useStyletron as bH,mergeOverride as bI,toObjectOverride as bJ,Icon$1 as bK,UIDConsumer as bL,StatefulMenu as bM,mergeOverrides as bN,ChevronDown$1 as bO,ThemeContext as bP,forkFocus as bQ,forkBlur as bR,Select as bS,without$1 as bT,fuzzyFilterSelectOptions as bU,TYPE as bV,VirtualDropdown as bW,isPresetTheme as bX,classNames as bY,UISelectbox as bZ,isValidFormId as b_,PlotlyChart$1 as ba,keysToSnakeCase as bb,WindowDimensionsContext as bc,Video$1 as bd,zip$1 as be,FileUploaderState as bf,UploadedFileInfo as bg,StyledSpinner as bh,ENABLE_PERIPHERALS_DOCS_URL as bi,Icon$2 as bj,BaseButton as bk,blend as bl,labelVisibilityProtoValueToEnum as bm,TooltipIcon as bn,WidgetLabel as bo,Tooltip as bp,styled as bq,getOverrides as br,LocaleContext as bs,ButtonGroup$1 as bt,LabelVisibilityMessage as bu,StyledWidgetLabelHelpInline as bv,themeColors as bw,isMobile_1 as bx,CAMERA_PERMISSION_URL as by,StyledWidgetLabelHelp as bz,_hasPath as c,_setPrototypeOf$e as c0,hexToRgb as c1,withWrapper as c2,StyledWidgetInstructions as c3,isFromMac as c4,CUSTOM_INPUT_TYPE as c5,SIZE$1 as c6,DeleteAlt$1 as c7,ADJOINED as c8,filterOptions as c9,ENHANCER_POSITION as ca,pick$1 as cb,Slider$2 as cc,isFromWindows as cd,__awaiter as ce,__generator as cf,__spread as cg,PropTypes as ch,ChevronLeft as ci,ChevronRight as cj,isInForm as ck,toString_1 as cl,TextInput$1 as cm,ThemeProvider$1 as cn,createThemedStyled as co,createThemedUseStyletron as cp,createThemedWithStyle as cq,expandBorderStyles as cr,withStyle as cs,getAugmentedNamespace as ct,reactIsExports$1 as cu,NumberInput$1 as cv,commonjsGlobal$1 as d,classnamesExports as e,_root as f,getDefaultExportFromCjs$1 as g,isObject_1 as h,isPropValid as i,jsx$1 as j,keyframes as k,_Set as l,_setToArray as m,newStyled as n,_SetCache as o,propTypesExports as p,_arrayIncludes as q,reactExports as r,_arrayIncludesWith as s,toNumber_1 as t,_cacheHas as u,groupBy$1 as v,__vitePreload as w,flatten$2 as x,require$$0 as y,toString$9 as z};
|
798
|
+
Event: ${nt}`)}async pingServer(){this.uriIndex=await doInitPings(this.args.baseUriPartsList,PING_MINIMUM_RETRY_PERIOD_MS,PING_MAXIMUM_RETRY_PERIOD_MS,this.args.onRetry,this.args.onHostConfigResp),this.stepFsm("SERVER_PING_SUCCEEDED")}async getSessionTokens(){var rt,ot;const nt=await this.args.claimHostAuthToken(),et=getCookie("_streamlit_xsrf");return this.args.resetHostAuthToken(),[nt??et??"PLACEHOLDER_AUTH_TOKEN",...(rt=this.args.sessionInfo.last)!=null&&rt.sessionId?[(ot=this.args.sessionInfo.last)==null?void 0:ot.sessionId]:[]]}async connectToWebSocket(){const nt=buildWsUri(this.args.baseUriPartsList[this.uriIndex],WEBSOCKET_STREAM_PATH);if(notNullOrUndefined(this.websocket))throw new Error("Websocket already exists");const et=await this.getSessionTokens();this.websocket=new WebSocket(nt,["streamlit",...et]),this.websocket.binaryType="arraybuffer",this.setConnectionTimeout(nt);const rt=this.websocket,ot=()=>rt===this.websocket;this.websocket.addEventListener("message",at=>{ot()&&this.handleMessage(at.data).catch(st=>{const ut=`Failed to process a Websocket message (${st})`;logError(LOG,ut),this.stepFsm("FATAL_ERROR",ut)})}),this.websocket.addEventListener("open",()=>{ot()&&this.stepFsm("CONNECTION_SUCCEEDED")}),this.websocket.addEventListener("close",()=>{ot()&&(this.closeConnection(),this.stepFsm("CONNECTION_CLOSED"))}),this.websocket.addEventListener("error",()=>{ot()&&(logError(LOG,"WebSocket onerror"),this.closeConnection(),this.stepFsm("CONNECTION_ERROR"))})}setConnectionTimeout(nt){if(notNullOrUndefined(this.wsConnectionTimeoutId))throw new Error("WS timeout is already set");const et=this.websocket;this.wsConnectionTimeoutId=window.setTimeout(()=>{if(et===this.websocket&&!isNullOrUndefined$1(this.wsConnectionTimeoutId)){if(isNullOrUndefined$1(this.websocket)){this.closeConnection(),this.stepFsm("FATAL_ERROR","Null Websocket in setConnectionTimeout");return}this.websocket.readyState===0&&(this.closeConnection(),this.stepFsm("CONNECTION_TIMED_OUT"))}},WEBSOCKET_TIMEOUT_MS),logMessage(LOG,`Set WS timeout ${this.wsConnectionTimeoutId}`)}closeConnection(){this.websocket&&(this.websocket.close(),this.websocket=void 0),notNullOrUndefined(this.wsConnectionTimeoutId)&&(logMessage(LOG,`Clearing WS timeout ${this.wsConnectionTimeoutId}`),window.clearTimeout(this.wsConnectionTimeoutId),this.wsConnectionTimeoutId=void 0)}sendMessage(nt){if(!this.websocket)return;const et=BackMsg.create(nt),rt=BackMsg.encode(et).finish();this.websocket.send(rt)}incrementMessageCacheRunCount(nt){this.cache.incrementRunCount(nt)}async handleMessage(nt){const et=this.nextMessageIndex;this.nextMessageIndex+=1,PerformanceEvents.record({name:"BeginHandleMessage",messageIndex:et});const rt=new Uint8Array(nt),ot=ForwardMsg.decode(rt);for(PerformanceEvents.record({name:"DecodedMessage",messageIndex:et,messageType:ot.type,len:nt.byteLength}),this.messageQueue[et]=await this.cache.processMessagePayload(ot,rt),PerformanceEvents.record({name:"GotCachedPayload",messageIndex:et});this.lastDispatchedMessageIndex+1 in this.messageQueue;){const at=this.lastDispatchedMessageIndex+1;this.args.onMessage(this.messageQueue[at]),PerformanceEvents.record({name:"DispatchedMessage",messageIndex:at,messageType:this.messageQueue[at].type}),delete this.messageQueue[at],this.lastDispatchedMessageIndex=at}}}const RETRY_COUNT_FOR_WARNING=6;class ConnectionManager{constructor(nt){this.connectionState=ConnectionState.INITIAL,this.setConnectionState=(et,rt)=>{this.connectionState!==et&&(this.connectionState=et,this.props.connectionStateChanged(et)),rt&&this.props.onConnectionError(rt)},this.showRetryError=(et,rt,ot)=>{et===RETRY_COUNT_FOR_WARNING&&this.props.onConnectionError(rt)},this.props=nt,this.connect()}isConnected(){return this.connectionState===ConnectionState.CONNECTED}getBaseUriParts(){if(this.connection instanceof WebsocketConnection)return this.connection.getBaseUriParts()}sendMessage(nt){this.connection instanceof WebsocketConnection&&this.isConnected()?this.connection.sendMessage(nt):logError(`Cannot send message when server is disconnected: ${nt}`)}incrementMessageCacheRunCount(nt){this.connection instanceof WebsocketConnection&&this.connection.incrementMessageCacheRunCount(nt)}async connect(){try{this.connection=await this.connectToRunningServer()}catch(nt){const et=ensureError(nt);logError(et.message),this.setConnectionState(ConnectionState.DISCONNECTED_FOREVER,et.message)}}disconnect(){var nt;(nt=this.connection)==null||nt.disconnect()}connectToRunningServer(){const nt=getPossibleBaseUris();return new WebsocketConnection({sessionInfo:this.props.sessionInfo,endpoints:this.props.endpoints,baseUriPartsList:nt,onMessage:this.props.onMessage,onConnectionStateChange:this.setConnectionState,onRetry:this.showRetryError,claimHostAuthToken:this.props.claimHostAuthToken,resetHostAuthToken:this.props.resetHostAuthToken,onHostConfigResp:this.props.onHostConfigResp})}}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(nt){this.onSessionEvent.emit(nt)}}const MEDIA_ENDPOINT="/media",UPLOAD_FILE_ENDPOINT="/_stcore/upload_file",COMPONENT_ENDPOINT_BASE="/component",FORWARD_MSG_CACHE_ENDPOINT="/_stcore/message";class DefaultStreamlitEndpoints{constructor(nt){this.getServerUri=nt.getServerUri,this.csrfEnabled=nt.csrfEnabled}buildComponentURL(nt,et){return buildHttpUri(this.requireServerUri(),`${COMPONENT_ENDPOINT_BASE}/${nt}/${et}`)}setFileUploadClientConfig({prefix:nt,headers:et}){this.fileUploadClientConfig={prefix:nt,headers:et}}buildMediaURL(nt){return nt.startsWith(MEDIA_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildFileUploadURL(nt){return this.fileUploadClientConfig?makePath(this.fileUploadClientConfig.prefix,nt):nt.startsWith(UPLOAD_FILE_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildAppPageURL(nt,et){const rt=et.urlPathname,ot=et.isDefault?"":rt;if(notNullOrUndefined(nt)&&nt.length>0)return`${nt}/${ot}`;const{port:at,protocol:st}=window.location,{basePath:ut,host:ct}=this.requireServerUri(),pt=at?`:${at}`:"",dt=ut?`${ut}/`:"";return`${st}//${ct}${pt}/${dt}${ot}`}async uploadFileUploaderFile(nt,et,rt,ot,at){const st=new FormData;st.append(et.name,et);const ut=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{cancelToken:at,method:"PUT",data:st,responseType:"text",headers:ut,onUploadProgress:ot}).then(()=>{})}getAdditionalHeaders(){let nt={};return this.fileUploadClientConfig&&(nt={...nt,...this.fileUploadClientConfig.headers}),nt}async deleteFileAtURL(nt,et){const rt=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{method:"DELETE",data:{sessionId:et},headers:rt}).then(()=>{})}async fetchCachedForwardMsg(nt){const et=this.requireServerUri(),rt=await axios.request({url:buildHttpUri(et,`${FORWARD_MSG_CACHE_ENDPOINT}?hash=${nt}`),method:"GET",responseType:"arraybuffer"});return new Uint8Array(rt.data)}requireServerUri(){const nt=this.getServerUri();if(notNullOrUndefined(nt))return this.cachedServerUri=nt,nt;if(notNullOrUndefined(this.cachedServerUri))return this.cachedServerUri;throw new Error("not connected to a server!")}csrfRequest(nt,et){if(et.url=nt,this.csrfEnabled){const rt=getCookie("_streamlit_xsrf");notNullOrUndefined(rt)&&(et.headers={"X-Xsrftoken":rt,...et.headers||{}},et.withCredentials=!0)}return axios.request(et)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(tt,nt,et,rt){if(!isObject(tt))return tt;nt=castPath$1(nt,tt);for(var ot=-1,at=nt.length,st=at-1,ut=tt;ut!=null&&++ot<at;){var ct=toKey(nt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return tt;if(ot!=st){var dt=ut[ct];pt=rt?rt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(nt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return tt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(tt,nt,et){for(var rt=-1,ot=nt.length,at={};++rt<ot;){var st=nt[rt],ut=baseGet(tt,st);et(ut,st)&&baseSet(at,castPath(st,tt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(tt,nt){return basePickBy(tt,nt,function(et,rt){return hasIn(tt,rt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(tt,nt){return tt==null?{}:basePick(tt,nt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json";class MetricsManager{constructor(nt){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=et=>{this.appHash=et},this.setMetricsConfig=(et="")=>{this.metricsUrl=et},this.sessionInfo=nt}async initialize({gatherUsageStats:nt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=nt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(logError("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),logAlways("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(nt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([nt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(nt,et))}setMetadata(nt){this.metadata=nt}async requestDefaultMetricsConfig(){const nt=localStorageAvailable();if(nt){const et=window.localStorage.getItem("stMetricsConfig");if(et){this.metricsUrl=et;return}}try{const et=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!et.ok)this.metricsUrl=void 0,logError("Failed to fetch metrics config: ",et.status);else{const rt=await et.json();this.metricsUrl=rt.url??void 0,nt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){logError("Failed to fetch metrics config:",et)}}send(nt,et={}){const rt=this.buildEventProto(nt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(nt,rt):this.track(rt)}sendPendingEvents(){this.pendingEvents.forEach(([nt,et])=>{this.send(nt,et)}),this.pendingEvents=[]}async track(nt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt.toJSON())});await fetch(et)}postMessageEvent(nt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:nt,data:et})}buildEventProto(nt,et){const rt=new MetricsEvent({event:nt,anonymousId:this.anonymousId,...this.getHostTrackingData(),...this.getInstallationData(),reportHash:this.appHash,dev:IS_DEV_ENV,source:"browser",streamlitVersion:this.sessionInfo.current.streamlitVersion,isHello:this.sessionInfo.isHello,...this.getContextData()});if(nt==="menuClick")rt.label=et.label;else if(nt==="pageProfile")return new MetricsEvent({...rt,...et});return rt}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick$1(this.metadata,["hostedAt","owner","repo","branch","mainModule","creatorId"]):{}}getContextData(){return{contextPageUrl:window.location.href,contextPageTitle:document.title,contextPagePath:window.location.pathname,contextPageReferrer:document.referrer,contextPageSearch:window.location.search,contextLocale:window.navigator.language,contextUserAgent:window.navigator.userAgent}}getAnonymousId(){if(!this.actuallySendMetrics)return;const nt="ajs_anonymous_id",et=localStorageAvailable(),rt=getCookie(nt),ot=et?window.localStorage.getItem(nt):null,at=new Date;at.setFullYear(new Date().getFullYear()+1),rt?(this.anonymousId=rt,et&&window.localStorage.setItem(nt,rt)):ot?(this.anonymousId=JSON.parse(ot),setCookie(nt,this.anonymousId,at)):(this.anonymousId=v4(),setCookie(nt,this.anonymousId,at),et&&window.localStorage.setItem(nt,this.anonymousId))}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:tt})=>{const nt=hasLightBackgroundColor(tt);return{position:"absolute",background:tt.colors.bgColor,color:tt.colors.bodyText,top:tt.spacing.none,left:tt.spacing.none,right:tt.spacing.none,bottom:tt.spacing.none,colorScheme:nt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:tt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:tt,toggleRecordAudio:nt,recordAudio:et,startRecording:rt})=>{const[ot,at]=reactExports.useState(et),st=reactExports.useCallback(ct=>{const{checked:pt}=ct.target;pt!==ot&&(at(pt),nt())},[ot,nt]),ut=reactExports.useCallback(()=>{rt(),tt()},[rt,tt]);return jsxs(Modal,{isOpen:!0,onClose:tt,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsxs(ModalBody$1,{children:[jsx$1("p",{children:"This will record a video with the contents of your screen, so you can easily share what you're seeing with others."}),jsx$1("p",{children:jsxs(StyledRecordAudioLabel,{"data-testid":"stScreencastAudioCheckbox",children:[jsx$1("input",{type:"checkbox",name:"recordAudio",checked:ot,onChange:st})," ","Also record audio"]})}),jsx$1(StyledInstruction,{"data-testid":"stScreencastInstruction",children:jsx$1(StreamlitMarkdown$1,{source:"Press `Esc` any time to stop recording.",allowHTML:!1})})]}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ut,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:tt})=>({width:tt.sizes.full,borderRadius:tt.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:tt})=>({display:"flex",flexDirection:"column",width:tt.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:tt})=>({display:"flex",flexDirection:"row",paddingTop:tt.spacing.md,paddingBottom:tt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:tt})=>({paddingRight:tt.spacing.lg,textAlign:"right",color:tt.colors.gray,fontWeight:tt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:tt})=>({flex:1,paddingRight:tt.spacing.lg,marginRight:"6em",[`@media (max-width: ${tt.breakpoints.sm})`]:{marginRight:tt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:tt})=>({marginTop:tt.spacing.sm,marginBottom:tt.spacing.none,fontSize:tt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:tt})=>({marginTop:tt.spacing.twoXS})),VideoRecordedDialog=({onClose:tt,videoBlob:nt,fileName:et})=>{const rt=URL.createObjectURL(nt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",rt),at.setAttribute("download",`${et}.webm`),at.click(),tt()};return jsxs(Modal,{isOpen:!0,onClose:tt,overrides:{Dialog:{style:{width:"80vw"}}},children:[jsx$1(ModalHeader,{children:"Next steps"}),jsx$1(ModalBody$1,{children:jsxs(StyledDialogContainer,{"data-testid":"stVideoRecordedDialog",children:[jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 1"}),jsxs(StyledSecondColumn,{children:[jsx$1("p",{children:"Preview your video below:"}),jsx$1(StyledVideo,{src:rt,controls:!0})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 2"}),jsxs(StyledSecondColumn,{children:[jsx$1(StyledDownloadButtonContainer,{children:jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:ot,children:"Save video to disk"})}),jsxs(StyledVideoFormatInstructions,{children:["This video is encoded in the"," ",jsx$1("a",{href:"https://www.webmproject.org/",children:"WebM format"}),", which is only supported by newer video players. You can also play it by dragging the file directly into your browser."]})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 3"}),jsxs(StyledSecondColumn,{children:["Share your video with the world on Twitter, LinkedIn, YouTube, or just plain email!"," ",jsx$1("span",{role:"img","aria-label":"Happy",children:"😀"})]})]})]})})]})},StyledScreenCastWarningDialog=newStyled("div",{target:"e1o5y2010"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1o5y2011"})(({theme:tt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:tt.spacing.twoXL,marginLeft:tt.spacing.sm,fontSize:tt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:tt})=>({margin:tt.spacing.none})),UnsupportedBrowserDialog=({onClose:tt})=>jsxs(Modal,{isOpen:!0,onClose:tt,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsx$1(ModalBody$1,{children:jsxs(StyledScreenCastWarningDialog,{"data-testid":"stUnsupportedBrowserDialog",children:[jsx$1(StyledUnsupportedScreenCastIcon,{children:jsx$1("span",{role:"img","aria-label":"Alien Monster",children:"👾"})}),jsx$1(StyledUnsupportedScreenCastExplanation,{children:"Due to limitations with some browsers, this feature is only supported on recent desktop versions of Chrome, Firefox, and Edge."})]})})]}),UnsupportedBrowserDialog$1=reactExports.memo(UnsupportedBrowserDialog),screencastCounterAnimation=keyframes("0%{opacity:0;}25%{opacity:1;}100%{opacity:0;}"),StyledCountdown=newStyled("div",{target:"evez3ra0"})(({theme:tt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:tt.sizes.full,height:tt.sizes.full,fontSize:"40vh",color:tt.colors.red,fontWeight:tt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${tt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:tt,endCallback:nt})=>{const[et,rt]=reactExports.useState(tt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&rt(at),at===0&&nt()},children:jsx$1("span",{children:et})},`frame${et}`)};function withScreencast(tt){const et=class et extends reactExports.PureComponent{constructor(){super(...arguments),this.state={fileName:"streamlit-screencast",recordAudio:!1,currentState:this.props.testOverride||"OFF"},this.toggleRecordAudio=()=>{const{recordAudio:ot}=this.state;this.setState({recordAudio:!ot})},this.showDialog=ot=>{const{currentState:at}=this.state;ScreenCastRecorder.isSupportedBrowser()?at==="OFF"?this.setState({fileName:ot,currentState:"SETUP"}):this.stopRecording().catch(st=>logWarning(`withScreencast.stopRecording threw an error: ${st}`)):this.setState({currentState:"UNSUPPORTED"})},this.startRecording=async()=>{const{recordAudio:ot}=this.state;this.recorder=new ScreenCastRecorder({recordAudio:ot,onErrorOrStop:()=>this.stopRecording()});try{await this.recorder.initialize()}catch{this.setState({currentState:"UNSUPPORTED"});return}this.setState({currentState:"COUNTDOWN"})},this.stopRecording=async()=>{let ot;const{currentState:at}=this.state;at==="OFF"||isNullOrUndefined$1(this.recorder)||(at==="COUNTDOWN"&&this.setState({currentState:"OFF"}),at==="RECORDING"&&(this.recorder.getState()==="inactive"?this.setState({currentState:"OFF"}):(ot=await this.recorder.stop(),this.setState({outputBlob:ot,currentState:"PREVIEW_FILE"}))))},this.onCountdownEnd=async()=>{if(isNullOrUndefined$1(this.recorder))throw new Error("Countdown finished but recorder is null");this.recorder.start()?this.setState({currentState:"RECORDING"}):this.stopRecording().catch(at=>logWarning(`withScreencast.stopRecording threw an error: ${at}`))},this.getScreenCastProps=()=>({currentState:this.state.currentState,toggleRecordAudio:this.toggleRecordAudio,startRecording:this.showDialog,stopRecording:this.stopRecording}),this.closeDialog=()=>{this.setState({currentState:"OFF"})},this.render=()=>{const{outputBlob:ot,fileName:at,recordAudio:st,currentState:ut}=this.state;return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(tt,{...this.props,screenCast:this.getScreenCastProps()}),ut==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:this.closeDialog}),ut==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:st,onClose:this.closeDialog,startRecording:this.startRecording,toggleRecordAudio:this.toggleRecordAudio}),ut==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:this.onCountdownEnd}),ut==="PREVIEW_FILE"&&ot&&jsx$1(VideoRecordedDialog,{onClose:this.closeDialog,videoBlob:ot,fileName:at})]})}}};et.displayName=`withScreencast(${tt.displayName||tt.name})`;let nt=et;return hoistNonReactStatics$2(nt,tt)}const showDevelopmentOptions=(tt,nt)=>nt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==nt||Config.ToolbarMode.MINIMAL==nt?!1:tt||isLocalhost();function getTitle(tt){return tt||"Streamlit"}class StrategyV1{constructor(nt){this.appNav=nt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(nt){var st,ut;this.appPages=nt.appPages,this.currentPageScriptHash=nt.pageScriptHash,this.hideSidebarNav=((st=nt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],rt=et.urlPathname??"",ot=((ut=this.appPages.find(ct=>ct.pageScriptHash===this.currentPageScriptHash))==null?void 0:ut.urlPathname)??"",at=et.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(rt,ot,at),document.title=getTitle(ot??""),[{hideSidebarNav:this.hideSidebarNav,appPages:this.appPages,currentPageScriptHash:this.currentPageScriptHash},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:this.appPages}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:at?"":ot,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged(nt){const{appPages:et}=nt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(nt){var ot;const{pageName:et}=nt;this.appNav.onPageNotFound(et);const rt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=rt,[{currentPageScriptHash:rt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:rt})}]}handleNavigation(nt){}findPageByUrlPath(nt){return this.appPages.length===0?null:this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(nt,et,rt){return AppRoot.empty(et,!1,rt,nt.logo)}}class StrategyV2{constructor(nt){this.appNav=nt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(nt){var et;return this.mainScriptHash=nt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=nt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(nt){}handlePageNotFound(nt){const{pageName:et}=nt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(nt){const{sections:et,position:rt,appPages:ot}=nt;this.appPages=ot,this.hideSidebarNav=rt===Navigation.Position.HIDDEN;const at=nt.pageScriptHash,st=ot.find(pt=>pt.pageScriptHash===at),ut=ot.find(pt=>pt.isDefault);this.mainPage=ut;const ct=st.urlPathname;if(!this.appNav.isPageTitleSet){const pt=getTitle(st.pageName);document.title=pt,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:st.pageName??""})}return!this.appNav.isPageIconSet&&st.icon&&this.appNav.onPageIconChange(st.icon),this.appNav.onUpdatePageUrl(ut.urlPathname??"",ct,st.isDefault??!1),[{appPages:ot,navSections:et,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:nt.expanded,currentPageScriptHash:at},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:ot}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:st.isDefault?"":ct,currentPageScriptHash:at})}]}findPageByUrlPath(nt){return this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(nt,et,rt){return nt.filterMainScriptElements(et)}}class AppNavigation{constructor(nt,et,rt,ot){this.hostCommunicationMgr=nt,this.onUpdatePageUrl=et,this.onPageNotFound=rt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(nt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(nt)}handleNavigation(nt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(nt)}handlePagesChanged(nt){return this.strategy.handlePagesChanged(nt)}handlePageNotFound(nt){return this.strategy.handlePageNotFound(nt)}findPageByUrlPath(nt){return this.strategy.findPageByUrlPath(nt)}handlePageConfigChanged(nt){this.isPageIconSet=!!nt.favicon,this.isPageTitleSet=!!nt.title}clearPageElements(nt,et,rt){return this.strategy.clearPageElements(nt,et,rt)}}const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>";class App extends reactExports.PureComponent{constructor(nt){super(nt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(rt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:rt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(rt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);rt===at.name&&ut?this.props.theme.setTheme(at):rt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=rt=>{if(logMessage(`Connection state changed from ${this.state.connectionState} to ${rt}`),rt===ConnectionState.CONNECTED){const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(this.widgetMgr.sendUpdateWidgetsMessage(void 0),this.setState({dialog:null})),this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_CONNECTED"})}else this.state.connectionState===ConnectionState.CONNECTED&&this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_DISCONNECTED",attemptingToReconnect:rt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:rt})},this.handleGitInfoChanged=rt=>{this.setState({gitInfo:rt})},this.handleCustomParentMessage=rt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:rt.message}):logError("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=rt=>{const ot=(at,st,ut)=>{const ct=at[st];if(ct in ut)return ut[ct](at[ct]);throw new Error(`Cannot handle ${st} "${ct}".`)};try{ot(rt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,rt.metadata),pageConfigChanged:at=>this.handlePageConfigChanged(at),pageInfoChanged:at=>this.handlePageInfoChanged(at),pagesChanged:at=>this.handlePagesChanged(at),pageNotFound:at=>this.handlePageNotFound(at),gitInfoChanged:at=>this.handleGitInfoChanged(at),scriptFinished:at=>this.handleScriptFinished(at),pageProfile:at=>this.handlePageProfileMsg(at),autoRerun:at=>this.handleAutoRerun(at),fileUrlsResponse:at=>this.uploadClient.onFileURLsResponse(at),parentMessage:at=>this.handleCustomParentMessage(at),logo:at=>this.handleLogo(at,rt.metadata),navigation:at=>this.handleNavigation(at),authRedirect:at=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:at.url}):window.location.href=at.url}})}catch(at){const st=ensureError(at);logError(st),this.showError("Bad message format",st.message)}},this.handleLogo=(rt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(rt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=rt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=rt;this.appNavigation.handlePageConfigChanged(rt),ot&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:ot}),document.title=ot),at&&this.onPageIconChanged(at),st!==this.state.layout&&this.setState(pt=>({layout:st,userSettings:{...pt.userSettings,wideMode:st===PageConfig.Layout.WIDE}})),ut!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ut})),this.setState({menuItems:ct})},this.handlePageInfoChanged=rt=>{const{queryString:ot}=rt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=rt=>{const ot=rt?`You have requested page /${rt}, but no corresponding file was found in the app's pages/ directory`:"The page that you have requested does not seem to exist";this.showError("Page not found",`${ot}. Running the app's main page.`)},this.handlePageNotFound=rt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(rt))},this.onPageIconChanged=rt=>{handleFavicon(rt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=rt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(rt))},this.handleNavigation=rt=>{this.maybeSetState(this.appNavigation.handleNavigation(rt))},this.handlePageProfileMsg=rt=>{var st,ut,ct;const ot=PageProfile.toObject(rt),at=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...ot,isFragmentRun:!!ot.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(st=this.state.appPages)==null?void 0:st.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ct=(ut=this.props.theme)==null?void 0:ut.activeTheme)==null?void 0:ct.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:at})},this.handleAutoRerun=rt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(rt.fragmentId,!0)},rt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=rt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,notNullOrUndefined(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!rt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=rt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(rt),rt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:rt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(rt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{basePath:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?rt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",Mt=`${ut?`/${ut}`:""}/${dt}${bt}`;window.history.pushState({},"",Mt)}}},this.handleNewSession=rt=>{const ot=rt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(rt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=rt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Mt=rt.config,mt=rt.customTheme;this.processThemeInput(mt),this.setState({allowRunOnSave:Mt.allowRunOnSave,hideTopBar:Mt.hideTopBar,toolbarMode:Mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(rt)),this.onPageIconChanged("./favicon.png")}const ht=hashString(this.sessionInfo.current.installationId+pt);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(ht),this.metricsMgr.enqueue("updateReport"),at===ht&&st===ft?this.setState({scriptRunId:ut}):this.clearAppState(ht,ut,ct,bt)},this.handleOneTimeInitialization=rt=>{const ot=rt.initialize,at=rt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(rt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:rt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===rt;isNullOrUndefined$1(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=rt=>{this.props.theme.setTheme(rt),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(rt.emotion)})},this.createThemeHash=rt=>{if(!rt)return"hash_for_undefined_custom_theme";const ot=Object.entries(rt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=rt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=rt;if(this.setState({userSettings:rt}),ot!==at&&this.isServerConnected()){const st=new BackMsg({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(rt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,rt,ot),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const at=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,at&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugShutdownRuntime:!0});rt.type="debugShutdownRuntime",this.sendBackMsg(rt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugDisconnectWebsocket:!0});rt.type="debugDisconnectWebsocket",this.sendBackMsg(rt)}},this.debugClearForwardMsgCache=()=>{var rt,ot;isLocalhost()&&((ot=(rt=this.connectionManager)==null?void 0:rt.connection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(rt=>{clearInterval(rt)}),this.setState({autoReruns:[]})},this.rerunScript=(rt=!1)=>{if(this.closeDialog(),!this.isServerConnected()){logError("Cannot rerun script when disconnected from server.");return}this.state.scriptRunState===ScriptRunState.RUNNING||this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),rt===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){logError("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg({loadGitInfo:!0}))},this.onPageChange=rt=>{const{elements:ot,mainScriptHash:at}=this.state;this.cleanupAutoReruns();const st=this.appNavigation.clearPageElements(ot,at,void 0),ut=new Set(Array.from(st.getElements()).map(ct=>getElementId(ct)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ut),void 0,rt)},this.isAppInReadyState=rt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&rt.scriptRunState===ScriptRunState.RUNNING&&rt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(rt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){logError("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{basePath:pt}=ut;let dt=this.getQueryString(),ft="";at?at!=ct&&(dt=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:dt})):ct?at=ct:(ft=extractPageNameFromPathName(document.location.pathname,pt),at=""),this.sendBackMsg(new BackMsg({rerunScript:{queryString:dt,widgetStates:rt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}})),PerformanceEvents.record({name:"RequestedRerun",scriptRunState:this.state.scriptRunState})},this.stopScript=()=>{if(!this.isServerConnected()){logError("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const rt=new BackMsg({stopScript:!0});rt.type="stopScript",this.sendBackMsg(rt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const rt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(rt)}else logError("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const rt={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((ot=this.state.dialog)==null?void 0:ot.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const rt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const rt=new BackMsg({clearCache:!0});rt.type="clearCache",this.sendBackMsg(rt)}else logError("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const rt=new BackMsg({appHeartbeat:!0});rt.type="appHeartbeat",this.sendBackMsg(rt)}else logError("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=rt=>{this.connectionManager?this.connectionManager.sendMessage(rt):logError(`Not connected. Cannot send back message: ${rt}`)},this.handleConnectionError=rt=>{this.showError("Connection error",rt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(rt=!0)=>{const ot={type:DialogType.SETTINGS,isServerConnected:this.isServerConnected(),settings:this.state.userSettings,allowRunOnSave:this.state.allowRunOnSave,onSave:this.saveSettings,onClose:()=>{},developerMode:showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),openThemeCreator:this.openThemeCreatorDialog,animateModal:rt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:rt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:rt==null?void 0:rt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:rt}=this.state;if(rt!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let ot;try{const at=getIFrameEnclosingApp(this.embeddingId);at&&at.contentWindow?ot=at.contentWindow.window:ot=window}catch{ot=window}finally{ot||(ot=window),ot.print()}},this.screencastCallback=()=>{const{scriptName:rt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${rt}-${at}`)},this.handleFullScreen=rt=>{this.setState({isFullScreen:rt})},this.setLibConfig=rt=>{this.setState({libConfig:rt})},this.setAppConfig=rt=>{this.setState({appConfig:rt})},this.addScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(rt)}))},this.removeScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,rt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:rt}=this.state,ot=rt&&rt.length>0?rt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:rt}=this.state;return rt&&(rt==null?void 0:rt.length)>0},this.showDeployButton=()=>showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&!this.isInCloudEnvironment()&&this.sessionInfo.isSet&&!this.sessionInfo.isHello,this.deployButtonClicked=()=>{this.metricsMgr.enqueue("menuClick",{label:"deployButtonInApp"}),this.sendLoadGitInfoBackMsg(),this.openDeployDialog()},this.requestFileURLs=(rt,ot)=>{if(this.isServerConnected()){const at=new BackMsg({fileUrlsRequest:{requestId:rt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=rt=>{switch(rt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=rt=>{rt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(nt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(nt.theme.activeTheme.emotion))),this.state={connectionState:ConnectionState.INITIAL,elements:AppRoot.empty("",!0),isFullScreen:!1,scriptName:"",scriptRunId:INITIAL_SCRIPT_RUN_ID,appHash:null,scriptRunState:ScriptRunState.NOT_RUNNING,userSettings:{wideMode:!1,runOnSave:!1},layout:PageConfig.Layout.CENTERED,initialSidebarState:PageConfig.SidebarState.AUTO,menuItems:void 0,allowRunOnSave:!0,scriptFinishedHandlers:[],themeHash:et,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,expandSidebarNav:!1,toolbarMode:Config.ToolbarMode.MINIMAL,latestRunTime:performance.now(),fragmentIdsThisRun:[],isOwner:!1,hostMenuItems:[],hostToolbarItems:[],hostHideSidebarNav:!1,sidebarChevronDownshift:0,pageLinkBaseUrl:"",queryParams:"",deployedAppMetadata:{},libConfig:{},appConfig:{},autoReruns:[],inputsDisabled:!1},this.connectionManager=null,this.widgetMgr=new WidgetStateManager({sendRerunBackMsg:this.sendRerunBackMsg,formsDataChanged:rt=>this.setState({formsData:rt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:nt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:rt=>{this.setState({inputsDisabled:rt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:rt=>this.setState({isOwner:rt}),fileUploadClientConfigChanged:rt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(rt)},hostMenuItemsChanged:rt=>{this.setState({hostMenuItems:rt})},hostToolbarItemsChanged:rt=>{this.setState({hostToolbarItems:rt})},hostHideSidebarNavChanged:rt=>{this.setState({hostHideSidebarNav:rt})},sidebarChevronDownshiftChanged:rt=>{this.setState({sidebarChevronDownshift:rt})},pageLinkBaseUrlChanged:rt=>{this.setState({pageLinkBaseUrl:rt})},queryParamsChanged:rt=>{this.setState({queryParams:rt})},deployedAppMetadataChanged:rt=>{this.setState({deployedAppMetadata:rt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var rt;(rt=this.connectionManager)==null||rt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:rt=>this.widgetMgr.setFormsWithUploadsInProgress(rt),requestFileURLs:this.requestFileURLs}),this.componentRegistry=new ComponentRegistry(this.endpoints),this.pendingElementsTimerRunning=!1,this.pendingElementsBuffer=this.state.elements,this.appNavigation=new AppNavigation(this.hostCommunicationMgr,this.maybeUpdatePageUrl,this.onPageNotFound,this.onPageIconChanged),window.streamlitDebug={clearForwardMsgCache:this.debugClearForwardMsgCache,disconnectWebsocket:this.debugDisconnectWebsocket,shutdownRuntime:this.debugShutdownRuntime}}initializeConnectionManager(){this.connectionManager=new ConnectionManager({sessionInfo:this.sessionInfo,endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:nt=>{const{allowedOrigins:et,useExternalAuthToken:rt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=nt,pt={allowedOrigins:et,useExternalAuthToken:rt,enableCustomParentMessages:at},dt={mapboxToken:st,disableFullscreenMode:ot,enforceDownloadInNewTab:ut};this.metricsMgr.setMetricsConfig(ct),this.hostCommunicationMgr.setAllowedOrigins(pt),this.setAppConfig(pt),this.setLibConfig(dt)}})}componentDidMount(){this.initializeConnectionManager(),mark(this.state.scriptRunState),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}),isScrollingHidden()&&document.body.classList.add("embedded"),isInChildFrame()&&(window.iFrameResizer={heightCalculationMethod:()=>{const nt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(nt).map(rt=>Math.ceil(rt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.DzzdqD8t.js").then(nt=>nt.i),[],import.meta.url)),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(this.props.theme.activeTheme.emotion)}),this.metricsMgr.enqueue("viewReport"),window.addEventListener("popstate",this.onHistoryChange,!1)}componentDidUpdate(nt,et){window.prerenderReady===!1&&this.isAppInReadyState(et)&&(window.prerenderReady=!0),this.state.scriptRunState!==et.scriptRunState&&(mark(this.state.scriptRunState),this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&measure("script-run-cycle",ScriptRunState.RUNNING,ScriptRunState.NOT_RUNNING),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}))}componentWillUnmount(){var nt;(nt=this.connectionManager)==null||nt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(nt,et){logError(et);const rt={type:DialogType.WARNING,title:nt,msg:et,onClose:()=>{}};this.openDialog(rt)}hasStreamlitVersionChanged(nt){if(this.sessionInfo.isSet){const et=this.sessionInfo.current.streamlitVersion,{environmentInfo:rt}=nt;if(notNullOrUndefined(rt)&¬NullOrUndefined(rt.streamlitVersion))return et!=rt.streamlitVersion}return!1}maybeSetState(nt){if(nt){const[et,rt]=nt;this.setState(et,rt)}}processThemeInput(nt){const et=this.createThemeHash(nt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const rt=!isPresetTheme(this.props.theme.activeTheme);if(nt){const ot=createTheme(CUSTOM_THEME_NAME,nt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||rt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),rt&&this.setAndSendTheme(getHostSpecifiedTheme())}handleScriptFinished(nt){if(nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:rt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(rt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(rt=>getElementId(rt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&nt!==ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(nt,et,rt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:rt,appHash:nt,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,ot,ut)},()=>{this.pendingElementsBuffer=this.state.elements;const ct=new Set(Array.from(this.state.elements.getElements()).map(pt=>getElementId(pt)).filter(notUndefined));this.widgetMgr.removeInactive(ct)})}openDialog(nt){this.setState({dialog:nt})}render(){const{allowRunOnSave:nt,connectionState:et,dialog:rt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,expandSidebarNav:ht,currentPageScriptHash:Mt,hostHideSidebarNav:mt,pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,hostMenuItems:yt,hostToolbarItems:vt,libConfig:At,appConfig:St,inputsDisabled:Et,appPages:Tt,navSections:Rt}=this.state,Ct=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),wt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),Lt=rt?StreamlitDialog({...rt,onClose:this.closeDialog}):null,Ht=Et||et!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:at,wideMode:dt.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,gitInfo:this.state.gitInfo,appConfig:St},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ut,setFullScreen:this.handleFullScreen,addScriptFinishedHandler:this.addScriptFinishedHandler,removeScriptFinishedHandler:this.removeScriptFinishedHandler,activeTheme:this.props.theme.activeTheme,setTheme:this.setAndSendTheme,availableThemes:this.props.theme.availableThemes,addThemes:this.props.theme.addThemes,onPageChange:this.onPageChange,currentPageScriptHash:Mt,libConfig:At,fragmentIdsThisRun:this.state.fragmentIdsThisRun,locale:window.navigator.language},children:jsx$1(ReactHotkeys,{keyName:"r,c,esc",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,children:jsxs(StyledApp,{className:wt,"data-testid":"stApp","data-test-script-state":ct==INITIAL_SCRIPT_RUN_ID?"initial":pt,"data-test-connection-state":et,children:[jsxs(Header,{children:[!ft&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:et,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:pt,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:nt}),jsx$1(ToolbarActions,{hostToolbarItems:vt,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,metricsMgr:this.metricsMgr})]}),this.showDeployButton()&&jsx$1(DeployButton,{onClick:this.deployButtonClicked.bind(this)}),jsx$1(MainMenu$1,{isServerConnected:this.isServerConnected(),quickRerunCallback:this.rerunScript,clearCacheCallback:this.openClearCacheDialog,settingsCallback:this.settingsCallback,aboutCallback:this.aboutCallback,printCallback:this.printCallback,screencastCallback:this.screencastCallback,screenCastState:this.props.screenCast.currentState,hostMenuItems:yt,developmentMode:Ct,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:st,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:ot,scriptRunId:ct,scriptRunState:pt,widgetMgr:this.widgetMgr,widgetsDisabled:Ht,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:Tt,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Mt,hideSidebarNav:bt||mt,expandSidebarNav:ht}),Lt]})})})})}}const AppWithScreencast=withScreencast(App);function useThemeManager(){const tt=getDefaultTheme(),[nt,et]=reactExports.useState(tt),[rt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(tt)?[]:[tt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==nt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,nt]),pt=reactExports.useCallback(()=>{nt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[nt.name,at,ct]),dt=reactExports.useCallback(ft=>{ft.fontFaces&&ot(ft.fontFaces);const bt=new CustomThemeConfig(ft),ht=createTheme(CUSTOM_THEME_NAME,bt);ct(ht)},[ot,ct]);return reactExports.useEffect(()=>{const ft=window.matchMedia("(prefers-color-scheme: dark)");return ft.addEventListener("change",pt),window.addEventListener("afterprint",pt),()=>{window.removeEventListener("afterprint",pt),ft.removeEventListener("change",pt)}},[nt,at,pt]),[{setTheme:ct,activeTheme:nt,addThemes:ut,availableThemes:at,setImportedTheme:dt},rt]}const ThemedApp=({streamlitExecutionStartedAt:tt})=>{const[nt,et]=useThemeManager(),{activeTheme:rt}=nt,ot=rt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:rt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreencast,{theme:nt,streamlitExecutionStartedAt:tt})]})})})},streamlitExecutionStartedAt=Date.now(),engine=new StyletronClient({prefix:"st-"});ReactDOM.render(jsx$1(Provider$1,{value:engine,children:jsx$1(ThemedApp,{streamlitExecutionStartedAt})}),document.getElementById("root"));export{convertTimeToDate as $,isNullOrUndefined$1 as A,merge$6 as B,numbro$1 as C,notNullOrUndefined as D,EmotionIconBase as E,Fragment as F,hooks as G,getTimezone as H,moment$1 as I,isIntegerType as J,isUnsignedIntegerType as K,isDurationType as L,isPeriodType as M,format as N,isBooleanType as O,PortalContext as P,_baseKeys as Q,React$1 as R,_getTag as S,isArguments_1 as T,isArray_1 as U,isArrayLike_1 as V,isBufferExports as W,_isPrototype as X,isTypedArray_1 as Y,isTimeType as Z,_extends$Q as _,range$1 as a,DEFAULT_IFRAME_FEATURE_POLICY as a$,isDecimalType as a0,isStringType as a1,isEmptyType as a2,isDatetimeType as a3,isDateType as a4,isObjectType as a5,isBytesType as a6,isNumericType as a7,isCategoricalType as a8,isListType as a9,getGray70 as aA,getGray30 as aB,getCategoricalColorsArray as aC,getDivergingColorsArray as aD,getSequentialColorsArray as aE,getBlue80 as aF,debounce$4 as aG,Global as aH,_baseMerge as aI,_createAssigner as aJ,withTheme as aK,DynamicIcon as aL,toaster as aM,Kind as aN,AlertElement as aO,_assertThisInitialized$e as aP,StyledInlineCode as aQ,ErrorElement as aR,axios as aS,Skeleton$1 as aT,Skeleton as aU,hoistNonReactStatics$2 as aV,ensureError as aW,lib$3 as aX,parseToRgba as aY,DeckGlJsonChart$1 as aZ,_unsupportedIterableToArray$l as a_,isRangeIndexType as aa,useTheme as ab,Arrow$2 as ac,logError as ad,isArray$k as ae,_defineProperty$u as af,_objectWithoutProperties$o as ag,_typeof$g as ah,jsx as ai,css$2 as aj,_toConsumableArray$3 as ak,transparentize as al,convertRemToPx as am,mix$1 as an,logWarning as ao,getStyledCell as ap,isEqual$1 as aq,StyledTooltipContentWrapper as ar,StreamlitMarkdown$1 as as,PLACEMENT as at,ACCESSIBILITY_TYPE as au,hasLightBackgroundColor as av,Popover$1 as aw,LibContext as ax,jsxs as ay,Resizable as az,reactDomExports as b,isValidFormId as b$,DEFAULT_IFRAME_SANDBOX_POLICY as b0,darken as b1,BaseButtonSize as b2,BaseButtonKind as b3,BaseButtonTooltip as b4,DynamicButtonLabel as b5,IsSidebarContext as b6,Placement as b7,getGray90 as b8,getIncreasingGreen as b9,StyledWidgetLabelHelp as bA,isFocusVisible as bB,getOverride as bC,getOverrideProps as bD,Checkbox$1 as bE,StyledContent as bF,StyledCheckbox$1 as bG,BaseColorPicker$1 as bH,useStyletron as bI,mergeOverride as bJ,toObjectOverride as bK,Icon$1 as bL,UIDConsumer as bM,StatefulMenu as bN,mergeOverrides as bO,ChevronDown$1 as bP,ThemeContext as bQ,forkFocus as bR,forkBlur as bS,Select as bT,without$1 as bU,fuzzyFilterSelectOptions as bV,TYPE as bW,VirtualDropdown as bX,isPresetTheme as bY,classNames as bZ,UISelectbox as b_,getDecreasingRed as ba,PlotlyChart$1 as bb,keysToSnakeCase as bc,WindowDimensionsContext as bd,Video$1 as be,zip$1 as bf,FileUploaderState as bg,UploadedFileInfo as bh,StyledSpinner as bi,ENABLE_PERIPHERALS_DOCS_URL as bj,Icon$2 as bk,BaseButton as bl,blend as bm,labelVisibilityProtoValueToEnum as bn,TooltipIcon as bo,WidgetLabel as bp,Tooltip as bq,styled as br,getOverrides as bs,LocaleContext as bt,ButtonGroup$1 as bu,LabelVisibilityMessage as bv,StyledWidgetLabelHelpInline as bw,themeColors as bx,isMobile_1 as by,CAMERA_PERMISSION_URL as bz,_hasPath as c,toPropertyKey as c0,_setPrototypeOf$e as c1,hexToRgb as c2,withWrapper as c3,StyledWidgetInstructions as c4,isFromMac as c5,CUSTOM_INPUT_TYPE as c6,SIZE$1 as c7,DeleteAlt$1 as c8,ADJOINED as c9,filterOptions as ca,ENHANCER_POSITION as cb,pick$1 as cc,Slider$2 as cd,isFromWindows as ce,__awaiter as cf,__generator as cg,__spread as ch,PropTypes as ci,ChevronLeft as cj,ChevronRight as ck,isInForm as cl,toString_1 as cm,TextInput$1 as cn,ThemeProvider$1 as co,createThemedStyled as cp,createThemedUseStyletron as cq,createThemedWithStyle as cr,expandBorderStyles as cs,withStyle as ct,getAugmentedNamespace as cu,reactIsExports$1 as cv,NumberInput$1 as cw,commonjsGlobal$1 as d,classnamesExports as e,_root as f,getDefaultExportFromCjs$1 as g,isObject_1 as h,isPropValid as i,jsx$1 as j,keyframes as k,_Set as l,_setToArray as m,newStyled as n,_SetCache as o,propTypesExports as p,_arrayIncludes as q,reactExports as r,_arrayIncludesWith as s,toNumber_1 as t,_cacheHas as u,groupBy$1 as v,__vitePreload as w,flatten$2 as x,require$$0 as y,toString$9 as z};
|