streamlit-nightly 1.42.1.dev20250204__py2.py3-none-any.whl → 1.42.1.dev20250205__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.
Files changed (72) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{FileDownload.esm.CuayiK6T.js → FileDownload.esm.ShSIWsKj.js} +1 -1
  3. streamlit/static/static/js/{FileDropzone.CvXoxIUm.js → FileDropzone.BFkJKygp.js} +1 -1
  4. streamlit/static/static/js/{FormClearHelper.DpwWkrvV.js → FormClearHelper.Bue0QSIn.js} +1 -1
  5. streamlit/static/static/js/{Hooks.BQiFiHd5.js → Hooks.kV16_k1-.js} +1 -1
  6. streamlit/static/static/js/{InputInstructions.CypmdrYz.js → InputInstructions.DpG38kbY.js} +1 -1
  7. streamlit/static/static/js/{ProgressBar.DfR4HyQR.js → ProgressBar.B_WJAIyy.js} +1 -1
  8. streamlit/static/static/js/{RenderInPortalIfExists.D6u3szcn.js → RenderInPortalIfExists.CGAGPcQq.js} +1 -1
  9. streamlit/static/static/js/{Toolbar.D6p42Hno.js → Toolbar.DBtrI961.js} +1 -1
  10. streamlit/static/static/js/{base-input.B5AcLp6p.js → base-input.P8VGAZdC.js} +1 -1
  11. streamlit/static/static/js/{createSuper.DNzaJgi-.js → createSuper.GYQHnroV.js} +1 -1
  12. streamlit/static/static/js/{data-grid-overlay-editor.CKACfVZL.js → data-grid-overlay-editor.B1sLTR3f.js} +1 -1
  13. streamlit/static/static/js/{downloader.D6HV3a60.js → downloader.y-Ssi2d3.js} +1 -1
  14. streamlit/static/static/js/{es6.UQDWlCyE.js → es6.DpUKmjxe.js} +2 -2
  15. streamlit/static/static/js/{iframeResizer.contentWindow.DQ-TFrBp.js → iframeResizer.contentWindow.BBjdpeP0.js} +1 -1
  16. streamlit/static/static/js/{index.C8zZSMvD.js → index.2bJmI0Ih.js} +1 -1
  17. streamlit/static/static/js/{index.BghvoEVe.js → index.3k422wEU.js} +1 -1
  18. streamlit/static/static/js/{index.DB_dBVfZ.js → index.B11A7C7I.js} +1 -1
  19. streamlit/static/static/js/{index.wW-pPvtW.js → index.B7AJyWjy.js} +1 -1
  20. streamlit/static/static/js/{index.D7BxtE4u.js → index.B7aeIxns.js} +1 -1
  21. streamlit/static/static/js/{index.CX9gqq2L.js → index.BRsob9Jp.js} +1 -1
  22. streamlit/static/static/js/{index.DMKXUbO6.js → index.BVkJfCWM.js} +1 -1
  23. streamlit/static/static/js/{index.DkV6k6Ng.js → index.BW_6EVtw.js} +1 -1
  24. streamlit/static/static/js/{index.DaoBv396.js → index.Bkk4sBLz.js} +1 -1
  25. streamlit/static/static/js/{index.DqZZoWyt.js → index.BqiT_qyM.js} +1 -1
  26. streamlit/static/static/js/{index.BXmBj7MJ.js → index.C-BkiutF.js} +1 -1
  27. streamlit/static/static/js/{index.BPmrb-47.js → index.C73Hi-mL.js} +1 -1
  28. streamlit/static/static/js/{index.BQEIBi4n.js → index.C8vyFGOc.js} +1 -1
  29. streamlit/static/static/js/{index.BdVr8Tta.js → index.CAQGqUJ5.js} +1 -1
  30. streamlit/static/static/js/{index.BUGQmWUV.js → index.CC_i5fnL.js} +1 -1
  31. streamlit/static/static/js/index.CIkzV9zP.js +2 -0
  32. streamlit/static/static/js/{index.BAFGiIHm.js → index.CIwUls4J.js} +1 -1
  33. streamlit/static/static/js/{index.CgVoYKAP.js → index.CUzW8sZB.js} +1 -1
  34. streamlit/static/static/js/{index.CSgG8OVN.js → index.CVIsVMt0.js} +1 -1
  35. streamlit/static/static/js/{index.BiybRa0I.js → index.CZFA90VV.js} +1 -1
  36. streamlit/static/static/js/{index.BY8YeKF1.js → index.Cd8_b4vi.js} +1 -1
  37. streamlit/static/static/js/{index.Epl2r08f.js → index.CoJayF2l.js} +1 -1
  38. streamlit/static/static/js/{index.D4SMJhY1.js → index.Cp60C2LQ.js} +1 -1
  39. streamlit/static/static/js/{index.BPNlEjgz.js → index.D-Qsohh0.js} +1 -1
  40. streamlit/static/static/js/{index.CAuJtYES.js → index.D2i6l9uv.js} +1 -1
  41. streamlit/static/static/js/{index.BuyK2IsW.js → index.D3PlNa4T.js} +1 -1
  42. streamlit/static/static/js/{index.BiMrOUpK.js → index.D7HtU_R4.js} +1 -1
  43. streamlit/static/static/js/{index.CKOdbWxq.js → index.DHOnt3Rd.js} +1 -1
  44. streamlit/static/static/js/{index.ByH1pn5_.js → index.DNKGONSt.js} +1 -1
  45. streamlit/static/static/js/{index.CEdHQ1ob.js → index.D_CViY1G.js} +1 -1
  46. streamlit/static/static/js/{index.ChrjN8GY.js → index.DdJR-Re7.js} +1 -1
  47. streamlit/static/static/js/{index.Bm7Vkuba.js → index.DdaoJ1WZ.js} +1 -1
  48. streamlit/static/static/js/{index.B96fHK2A.js → index.DsOZJLyF.js} +1 -1
  49. streamlit/static/static/js/{index.2EE80u0h.js → index.DuqdUleB.js} +5 -5
  50. streamlit/static/static/js/{index.CrMtUJsu.js → index.GZ99DH1Q.js} +5 -5
  51. streamlit/static/static/js/{index.ndVWhafL.js → index.OWYUy0bC.js} +1 -1
  52. streamlit/static/static/js/{index.Dr6DSYcq.js → index.USVf5VUT.js} +1 -1
  53. streamlit/static/static/js/{input.CxqdG-sh.js → input.BANuQoGH.js} +1 -1
  54. streamlit/static/static/js/{memory.DuSk7Eex.js → memory.DTxlMbK7.js} +1 -1
  55. streamlit/static/static/js/{mergeWith.DrxB1Sj4.js → mergeWith.CfihrnQo.js} +1 -1
  56. streamlit/static/static/js/{number-overlay-editor.DBc0yndt.js → number-overlay-editor.BHsEp8VL.js} +1 -1
  57. streamlit/static/static/js/{possibleConstructorReturn.ZdYWHeG3.js → possibleConstructorReturn.BErM7qST.js} +1 -1
  58. streamlit/static/static/js/{sandbox.D3L4CYjG.js → sandbox.BMuVLu80.js} +1 -1
  59. streamlit/static/static/js/{textarea.CSafh28v.js → textarea.CmSZv6UE.js} +1 -1
  60. streamlit/static/static/js/{timepicker.C-pwkiaT.js → timepicker.DsaAj0da.js} +1 -1
  61. streamlit/static/static/js/{toConsumableArray.DyCVskz5.js → toConsumableArray.DJs7oxRq.js} +1 -1
  62. streamlit/static/static/js/{uniqueId.BODM2vTk.js → uniqueId.CVe3uxKs.js} +1 -1
  63. streamlit/static/static/js/{useBasicWidgetState.DQUiM2dz.js → useBasicWidgetState.D572sX2t.js} +1 -1
  64. streamlit/static/static/js/{useOnInputChange.Ccjd55xn.js → useOnInputChange.D9rTVyjn.js} +1 -1
  65. streamlit/static/static/js/{withFullScreenWrapper.CneUoXNE.js → withFullScreenWrapper.4QDrgZxA.js} +1 -1
  66. {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/METADATA +1 -1
  67. {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/RECORD +71 -71
  68. streamlit/static/static/js/index.CJ-t5S6T.js +0 -2
  69. {streamlit_nightly-1.42.1.dev20250204.data → streamlit_nightly-1.42.1.dev20250205.data}/scripts/streamlit.cmd +0 -0
  70. {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/WHEEL +0 -0
  71. {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/entry_points.txt +0 -0
  72. {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.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.CgVoYKAP.js","./RenderInPortalIfExists.D6u3szcn.js","./index.BPmrb-47.js","./index.CrMtUJsu.js","./FormClearHelper.DpwWkrvV.js","./withFullScreenWrapper.CneUoXNE.js","./Toolbar.D6p42Hno.js","./mergeWith.DrxB1Sj4.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.DyCVskz5.js","./possibleConstructorReturn.ZdYWHeG3.js","./createSuper.DNzaJgi-.js","./FileDownload.esm.CuayiK6T.js","../css/index.Bmkmz40k.css","./index.BQEIBi4n.js","./threshold.B8r8f5kt.js","./value.iufjd77T.js","./timer.RueuYoQV.js","./index.DB_dBVfZ.js","./useBasicWidgetState.DQUiM2dz.js","./axios.upsvKRUO.js","../css/index.DzuxGC_t.css","./index.BdVr8Tta.js","./index.BY8YeKF1.js","./index.C8zZSMvD.js","./index.Bm7Vkuba.js","./Hooks.BQiFiHd5.js","./index.CJ-t5S6T.js","./index.DkV6k6Ng.js","./index.DaoBv396.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.DfR4HyQR.js","./index.CX9gqq2L.js","./FileDropzone.CvXoxIUm.js","./InputInstructions.CypmdrYz.js","./inputUtils.CQWz5UKz.js","./textarea.CSafh28v.js","./base-input.B5AcLp6p.js","./index.BiybRa0I.js","./index.ByH1pn5_.js","./index.DqZZoWyt.js","./timepicker.C-pwkiaT.js","./input.CxqdG-sh.js","./index.BuyK2IsW.js","./index.BPNlEjgz.js","./index.BUGQmWUV.js","./index.BXmBj7MJ.js","./index.ndVWhafL.js","./index.CAuJtYES.js","./index.ChrjN8GY.js","./uniqueId.BODM2vTk.js","./useOnInputChange.Ccjd55xn.js","./index.Dr6DSYcq.js","./index.wW-pPvtW.js","./index.BAFGiIHm.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.CUzW8sZB.js","./RenderInPortalIfExists.CGAGPcQq.js","./index.C73Hi-mL.js","./index.GZ99DH1Q.js","./FormClearHelper.Bue0QSIn.js","./withFullScreenWrapper.4QDrgZxA.js","./Toolbar.DBtrI961.js","./mergeWith.CfihrnQo.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.DJs7oxRq.js","./possibleConstructorReturn.BErM7qST.js","./createSuper.GYQHnroV.js","./FileDownload.esm.ShSIWsKj.js","../css/index.Bmkmz40k.css","./index.C8vyFGOc.js","./threshold.B8r8f5kt.js","./value.iufjd77T.js","./timer.RueuYoQV.js","./index.B11A7C7I.js","./useBasicWidgetState.D572sX2t.js","./axios.upsvKRUO.js","../css/index.DzuxGC_t.css","./index.CAQGqUJ5.js","./index.Cd8_b4vi.js","./index.2bJmI0Ih.js","./index.DdaoJ1WZ.js","./Hooks.kV16_k1-.js","./index.CIkzV9zP.js","./index.BW_6EVtw.js","./index.Bkk4sBLz.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.B_WJAIyy.js","./index.BRsob9Jp.js","./FileDropzone.BFkJKygp.js","./InputInstructions.DpG38kbY.js","./inputUtils.CQWz5UKz.js","./textarea.CmSZv6UE.js","./base-input.P8VGAZdC.js","./index.CZFA90VV.js","./index.DNKGONSt.js","./index.BqiT_qyM.js","./timepicker.DsaAj0da.js","./input.BANuQoGH.js","./index.D3PlNa4T.js","./index.D-Qsohh0.js","./index.CC_i5fnL.js","./index.C-BkiutF.js","./index.OWYUy0bC.js","./index.D2i6l9uv.js","./index.DdJR-Re7.js","./uniqueId.CVe3uxKs.js","./useOnInputChange.D9rTVyjn.js","./index.USVf5VUT.js","./index.B7AJyWjy.js","./index.CIwUls4J.js"])))=>i.map(i=>d[i]);
2
2
  var E0=Object.defineProperty;var l0=rt=>{throw TypeError(rt)};var S0=(rt,tt,et)=>tt in rt?E0(rt,tt,{enumerable:!0,configurable:!0,writable:!0,value:et}):rt[tt]=et;var fo=(rt,tt,et)=>S0(rt,typeof tt!="symbol"?tt+"":tt,et),xa=(rt,tt,et)=>tt.has(rt)||l0("Cannot "+et);var xr=(rt,tt,et)=>(xa(rt,tt,"read from private field"),et?et.call(rt):tt.get(rt)),xn=(rt,tt,et)=>tt.has(rt)?l0("Cannot add the same private member more than once"):tt instanceof WeakSet?tt.add(rt):tt.set(rt,et),Cn=(rt,tt,et,nt)=>(xa(rt,tt,"write to private field"),nt?nt.call(rt,et):tt.set(rt,et),et),Wr=(rt,tt,et)=>(xa(rt,tt,"access private method"),et);function _mergeNamespaces(rt,tt){for(var et=0;et<tt.length;et++){const nt=tt[et];if(typeof nt!="string"&&!Array.isArray(nt)){for(const ot in nt)if(ot!=="default"&&!(ot in rt)){const at=Object.getOwnPropertyDescriptor(nt,ot);at&&Object.defineProperty(rt,ot,at.get?at:{enumerable:!0,get:()=>nt[ot]})}}}return Object.freeze(Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"}))}(function(){const tt=document.createElement("link").relList;if(tt&&tt.supports&&tt.supports("modulepreload"))return;for(const ot of document.querySelectorAll('link[rel="modulepreload"]'))nt(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"&&nt(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 nt(ot){if(ot.ep)return;ot.ep=!0;const at=et(ot);fetch(ot.href,at)}})();var commonjsGlobal$2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(rt){return rt&&rt.__esModule&&Object.prototype.hasOwnProperty.call(rt,"default")?rt.default:rt}function getAugmentedNamespace(rt){if(rt.__esModule)return rt;var tt=rt.default;if(typeof tt=="function"){var et=function nt(){return this instanceof nt?Reflect.construct(tt,arguments,this.constructor):tt.apply(this,arguments)};et.prototype=tt.prototype}else et={};return Object.defineProperty(et,"__esModule",{value:!0}),Object.keys(rt).forEach(function(nt){var ot=Object.getOwnPropertyDescriptor(rt,nt);Object.defineProperty(et,nt,ot.get?ot:{enumerable:!0,get:function(){return rt[nt]}})}),et}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -448,9 +448,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
448
448
  `):[];at.shift();const st=at.map(ut=>ut.trim()).join(`
449
449
  `);return jsxs(AlertContainer,{kind:Kind.ERROR,width:ot,children:[jsxs(StyledErrorName,{children:[tt,": "]}),et,nt?jsx$1(StyledStackTrace,{"data-testid":"stErrorElementStack",children:jsx$1(StyledCode,{children:st})}):null]})}const log$b=loglevelExports$1.getLogger("ErrorBoundary"),o0=class o0 extends React$1.PureComponent{constructor(){super(...arguments),this.state={error:null},this.componentDidCatch=tt=>{log$b.error(`${tt.name}: ${tt.message}
450
450
  ${tt.stack}`)}}render(){const{error:tt}=this.state;return tt?tt.name==="ChunkLoadError"?jsx$1(ErrorElement,{width:this.props.width,name:"Network issue",message:jsxs("p",{children:["Cannot load Streamlit frontend code. This can happen when you update Streamlit while a Streamlit app is running.",jsx$1("br",{}),"To fix this, simply reload this app by pressing"," ",jsx$1(StyledInlineCode,{children:"F5"}),","," ",jsx$1(StyledInlineCode,{children:"Ctrl+R"}),", or"," ",jsx$1(StyledInlineCode,{children:"Cmd+R"}),".",jsx$1("br",{}),"If the error persists, try force-clearing your browser's cache as described"," ",jsx$1("a",{href:"https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache#Cache_clearing_and_disabling",rel:"noopener noreferrer",target:"_blank",children:"here"})]})}):jsx$1(ErrorElement,{width:this.props.width,name:tt.name,message:tt.message,stack:tt.stack}):this.props.children}};o0.getDerivedStateFromError=tt=>({error:tt});let ErrorBoundary=o0;var PLACEMENT={auto:"auto",topLeft:"topLeft",top:"top",topRight:"topRight",rightTop:"rightTop",right:"right",rightBottom:"rightBottom",bottomRight:"bottomRight",bottom:"bottom",bottomLeft:"bottomLeft",leftBottom:"leftBottom",left:"left",leftTop:"leftTop"},TRIGGER_TYPE={click:"click",hover:"hover"},STATE_CHANGE_TYPE$1={open:"open",close:"close"},ACCESSIBILITY_TYPE={none:"none",menu:"menu",tooltip:"tooltip"},POPOVER_MARGIN=8,ARROW_SIZE=6,ANIMATE_OUT_TIME=0,ANIMATE_IN_TIME=20,ARROW_WIDTH=Math.ceil(Math.sqrt(Math.pow(ARROW_SIZE*2,2)/2));function _typeof$d(rt){"@babel/helpers - typeof";return _typeof$d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$d(rt)}function ownKeys$l(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$k(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$l(Object(et),!0).forEach(function(nt){_defineProperty$q(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$l(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _classCallCheck$k(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$a(rt,tt){for(var et=0;et<tt.length;et++){var nt=tt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(rt,nt.key,nt)}}function _createClass$i(rt,tt,et){return tt&&_defineProperties$a(rt.prototype,tt),Object.defineProperty(rt,"prototype",{writable:!1}),rt}function _inherits$k(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function");rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,writable:!0,configurable:!0}}),Object.defineProperty(rt,"prototype",{writable:!1}),tt&&_setPrototypeOf$b(rt,tt)}function _setPrototypeOf$b(rt,tt){return _setPrototypeOf$b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,ot){return nt.__proto__=ot,nt},_setPrototypeOf$b(rt,tt)}function _createSuper$9(rt){var tt=_isNativeReflectConstruct$9();return function(){var nt=_getPrototypeOf$a(rt),ot;if(tt){var at=_getPrototypeOf$a(this).constructor;ot=Reflect.construct(nt,arguments,at)}else ot=nt.apply(this,arguments);return _possibleConstructorReturn$k(this,ot)}}function _possibleConstructorReturn$k(rt,tt){if(tt&&(_typeof$d(tt)==="object"||typeof tt=="function"))return tt;if(tt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$b(rt)}function _assertThisInitialized$b(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}function _isNativeReflectConstruct$9(){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$a(rt){return _getPrototypeOf$a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$a(rt)}function _defineProperty$q(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var defaultStateReducer=function rt(tt,et){return et},StatefulContainer$1=function(rt){_inherits$k(et,rt);var tt=_createSuper$9(et);function et(){var nt;_classCallCheck$k(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return nt=tt.call.apply(tt,[this].concat(at)),_defineProperty$q(_assertThisInitialized$b(nt),"state",_objectSpread$k({isOpen:!1},nt.props.initialState)),_defineProperty$q(_assertThisInitialized$b(nt),"onBlur",function(ut){nt.props.onBlur&&nt.props.onBlur(ut),!(nt.props.focusLock||nt.props.autoFocus)&&nt.close()}),_defineProperty$q(_assertThisInitialized$b(nt),"onClick",function(ut){nt.props.onClick&&nt.props.onClick(ut),nt.state.isOpen?nt.close():nt.open()}),_defineProperty$q(_assertThisInitialized$b(nt),"onClickOutside",function(){nt.close()}),_defineProperty$q(_assertThisInitialized$b(nt),"onEsc",function(){nt.close()}),_defineProperty$q(_assertThisInitialized$b(nt),"onFocus",function(ut){nt.props.onFocus&&nt.props.onFocus(ut),isFocusVisible(ut)&&nt.open()}),_defineProperty$q(_assertThisInitialized$b(nt),"onMouseEnter",function(ut){nt.props.onMouseEnter&&nt.props.onMouseEnter(ut),nt.open()}),_defineProperty$q(_assertThisInitialized$b(nt),"onMouseLeave",function(ut){nt.props.onMouseLeave&&nt.props.onMouseLeave(ut),nt.close()}),_defineProperty$q(_assertThisInitialized$b(nt),"onContentClose",function(){nt.close()}),_defineProperty$q(_assertThisInitialized$b(nt),"renderContent",function(){var ut=nt.props.content;return typeof ut=="function"?ut({close:nt.onContentClose}):ut}),nt}return _createClass$i(et,[{key:"open",value:function(){this.internalSetState(STATE_CHANGE_TYPE$1.open,{isOpen:!0}),this.props.onOpen&&this.props.onOpen()}},{key:"close",value:function(){this.internalSetState(STATE_CHANGE_TYPE$1.close,{isOpen:!1}),this.props.onClose&&this.props.onClose()}},{key:"internalSetState",value:function(ot,at){var st=this.props.stateReducer;if(typeof st!="function"){this.setState(at);return}this.setState(function(ut){return st(ot,at,ut)})}},{key:"render",value:function(){var ot=this.props,at=ot.accessibilityType,st=ot.autoFocus,ut=ot.animateOutTime,ct=ot.dismissOnClickOutside,pt=ot.dismissOnEsc,dt=ot.focusLock,ft=ot.ignoreBoundary,bt=ot.mountNode,ht=ot.onBlur,mt=ot.onClick,Ot=ot.onFocus,yt=ot.onMouseEnter,Mt=ot.onMouseLeave,At=ot.onMouseEnterDelay,St=ot.onMouseLeaveDelay,Et=ot.overrides,zt=ot.placement,vt=ot.popperOptions,Tt=ot.renderAll,$t=ot.returnFocus,Rt=ot.showArrow,wt=ot.triggerType,It=ot.popoverMargin,kt=ot.focusOptions,Ft={accessibilityType:at,animateOutTime:ut,autoFocus:st,content:this.renderContent,focusLock:dt,ignoreBoundary:ft,isOpen:this.state.isOpen,mountNode:bt,onBlur:ht,onClick:mt,onFocus:Ot,onMouseEnter:yt,onMouseLeave:Mt,onMouseEnterDelay:At,onMouseLeaveDelay:St,overrides:Et,placement:zt,popperOptions:vt,renderAll:Tt,returnFocus:$t,showArrow:Rt,triggerType:wt,popoverMargin:It,focusOptions:kt};return ct&&(Ft.onClickOutside=this.onClickOutside),pt&&(Ft.onEsc=this.onEsc),wt===TRIGGER_TYPE.hover?(Ft.onBlur=this.onBlur,Ft.onFocus=this.onFocus,Ft.onMouseEnter=this.onMouseEnter,Ft.onMouseLeave=this.onMouseLeave):Ft.onClick=this.onClick,this.props.children(Ft)}}]),et}(reactExports.Component);_defineProperty$q(StatefulContainer$1,"defaultProps",{accessibilityType:ACCESSIBILITY_TYPE.menu,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,popperOptions:{},showArrow:!1,triggerType:TRIGGER_TYPE.click,dismissOnClickOutside:!0,dismissOnEsc:!0,stateReducer:defaultStateReducer,popoverMargin:POPOVER_MARGIN});function _objectWithoutPropertiesLoose$j(rt,tt){if(rt==null)return{};var et={};for(var nt in rt)if({}.hasOwnProperty.call(rt,nt)){if(tt.includes(nt))continue;et[nt]=rt[nt]}return et}var FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef(rt,tt){return typeof rt=="function"?rt(tt):rt&&(rt.current=tt),rt}function useCallbackRef(rt,tt){var et=reactExports.useState(function(){return{value:rt,callback:tt,facade:{get current(){return et.value},set current(nt){var ot=et.value;ot!==nt&&(et.value=nt,et.callback(nt,ot))}}}})[0];return et.callback=tt,et.facade}var useIsomorphicLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(rt,tt){var et=useCallbackRef(null,function(nt){return rt.forEach(function(ot){return assignRef(ot,nt)})});return useIsomorphicLayoutEffect(function(){var nt=currentValues.get(et);if(nt){var ot=new Set(nt),at=new Set(rt),st=et.current;ot.forEach(function(ut){at.has(ut)||assignRef(ut,null)}),at.forEach(function(ut){ot.has(ut)||assignRef(ut,st)})}currentValues.set(et,rt)},[rt]),et}var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function ItoI(rt){return rt}function innerCreateMedium(rt,tt){tt===void 0&&(tt=ItoI);var et=[],nt=!1,ot={read:function(){if(nt)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return et.length?et[et.length-1]:rt},useMedium:function(at){var st=tt(at,nt);return et.push(st),function(){et=et.filter(function(ut){return ut!==st})}},assignSyncMedium:function(at){for(nt=!0;et.length;){var st=et;et=[],st.forEach(at)}et={push:function(ut){return at(ut)},filter:function(){return et}}},assignMedium:function(at){nt=!0;var st=[];if(et.length){var ut=et;et=[],ut.forEach(at),st=et}var ct=function(){var dt=st;st=[],dt.forEach(at)},pt=function(){return Promise.resolve().then(ct)};pt(),et={push:function(dt){st.push(dt),pt()},filter:function(dt){return st=st.filter(dt),et}}}};return ot}function createMedium(rt,tt){return tt===void 0&&(tt=ItoI),innerCreateMedium(rt,tt)}function createSidecarMedium(rt){rt===void 0&&(rt={});var tt=innerCreateMedium(null);return tt.options=__assign$2({async:!0,ssr:!1},rt),tt}var mediumFocus=createMedium({},function(rt){var tt=rt.target,et=rt.currentTarget;return{target:tt,currentTarget:et}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0,ssr:typeof document<"u"}),focusScope=reactExports.createContext(void 0),emptyArray=[],FocusLock=reactExports.forwardRef(function rt(tt,et){var nt,ot=reactExports.useState(),at=ot[0],st=ot[1],ut=reactExports.useRef(),ct=reactExports.useRef(!1),pt=reactExports.useRef(null),dt=reactExports.useState({}),ft=dt[1],bt=tt.children,ht=tt.disabled,mt=ht===void 0?!1:ht,Ot=tt.noFocusGuards,yt=Ot===void 0?!1:Ot,Mt=tt.persistentFocus,At=Mt===void 0?!1:Mt,St=tt.crossFrame,Et=St===void 0?!0:St,zt=tt.autoFocus,vt=zt===void 0?!0:zt;tt.allowTextSelection;var Tt=tt.group,$t=tt.className,Rt=tt.whiteList,wt=tt.hasPositiveIndices,It=tt.shards,kt=It===void 0?emptyArray:It,Ft=tt.as,nr=Ft===void 0?"div":Ft,Ut=tt.lockProps,Yt=Ut===void 0?{}:Ut,gr=tt.sideCar,ur=tt.returnFocus,Jt=ur===void 0?!1:ur,Dt=tt.focusOptions,Xt=tt.onActivation,xt=tt.onDeactivation,Ct=reactExports.useState({}),Lt=Ct[0],rr=reactExports.useCallback(function(Zt){var Kt=Zt.captureFocusRestore;if(!pt.current){var ir,hr=(ir=document)==null?void 0:ir.activeElement;pt.current=hr,hr!==document.body&&(pt.current=Kt(hr))}ut.current&&Xt&&Xt(ut.current),ct.current=!0,ft()},[Xt]),sr=reactExports.useCallback(function(){ct.current=!1,xt&&xt(ut.current),ft()},[xt]),cr=reactExports.useCallback(function(Zt){var Kt=pt.current;if(Kt){var ir=(typeof Kt=="function"?Kt():Kt)||document.body,hr=typeof Jt=="function"?Jt(ir):Jt;if(hr){var pr=typeof hr=="object"?hr:void 0;pt.current=null,Zt?Promise.resolve().then(function(){return ir.focus(pr)}):ir.focus(pr)}}},[Jt]),mr=reactExports.useCallback(function(Zt){ct.current&&mediumFocus.useMedium(Zt)},[]),ar=mediumBlur.useMedium,Nt=reactExports.useCallback(function(Zt){ut.current!==Zt&&(ut.current=Zt,st(Zt))},[]),qt=_extends$Q((nt={},nt[FOCUS_DISABLED]=mt&&"disabled",nt[FOCUS_GROUP]=Tt,nt),Yt),jt=yt!==!0,Pt=jt&&yt!=="tail",Wt=useMergeRefs([et,Nt]),Vt=reactExports.useMemo(function(){return{observed:ut,shards:kt,enabled:!mt,active:ct.current}},[mt,ct.current,kt,at]);return reactExports.createElement(reactExports.Fragment,null,jt&&[reactExports.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:mt?-1:0,style:hiddenGuard}),wt?reactExports.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:mt?-1:1,style:hiddenGuard}):null],!mt&&reactExports.createElement(gr,{id:Lt,sideCar:mediumSidecar,observed:at,disabled:mt,persistentFocus:At,crossFrame:Et,autoFocus:vt,whiteList:Rt,shards:kt,onActivation:rr,onDeactivation:sr,returnFocus:cr,focusOptions:Dt,noFocusGuards:yt}),reactExports.createElement(nr,_extends$Q({ref:Wt},qt,{className:$t,onBlur:ar,onFocus:mr}),reactExports.createElement(focusScope.Provider,{value:Vt},bt)),Pt&&reactExports.createElement("div",{"data-focus-guard":!0,tabIndex:mt?-1:0,style:hiddenGuard}))});FocusLock.propTypes={};function _setPrototypeOf$a(rt,tt){return _setPrototypeOf$a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(et,nt){return et.__proto__=nt,et},_setPrototypeOf$a(rt,tt)}function _inheritsLoose(rt,tt){rt.prototype=Object.create(tt.prototype),rt.prototype.constructor=rt,_setPrototypeOf$a(rt,tt)}function _typeof$c(rt){"@babel/helpers - typeof";return _typeof$c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$c(rt)}function toPrimitive(rt,tt){if(_typeof$c(rt)!="object"||!rt)return rt;var et=rt[Symbol.toPrimitive];if(et!==void 0){var nt=et.call(rt,tt||"default");if(_typeof$c(nt)!="object")return nt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(tt==="string"?String:Number)(rt)}function toPropertyKey(rt){var tt=toPrimitive(rt,"string");return _typeof$c(tt)=="symbol"?tt:tt+""}function _defineProperty$p(rt,tt,et){return(tt=toPropertyKey(tt))in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}function withSideEffect(rt,tt){function et(nt){return nt.displayName||nt.name||"Component"}return function(ot){var at=[],st;function ut(){st=rt(at.map(function(pt){return pt.props})),tt(st)}var ct=function(pt){_inheritsLoose(dt,pt);function dt(){return pt.apply(this,arguments)||this}dt.peek=function(){return st};var ft=dt.prototype;return ft.componentDidMount=function(){at.push(this),ut()},ft.componentDidUpdate=function(){ut()},ft.componentWillUnmount=function(){var ht=at.indexOf(this);at.splice(ht,1),ut()},ft.render=function(){return React$1.createElement(ot,this.props)},dt}(reactExports.PureComponent);return _defineProperty$p(ct,"displayName","SideEffect("+et(ot)+")"),ct}}var toArray$2=function(rt){for(var tt=Array(rt.length),et=0;et<rt.length;++et)tt[et]=rt[et];return tt},asArray=function(rt){return Array.isArray(rt)?rt:[rt]},getFirst=function(rt){return Array.isArray(rt)?rt[0]:rt},isElementHidden=function(rt){if(rt.nodeType!==Node.ELEMENT_NODE)return!1;var tt=window.getComputedStyle(rt,null);return!tt||!tt.getPropertyValue?!1:tt.getPropertyValue("display")==="none"||tt.getPropertyValue("visibility")==="hidden"},getParentNode=function(rt){return rt.parentNode&&rt.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?rt.parentNode.host:rt.parentNode},isTopNode=function(rt){return rt===document||rt&&rt.nodeType===Node.DOCUMENT_NODE},isInert=function(rt){return rt.hasAttribute("inert")},isVisibleUncached=function(rt,tt){return!rt||isTopNode(rt)||!isElementHidden(rt)&&!isInert(rt)&&tt(getParentNode(rt))},isVisibleCached=function(rt,tt){var et=rt.get(tt);if(et!==void 0)return et;var nt=isVisibleUncached(tt,isVisibleCached.bind(void 0,rt));return rt.set(tt,nt),nt},isAutoFocusAllowedUncached=function(rt,tt){return rt&&!isTopNode(rt)?isAutoFocusAllowed(rt)?tt(getParentNode(rt)):!1:!0},isAutoFocusAllowedCached=function(rt,tt){var et=rt.get(tt);if(et!==void 0)return et;var nt=isAutoFocusAllowedUncached(tt,isAutoFocusAllowedCached.bind(void 0,rt));return rt.set(tt,nt),nt},getDataset=function(rt){return rt.dataset},isHTMLButtonElement=function(rt){return rt.tagName==="BUTTON"},isHTMLInputElement=function(rt){return rt.tagName==="INPUT"},isRadioElement=function(rt){return isHTMLInputElement(rt)&&rt.type==="radio"},notHiddenInput=function(rt){return!((isHTMLInputElement(rt)||isHTMLButtonElement(rt))&&(rt.type==="hidden"||rt.disabled))},isAutoFocusAllowed=function(rt){var tt=rt.getAttribute(FOCUS_NO_AUTOFOCUS);return![!0,"true",""].includes(tt)},isGuard=function(rt){var tt;return!!(rt&&(!((tt=getDataset(rt))===null||tt===void 0)&&tt.focusGuard))},isNotAGuard=function(rt){return!isGuard(rt)},isDefined=function(rt){return!!rt},tabSort=function(rt,tt){var et=Math.max(0,rt.tabIndex),nt=Math.max(0,tt.tabIndex),ot=et-nt,at=rt.index-tt.index;if(ot){if(!et)return 1;if(!nt)return-1}return ot||at},getTabIndex=function(rt){return rt.tabIndex<0&&!rt.hasAttribute("tabindex")?0:rt.tabIndex},orderByTabIndex=function(rt,tt,et){return toArray$2(rt).map(function(nt,ot){var at=getTabIndex(nt);return{node:nt,index:ot,tabIndex:et&&at===-1?(nt.dataset||{}).focusGuard?0:-1:at}}).filter(function(nt){return!tt||nt.tabIndex>=0}).sort(tabSort)},tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(rt,tt){return toArray$2((rt.shadowRoot||rt).children).reduce(function(et,nt){return et.concat(nt.matches(tt?queryGuardTabbables:queryTabbables)?[nt]:[],getFocusablesWithShadowDom(nt))},[])},getFocusablesWithIFrame=function(rt,tt){var et;return rt instanceof HTMLIFrameElement&&(!((et=rt.contentDocument)===null||et===void 0)&&et.body)?getFocusables([rt.contentDocument.body],tt):[rt]},getFocusables=function(rt,tt){return rt.reduce(function(et,nt){var ot,at=getFocusablesWithShadowDom(nt,tt),st=(ot=[]).concat.apply(ot,at.map(function(ut){return getFocusablesWithIFrame(ut,tt)}));return et.concat(st,nt.parentNode?toArray$2(nt.parentNode.querySelectorAll(queryTabbables)).filter(function(ut){return ut===nt}):[])},[])},getParentAutofocusables=function(rt){var tt=rt.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray$2(tt).map(function(et){return getFocusables([et])}).reduce(function(et,nt){return et.concat(nt)},[])},filterFocusable=function(rt,tt){return toArray$2(rt).filter(function(et){return isVisibleCached(tt,et)}).filter(function(et){return notHiddenInput(et)})},filterAutoFocusable=function(rt,tt){return tt===void 0&&(tt=new Map),toArray$2(rt).filter(function(et){return isAutoFocusAllowedCached(tt,et)})},getTabbableNodes=function(rt,tt,et){return orderByTabIndex(filterFocusable(getFocusables(rt,et),tt),!0,et)},getFocusableNodes=function(rt,tt){return orderByTabIndex(filterFocusable(getFocusables(rt),tt),!1)},parentAutofocusables=function(rt,tt){return filterFocusable(getParentAutofocusables(rt),tt)},contains=function(rt,tt){return rt.shadowRoot?contains(rt.shadowRoot,tt):Object.getPrototypeOf(rt).contains!==void 0&&Object.getPrototypeOf(rt).contains.call(rt,tt)?!0:toArray$2(rt.children).some(function(et){var nt;if(et instanceof HTMLIFrameElement){var ot=(nt=et.contentDocument)===null||nt===void 0?void 0:nt.body;return ot?contains(ot,tt):!1}return contains(et,tt)})},filterNested=function(rt){for(var tt=new Set,et=rt.length,nt=0;nt<et;nt+=1)for(var ot=nt+1;ot<et;ot+=1){var at=rt[nt].compareDocumentPosition(rt[ot]);(at&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&tt.add(ot),(at&Node.DOCUMENT_POSITION_CONTAINS)>0&&tt.add(nt)}return rt.filter(function(st,ut){return!tt.has(ut)})},getTopParent=function(rt){return rt.parentNode?getTopParent(rt.parentNode):rt},getAllAffectedNodes=function(rt){var tt=asArray(rt);return tt.filter(Boolean).reduce(function(et,nt){var ot=nt.getAttribute(FOCUS_GROUP);return et.push.apply(et,ot?filterNested(toArray$2(getTopParent(nt).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(ot,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[nt]),et},[])},safeProbe=function(rt){try{return rt()}catch{return}},getActiveElement=function(rt){if(rt===void 0&&(rt=document),!(!rt||!rt.activeElement)){var tt=rt.activeElement;return tt.shadowRoot?getActiveElement(tt.shadowRoot):tt instanceof HTMLIFrameElement&&safeProbe(function(){return tt.contentWindow.document})?getActiveElement(tt.contentWindow.document):tt}},focusInFrame=function(rt,tt){return rt===tt},focusInsideIframe=function(rt,tt){return!!toArray$2(rt.querySelectorAll("iframe")).some(function(et){return focusInFrame(et,tt)})},focusInside=function(rt,tt){return tt===void 0&&(tt=getActiveElement(getFirst(rt).ownerDocument)),!tt||tt.dataset&&tt.dataset.focusGuard?!1:getAllAffectedNodes(rt).some(function(et){return contains(et,tt)||focusInsideIframe(et,tt)})},focusIsHidden=function(rt){rt===void 0&&(rt=document);var tt=getActiveElement(rt);return tt?toArray$2(rt.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(et){return contains(et,tt)}):!1},findSelectedRadio=function(rt,tt){return tt.filter(isRadioElement).filter(function(et){return et.name===rt.name}).filter(function(et){return et.checked})[0]||rt},correctNode=function(rt,tt){return isRadioElement(rt)&&rt.name?findSelectedRadio(rt,tt):rt},correctNodes=function(rt){var tt=new Set;return rt.forEach(function(et){return tt.add(correctNode(et,rt))}),rt.filter(function(et){return tt.has(et)})},pickFirstFocus=function(rt){return rt[0]&&rt.length>1?correctNode(rt[0],rt):rt[0]},pickFocusable=function(rt,tt){return rt.indexOf(correctNode(tt,rt))},NEW_FOCUS="NEW_FOCUS",newFocus=function(rt,tt,et,nt,ot){var at=rt.length,st=rt[0],ut=rt[at-1],ct=isGuard(nt);if(!(nt&&rt.indexOf(nt)>=0)){var pt=nt!==void 0?et.indexOf(nt):-1,dt=ot?et.indexOf(ot):pt,ft=ot?rt.indexOf(ot):-1;if(pt===-1)return ft!==-1?ft:NEW_FOCUS;if(ft===-1)return NEW_FOCUS;var bt=pt-dt,ht=et.indexOf(st),mt=et.indexOf(ut),Ot=correctNodes(et),yt=nt!==void 0?Ot.indexOf(nt):-1,Mt=yt-(ot?Ot.indexOf(ot):pt);if(!bt&&ft>=0||tt.length===0)return ft;var At=pickFocusable(rt,tt[0]),St=pickFocusable(rt,tt[tt.length-1]);if(pt<=ht&&ct&&Math.abs(bt)>1)return St;if(pt>=mt&&ct&&Math.abs(bt)>1)return At;if(bt&&Math.abs(Mt)>1)return ft;if(pt<=ht)return St;if(pt>mt)return At;if(bt)return Math.abs(bt)>1?ft:(at+ft+bt)%at}},findAutoFocused=function(rt){return function(tt){var et,nt=(et=getDataset(tt))===null||et===void 0?void 0:et.autofocus;return tt.autofocus||nt!==void 0&&nt!=="false"||rt.indexOf(tt)>=0}},pickAutofocus=function(rt,tt,et){var nt=rt.map(function(at){var st=at.node;return st}),ot=filterAutoFocusable(nt.filter(findAutoFocused(et)));return ot&&ot.length?pickFirstFocus(ot):pickFirstFocus(filterAutoFocusable(tt))},getParents=function(rt,tt){return tt===void 0&&(tt=[]),tt.push(rt),rt.parentNode&&getParents(rt.parentNode.host||rt.parentNode,tt),tt},getCommonParent=function(rt,tt){for(var et=getParents(rt),nt=getParents(tt),ot=0;ot<et.length;ot+=1){var at=et[ot];if(nt.indexOf(at)>=0)return at}return!1},getTopCommonParent=function(rt,tt,et){var nt=asArray(rt),ot=asArray(tt),at=nt[0],st=!1;return ot.filter(Boolean).forEach(function(ut){st=getCommonParent(st||ut,ut)||st,et.filter(Boolean).forEach(function(ct){var pt=getCommonParent(at,ct);pt&&(!st||contains(pt,st)?st=pt:st=getCommonParent(pt,st))})}),st},allParentAutofocusables=function(rt,tt){return rt.reduce(function(et,nt){return et.concat(parentAutofocusables(nt,tt))},[])},reorderNodes=function(rt,tt){var et=new Map;return tt.forEach(function(nt){return et.set(nt.node,nt)}),rt.map(function(nt){return et.get(nt)}).filter(isDefined)},focusSolver=function(rt,tt){var et=getActiveElement(asArray(rt).length>0?document:getFirst(rt).ownerDocument),nt=getAllAffectedNodes(rt).filter(isNotAGuard),ot=getTopCommonParent(et||rt,rt,nt),at=new Map,st=getFocusableNodes(nt,at),ut=st.filter(function(mt){var Ot=mt.node;return isNotAGuard(Ot)});if(ut[0]){var ct=getFocusableNodes([ot],at).map(function(mt){var Ot=mt.node;return Ot}),pt=reorderNodes(ct,ut),dt=pt.map(function(mt){var Ot=mt.node;return Ot}),ft=pt.filter(function(mt){var Ot=mt.tabIndex;return Ot>=0}).map(function(mt){var Ot=mt.node;return Ot}),bt=newFocus(dt,ft,ct,et,tt);if(bt===NEW_FOCUS){var ht=pickAutofocus(st,ft,allParentAutofocusables(nt,at))||pickAutofocus(st,dt,allParentAutofocusables(nt,at));if(ht)return{node:ht};console.warn("focus-lock: cannot find any node to move focus into");return}return bt===void 0?bt:pt[bt]}},expandFocusableNodes=function(rt){var tt=getAllAffectedNodes(rt).filter(isNotAGuard),et=getTopCommonParent(rt,rt,tt),nt=orderByTabIndex(getFocusables([et],!0),!0,!0),ot=getFocusables(tt,!1);return nt.map(function(at){var st=at.node,ut=at.index;return{node:st,index:ut,lockItem:ot.indexOf(st)>=0,guard:isGuard(st)}})},focusOn=function(rt,tt){rt&&("focus"in rt&&rt.focus(tt),"contentWindow"in rt&&rt.contentWindow&&rt.contentWindow.focus())},guardCount=0,lockDisabled=!1,moveFocusInside=function(rt,tt,et){et===void 0&&(et={});var nt=focusSolver(rt,tt);if(!lockDisabled&&nt){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(nt.node,et.focusOptions),guardCount--}};function weakRef(rt){if(!rt)return null;if(typeof WeakRef>"u")return function(){return rt||null};var tt=rt?new WeakRef(rt):null;return function(){return(tt==null?void 0:tt.deref())||null}}var recordElementLocation=function(rt){if(!rt)return null;for(var tt=[],et=rt;et&&et!==document.body;)tt.push({current:weakRef(et),parent:weakRef(et.parentElement),left:weakRef(et.previousElementSibling),right:weakRef(et.nextElementSibling)}),et=et.parentElement;return{element:weakRef(rt),stack:tt,ownerDocument:rt.ownerDocument}},restoreFocusTo=function(rt){var tt,et,nt,ot,at;if(rt)for(var st=rt.stack,ut=rt.ownerDocument,ct=new Map,pt=0,dt=st;pt<dt.length;pt++){var ft=dt[pt],bt=(tt=ft.parent)===null||tt===void 0?void 0:tt.call(ft);if(bt&&ut.contains(bt)){for(var ht=(et=ft.left)===null||et===void 0?void 0:et.call(ft),mt=ft.current(),Ot=bt.contains(mt)?mt:void 0,yt=(nt=ft.right)===null||nt===void 0?void 0:nt.call(ft),Mt=getTabbableNodes([bt],ct),At=(at=(ot=Ot??(ht==null?void 0:ht.nextElementSibling))!==null&&ot!==void 0?ot:yt)!==null&&at!==void 0?at:ht;At;){for(var St=0,Et=Mt;St<Et.length;St++){var zt=Et[St];if(At!=null&&At.contains(zt.node))return zt.node}At=At.nextElementSibling}if(Mt.length)return Mt[0].node}}},captureFocusRestore=function(rt){var tt=recordElementLocation(rt);return function(){return restoreFocusTo(tt)}},getRelativeFocusable=function(rt,tt,et){if(!rt||!tt)return console.error("no element or scope given"),{};var nt=asArray(tt);if(nt.every(function(st){return!contains(st,rt)}))return console.error("Active element is not contained in the scope"),{};var ot=et?getTabbableNodes(nt,new Map):getFocusableNodes(nt,new Map),at=ot.findIndex(function(st){var ut=st.node;return ut===rt});if(at!==-1)return{prev:ot[at-1],next:ot[at+1],first:ot[0],last:ot[ot.length-1]}},getBoundary=function(rt,tt){var et=tt?getTabbableNodes(asArray(rt),new Map):getFocusableNodes(asArray(rt),new Map);return{first:et[0],last:et[et.length-1]}},defaultOptions$1=function(rt){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},rt)},moveFocus=function(rt,tt,et){tt===void 0&&(tt={});var nt=defaultOptions$1(tt),ot=getRelativeFocusable(rt,nt.scope,nt.onlyTabbable);if(ot){var at=et(ot,nt.cycle);at&&focusOn(at.node,nt.focusOptions)}},focusNextElement=function(rt,tt){tt===void 0&&(tt={}),moveFocus(rt,tt,function(et,nt){var ot=et.next,at=et.first;return ot||nt&&at})},focusPrevElement=function(rt,tt){tt===void 0&&(tt={}),moveFocus(rt,tt,function(et,nt){var ot=et.prev,at=et.last;return ot||nt&&at})},pickBoundary=function(rt,tt,et){var nt,ot=getBoundary(rt,(nt=tt.onlyTabbable)!==null&&nt!==void 0?nt:!0),at=ot[et];at&&focusOn(at.node,tt.focusOptions)},focusFirstElement=function(rt,tt){tt===void 0&&(tt={}),pickBoundary(rt,tt,"first")},focusLastElement=function(rt,tt){tt===void 0&&(tt={}),pickBoundary(rt,tt,"last")};function deferAction(rt){setTimeout(rt,1)}var inlineProp=function rt(tt,et){var nt={};return nt[tt]=et,nt},extractRef=function rt(tt){return tt&&"current"in tt?tt.current:tt},focusOnBody=function rt(){return document&&document.activeElement===document.body},isFreeFocus=function rt(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,tryRestoreFocus=function rt(){return null},lastPortaledElement=null,focusWasOutsideWindow=!1,windowFocused=!1,defaultWhitelist=function rt(){return!0},focusWhitelisted=function rt(tt){return(lastActiveTrap.whiteList||defaultWhitelist)(tt)},recordPortal=function rt(tt,et){lastPortaledElement={observerNode:tt,portaledElement:et}},focusIsPortaledPair=function rt(tt){return lastPortaledElement&&lastPortaledElement.portaledElement===tt};function autoGuard(rt,tt,et,nt){var ot=null,at=rt;do{var st=nt[at];if(st.guard)st.node.dataset.focusAutoGuard&&(ot=st);else if(st.lockItem){if(at!==rt)return;ot=null}else break}while((at+=et)!==tt);ot&&(ot.node.tabIndex=0)}var focusWasOutside=function rt(tt){return tt?!!focusWasOutsideWindow:focusWasOutsideWindow==="meanwhile"},checkInHost=function rt(tt,et,nt){return et&&(et.host===tt&&(!et.activeElement||nt.contains(et.activeElement))||et.parentNode&&rt(tt,et.parentNode,nt))},withinHost=function rt(tt,et){return et.some(function(nt){return checkInHost(tt,nt,nt)})},getNodeFocusables=function rt(tt){return getFocusableNodes(tt,new Map)},isNotFocusable=function rt(tt){return!getNodeFocusables([tt.parentNode]).some(function(et){return et.node===tt})},activateTrap=function rt(){var tt=!1;if(lastActiveTrap){var et=lastActiveTrap,nt=et.observed,ot=et.persistentFocus,at=et.autoFocus,st=et.shards,ut=et.crossFrame,ct=et.focusOptions,pt=et.noFocusGuards,dt=nt||lastPortaledElement&&lastPortaledElement.portaledElement;if(focusOnBody()&&lastActiveFocus&&(!document.body.contains(lastActiveFocus)||isNotFocusable(lastActiveFocus))){lastActiveFocus=null;var ft=tryRestoreFocus();ft&&ft.focus()}var bt=document&&document.activeElement;if(dt){var ht=[dt].concat(st.map(extractRef).filter(Boolean)),mt=function(){if(!focusWasOutside(ut)||!pt||!lastActiveFocus||windowFocused)return!1;var St=getNodeFocusables(ht),Et=St.findIndex(function(zt){var vt=zt.node;return vt===lastActiveFocus});return Et===0||Et===St.length-1};if((!bt||focusWhitelisted(bt))&&(ot||mt()||!isFreeFocus()||!lastActiveFocus&&at)&&(dt&&!(focusInside(ht)||bt&&withinHost(bt,ht)||focusIsPortaledPair(bt))&&(document&&!lastActiveFocus&&bt&&!at?(bt.blur&&bt.blur(),document.body.focus()):(tt=moveFocusInside(ht,lastActiveFocus,{focusOptions:ct}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement,tryRestoreFocus=captureFocusRestore(lastActiveFocus)),document&&bt!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var Ot=document&&document.activeElement,yt=expandFocusableNodes(ht),Mt=yt.map(function(At){var St=At.node;return St}).indexOf(Ot);Mt>-1&&(yt.filter(function(At){var St=At.guard,Et=At.node;return St&&Et.dataset.focusAutoGuard}).forEach(function(At){var St=At.node;return St.removeAttribute("tabIndex")}),autoGuard(Mt,yt.length,1,yt),autoGuard(Mt,-1,-1,yt))}}}return tt},onTrap=function rt(tt){activateTrap()&&tt&&(tt.stopPropagation(),tt.preventDefault())},onBlur=function rt(){return deferAction(activateTrap)},onFocus=function rt(tt){var et=tt.target,nt=tt.currentTarget;nt.contains(et)||recordPortal(nt,et)},FocusWatcher=function rt(){return null},onWindowFocus=function rt(){windowFocused=!0},onWindowBlur=function rt(){windowFocused=!1,focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function rt(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("focus",onWindowFocus),window.addEventListener("blur",onWindowBlur)},detachHandler=function rt(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("focus",onWindowFocus),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(rt){return rt.filter(function(tt){var et=tt.disabled;return!et})}var focusLockAPI={moveFocusInside,focusInside,focusNextElement,focusPrevElement,focusFirstElement,focusLastElement,captureFocusRestore};function handleStateChangeOnClient(rt){var tt=rt.slice(-1)[0];tt&&!lastActiveTrap&&attachHandler();var et=lastActiveTrap,nt=et&&tt&&tt.id===et.id;lastActiveTrap=tt,et&&!nt&&(et.onDeactivation(),rt.filter(function(ot){var at=ot.id;return at===et.id}).length||et.returnFocus(!tt)),tt?(lastActiveFocus=null,(!nt||et.observed!==tt.observed)&&tt.onActivation(focusLockAPI),activateTrap(),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(rt){return rt(focusLockAPI)});const FocusTrap=withSideEffect(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=reactExports.forwardRef(function rt(tt,et){return reactExports.createElement(FocusLock,_extends$Q({sideCar:FocusTrap,ref:et},tt))}),_ref=FocusLock.propTypes||{};_ref.sideCar;_objectWithoutPropertiesLoose$j(_ref,["sideCar"]);FocusLockCombination.propTypes={};var useFocusInside=function rt(tt){reactExports.useEffect(function(){var et=!0;return mediumEffect.useMedium(function(nt){var ot=tt&&tt.current;et&&ot&&(nt.focusInside(ot)||nt.moveFocusInside(ot,null))}),function(){et=!1}},[tt])};function MoveFocusInside(rt){var tt=rt.disabled,et=tt===void 0?!1:tt,nt=rt.className,ot=rt.children,at=reactExports.useRef(null);return useFocusInside(et?void 0:at),reactExports.createElement("div",_extends$Q({},inlineProp(FOCUS_AUTO,!et),{ref:at,className:nt}),ot)}MoveFocusInside.propTypes={};function ownKeys$k(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$j(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$k(Object(et),!0).forEach(function(nt){_defineProperty$o(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$k(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _defineProperty$o(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}function _slicedToArray$g(rt,tt){return _arrayWithHoles$g(rt)||_iterableToArrayLimit$g(rt,tt)||_unsupportedIterableToArray$g(rt,tt)||_nonIterableRest$g()}function _nonIterableRest$g(){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$g(rt,tt){if(rt){if(typeof rt=="string")return _arrayLikeToArray$g(rt,tt);var et=Object.prototype.toString.call(rt).slice(8,-1);if(et==="Object"&&rt.constructor&&(et=rt.constructor.name),et==="Map"||et==="Set")return Array.from(rt);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return _arrayLikeToArray$g(rt,tt)}}function _arrayLikeToArray$g(rt,tt){(tt==null||tt>rt.length)&&(tt=rt.length);for(var et=0,nt=new Array(tt);et<tt;et++)nt[et]=rt[et];return nt}function _iterableToArrayLimit$g(rt,tt){var et=rt==null?null:typeof Symbol<"u"&&rt[Symbol.iterator]||rt["@@iterator"];if(et!=null){var nt=[],ot=!0,at=!1,st,ut;try{for(et=et.call(rt);!(ot=(st=et.next()).done)&&(nt.push(st.value),!(tt&&nt.length===tt));ot=!0);}catch(ct){at=!0,ut=ct}finally{try{!ot&&et.return!=null&&et.return()}finally{if(at)throw ut}}return nt}}function _arrayWithHoles$g(rt){if(Array.isArray(rt))return rt}var OPPOSITE_POSITIONS={top:"bottom",bottom:"top",right:"left",left:"right"};function getOppositePosition(rt){return OPPOSITE_POSITIONS[rt]}function isVerticalPosition(rt){return rt==="top"||rt==="bottom"}function capitalize(rt){return rt.charAt(0).toUpperCase()+rt.slice(1)}function fromPopperPlacement(rt){var tt=rt.replace(/(top|bottom)-start$/,"$1Left").replace(/(top|bottom)-end$/,"$1Right").replace(/(left|right)-start$/,"$1Top").replace(/(left|right)-end$/,"$1Bottom");return PLACEMENT[tt]||null}function splitPlacement(rt){var tt=rt.match(/^([a-z]+)([A-Z][a-z]+)?/)||[];return tt.slice(1,3).filter(Boolean).map(function(et){return et.toLowerCase()})}function getPopoverMarginStyles(rt,tt,et){var nt=splitPlacement(tt),ot=_slicedToArray$g(nt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut="margin".concat(capitalize(st));return _defineProperty$o({},ut,"".concat(rt+et,"px"))}function getStartPosition(rt,tt,et,nt){rt=_objectSpread$j({},rt);var ot=splitPlacement(tt),at=_slicedToArray$g(ot,1),st=at[0],ut=(et>0?et:nt)*2;return isVerticalPosition(st)?rt.top+=st==="top"?ut:-ut:rt.left+=st==="left"?ut:-ut,"translate3d(".concat(rt.left,"px, ").concat(rt.top,"px, 0)")}function getEndPosition(rt){return"translate3d(".concat(rt.left,"px, ").concat(rt.top,"px, 0)")}function getArrowPositionStyles(rt,tt){var et,nt=splitPlacement(tt),ot=_slicedToArray$g(nt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut=isVerticalPosition(at)?"left":"top";return et={},_defineProperty$o(et,ut,"".concat(rt[ut],"px")),_defineProperty$o(et,st,"-".concat(ARROW_SIZE-2,"px")),et}function ownKeys$j(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$i(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$j(Object(et),!0).forEach(function(nt){_defineProperty$n(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$j(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _defineProperty$n(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}function getBodyStyles(rt){var tt=rt.$animationDuration,et=rt.$isOpen,nt=rt.$isAnimating,ot=rt.$placement,at=rt.$popoverOffset,st=rt.$showArrow,ut=rt.$theme,ct=rt.$popoverMargin,pt=rt.$isHoverTrigger;return _objectSpread$i(_objectSpread$i({position:"absolute",top:0,left:0,backgroundColor:ut.colors.backgroundTertiary,borderTopLeftRadius:ut.borders.popoverBorderRadius,borderTopRightRadius:ut.borders.popoverBorderRadius,borderBottomRightRadius:ut.borders.popoverBorderRadius,borderBottomLeftRadius:ut.borders.popoverBorderRadius,boxShadow:ut.lighting.shadow600,transitionProperty:"opacity,transform",transitionDuration:nt?et?"0.1s":"".concat(tt,"ms"):"0s",transitionTimingFunction:et?ut.animation.easeOutCurve:ut.animation.easeInCurve,opacity:nt&&et?1:0,transform:nt&&et?getEndPosition(at):getStartPosition(at,ot,st?ARROW_SIZE:0,ct)},getPopoverMarginStyles(st?ARROW_SIZE:0,ot,ct)),pt?{animationDuration:".1s",animationName:{"0%":{pointerEvents:"none"},"99%":{pointerEvents:"none"},"100%":{pointerEvents:"auto"}}}:{})}var Body$2=styled("div",getBodyStyles);Body$2.displayName="Body";Body$2.displayName="Body";function getArrowStyles(rt){var tt=rt.$arrowOffset,et=rt.$placement,nt=rt.$theme;return _objectSpread$i({backgroundColor:nt.colors.backgroundTertiary,boxShadow:nt.lighting.shadow600,width:"".concat(ARROW_WIDTH,"px"),height:"".concat(ARROW_WIDTH,"px"),transform:"rotate(45deg)",position:"absolute"},getArrowPositionStyles(tt,et))}var Arrow$1=styled("div",getArrowStyles);Arrow$1.displayName="Arrow";Arrow$1.displayName="Arrow";function getInnerStyles(rt){var tt=rt.$theme;return{backgroundColor:tt.colors.backgroundTertiary,borderTopLeftRadius:tt.borders.popoverBorderRadius,borderTopRightRadius:tt.borders.popoverBorderRadius,borderBottomRightRadius:tt.borders.popoverBorderRadius,borderBottomLeftRadius:tt.borders.popoverBorderRadius,color:tt.colors.contentPrimary,position:"relative"}}var Inner$1=styled("div",getInnerStyles);Inner$1.displayName="Inner";Inner$1.displayName="Inner";var Padding=styled("div",{paddingLeft:"12px",paddingTop:"12px",paddingRight:"12px",paddingBottom:"12px"});Padding.displayName="Padding";Padding.displayName="Padding";var Hidden=styled("div",{display:"none"});Hidden.displayName="Hidden";Hidden.displayName="Hidden";var baseDefaultProps$1={accessibilityType:ACCESSIBILITY_TYPE.menu,focusLock:!1,autoFocus:!0,returnFocus:!0,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,renderAll:!1};function ownKeys$i(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$h(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$i(Object(et),!0).forEach(function(nt){_defineProperty$m(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$i(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _extends$A(){return _extends$A=Object.assign?Object.assign.bind():function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_extends$A.apply(this,arguments)}function _typeof$b(rt){"@babel/helpers - typeof";return _typeof$b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$b(rt)}function _classCallCheck$j(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$9(rt,tt){for(var et=0;et<tt.length;et++){var nt=tt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(rt,nt.key,nt)}}function _createClass$h(rt,tt,et){return tt&&_defineProperties$9(rt.prototype,tt),Object.defineProperty(rt,"prototype",{writable:!1}),rt}function _inherits$j(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function");rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,writable:!0,configurable:!0}}),Object.defineProperty(rt,"prototype",{writable:!1}),tt&&_setPrototypeOf$9(rt,tt)}function _setPrototypeOf$9(rt,tt){return _setPrototypeOf$9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,ot){return nt.__proto__=ot,nt},_setPrototypeOf$9(rt,tt)}function _createSuper$8(rt){var tt=_isNativeReflectConstruct$8();return function(){var nt=_getPrototypeOf$9(rt),ot;if(tt){var at=_getPrototypeOf$9(this).constructor;ot=Reflect.construct(nt,arguments,at)}else ot=nt.apply(this,arguments);return _possibleConstructorReturn$j(this,ot)}}function _possibleConstructorReturn$j(rt,tt){if(tt&&(_typeof$b(tt)==="object"||typeof tt=="function"))return tt;if(tt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$a(rt)}function _assertThisInitialized$a(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}function _isNativeReflectConstruct$8(){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$9(rt){return _getPrototypeOf$9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$9(rt)}function _defineProperty$m(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var PopoverInner=function(rt){_inherits$j(et,rt);var tt=_createSuper$8(et);function et(){var nt;_classCallCheck$j(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return nt=tt.call.apply(tt,[this].concat(at)),_defineProperty$m(_assertThisInitialized$a(nt),"animateInTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"animateOutTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"animateOutCompleteTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"onMouseEnterTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"onMouseLeaveTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"anchorRef",reactExports.createRef()),_defineProperty$m(_assertThisInitialized$a(nt),"popperRef",reactExports.createRef()),_defineProperty$m(_assertThisInitialized$a(nt),"arrowRef",reactExports.createRef()),_defineProperty$m(_assertThisInitialized$a(nt),"state",nt.getDefaultState(nt.props)),_defineProperty$m(_assertThisInitialized$a(nt),"animateIn",function(){nt.props.isOpen&&nt.setState({isAnimating:!0})}),_defineProperty$m(_assertThisInitialized$a(nt),"animateOut",function(){nt.props.isOpen||(nt.setState({isAnimating:!0}),nt.animateOutCompleteTimer=setTimeout(function(){nt.setState({isAnimating:!1,placement:nt.props.placement})},nt.props.animateOutTime||ANIMATE_OUT_TIME))}),_defineProperty$m(_assertThisInitialized$a(nt),"onAnchorClick",function(ut){nt.props.onClick&&nt.props.onClick(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onAnchorMouseEnter",function(ut){nt.onMouseLeaveTimer&&clearTimeout(nt.onMouseLeaveTimer),nt.triggerOnMouseEnterWithDelay(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onAnchorMouseLeave",function(ut){nt.onMouseEnterTimer&&clearTimeout(nt.onMouseEnterTimer),nt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onPopoverMouseEnter",function(){nt.onMouseLeaveTimer&&clearTimeout(nt.onMouseLeaveTimer)}),_defineProperty$m(_assertThisInitialized$a(nt),"onPopoverMouseLeave",function(ut){nt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onPopperUpdate",function(ut,ct){var pt=fromPopperPlacement(ct.placement)||PLACEMENT.top;return nt.setState({arrowOffset:ut.arrow,popoverOffset:ut.popper,placement:pt}),nt.animateInTimer=setTimeout(nt.animateIn,ANIMATE_IN_TIME),ct}),_defineProperty$m(_assertThisInitialized$a(nt),"triggerOnMouseLeave",function(ut){nt.props.onMouseLeave&&nt.props.onMouseLeave(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"triggerOnMouseEnter",function(ut){nt.props.onMouseEnter&&nt.props.onMouseEnter(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onDocumentClick",function(ut){var ct=ut.composedPath?ut.composedPath()[0]:ut.target,pt=nt.popperRef.current,dt=nt.anchorRef.current;!pt||pt===ct||ct instanceof Node&&pt.contains(ct)||!dt||dt===ct||ct instanceof Node&&dt.contains(ct)||nt.props.onClickOutside&&nt.props.onClickOutside(ut)}),nt}return _createClass$h(et,[{key:"componentDidMount",value:function(){this.setState({isMounted:!0})}},{key:"componentDidUpdate",value:function(ot,at){this.init(ot,at),this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip&&this.props.autoFocus&&!this.state.autoFocusAfterPositioning&&this.popperRef.current!==null&&this.popperRef.current.getBoundingClientRect().top>0&&this.setState({autoFocusAfterPositioning:!0})}},{key:"init",value:function(ot,at){if(this.props.isOpen!==ot.isOpen||this.state.isMounted!==at.isMounted||this.state.isLayerMounted!==at.isLayerMounted){if(this.props.isOpen&&this.state.isLayerMounted){this.clearTimers();return}if(!this.props.isOpen&&ot.isOpen){this.animateOutTimer=setTimeout(this.animateOut,20);return}}}},{key:"componentWillUnmount",value:function(){this.clearTimers()}},{key:"getDefaultState",value:function(ot){return{isAnimating:!1,arrowOffset:{left:0,top:0},popoverOffset:{left:0,top:0},placement:ot.placement,isMounted:!1,isLayerMounted:!1,autoFocusAfterPositioning:!1}}},{key:"clearTimers",value:function(){[this.animateInTimer,this.animateOutTimer,this.animateOutCompleteTimer,this.onMouseEnterTimer,this.onMouseLeaveTimer].forEach(function(ot){ot&&clearTimeout(ot)})}},{key:"triggerOnMouseLeaveWithDelay",value:function(ot){var at=this,st=this.props.onMouseLeaveDelay;if(st){this.onMouseLeaveTimer=setTimeout(function(){return at.triggerOnMouseLeave(ot)},st);return}this.triggerOnMouseLeave(ot)}},{key:"triggerOnMouseEnterWithDelay",value:function(ot){var at=this,st=this.props.onMouseEnterDelay;if(st){this.onMouseEnterTimer=setTimeout(function(){return at.triggerOnMouseEnter(ot)},st);return}this.triggerOnMouseEnter(ot)}},{key:"isClickTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.click}},{key:"isHoverTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.hover}},{key:"isAccessibilityTypeMenu",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.menu}},{key:"isAccessibilityTypeTooltip",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.tooltip}},{key:"getAnchorIdAttr",value:function(){var ot=this.getPopoverIdAttr();return ot?"".concat(ot,"__anchor"):null}},{key:"getPopoverIdAttr",value:function(){return this.props.id||null}},{key:"getAnchorProps",value:function(){var ot=this.props.isOpen,at={ref:this.anchorRef},st=this.getPopoverIdAttr();if(this.isAccessibilityTypeMenu()){var ut=this.isClickTrigger()?"aria-controls":"aria-owns";at[ut]=ot?st:null,at["aria-haspopup"]=!0,at["aria-expanded"]=!!ot}else this.isAccessibilityTypeTooltip()&&(at.id=this.getAnchorIdAttr(),at["aria-describedby"]=ot?st:null);return this.isHoverTrigger()?(at.onMouseEnter=this.onAnchorMouseEnter,at.onMouseLeave=this.onAnchorMouseLeave,at.onBlur=this.props.onBlur,at.onFocus=this.props.onFocus):at.onClick=this.onAnchorClick,at}},{key:"getPopoverBodyProps",value:function(){var ot={},at=this.getPopoverIdAttr();return this.isAccessibilityTypeMenu()?ot.id=at:this.isAccessibilityTypeTooltip()&&(ot.id=at,ot.role="tooltip"),this.isHoverTrigger()&&(ot.onMouseEnter=this.onPopoverMouseEnter,ot.onMouseLeave=this.onPopoverMouseLeave),ot}},{key:"getSharedProps",value:function(){var ot=this.props,at=ot.isOpen,st=ot.showArrow,ut=ot.popoverMargin,ct=ut===void 0?POPOVER_MARGIN:ut,pt=this.state,dt=pt.isAnimating,ft=pt.arrowOffset,bt=pt.popoverOffset,ht=pt.placement;return{$showArrow:!!st,$arrowOffset:ft,$popoverOffset:bt,$placement:ht,$isAnimating:dt,$animationDuration:this.props.animateOutTime||ANIMATE_OUT_TIME,$isOpen:at,$popoverMargin:ct,$isHoverTrigger:this.isHoverTrigger()}}},{key:"getAnchorFromChildren",value:function(){var ot=this.props.children,at=reactExports.Children.toArray(ot);return at.length!==1&&console.error("[baseui] Exactly 1 child must be passed to Popover/Tooltip, found ".concat(at.length," children")),at[0]}},{key:"renderAnchor",value:function(){var ot=this.getAnchorFromChildren();if(!ot)return null;var at=reactExports.isValidElement(ot),st=this.getAnchorProps();return _typeof$b(ot)==="object"&&at?reactExports.cloneElement(ot,st):reactExports.createElement("span",_extends$A({key:"popover-anchor"},st),ot)}},{key:"renderPopover",value:function(ot){var at=this.props,st=at.showArrow,ut=at.overrides,ct=ut===void 0?{}:ut,pt=ct.Arrow,dt=ct.Body,ft=ct.Inner,bt=getOverride(pt)||Arrow$1,ht=getOverride(dt)||Body$2,mt=getOverride(ft)||Inner$1,Ot=this.getSharedProps(),yt=this.getPopoverBodyProps();return reactExports.createElement(ht,_extends$A({key:"popover-body",ref:this.popperRef,"data-baseweb":this.props["data-baseweb"]||"popover"},yt,Ot,getOverrideProps(dt)),st?reactExports.createElement(bt,_extends$A({key:"popover-arrow",ref:this.arrowRef},Ot,getOverrideProps(pt))):null,reactExports.createElement(mt,_extends$A({},Ot,getOverrideProps(ft)),ot))}},{key:"renderContent",value:function(){var ot=this.props.content;return typeof ot=="function"?ot():ot}},{key:"render",value:function(){var ot=this,at=this.state.isMounted&&(this.props.isOpen||this.state.isAnimating),st=[this.renderAnchor()],ut=at||this.props.renderAll?this.renderContent():null,ct={modifiers:{preventOverflow:{enabled:!this.props.ignoreBoundary,padding:0}}};return ut&&(at?st.push(reactExports.createElement(Layer,{key:"new-layer",mountNode:this.props.mountNode,onEscape:this.props.onEsc,onDocumentClick:this.isHoverTrigger()?void 0:this.onDocumentClick,isHoverLayer:this.isHoverTrigger(),onMount:function(){return ot.setState({isLayerMounted:!0})},onUnmount:function(){return ot.setState({isLayerMounted:!1})}},reactExports.createElement(Tether,{anchorRef:this.anchorRef.current,arrowRef:this.arrowRef.current,popperRef:this.popperRef.current,popperOptions:_objectSpread$h(_objectSpread$h({},ct),this.props.popperOptions),onPopperUpdate:this.onPopperUpdate,placement:this.state.placement},this.props.focusLock&&this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip?reactExports.createElement(FocusLockCombination,{disabled:!this.props.focusLock,noFocusGuards:!1,returnFocus:!this.isHoverTrigger()&&this.props.returnFocus,autoFocus:this.state.autoFocusAfterPositioning,crossFrame:!1,focusOptions:this.props.focusOptions},this.renderPopover(ut)):reactExports.createElement(MoveFocusInside,{disabled:!this.props.autoFocus||!this.state.autoFocusAfterPositioning},this.renderPopover(ut))))):st.push(reactExports.createElement(Hidden,{key:"hidden-layer"},ut))),st}}]),et}(reactExports.Component);_defineProperty$m(PopoverInner,"defaultProps",baseDefaultProps$1);var Popover$1=function rt(tt){var et=tt.innerRef,nt=useUID();return reactExports.createElement(PopoverInner,_extends$A({id:tt.id||nt,ref:et},tt))};Popover$1.defaultProps=baseDefaultProps$1;var _excluded$i=["children"];function _objectWithoutProperties$l(rt,tt){if(rt==null)return{};var et=_objectWithoutPropertiesLoose$i(rt,tt),nt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(rt);for(ot=0;ot<at.length;ot++)nt=at[ot],!(tt.indexOf(nt)>=0)&&Object.prototype.propertyIsEnumerable.call(rt,nt)&&(et[nt]=rt[nt])}return et}function _objectWithoutPropertiesLoose$i(rt,tt){if(rt==null)return{};var et={},nt=Object.keys(rt),ot,at;for(at=0;at<nt.length;at++)ot=nt[at],!(tt.indexOf(ot)>=0)&&(et[ot]=rt[ot]);return et}function StatefulPopover(rt){var tt=rt.children,et=_objectWithoutProperties$l(rt,_excluded$i);return reactExports.createElement(StatefulContainer$1,et,function(nt){return reactExports.createElement(Popover$1,nt,tt)})}StatefulPopover.defaultProps={accessibilityType:ACCESSIBILITY_TYPE.menu,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,dismissOnClickOutside:!0,dismissOnEsc:!0,stateReducer:function rt(tt,et){return et},popoverMargin:POPOVER_MARGIN};var baseDefaultProps={accessibilityType:ACCESSIBILITY_TYPE.tooltip,focusLock:!1,autoFocus:!1,returnFocus:!1,onMouseEnterDelay:200,onMouseLeaveDelay:200,overrides:{},placement:PLACEMENT.auto,popoverMargin:0,showArrow:!1,triggerType:TRIGGER_TYPE.hover,renderAll:!1};function _typeof$a(rt){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$a(rt)}function ownKeys$h(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$g(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$h(Object(et),!0).forEach(function(nt){_defineProperty$l(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$h(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _classCallCheck$i(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(rt,tt){for(var et=0;et<tt.length;et++){var nt=tt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(rt,nt.key,nt)}}function _createClass$g(rt,tt,et){return tt&&_defineProperties$8(rt.prototype,tt),Object.defineProperty(rt,"prototype",{writable:!1}),rt}function _inherits$i(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function");rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,writable:!0,configurable:!0}}),Object.defineProperty(rt,"prototype",{writable:!1}),tt&&_setPrototypeOf$8(rt,tt)}function _setPrototypeOf$8(rt,tt){return _setPrototypeOf$8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,ot){return nt.__proto__=ot,nt},_setPrototypeOf$8(rt,tt)}function _createSuper$7(rt){var tt=_isNativeReflectConstruct$7();return function(){var nt=_getPrototypeOf$8(rt),ot;if(tt){var at=_getPrototypeOf$8(this).constructor;ot=Reflect.construct(nt,arguments,at)}else ot=nt.apply(this,arguments);return _possibleConstructorReturn$i(this,ot)}}function _possibleConstructorReturn$i(rt,tt){if(tt&&(_typeof$a(tt)==="object"||typeof tt=="function"))return tt;if(tt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$9(rt)}function _assertThisInitialized$9(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}function _isNativeReflectConstruct$7(){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$8(rt){return _getPrototypeOf$8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$8(rt)}function _defineProperty$l(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var StatefulContainer=function(rt){_inherits$i(et,rt);var tt=_createSuper$7(et);function et(){return _classCallCheck$i(this,et),tt.apply(this,arguments)}return _createClass$g(et,[{key:"render",value:function(){return reactExports.createElement(StatefulContainer$1,this.props)}}]),et}(reactExports.Component);_defineProperty$l(StatefulContainer,"defaultProps",_objectSpread$g({},baseDefaultProps));function ownKeys$g(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$f(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$g(Object(et),!0).forEach(function(nt){_defineProperty$k(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$g(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _defineProperty$k(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var Body$1=styled("div",function(rt){return _objectSpread$f(_objectSpread$f({},getBodyStyles(rt)),{},{backgroundColor:rt.$theme.colors.tooltipBackground,borderTopLeftRadius:rt.$theme.borders.radius300,borderTopRightRadius:rt.$theme.borders.radius300,borderBottomRightRadius:rt.$theme.borders.radius300,borderBottomLeftRadius:rt.$theme.borders.radius300,boxShadow:rt.$theme.lighting.shadow400,color:rt.$theme.colors.tooltipText,transitionProperty:"opacity",transform:getEndPosition(rt.$popoverOffset)})});Body$1.displayName="Body";Body$1.displayName="Body";var Inner=styled("div",function(rt){return _objectSpread$f(_objectSpread$f(_objectSpread$f({},getInnerStyles(rt)),{},{backgroundColor:rt.$theme.colors.tooltipBackground,borderTopLeftRadius:rt.$theme.borders.radius300,borderTopRightRadius:rt.$theme.borders.radius300,borderBottomRightRadius:rt.$theme.borders.radius300,borderBottomLeftRadius:rt.$theme.borders.radius300,paddingTop:rt.$theme.sizing.scale300,paddingBottom:rt.$theme.sizing.scale300,paddingLeft:rt.$theme.sizing.scale600,paddingRight:rt.$theme.sizing.scale600},rt.$theme.typography.font150),{},{color:rt.$theme.colors.tooltipText})});Inner.displayName="Inner";Inner.displayName="Inner";var Arrow=styled("div",function(rt){return _objectSpread$f(_objectSpread$f({},getArrowStyles(rt)),{},{backgroundColor:rt.$theme.colors.tooltipBackground})});Arrow.displayName="Arrow";Arrow.displayName="Arrow";function _typeof$9(rt){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$9(rt)}function ownKeys$f(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$e(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$f(Object(et),!0).forEach(function(nt){_defineProperty$j(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$f(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _extends$z(){return _extends$z=Object.assign?Object.assign.bind():function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_extends$z.apply(this,arguments)}function _classCallCheck$h(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(rt,tt){for(var et=0;et<tt.length;et++){var nt=tt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(rt,nt.key,nt)}}function _createClass$f(rt,tt,et){return tt&&_defineProperties$7(rt.prototype,tt),Object.defineProperty(rt,"prototype",{writable:!1}),rt}function _inherits$h(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function");rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,writable:!0,configurable:!0}}),Object.defineProperty(rt,"prototype",{writable:!1}),tt&&_setPrototypeOf$7(rt,tt)}function _setPrototypeOf$7(rt,tt){return _setPrototypeOf$7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,ot){return nt.__proto__=ot,nt},_setPrototypeOf$7(rt,tt)}function _createSuper$6(rt){var tt=_isNativeReflectConstruct$6();return function(){var nt=_getPrototypeOf$7(rt),ot;if(tt){var at=_getPrototypeOf$7(this).constructor;ot=Reflect.construct(nt,arguments,at)}else ot=nt.apply(this,arguments);return _possibleConstructorReturn$h(this,ot)}}function _possibleConstructorReturn$h(rt,tt){if(tt&&(_typeof$9(tt)==="object"||typeof tt=="function"))return tt;if(tt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$8(rt)}function _assertThisInitialized$8(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}function _isNativeReflectConstruct$6(){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$7(rt){return _getPrototypeOf$7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$7(rt)}function _defineProperty$j(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var Tooltip$1=function(rt){_inherits$h(et,rt);var tt=_createSuper$6(et);function et(){return _classCallCheck$h(this,et),tt.apply(this,arguments)}return _createClass$f(et,[{key:"render",value:function(){var ot=mergeOverrides({Arrow,Body:Body$1,Inner},this.props.overrides);return reactExports.createElement(Popover$1,_extends$z({autoFocus:!1,"data-baseweb":"tooltip"},this.props,{overrides:ot}))}}]),et}(reactExports.Component);_defineProperty$j(Tooltip$1,"defaultProps",_objectSpread$e({},baseDefaultProps));var _excluded$h=["children"];function _objectWithoutProperties$k(rt,tt){if(rt==null)return{};var et=_objectWithoutPropertiesLoose$h(rt,tt),nt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(rt);for(ot=0;ot<at.length;ot++)nt=at[ot],!(tt.indexOf(nt)>=0)&&Object.prototype.propertyIsEnumerable.call(rt,nt)&&(et[nt]=rt[nt])}return et}function _objectWithoutPropertiesLoose$h(rt,tt){if(rt==null)return{};var et={},nt=Object.keys(rt),ot,at;for(at=0;at<nt.length;at++)ot=nt[at],!(tt.indexOf(ot)>=0)&&(et[ot]=rt[ot]);return et}function StatefulTooltip(rt){var tt=rt.children,et=_objectWithoutProperties$k(rt,_excluded$h);return reactExports.createElement(StatefulContainer,et,function(nt){return reactExports.createElement(Tooltip$1,nt,tt)})}StatefulTooltip.defaultProps=StatefulContainer.defaultProps;const StyledWrapper=newStyled("div",{target:"ebtlh8d0"})({display:"table",tableLayout:"fixed",width:"100%"}),StyledEllipsizedDiv=newStyled("div",{target:"ebtlh8d1"})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell"}),StyledTooltipContentWrapper=newStyled("div",{target:"ebtlh8d2"})(({theme:rt})=>({boxSizing:"border-box",fontSize:`${rt.fontSizes.sm}`,maxWidth:`calc(${rt.sizes.contentMaxWidth} - 2 * ${rt.spacing.threeXL})`,maxHeight:rt.sizes.maxTooltipHeight,overflow:["auto","overlay"],padding:`${rt.spacing.xs} ${rt.spacing.md}`,[`@media (max-width: ${rt.breakpoints.sm})`]:{maxWidth:`calc(100% - ${rt.spacing.threeXL})`},img:{maxWidth:"100%"},"*":{fontSize:`${rt.fontSizes.sm} !important`}}));var Placement;(function(rt){rt.AUTO="auto",rt.TOP_LEFT="topLeft",rt.TOP="top",rt.TOP_RIGHT="topRight",rt.RIGHT_TOP="rightTop",rt.RIGHT="right",rt.RIGHT_BOTTOM="rightBottom",rt.BOTTOM_RIGHT="bottomRight",rt.BOTTOM="bottom",rt.BOTTOM_LEFT="bottomLeft",rt.LEFT_BOTTOM="leftBottom",rt.LEFT="left",rt.LEFT_TOP="leftTop"})(Placement||(Placement={}));function Tooltip({content:rt,placement:tt,children:et,inline:nt,style:ot,onMouseEnterDelay:at,overrides:st}){const ut=useTheme(),{colors:ct,fontSizes:pt,radii:dt,fontWeights:ft}=ut,bt=reactExports.useRef(null);return jsx$1(StatefulTooltip,{onOpen:()=>{var mt;const ht=(mt=bt.current)==null?void 0:mt.parentElement;ht&&setTimeout(()=>{var St;const Ot=ht.getBoundingClientRect(),yt=Ot.x,Mt=yt+Ot.width-window.innerWidth,At=ht.parentElement;if(Mt>0&&At){const Et=new DOMMatrix((St=window.getComputedStyle(At))==null?void 0:St.transform);At.style.transform=`translate3d(${Et.e-Mt}px, ${Et.f}px, 0px)`}yt<0&&(ht.style.left=`${-yt}px`)},0)},content:rt?jsx$1(StyledTooltipContentWrapper,{className:"stTooltipContent","data-testid":"stTooltipContent",ref:bt,children:rt}):null,placement:PLACEMENT[tt],accessibilityType:ACCESSIBILITY_TYPE.tooltip,showArrow:!1,popoverMargin:10,onMouseEnterDelay:at,overrides:{Body:{style:{borderTopLeftRadius:dt.default,borderTopRightRadius:dt.default,borderBottomLeftRadius:dt.default,borderBottomRightRadius:dt.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:hasLightBackgroundColor(ut)?ct.bgColor:ct.secondaryBg,color:ct.bodyText,fontSize:pt.sm,fontWeight:ft.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}},...st},children:jsx$1("div",{style:{display:"flex",flexDirection:"row",justifyContent:nt?"flex-end":"",...ot},"data-testid":"stTooltipHoverTarget",className:"stTooltipHoverTarget",children:et})})}function OverflowTooltip({content:rt,placement:tt,children:et,inline:nt,style:ot}){const at=React$1.useRef(null),[st,ut]=reactExports.useState(!1);return React$1.useEffect(()=>{const ct=at!=null&&at.current?at.current.offsetWidth<at.current.scrollWidth:!1;ct!==st&&ut(ct)},[et,st]),jsx$1(Tooltip,{content:st?rt:"",placement:tt,inline:nt,children:jsx$1(StyledWrapper,{children:jsx$1(StyledEllipsizedDiv,{ref:at,style:ot,children:et})})})}const StyledTooltipIconWrapper=newStyled("div",{target:"e1pw9gww0"})(({isLatex:rt,theme:tt})=>({display:"flex",alignItems:"center",marginTop:rt?tt.spacing.md:"0","& .stTooltipHoverTarget > svg":{stroke:tt.colors.fadedText60,strokeWidth:2.25}})),StyledLabelHelpWrapper=newStyled("div",{target:"e1pw9gww1"})(({isLatex:rt})=>({display:"flex",visibility:"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center",...rt?{justifyContent:"center"}:{}})),StyledLabelHelpInline=newStyled("label",{target:"e1pw9gww2"})(({theme:rt})=>({marginLeft:rt.spacing.xs,position:"relative",display:"flex",flexDirection:"row"}));function TooltipIcon({placement:rt=Placement.AUTO,isLatex:tt=!1,content:et,children:nt,markdownProps:ot,onMouseEnterDelay:at}){const st=useTheme();return jsx$1(StyledTooltipIconWrapper,{className:"stTooltipIcon","data-testid":"stTooltipIcon",isLatex:tt,children:jsx$1(Tooltip,{content:jsx$1(StreamlitMarkdown$1,{style:{fontSize:st.fontSizes.sm},source:et,allowHTML:!1,...ot||{}}),placement:rt,onMouseEnterDelay:at,inline:!0,children:nt||jsx$1(HelpCircle,{className:"icon",size:st.iconSizes.base})})})}const InlineTooltipIcon=({placement:rt=Placement.TOP_RIGHT,isLatex:tt=!1,content:et,children:nt,markdownProps:ot})=>jsx$1(StyledLabelHelpInline,{children:jsx$1(TooltipIcon,{placement:rt,isLatex:tt,content:et,markdownProps:ot,children:nt})}),streamlitLogo="data:image/svg+xml,%3csvg%20width='301'%20height='165'%20viewBox='0%200%20301%20165'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M150.731%20101.547L98.1387%2073.7471L6.84674%2025.4969C6.7634%2025.4136%206.59674%2025.4136%206.51341%2025.4136C3.18007%2023.8303%20-0.236608%2027.1636%201.0134%2030.497L47.5302%20149.139L47.5385%20149.164C47.5885%20149.281%2047.6302%20149.397%2047.6802%20149.514C49.5885%20153.939%2053.7552%20156.672%2058.2886%20157.747C58.6719%20157.831%2058.9461%20157.906%2059.4064%20157.998C59.8645%20158.1%2060.5052%20158.239%2061.0552%20158.281C61.1469%20158.289%2061.2302%20158.289%2061.3219%20158.297H61.3886C61.4552%20158.306%2061.5219%20158.306%2061.5886%20158.314H61.6802C61.7386%20158.322%2061.8052%20158.322%2061.8636%20158.322H61.9719C62.0386%20158.331%2062.1052%20158.331%2062.1719%20158.331V158.331C121.084%20164.754%20180.519%20164.754%20239.431%20158.331V158.331C240.139%20158.331%20240.831%20158.297%20241.497%20158.231C241.714%20158.206%20241.922%20158.181%20242.131%20158.156C242.156%20158.147%20242.189%20158.147%20242.214%20158.139C242.356%20158.122%20242.497%20158.097%20242.639%20158.072C242.847%20158.047%20243.056%20158.006%20243.264%20157.964C243.681%20157.872%20243.87%20157.806%20244.436%20157.611C245.001%20157.417%20245.94%20157.077%20246.527%20156.794C247.115%20156.511%20247.522%20156.239%20248.014%20155.931C248.622%20155.547%20249.201%20155.155%20249.788%20154.715C250.041%20154.521%20250.214%20154.397%20250.397%20154.222L250.297%20154.164L150.731%20101.547Z'%20fill='%23FF4B4B'/%3e%3cpath%20d='M294.766%2025.4981H294.683L203.357%2073.7483L254.124%20149.357L300.524%2030.4981V30.3315C301.691%2026.8314%20298.108%2023.6648%20294.766%2025.4981'%20fill='%237D353B'/%3e%3cpath%20d='M155.598%202.55572C153.264%20-0.852624%20148.181%20-0.852624%20145.931%202.55572L98.1389%2073.7477L150.731%20101.548L250.398%20154.222C251.024%20153.609%20251.526%20153.012%20252.056%20152.381C252.806%20151.456%20253.506%20150.465%20254.123%20149.356L203.356%2073.7477L155.598%202.55572Z'%20fill='%23BD4043'/%3e%3c/svg%3e";function convertRemToEm(rt){return rt.replace(/rem$/,"em")}function sharedMarkdownStyle(rt){return{a:{color:rt.colors.link,textDecoration:"underline"}}}function convertFontSizes(rt,tt,et,nt,ot,at){return ot?at?convertRemToEm(nt):tt:at?convertRemToEm(et):rt}function getMarkdownHeadingDefinitions(rt,tt,et){return{"h1, h2, h3, h4, h5, h6":{fontFamily:rt.genericFonts.headingFont,fontWeight:rt.fontWeights.bold,lineHeight:rt.lineHeights.headings,margin:0,color:"inherit"},h1:{fontSize:convertFontSizes(rt.fontSizes.fourXL,rt.fontSizes.xl,rt.fontSizes.threeXL,rt.fontSizes.xl,tt,et),fontWeight:tt?rt.fontWeights.bold:rt.fontWeights.extrabold,padding:`${rt.spacing.xl} 0 ${rt.spacing.lg} 0`},"h1 b, h1 strong":{fontWeight:rt.fontWeights.extrabold},"h2, h3":{letterSpacing:"-0.005em"},h2:{fontSize:convertFontSizes(rt.fontSizes.threeXL,rt.fontSizes.lg,rt.fontSizes.twoXL,rt.fontSizes.lg,tt,et),padding:`${rt.spacing.lg} 0 ${rt.spacing.lg} 0`},h3:{fontSize:convertFontSizes(rt.fontSizes.twoXL,rt.fontSizes.mdLg,rt.fontSizes.lg,rt.fontSizes.mdLg,tt,et),padding:`${rt.spacing.sm} 0 ${rt.spacing.lg} 0`},h4:{fontSize:convertFontSizes(rt.fontSizes.xl,rt.fontSizes.md,rt.fontSizes.md,rt.fontSizes.md,tt,et),padding:`${rt.spacing.md} 0 ${rt.spacing.lg} 0`},h5:{fontSize:convertFontSizes(rt.fontSizes.lg,rt.fontSizes.sm,rt.fontSizes.md,rt.fontSizes.md,tt,et),padding:`0 0 ${rt.spacing.lg} 0`},h6:{fontSize:convertFontSizes(rt.fontSizes.md,rt.fontSizes.twoSm,rt.fontSizes.md,rt.fontSizes.md,tt,et),padding:`0 0 ${rt.spacing.lg} 0`}}}const StyledStreamlitMarkdown=newStyled("div",{target:"e1rzdmaw0"})(({theme:rt,isCaption:tt,isInSidebarOrDialog:et,isLabel:nt,boldLabel:ot,largerLabel:at,isToast:st})=>{const ut=nt&&!at||st||tt;return{fontFamily:rt.genericFonts.bodyFont,fontSize:ut?rt.fontSizes.sm:rt.fontSizes.md,marginBottom:nt?"":`-${rt.spacing.lg}`,opacity:tt?.6:void 0,color:"inherit",...sharedMarkdownStyle(rt),...getMarkdownHeadingDefinitions(rt,et,tt),p:{wordBreak:"break-word",marginBottom:nt?rt.spacing.none:"",fontWeight:ot?rt.fontWeights.bold:"",marginTop:rt.spacing.none,marginLeft:rt.spacing.none,marginRight:rt.spacing.none},img:{maxWidth:"100%",maxHeight:nt?"1em":void 0,verticalAlign:"middle"},li:{margin:"0.2em 0 0.2em 1.2em",padding:"0 0 0 0.6em"},blockquote:{margin:"1em 0 1em 0",padding:"0 0 0 1.2em",borderLeft:`${rt.sizes.borderWidth} solid ${rt.colors.lightGray}`},"b, strong":{fontWeight:rt.fontWeights.bold},hr:{margin:"2em 0",padding:0,color:"inherit",backgroundColor:"transparent",border:"none",borderBottom:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,"&:not([size])":{height:rt.sizes.borderWidth}},table:{marginBottom:rt.spacing.lg,borderCollapse:"collapse"},tr:{borderTop:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`},th:{textAlign:"inherit"},"th, td":{padding:`${rt.spacing.xs} ${rt.spacing.md}`,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`},"span.has-background-color":{padding:`${rt.spacing.threeXS} ${rt.spacing.twoXS}`,margin:rt.spacing.none,borderRadius:rt.radii.md},"p, ol, ul, dl, li":{fontSize:"inherit"}}}),StyledLinkIcon=newStyled("a",{target:"e1rzdmaw1"})(({theme:rt})=>({lineHeight:0,display:"inline-flex",alignItems:"center",justifyContent:"center",svg:{stroke:rt.colors.fadedText60,strokeWidth:2.25},"&:hover svg":{stroke:rt.colors.bodyText}})),StyledHeadingWithActionElements=newStyled("div",{target:"e1rzdmaw2"})(({theme:rt})=>({"h1, h2, h3, h4, h5, h6, span":{scrollMarginTop:rt.sizes.headerHeight},...sharedMarkdownStyle(rt),wordBreak:"break-word",textWrap:"pretty",[StyledLinkIcon]:{visibility:"hidden"},"&:hover":{[StyledLinkIcon]:{visibility:"visible"}}})),StyledHeadingActionElements=newStyled("span",{target:"e1rzdmaw3"})(({theme:rt})=>({marginLeft:rt.spacing.sm,display:"inline-flex",gap:rt.spacing.sm,verticalAlign:"middle","& > *":{marginLeft:"0 !important"}})),StyledHeaderDivider=newStyled("hr",{target:"e1rzdmaw4"})(({theme:rt,rainbow:tt,color:et})=>({height:`${rt.spacing.threeXS} !important`,marginTop:rt.spacing.sm,marginBottom:rt.spacing.none,border:"none",borderRadius:rt.radii.full,...tt?{background:et}:{backgroundColor:et}})),StyledPreWrapper=newStyled("div",{target:"e1rzdmaw5"})(({theme:rt})=>({marginBottom:rt.spacing.lg}));var Tags;(function(rt){rt.H1="h1",rt.H2="h2",rt.H3="h3"})(Tags||(Tags={}));function createAnchorFromText(rt){let tt="";return rt&&/^[\x00-\x7F]*$/.test(rt)?tt=rt==null?void 0:rt.toLowerCase().split(/[^\p{L}\p{N}]+/gu).filter(Boolean).join("-"):rt&&(tt=xxhash.h32(rt,43981).toString(16)),tt}function transformLinkUri(rt){return rt}const scrollNodeIntoView=once$1(rt=>{rt.scrollIntoView(!0)}),HeaderActionElements=({elementId:rt,help:tt,hideAnchor:et})=>{const nt=useTheme();return!tt&&et?jsx$1(Fragment,{}):jsxs(StyledHeadingActionElements,{"data-testid":"stHeaderActionElements",children:[tt&&jsx$1(InlineTooltipIcon,{content:tt}),rt&&!et&&jsx$1(StyledLinkIcon,{href:`#${rt}`,children:jsx$1(Link2,{size:nt.iconSizes.base})})]})},HeadingWithActionElements=({tag:rt,anchor:tt,help:et,hideAnchor:nt,children:ot,tagProps:at})=>{const st=React$1.useContext(IsSidebarContext),ut=React$1.useContext(IsDialogContext),[ct,pt]=React$1.useState(tt),[dt,ft]=React$1.useState(null),{addScriptFinishedHandler:bt,removeScriptFinishedHandler:ht}=React$1.useContext(LibContext),mt=React$1.useCallback(()=>{dt!==null&&window.setTimeout(()=>{scrollNodeIntoView(dt)},300)},[dt]);React$1.useEffect(()=>(bt(mt),()=>{ht(mt)}),[bt,ht,mt]);const Ot=React$1.useCallback(Et=>{if(Et===null)return;const zt=tt||createAnchorFromText(Et.textContent);pt(zt);const vt=window.location.hash.slice(1);vt&&vt===zt&&ft(Et)},[tt]),yt=st||ut,Mt=jsx$1(HeaderActionElements,{elementId:ct,help:et,hideAnchor:nt||yt}),At=yt?{}:{ref:Ot,id:ct},St=React$1.createElement(rt,{...at,...At},jsxs(Fragment,{children:[ot,Mt]}));return yt?St:jsx$1(StyledHeadingWithActionElements,{"data-testid":"stHeadingWithActionElements",children:St})},CustomHeading=({node:rt,children:tt,...et})=>{const nt=et["data-anchor"];return jsx$1(HeadingWithActionElements,{tag:rt.tagName,anchor:nt,tagProps:et,children:tt})},CustomCodeTag=({inline:rt,className:tt,children:et,...nt})=>{const ot=/language-(\w+)/.exec(tt||""),at=String(et).trim().replace(/\n$/,""),st=ot&&ot[1]||"";return rt?jsx$1(StyledInlineCode,{className:tt,...omit$1(nt,"node"),children:et}):jsx$1(StreamlitSyntaxHighlighter$1,{language:st,showLineNumbers:!1,children:at})},CustomPreTag=({children:rt})=>jsx$1(StyledPreWrapper,{"data-testid":"stMarkdownPre",children:rt});function RenderedMarkdown({allowHTML:rt,source:tt,overrideComponents:et,isLabel:nt,disableLinks:ot}){const at={pre:CustomPreTag,code:CustomCodeTag,a:LinkWithTargetBlank,h1:CustomHeading,h2:CustomHeading,h3:CustomHeading,h4:CustomHeading,h5:CustomHeading,h6:CustomHeading,...et||{}},st=useTheme(),{red:ut,orange:ct,yellow:pt,green:dt,blue:ft,violet:bt,purple:ht,gray:mt,primary:Ot}=getMarkdownTextColors(st),{redbg:yt,orangebg:Mt,yellowbg:At,greenbg:St,bluebg:Et,violetbg:zt,purplebg:vt,graybg:Tt,primarybg:$t}=getMarkdownBgColors(st),Rt=new Map(Object.entries({red:`color: ${ut}`,blue:`color: ${ft}`,green:`color: ${dt}`,violet:`color: ${bt}`,orange:`color: ${ct}`,gray:`color: ${mt}`,grey:`color: ${mt}`,primary:`color: ${Ot}`,rainbow:`color: transparent; background-clip: text; -webkit-background-clip: text; background-image: linear-gradient(to right,
451
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$g(rt,tt){if(rt){if(typeof rt=="string")return _arrayLikeToArray$g(rt,tt);var et=Object.prototype.toString.call(rt).slice(8,-1);if(et==="Object"&&rt.constructor&&(et=rt.constructor.name),et==="Map"||et==="Set")return Array.from(rt);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return _arrayLikeToArray$g(rt,tt)}}function _arrayLikeToArray$g(rt,tt){(tt==null||tt>rt.length)&&(tt=rt.length);for(var et=0,nt=new Array(tt);et<tt;et++)nt[et]=rt[et];return nt}function _iterableToArrayLimit$g(rt,tt){var et=rt==null?null:typeof Symbol<"u"&&rt[Symbol.iterator]||rt["@@iterator"];if(et!=null){var nt=[],ot=!0,at=!1,st,ut;try{for(et=et.call(rt);!(ot=(st=et.next()).done)&&(nt.push(st.value),!(tt&&nt.length===tt));ot=!0);}catch(ct){at=!0,ut=ct}finally{try{!ot&&et.return!=null&&et.return()}finally{if(at)throw ut}}return nt}}function _arrayWithHoles$g(rt){if(Array.isArray(rt))return rt}var OPPOSITE_POSITIONS={top:"bottom",bottom:"top",right:"left",left:"right"};function getOppositePosition(rt){return OPPOSITE_POSITIONS[rt]}function isVerticalPosition(rt){return rt==="top"||rt==="bottom"}function capitalize(rt){return rt.charAt(0).toUpperCase()+rt.slice(1)}function fromPopperPlacement(rt){var tt=rt.replace(/(top|bottom)-start$/,"$1Left").replace(/(top|bottom)-end$/,"$1Right").replace(/(left|right)-start$/,"$1Top").replace(/(left|right)-end$/,"$1Bottom");return PLACEMENT[tt]||null}function splitPlacement(rt){var tt=rt.match(/^([a-z]+)([A-Z][a-z]+)?/)||[];return tt.slice(1,3).filter(Boolean).map(function(et){return et.toLowerCase()})}function getPopoverMarginStyles(rt,tt,et){var nt=splitPlacement(tt),ot=_slicedToArray$g(nt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut="margin".concat(capitalize(st));return _defineProperty$o({},ut,"".concat(rt+et,"px"))}function getStartPosition(rt,tt,et,nt){rt=_objectSpread$j({},rt);var ot=splitPlacement(tt),at=_slicedToArray$g(ot,1),st=at[0],ut=(et>0?et:nt)*2;return isVerticalPosition(st)?rt.top+=st==="top"?ut:-ut:rt.left+=st==="left"?ut:-ut,"translate3d(".concat(rt.left,"px, ").concat(rt.top,"px, 0)")}function getEndPosition(rt){return"translate3d(".concat(rt.left,"px, ").concat(rt.top,"px, 0)")}function getArrowPositionStyles(rt,tt){var et,nt=splitPlacement(tt),ot=_slicedToArray$g(nt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut=isVerticalPosition(at)?"left":"top";return et={},_defineProperty$o(et,ut,"".concat(rt[ut],"px")),_defineProperty$o(et,st,"-".concat(ARROW_SIZE-2,"px")),et}function ownKeys$j(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$i(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$j(Object(et),!0).forEach(function(nt){_defineProperty$n(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$j(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _defineProperty$n(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}function getBodyStyles(rt){var tt=rt.$animationDuration,et=rt.$isOpen,nt=rt.$isAnimating,ot=rt.$placement,at=rt.$popoverOffset,st=rt.$showArrow,ut=rt.$theme,ct=rt.$popoverMargin,pt=rt.$isHoverTrigger;return _objectSpread$i(_objectSpread$i({position:"absolute",top:0,left:0,backgroundColor:ut.colors.backgroundTertiary,borderTopLeftRadius:ut.borders.popoverBorderRadius,borderTopRightRadius:ut.borders.popoverBorderRadius,borderBottomRightRadius:ut.borders.popoverBorderRadius,borderBottomLeftRadius:ut.borders.popoverBorderRadius,boxShadow:ut.lighting.shadow600,transitionProperty:"opacity,transform",transitionDuration:nt?et?"0.1s":"".concat(tt,"ms"):"0s",transitionTimingFunction:et?ut.animation.easeOutCurve:ut.animation.easeInCurve,opacity:nt&&et?1:0,transform:nt&&et?getEndPosition(at):getStartPosition(at,ot,st?ARROW_SIZE:0,ct)},getPopoverMarginStyles(st?ARROW_SIZE:0,ot,ct)),pt?{animationDuration:".1s",animationName:{"0%":{pointerEvents:"none"},"99%":{pointerEvents:"none"},"100%":{pointerEvents:"auto"}}}:{})}var Body$2=styled("div",getBodyStyles);Body$2.displayName="Body";Body$2.displayName="Body";function getArrowStyles(rt){var tt=rt.$arrowOffset,et=rt.$placement,nt=rt.$theme;return _objectSpread$i({backgroundColor:nt.colors.backgroundTertiary,boxShadow:nt.lighting.shadow600,width:"".concat(ARROW_WIDTH,"px"),height:"".concat(ARROW_WIDTH,"px"),transform:"rotate(45deg)",position:"absolute"},getArrowPositionStyles(tt,et))}var Arrow$1=styled("div",getArrowStyles);Arrow$1.displayName="Arrow";Arrow$1.displayName="Arrow";function getInnerStyles(rt){var tt=rt.$theme;return{backgroundColor:tt.colors.backgroundTertiary,borderTopLeftRadius:tt.borders.popoverBorderRadius,borderTopRightRadius:tt.borders.popoverBorderRadius,borderBottomRightRadius:tt.borders.popoverBorderRadius,borderBottomLeftRadius:tt.borders.popoverBorderRadius,color:tt.colors.contentPrimary,position:"relative"}}var Inner$1=styled("div",getInnerStyles);Inner$1.displayName="Inner";Inner$1.displayName="Inner";var Padding=styled("div",{paddingLeft:"12px",paddingTop:"12px",paddingRight:"12px",paddingBottom:"12px"});Padding.displayName="Padding";Padding.displayName="Padding";var Hidden=styled("div",{display:"none"});Hidden.displayName="Hidden";Hidden.displayName="Hidden";var baseDefaultProps$1={accessibilityType:ACCESSIBILITY_TYPE.menu,focusLock:!1,autoFocus:!0,returnFocus:!0,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,renderAll:!1};function ownKeys$i(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$h(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$i(Object(et),!0).forEach(function(nt){_defineProperty$m(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$i(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _extends$A(){return _extends$A=Object.assign?Object.assign.bind():function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_extends$A.apply(this,arguments)}function _typeof$b(rt){"@babel/helpers - typeof";return _typeof$b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$b(rt)}function _classCallCheck$j(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$9(rt,tt){for(var et=0;et<tt.length;et++){var nt=tt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(rt,nt.key,nt)}}function _createClass$h(rt,tt,et){return tt&&_defineProperties$9(rt.prototype,tt),Object.defineProperty(rt,"prototype",{writable:!1}),rt}function _inherits$j(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function");rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,writable:!0,configurable:!0}}),Object.defineProperty(rt,"prototype",{writable:!1}),tt&&_setPrototypeOf$9(rt,tt)}function _setPrototypeOf$9(rt,tt){return _setPrototypeOf$9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,ot){return nt.__proto__=ot,nt},_setPrototypeOf$9(rt,tt)}function _createSuper$8(rt){var tt=_isNativeReflectConstruct$8();return function(){var nt=_getPrototypeOf$9(rt),ot;if(tt){var at=_getPrototypeOf$9(this).constructor;ot=Reflect.construct(nt,arguments,at)}else ot=nt.apply(this,arguments);return _possibleConstructorReturn$j(this,ot)}}function _possibleConstructorReturn$j(rt,tt){if(tt&&(_typeof$b(tt)==="object"||typeof tt=="function"))return tt;if(tt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$a(rt)}function _assertThisInitialized$a(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}function _isNativeReflectConstruct$8(){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$9(rt){return _getPrototypeOf$9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$9(rt)}function _defineProperty$m(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var PopoverInner=function(rt){_inherits$j(et,rt);var tt=_createSuper$8(et);function et(){var nt;_classCallCheck$j(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return nt=tt.call.apply(tt,[this].concat(at)),_defineProperty$m(_assertThisInitialized$a(nt),"animateInTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"animateOutTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"animateOutCompleteTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"onMouseEnterTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"onMouseLeaveTimer",void 0),_defineProperty$m(_assertThisInitialized$a(nt),"anchorRef",reactExports.createRef()),_defineProperty$m(_assertThisInitialized$a(nt),"popperRef",reactExports.createRef()),_defineProperty$m(_assertThisInitialized$a(nt),"arrowRef",reactExports.createRef()),_defineProperty$m(_assertThisInitialized$a(nt),"state",nt.getDefaultState(nt.props)),_defineProperty$m(_assertThisInitialized$a(nt),"animateIn",function(){nt.props.isOpen&&nt.setState({isAnimating:!0})}),_defineProperty$m(_assertThisInitialized$a(nt),"animateOut",function(){nt.props.isOpen||(nt.setState({isAnimating:!0}),nt.animateOutCompleteTimer=setTimeout(function(){nt.setState({isAnimating:!1,placement:nt.props.placement})},nt.props.animateOutTime||ANIMATE_OUT_TIME))}),_defineProperty$m(_assertThisInitialized$a(nt),"onAnchorClick",function(ut){nt.props.onClick&&nt.props.onClick(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onAnchorMouseEnter",function(ut){nt.onMouseLeaveTimer&&clearTimeout(nt.onMouseLeaveTimer),nt.triggerOnMouseEnterWithDelay(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onAnchorMouseLeave",function(ut){nt.onMouseEnterTimer&&clearTimeout(nt.onMouseEnterTimer),nt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onPopoverMouseEnter",function(){nt.onMouseLeaveTimer&&clearTimeout(nt.onMouseLeaveTimer)}),_defineProperty$m(_assertThisInitialized$a(nt),"onPopoverMouseLeave",function(ut){nt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onPopperUpdate",function(ut,ct){var pt=fromPopperPlacement(ct.placement)||PLACEMENT.top;return nt.setState({arrowOffset:ut.arrow,popoverOffset:ut.popper,placement:pt}),nt.animateInTimer=setTimeout(nt.animateIn,ANIMATE_IN_TIME),ct}),_defineProperty$m(_assertThisInitialized$a(nt),"triggerOnMouseLeave",function(ut){nt.props.onMouseLeave&&nt.props.onMouseLeave(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"triggerOnMouseEnter",function(ut){nt.props.onMouseEnter&&nt.props.onMouseEnter(ut)}),_defineProperty$m(_assertThisInitialized$a(nt),"onDocumentClick",function(ut){var ct=ut.composedPath?ut.composedPath()[0]:ut.target,pt=nt.popperRef.current,dt=nt.anchorRef.current;!pt||pt===ct||ct instanceof Node&&pt.contains(ct)||!dt||dt===ct||ct instanceof Node&&dt.contains(ct)||nt.props.onClickOutside&&nt.props.onClickOutside(ut)}),nt}return _createClass$h(et,[{key:"componentDidMount",value:function(){this.setState({isMounted:!0})}},{key:"componentDidUpdate",value:function(ot,at){this.init(ot,at),this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip&&this.props.autoFocus&&!this.state.autoFocusAfterPositioning&&this.popperRef.current!==null&&this.popperRef.current.getBoundingClientRect().top>0&&this.setState({autoFocusAfterPositioning:!0})}},{key:"init",value:function(ot,at){if(this.props.isOpen!==ot.isOpen||this.state.isMounted!==at.isMounted||this.state.isLayerMounted!==at.isLayerMounted){if(this.props.isOpen&&this.state.isLayerMounted){this.clearTimers();return}if(!this.props.isOpen&&ot.isOpen){this.animateOutTimer=setTimeout(this.animateOut,20);return}}}},{key:"componentWillUnmount",value:function(){this.clearTimers()}},{key:"getDefaultState",value:function(ot){return{isAnimating:!1,arrowOffset:{left:0,top:0},popoverOffset:{left:0,top:0},placement:ot.placement,isMounted:!1,isLayerMounted:!1,autoFocusAfterPositioning:!1}}},{key:"clearTimers",value:function(){[this.animateInTimer,this.animateOutTimer,this.animateOutCompleteTimer,this.onMouseEnterTimer,this.onMouseLeaveTimer].forEach(function(ot){ot&&clearTimeout(ot)})}},{key:"triggerOnMouseLeaveWithDelay",value:function(ot){var at=this,st=this.props.onMouseLeaveDelay;if(st){this.onMouseLeaveTimer=setTimeout(function(){return at.triggerOnMouseLeave(ot)},st);return}this.triggerOnMouseLeave(ot)}},{key:"triggerOnMouseEnterWithDelay",value:function(ot){var at=this,st=this.props.onMouseEnterDelay;if(st){this.onMouseEnterTimer=setTimeout(function(){return at.triggerOnMouseEnter(ot)},st);return}this.triggerOnMouseEnter(ot)}},{key:"isClickTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.click}},{key:"isHoverTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.hover}},{key:"isAccessibilityTypeMenu",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.menu}},{key:"isAccessibilityTypeTooltip",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.tooltip}},{key:"getAnchorIdAttr",value:function(){var ot=this.getPopoverIdAttr();return ot?"".concat(ot,"__anchor"):null}},{key:"getPopoverIdAttr",value:function(){return this.props.id||null}},{key:"getAnchorProps",value:function(){var ot=this.props.isOpen,at={ref:this.anchorRef},st=this.getPopoverIdAttr();if(this.isAccessibilityTypeMenu()){var ut=this.isClickTrigger()?"aria-controls":"aria-owns";at[ut]=ot?st:null,at["aria-haspopup"]=!0,at["aria-expanded"]=!!ot}else this.isAccessibilityTypeTooltip()&&(at.id=this.getAnchorIdAttr(),at["aria-describedby"]=ot?st:null);return this.isHoverTrigger()?(at.onMouseEnter=this.onAnchorMouseEnter,at.onMouseLeave=this.onAnchorMouseLeave,at.onBlur=this.props.onBlur,at.onFocus=this.props.onFocus):at.onClick=this.onAnchorClick,at}},{key:"getPopoverBodyProps",value:function(){var ot={},at=this.getPopoverIdAttr();return this.isAccessibilityTypeMenu()?ot.id=at:this.isAccessibilityTypeTooltip()&&(ot.id=at,ot.role="tooltip"),this.isHoverTrigger()&&(ot.onMouseEnter=this.onPopoverMouseEnter,ot.onMouseLeave=this.onPopoverMouseLeave),ot}},{key:"getSharedProps",value:function(){var ot=this.props,at=ot.isOpen,st=ot.showArrow,ut=ot.popoverMargin,ct=ut===void 0?POPOVER_MARGIN:ut,pt=this.state,dt=pt.isAnimating,ft=pt.arrowOffset,bt=pt.popoverOffset,ht=pt.placement;return{$showArrow:!!st,$arrowOffset:ft,$popoverOffset:bt,$placement:ht,$isAnimating:dt,$animationDuration:this.props.animateOutTime||ANIMATE_OUT_TIME,$isOpen:at,$popoverMargin:ct,$isHoverTrigger:this.isHoverTrigger()}}},{key:"getAnchorFromChildren",value:function(){var ot=this.props.children,at=reactExports.Children.toArray(ot);return at.length!==1&&console.error("[baseui] Exactly 1 child must be passed to Popover/Tooltip, found ".concat(at.length," children")),at[0]}},{key:"renderAnchor",value:function(){var ot=this.getAnchorFromChildren();if(!ot)return null;var at=reactExports.isValidElement(ot),st=this.getAnchorProps();return _typeof$b(ot)==="object"&&at?reactExports.cloneElement(ot,st):reactExports.createElement("span",_extends$A({key:"popover-anchor"},st),ot)}},{key:"renderPopover",value:function(ot){var at=this.props,st=at.showArrow,ut=at.overrides,ct=ut===void 0?{}:ut,pt=ct.Arrow,dt=ct.Body,ft=ct.Inner,bt=getOverride(pt)||Arrow$1,ht=getOverride(dt)||Body$2,mt=getOverride(ft)||Inner$1,Ot=this.getSharedProps(),yt=this.getPopoverBodyProps();return reactExports.createElement(ht,_extends$A({key:"popover-body",ref:this.popperRef,"data-baseweb":this.props["data-baseweb"]||"popover"},yt,Ot,getOverrideProps(dt)),st?reactExports.createElement(bt,_extends$A({key:"popover-arrow",ref:this.arrowRef},Ot,getOverrideProps(pt))):null,reactExports.createElement(mt,_extends$A({},Ot,getOverrideProps(ft)),ot))}},{key:"renderContent",value:function(){var ot=this.props.content;return typeof ot=="function"?ot():ot}},{key:"render",value:function(){var ot=this,at=this.state.isMounted&&(this.props.isOpen||this.state.isAnimating),st=[this.renderAnchor()],ut=at||this.props.renderAll?this.renderContent():null,ct={modifiers:{preventOverflow:{enabled:!this.props.ignoreBoundary,padding:0}}};return ut&&(at?st.push(reactExports.createElement(Layer,{key:"new-layer",mountNode:this.props.mountNode,onEscape:this.props.onEsc,onDocumentClick:this.isHoverTrigger()?void 0:this.onDocumentClick,isHoverLayer:this.isHoverTrigger(),onMount:function(){return ot.setState({isLayerMounted:!0})},onUnmount:function(){return ot.setState({isLayerMounted:!1})}},reactExports.createElement(Tether,{anchorRef:this.anchorRef.current,arrowRef:this.arrowRef.current,popperRef:this.popperRef.current,popperOptions:_objectSpread$h(_objectSpread$h({},ct),this.props.popperOptions),onPopperUpdate:this.onPopperUpdate,placement:this.state.placement},this.props.focusLock&&this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip?reactExports.createElement(FocusLockCombination,{disabled:!this.props.focusLock,noFocusGuards:!1,returnFocus:!this.isHoverTrigger()&&this.props.returnFocus,autoFocus:this.state.autoFocusAfterPositioning,crossFrame:!1,focusOptions:this.props.focusOptions},this.renderPopover(ut)):reactExports.createElement(MoveFocusInside,{disabled:!this.props.autoFocus||!this.state.autoFocusAfterPositioning},this.renderPopover(ut))))):st.push(reactExports.createElement(Hidden,{key:"hidden-layer"},ut))),st}}]),et}(reactExports.Component);_defineProperty$m(PopoverInner,"defaultProps",baseDefaultProps$1);var Popover$1=function rt(tt){var et=tt.innerRef,nt=useUID();return reactExports.createElement(PopoverInner,_extends$A({id:tt.id||nt,ref:et},tt))};Popover$1.defaultProps=baseDefaultProps$1;var _excluded$i=["children"];function _objectWithoutProperties$l(rt,tt){if(rt==null)return{};var et=_objectWithoutPropertiesLoose$i(rt,tt),nt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(rt);for(ot=0;ot<at.length;ot++)nt=at[ot],!(tt.indexOf(nt)>=0)&&Object.prototype.propertyIsEnumerable.call(rt,nt)&&(et[nt]=rt[nt])}return et}function _objectWithoutPropertiesLoose$i(rt,tt){if(rt==null)return{};var et={},nt=Object.keys(rt),ot,at;for(at=0;at<nt.length;at++)ot=nt[at],!(tt.indexOf(ot)>=0)&&(et[ot]=rt[ot]);return et}function StatefulPopover(rt){var tt=rt.children,et=_objectWithoutProperties$l(rt,_excluded$i);return reactExports.createElement(StatefulContainer$1,et,function(nt){return reactExports.createElement(Popover$1,nt,tt)})}StatefulPopover.defaultProps={accessibilityType:ACCESSIBILITY_TYPE.menu,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,dismissOnClickOutside:!0,dismissOnEsc:!0,stateReducer:function rt(tt,et){return et},popoverMargin:POPOVER_MARGIN};var baseDefaultProps={accessibilityType:ACCESSIBILITY_TYPE.tooltip,focusLock:!1,autoFocus:!1,returnFocus:!1,onMouseEnterDelay:200,onMouseLeaveDelay:200,overrides:{},placement:PLACEMENT.auto,popoverMargin:0,showArrow:!1,triggerType:TRIGGER_TYPE.hover,renderAll:!1};function _typeof$a(rt){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$a(rt)}function ownKeys$h(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$g(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$h(Object(et),!0).forEach(function(nt){_defineProperty$l(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$h(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _classCallCheck$i(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(rt,tt){for(var et=0;et<tt.length;et++){var nt=tt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(rt,nt.key,nt)}}function _createClass$g(rt,tt,et){return tt&&_defineProperties$8(rt.prototype,tt),Object.defineProperty(rt,"prototype",{writable:!1}),rt}function _inherits$i(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function");rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,writable:!0,configurable:!0}}),Object.defineProperty(rt,"prototype",{writable:!1}),tt&&_setPrototypeOf$8(rt,tt)}function _setPrototypeOf$8(rt,tt){return _setPrototypeOf$8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,ot){return nt.__proto__=ot,nt},_setPrototypeOf$8(rt,tt)}function _createSuper$7(rt){var tt=_isNativeReflectConstruct$7();return function(){var nt=_getPrototypeOf$8(rt),ot;if(tt){var at=_getPrototypeOf$8(this).constructor;ot=Reflect.construct(nt,arguments,at)}else ot=nt.apply(this,arguments);return _possibleConstructorReturn$i(this,ot)}}function _possibleConstructorReturn$i(rt,tt){if(tt&&(_typeof$a(tt)==="object"||typeof tt=="function"))return tt;if(tt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$9(rt)}function _assertThisInitialized$9(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}function _isNativeReflectConstruct$7(){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$8(rt){return _getPrototypeOf$8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$8(rt)}function _defineProperty$l(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var StatefulContainer=function(rt){_inherits$i(et,rt);var tt=_createSuper$7(et);function et(){return _classCallCheck$i(this,et),tt.apply(this,arguments)}return _createClass$g(et,[{key:"render",value:function(){return reactExports.createElement(StatefulContainer$1,this.props)}}]),et}(reactExports.Component);_defineProperty$l(StatefulContainer,"defaultProps",_objectSpread$g({},baseDefaultProps));function ownKeys$g(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$f(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$g(Object(et),!0).forEach(function(nt){_defineProperty$k(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$g(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _defineProperty$k(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var Body$1=styled("div",function(rt){return _objectSpread$f(_objectSpread$f({},getBodyStyles(rt)),{},{backgroundColor:rt.$theme.colors.tooltipBackground,borderTopLeftRadius:rt.$theme.borders.radius300,borderTopRightRadius:rt.$theme.borders.radius300,borderBottomRightRadius:rt.$theme.borders.radius300,borderBottomLeftRadius:rt.$theme.borders.radius300,boxShadow:rt.$theme.lighting.shadow400,color:rt.$theme.colors.tooltipText,transitionProperty:"opacity",transform:getEndPosition(rt.$popoverOffset)})});Body$1.displayName="Body";Body$1.displayName="Body";var Inner=styled("div",function(rt){return _objectSpread$f(_objectSpread$f(_objectSpread$f({},getInnerStyles(rt)),{},{backgroundColor:rt.$theme.colors.tooltipBackground,borderTopLeftRadius:rt.$theme.borders.radius300,borderTopRightRadius:rt.$theme.borders.radius300,borderBottomRightRadius:rt.$theme.borders.radius300,borderBottomLeftRadius:rt.$theme.borders.radius300,paddingTop:rt.$theme.sizing.scale300,paddingBottom:rt.$theme.sizing.scale300,paddingLeft:rt.$theme.sizing.scale600,paddingRight:rt.$theme.sizing.scale600},rt.$theme.typography.font150),{},{color:rt.$theme.colors.tooltipText})});Inner.displayName="Inner";Inner.displayName="Inner";var Arrow=styled("div",function(rt){return _objectSpread$f(_objectSpread$f({},getArrowStyles(rt)),{},{backgroundColor:rt.$theme.colors.tooltipBackground})});Arrow.displayName="Arrow";Arrow.displayName="Arrow";function _typeof$9(rt){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},_typeof$9(rt)}function ownKeys$f(rt,tt){var et=Object.keys(rt);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(rt);tt&&(nt=nt.filter(function(ot){return Object.getOwnPropertyDescriptor(rt,ot).enumerable})),et.push.apply(et,nt)}return et}function _objectSpread$e(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt]!=null?arguments[tt]:{};tt%2?ownKeys$f(Object(et),!0).forEach(function(nt){_defineProperty$j(rt,nt,et[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(rt,Object.getOwnPropertyDescriptors(et)):ownKeys$f(Object(et)).forEach(function(nt){Object.defineProperty(rt,nt,Object.getOwnPropertyDescriptor(et,nt))})}return rt}function _extends$z(){return _extends$z=Object.assign?Object.assign.bind():function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_extends$z.apply(this,arguments)}function _classCallCheck$h(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(rt,tt){for(var et=0;et<tt.length;et++){var nt=tt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(rt,nt.key,nt)}}function _createClass$f(rt,tt,et){return tt&&_defineProperties$7(rt.prototype,tt),Object.defineProperty(rt,"prototype",{writable:!1}),rt}function _inherits$h(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function");rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,writable:!0,configurable:!0}}),Object.defineProperty(rt,"prototype",{writable:!1}),tt&&_setPrototypeOf$7(rt,tt)}function _setPrototypeOf$7(rt,tt){return _setPrototypeOf$7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(nt,ot){return nt.__proto__=ot,nt},_setPrototypeOf$7(rt,tt)}function _createSuper$6(rt){var tt=_isNativeReflectConstruct$6();return function(){var nt=_getPrototypeOf$7(rt),ot;if(tt){var at=_getPrototypeOf$7(this).constructor;ot=Reflect.construct(nt,arguments,at)}else ot=nt.apply(this,arguments);return _possibleConstructorReturn$h(this,ot)}}function _possibleConstructorReturn$h(rt,tt){if(tt&&(_typeof$9(tt)==="object"||typeof tt=="function"))return tt;if(tt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$8(rt)}function _assertThisInitialized$8(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}function _isNativeReflectConstruct$6(){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$7(rt){return _getPrototypeOf$7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$7(rt)}function _defineProperty$j(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}var Tooltip$1=function(rt){_inherits$h(et,rt);var tt=_createSuper$6(et);function et(){return _classCallCheck$h(this,et),tt.apply(this,arguments)}return _createClass$f(et,[{key:"render",value:function(){var ot=mergeOverrides({Arrow,Body:Body$1,Inner},this.props.overrides);return reactExports.createElement(Popover$1,_extends$z({autoFocus:!1,"data-baseweb":"tooltip"},this.props,{overrides:ot}))}}]),et}(reactExports.Component);_defineProperty$j(Tooltip$1,"defaultProps",_objectSpread$e({},baseDefaultProps));var _excluded$h=["children"];function _objectWithoutProperties$k(rt,tt){if(rt==null)return{};var et=_objectWithoutPropertiesLoose$h(rt,tt),nt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(rt);for(ot=0;ot<at.length;ot++)nt=at[ot],!(tt.indexOf(nt)>=0)&&Object.prototype.propertyIsEnumerable.call(rt,nt)&&(et[nt]=rt[nt])}return et}function _objectWithoutPropertiesLoose$h(rt,tt){if(rt==null)return{};var et={},nt=Object.keys(rt),ot,at;for(at=0;at<nt.length;at++)ot=nt[at],!(tt.indexOf(ot)>=0)&&(et[ot]=rt[ot]);return et}function StatefulTooltip(rt){var tt=rt.children,et=_objectWithoutProperties$k(rt,_excluded$h);return reactExports.createElement(StatefulContainer,et,function(nt){return reactExports.createElement(Tooltip$1,nt,tt)})}StatefulTooltip.defaultProps=StatefulContainer.defaultProps;const StyledWrapper=newStyled("div",{target:"ebtlh8d0"})({display:"table",tableLayout:"fixed",width:"100%"}),StyledEllipsizedDiv=newStyled("div",{target:"ebtlh8d1"})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell"}),StyledTooltipContentWrapper=newStyled("div",{target:"ebtlh8d2"})(({theme:rt})=>({boxSizing:"border-box",fontSize:`${rt.fontSizes.sm}`,maxWidth:`calc(${rt.sizes.contentMaxWidth} - 2 * ${rt.spacing.threeXL})`,maxHeight:rt.sizes.maxTooltipHeight,overflow:["auto","overlay"],padding:`${rt.spacing.xs} ${rt.spacing.md}`,[`@media (max-width: ${rt.breakpoints.sm})`]:{maxWidth:`calc(100% - ${rt.spacing.threeXL})`},img:{maxWidth:"100%"},"*":{fontSize:`${rt.fontSizes.sm} !important`}}));var Placement;(function(rt){rt.AUTO="auto",rt.TOP_LEFT="topLeft",rt.TOP="top",rt.TOP_RIGHT="topRight",rt.RIGHT_TOP="rightTop",rt.RIGHT="right",rt.RIGHT_BOTTOM="rightBottom",rt.BOTTOM_RIGHT="bottomRight",rt.BOTTOM="bottom",rt.BOTTOM_LEFT="bottomLeft",rt.LEFT_BOTTOM="leftBottom",rt.LEFT="left",rt.LEFT_TOP="leftTop"})(Placement||(Placement={}));function Tooltip({content:rt,placement:tt,children:et,inline:nt,style:ot,onMouseEnterDelay:at,overrides:st}){const ut=useTheme(),{colors:ct,fontSizes:pt,radii:dt,fontWeights:ft}=ut,bt=reactExports.useRef(null);return jsx$1(StatefulTooltip,{onOpen:()=>{var mt;const ht=(mt=bt.current)==null?void 0:mt.parentElement;ht&&setTimeout(()=>{var St;const Ot=ht.getBoundingClientRect(),yt=Ot.x,Mt=yt+Ot.width-window.innerWidth,At=ht.parentElement;if(Mt>0&&At){const Et=new DOMMatrix((St=window.getComputedStyle(At))==null?void 0:St.transform);At.style.transform=`translate3d(${Et.e-Mt}px, ${Et.f}px, 0px)`}yt<0&&(ht.style.left=`${-yt}px`)},0)},content:rt?jsx$1(StyledTooltipContentWrapper,{className:"stTooltipContent","data-testid":"stTooltipContent",ref:bt,children:rt}):null,placement:PLACEMENT[tt],accessibilityType:ACCESSIBILITY_TYPE.tooltip,showArrow:!1,popoverMargin:10,onMouseEnterDelay:at,overrides:{Body:{style:{borderTopLeftRadius:dt.default,borderTopRightRadius:dt.default,borderBottomLeftRadius:dt.default,borderBottomRightRadius:dt.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:hasLightBackgroundColor(ut)?ct.bgColor:ct.secondaryBg,color:ct.bodyText,fontSize:pt.sm,fontWeight:ft.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}},...st},children:jsx$1("div",{style:{display:"flex",flexDirection:"row",justifyContent:nt?"flex-end":"",...ot},"data-testid":"stTooltipHoverTarget",className:"stTooltipHoverTarget",children:et})})}function OverflowTooltip({content:rt,placement:tt,children:et,inline:nt,style:ot}){const at=React$1.useRef(null),[st,ut]=reactExports.useState(!1);return React$1.useEffect(()=>{const ct=at!=null&&at.current?at.current.offsetWidth<at.current.scrollWidth:!1;ct!==st&&ut(ct)},[et,st]),jsx$1(Tooltip,{content:st?rt:"",placement:tt,inline:nt,children:jsx$1(StyledWrapper,{children:jsx$1(StyledEllipsizedDiv,{ref:at,style:ot,children:et})})})}const StyledTooltipIconWrapper=newStyled("div",{target:"e1pw9gww0"})(({isLatex:rt,theme:tt})=>({display:"flex",alignItems:"center",marginTop:rt?tt.spacing.md:"0","& .stTooltipHoverTarget > svg":{stroke:tt.colors.fadedText60,strokeWidth:2.25}})),StyledLabelHelpWrapper=newStyled("div",{target:"e1pw9gww1"})(({isLatex:rt})=>({display:"flex",visibility:"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center",...rt?{justifyContent:"center"}:{}})),StyledLabelHelpInline=newStyled("label",{target:"e1pw9gww2"})(({theme:rt})=>({marginLeft:rt.spacing.xs,position:"relative",display:"flex",flexDirection:"row"}));function TooltipIcon({placement:rt=Placement.AUTO,isLatex:tt=!1,content:et,children:nt,markdownProps:ot,onMouseEnterDelay:at}){const st=useTheme();return jsx$1(StyledTooltipIconWrapper,{className:"stTooltipIcon","data-testid":"stTooltipIcon",isLatex:tt,children:jsx$1(Tooltip,{content:jsx$1(StreamlitMarkdown$1,{style:{fontSize:st.fontSizes.sm},source:et,allowHTML:!1,...ot||{}}),placement:rt,onMouseEnterDelay:at,inline:!0,children:nt||jsx$1(HelpCircle,{className:"icon",size:st.iconSizes.base})})})}const InlineTooltipIcon=({placement:rt=Placement.TOP_RIGHT,isLatex:tt=!1,content:et,children:nt,markdownProps:ot})=>jsx$1(StyledLabelHelpInline,{children:jsx$1(TooltipIcon,{placement:rt,isLatex:tt,content:et,markdownProps:ot,children:nt})}),streamlitLogo="data:image/svg+xml,%3csvg%20width='301'%20height='165'%20viewBox='0%200%20301%20165'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M150.731%20101.547L98.1387%2073.7471L6.84674%2025.4969C6.7634%2025.4136%206.59674%2025.4136%206.51341%2025.4136C3.18007%2023.8303%20-0.236608%2027.1636%201.0134%2030.497L47.5302%20149.139L47.5385%20149.164C47.5885%20149.281%2047.6302%20149.397%2047.6802%20149.514C49.5885%20153.939%2053.7552%20156.672%2058.2886%20157.747C58.6719%20157.831%2058.9461%20157.906%2059.4064%20157.998C59.8645%20158.1%2060.5052%20158.239%2061.0552%20158.281C61.1469%20158.289%2061.2302%20158.289%2061.3219%20158.297H61.3886C61.4552%20158.306%2061.5219%20158.306%2061.5886%20158.314H61.6802C61.7386%20158.322%2061.8052%20158.322%2061.8636%20158.322H61.9719C62.0386%20158.331%2062.1052%20158.331%2062.1719%20158.331V158.331C121.084%20164.754%20180.519%20164.754%20239.431%20158.331V158.331C240.139%20158.331%20240.831%20158.297%20241.497%20158.231C241.714%20158.206%20241.922%20158.181%20242.131%20158.156C242.156%20158.147%20242.189%20158.147%20242.214%20158.139C242.356%20158.122%20242.497%20158.097%20242.639%20158.072C242.847%20158.047%20243.056%20158.006%20243.264%20157.964C243.681%20157.872%20243.87%20157.806%20244.436%20157.611C245.001%20157.417%20245.94%20157.077%20246.527%20156.794C247.115%20156.511%20247.522%20156.239%20248.014%20155.931C248.622%20155.547%20249.201%20155.155%20249.788%20154.715C250.041%20154.521%20250.214%20154.397%20250.397%20154.222L250.297%20154.164L150.731%20101.547Z'%20fill='%23FF4B4B'/%3e%3cpath%20d='M294.766%2025.4981H294.683L203.357%2073.7483L254.124%20149.357L300.524%2030.4981V30.3315C301.691%2026.8314%20298.108%2023.6648%20294.766%2025.4981'%20fill='%237D353B'/%3e%3cpath%20d='M155.598%202.55572C153.264%20-0.852624%20148.181%20-0.852624%20145.931%202.55572L98.1389%2073.7477L150.731%20101.548L250.398%20154.222C251.024%20153.609%20251.526%20153.012%20252.056%20152.381C252.806%20151.456%20253.506%20150.465%20254.123%20149.356L203.356%2073.7477L155.598%202.55572Z'%20fill='%23BD4043'/%3e%3c/svg%3e";function convertRemToEm(rt){return rt.replace(/rem$/,"em")}function sharedMarkdownStyle(rt){return{a:{color:rt.colors.link,textDecoration:"underline"}}}function convertFontSizes(rt,tt,et,nt,ot,at){return ot?at?convertRemToEm(nt):tt:at?convertRemToEm(et):rt}function getMarkdownHeadingDefinitions(rt,tt,et){return{"h1, h2, h3, h4, h5, h6":{fontFamily:rt.genericFonts.headingFont,fontWeight:rt.fontWeights.bold,lineHeight:rt.lineHeights.headings,margin:0,color:"inherit"},h1:{fontSize:convertFontSizes(rt.fontSizes.fourXL,rt.fontSizes.xl,rt.fontSizes.threeXL,rt.fontSizes.xl,tt,et),fontWeight:tt?rt.fontWeights.bold:rt.fontWeights.extrabold,padding:`${rt.spacing.xl} 0 ${rt.spacing.lg} 0`},"h1 b, h1 strong":{fontWeight:rt.fontWeights.extrabold},"h2, h3":{letterSpacing:"-0.005em"},h2:{fontSize:convertFontSizes(rt.fontSizes.threeXL,rt.fontSizes.lg,rt.fontSizes.twoXL,rt.fontSizes.lg,tt,et),padding:`${rt.spacing.lg} 0 ${rt.spacing.lg} 0`},h3:{fontSize:convertFontSizes(rt.fontSizes.twoXL,rt.fontSizes.mdLg,rt.fontSizes.lg,rt.fontSizes.mdLg,tt,et),padding:`${rt.spacing.sm} 0 ${rt.spacing.lg} 0`},h4:{fontSize:convertFontSizes(rt.fontSizes.xl,rt.fontSizes.md,rt.fontSizes.md,rt.fontSizes.md,tt,et),padding:`${rt.spacing.md} 0 ${rt.spacing.lg} 0`},h5:{fontSize:convertFontSizes(rt.fontSizes.lg,rt.fontSizes.sm,rt.fontSizes.md,rt.fontSizes.md,tt,et),padding:`0 0 ${rt.spacing.lg} 0`},h6:{fontSize:convertFontSizes(rt.fontSizes.md,rt.fontSizes.twoSm,rt.fontSizes.md,rt.fontSizes.md,tt,et),padding:`0 0 ${rt.spacing.lg} 0`}}}const StyledStreamlitMarkdown=newStyled("div",{target:"e1icttdg0"})(({theme:rt,isCaption:tt,isInSidebarOrDialog:et,isLabel:nt,boldLabel:ot,largerLabel:at,isToast:st})=>{const ut=nt&&!at||st||tt;return{fontFamily:rt.genericFonts.bodyFont,fontSize:ut?rt.fontSizes.sm:rt.fontSizes.md,marginBottom:nt?"":`-${rt.spacing.lg}`,opacity:tt?.6:void 0,color:"inherit",...sharedMarkdownStyle(rt),...getMarkdownHeadingDefinitions(rt,et,tt),p:{wordBreak:"break-word",marginBottom:nt?rt.spacing.none:"",fontWeight:ot?rt.fontWeights.bold:"",marginTop:rt.spacing.none,marginLeft:rt.spacing.none,marginRight:rt.spacing.none},img:{maxWidth:"100%",maxHeight:nt?"1em":void 0,verticalAlign:"middle"},li:{margin:"0.2em 0 0.2em 1.2em",padding:"0 0 0 0.6em"},blockquote:{margin:"1em 0 1em 0",padding:"0 0 0 1.2em",borderLeft:`${rt.sizes.borderWidth} solid ${rt.colors.lightGray}`},"b, strong":{fontWeight:rt.fontWeights.bold},hr:{margin:"2em 0",padding:0,color:"inherit",backgroundColor:"transparent",border:"none",borderBottom:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,"&:not([size])":{height:rt.sizes.borderWidth}},table:{marginBottom:rt.spacing.lg,borderCollapse:"collapse"},tr:{borderTop:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`},th:{textAlign:"inherit"},"th, td":{padding:`${rt.spacing.xs} ${rt.spacing.md}`,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`},"span.has-background-color":{padding:`${rt.spacing.threeXS} ${rt.spacing.twoXS}`,margin:rt.spacing.none,borderRadius:rt.radii.md},"p, ol, ul, dl, li":{fontSize:"inherit"}}}),StyledLinkIcon=newStyled("a",{target:"e1icttdg1"})(({theme:rt})=>({lineHeight:0,display:"inline-flex",alignItems:"center",justifyContent:"center",svg:{stroke:rt.colors.fadedText60,strokeWidth:2.25},"&:hover svg":{stroke:rt.colors.bodyText}})),StyledHeadingWithActionElements=newStyled("div",{target:"e1icttdg2"})(({theme:rt})=>({"h1, h2, h3, h4, h5, h6, span":{scrollMarginTop:rt.sizes.headerHeight},...sharedMarkdownStyle(rt),wordBreak:"break-word",textWrap:"pretty",[StyledLinkIcon]:{visibility:"hidden"},"&:hover":{[StyledLinkIcon]:{visibility:"visible"}}})),StyledHeadingActionElements=newStyled("span",{target:"e1icttdg3"})(({theme:rt})=>({marginLeft:rt.spacing.sm,display:"inline-flex",gap:rt.spacing.sm,verticalAlign:"middle","& > *":{marginLeft:"0 !important"}})),StyledHeaderDivider=newStyled("hr",{target:"e1icttdg4"})(({theme:rt,rainbow:tt,color:et})=>({height:`${rt.spacing.threeXS} !important`,marginTop:rt.spacing.sm,marginBottom:rt.spacing.none,border:"none",borderRadius:rt.radii.full,...tt?{background:et}:{backgroundColor:et}})),StyledPreWrapper=newStyled("div",{target:"e1icttdg5"})(({theme:rt})=>({marginBottom:rt.spacing.lg}));var Tags;(function(rt){rt.H1="h1",rt.H2="h2",rt.H3="h3"})(Tags||(Tags={}));function createAnchorFromText(rt){let tt="";return rt&&/^[\x00-\x7F]*$/.test(rt)?tt=rt==null?void 0:rt.toLowerCase().split(/[^\p{L}\p{N}]+/gu).filter(Boolean).join("-"):rt&&(tt=xxhash.h32(rt,43981).toString(16)),tt}function transformLinkUri(rt){return rt}const scrollNodeIntoView=once$1(rt=>{rt.scrollIntoView(!0)}),HeaderActionElements=({elementId:rt,help:tt,hideAnchor:et})=>{const nt=useTheme();return!tt&&et?jsx$1(Fragment,{}):jsxs(StyledHeadingActionElements,{"data-testid":"stHeaderActionElements",children:[tt&&jsx$1(InlineTooltipIcon,{content:tt}),rt&&!et&&jsx$1(StyledLinkIcon,{href:`#${rt}`,children:jsx$1(Link2,{size:nt.iconSizes.base})})]})},HeadingWithActionElements=({tag:rt,anchor:tt,help:et,hideAnchor:nt,children:ot,tagProps:at})=>{const st=React$1.useContext(IsSidebarContext),ut=React$1.useContext(IsDialogContext),[ct,pt]=React$1.useState(tt),[dt,ft]=React$1.useState(null),{addScriptFinishedHandler:bt,removeScriptFinishedHandler:ht}=React$1.useContext(LibContext),mt=React$1.useCallback(()=>{dt!==null&&window.setTimeout(()=>{scrollNodeIntoView(dt)},300)},[dt]);React$1.useEffect(()=>(bt(mt),()=>{ht(mt)}),[bt,ht,mt]);const Ot=React$1.useCallback(Et=>{if(Et===null)return;const zt=tt||createAnchorFromText(Et.textContent);pt(zt);const vt=window.location.hash.slice(1);vt&&vt===zt&&ft(Et)},[tt]),yt=st||ut,Mt=jsx$1(HeaderActionElements,{elementId:ct,help:et,hideAnchor:nt||yt}),At=yt?{}:{ref:Ot,id:ct},St=React$1.createElement(rt,{...at,...At},jsxs(Fragment,{children:[ot,Mt]}));return yt?St:jsx$1(StyledHeadingWithActionElements,{"data-testid":"stHeadingWithActionElements",children:St})},CustomHeading=({node:rt,children:tt,...et})=>{const nt=et["data-anchor"];return jsx$1(HeadingWithActionElements,{tag:rt.tagName,anchor:nt,tagProps:et,children:tt})},CustomCodeTag=({inline:rt,className:tt,children:et,...nt})=>{const ot=/language-(\w+)/.exec(tt||""),at=String(et).trim().replace(/\n$/,""),st=ot&&ot[1]||"";return rt?jsx$1(StyledInlineCode,{className:tt,...omit$1(nt,"node"),children:et}):jsx$1(StreamlitSyntaxHighlighter$1,{language:st,showLineNumbers:!1,children:at})},CustomPreTag=({children:rt})=>jsx$1(StyledPreWrapper,{"data-testid":"stMarkdownPre",children:rt});function RenderedMarkdown({allowHTML:rt,source:tt,overrideComponents:et,isLabel:nt,disableLinks:ot}){const at={pre:CustomPreTag,code:CustomCodeTag,a:LinkWithTargetBlank,h1:CustomHeading,h2:CustomHeading,h3:CustomHeading,h4:CustomHeading,h5:CustomHeading,h6:CustomHeading,...et||{}},st=useTheme(),{red:ut,orange:ct,yellow:pt,green:dt,blue:ft,violet:bt,purple:ht,gray:mt,primary:Ot}=getMarkdownTextColors(st),{redbg:yt,orangebg:Mt,yellowbg:At,greenbg:St,bluebg:Et,violetbg:zt,purplebg:vt,graybg:Tt,primarybg:$t}=getMarkdownBgColors(st),Rt=new Map(Object.entries({red:`color: ${ut}`,blue:`color: ${ft}`,green:`color: ${dt}`,violet:`color: ${bt}`,orange:`color: ${ct}`,gray:`color: ${mt}`,grey:`color: ${mt}`,primary:`color: ${Ot}`,rainbow:`color: transparent; background-clip: text; -webkit-background-clip: text; background-image: linear-gradient(to right,
452
452
  ${ut}, ${ct}, ${pt}, ${dt}, ${ft}, ${bt}, ${ht});`,"red-background":`background-color: ${yt}`,"blue-background":`background-color: ${Et}`,"green-background":`background-color: ${St}`,"violet-background":`background-color: ${zt}`,"orange-background":`background-color: ${Mt}`,"gray-background":`background-color: ${Tt}`,"grey-background":`background-color: ${Tt}`,"primary-background":`background-color: ${$t}`,"rainbow-background":`background: linear-gradient(to right,
453
- ${yt}, ${Mt}, ${At}, ${St}, ${Et}, ${zt}, ${vt});`}));function wt(){return ur=>{visit(ur,"textDirective",(Jt,Dt,Xt)=>{const xt=String(Jt.name);if(Rt.has(xt)){const Ct=Jt.data||(Jt.data={}),Lt=Rt.get(xt);Ct.hName="span",Ct.hProperties=Ct.hProperties||{},Ct.hProperties.style=Lt,Lt&&(/background-color:/.test(Lt)||/background:/.test(Lt))&&(Ct.hProperties.className=(Ct.hProperties.className||"")+" has-background-color")}else Jt.type="text",Jt.value=`:${xt}`,Jt.data={}})}}function It(){return ur=>{function Jt(Dt,Xt){return{type:"text",value:Dt,data:{hName:"span",hProperties:{role:"img",ariaLabel:Xt+" icon",translate:"no",style:{display:"inline-block",fontFamily:st.genericFonts.iconFont,fontWeight:st.fontWeights.normal,userSelect:"none",verticalAlign:"bottom",whiteSpace:"nowrap",wordWrap:"normal"}},hChildren:[{type:"text",value:Xt}]}}}return findAndReplace(ur,[[/:material_(\w+):/g,Jt]]),ur}}function kt(){return ur=>{function Jt(){return{type:"text",value:"",data:{hName:"img",hProperties:{src:streamlitLogo,alt:"Streamlit logo",style:{display:"inline-block",userSelect:"none",height:"0.75em",verticalAlign:"baseline",marginBottom:"-0.05ex"}}}}}return findAndReplace(ur,[[/:streamlit:/g,Jt]]),ur}}function Ft(){return ur=>(visit(ur,(Jt,Dt,Xt)=>{if(!(Xt&&(Xt.type==="link"||Xt.type==="linkReference"))&&Jt.type==="text"&&Jt.value){const xt=[[/(^|\s)<->(\s|$)/g,"$1↔$2"],[/(^|\s)->(\s|$)/g,"$1→$2"],[/(^|\s)<-(\s|$)/g,"$1←$2"],[/(^|\s)--(\s|$)/g,"$1—$2"],[/(^|\s)>=(\s|$)/g,"$1≥$2"],[/(^|\s)<=(\s|$)/g,"$1≤$2"],[/(^|\s)~=(\s|$)/g,"$1≈$2"]];let Ct=Jt.value;for(const[Lt,rr]of xt)Ct=Ct.replace(Lt,rr);Ct!==Jt.value&&(Jt.value=Ct)}}),ur)}const nr=[remarkMath,plugin,remarkGfm,remarkDirective,wt,It,kt,Ft],Ut=[rehypeKatex,...rt?[rehypeRaw]:[]],Yt=tt.replaceAll(":material/",":material_"),gr=["table","thead","tbody","tr","th","td","h1","h2","h3","h4","h5","h6","ul","ol","li","input","hr","blockquote",...ot?["a"]:[]];return jsx$1(ErrorBoundary,{children:jsx$1(ReactMarkdown,{remarkPlugins:nr,rehypePlugins:Ut,components:at,transformLinkUri,disallowedElements:nt?gr:[],unwrapDisallowed:!0,children:Yt})})}const StreamlitMarkdown=({source:rt,allowHTML:tt,style:et,isCaption:nt,isLabel:ot,boldLabel:at,largerLabel:st,disableLinks:ut,isToast:ct})=>{const pt=reactExports.useContext(IsSidebarContext),dt=reactExports.useContext(IsDialogContext);return jsx$1(StyledStreamlitMarkdown,{isCaption:!!nt,isInSidebarOrDialog:pt||dt,isLabel:ot,boldLabel:at,largerLabel:st,isToast:ct,style:et,"data-testid":nt?"stCaptionContainer":"stMarkdownContainer",children:jsx$1(RenderedMarkdown,{source:rt,allowHTML:tt,isLabel:ot,disableLinks:ut})})};function LinkWithTargetBlank(rt){const{href:tt}=rt;if(tt&&tt.startsWith("#")){const{children:ut,...ct}=rt;return jsx$1("a",{...omit$1(ct,"node"),children:ut})}const{title:et,children:nt,target:ot,rel:at,...st}=rt;return jsx$1("a",{href:tt,title:et,target:ot||"_blank",rel:at||"noopener noreferrer",...omit$1(st,"node"),children:nt})}const StreamlitMarkdown$1=reactExports.memo(StreamlitMarkdown),DynamicButtonLabel=({icon:rt,label:tt,iconSize:et})=>{const nt=rt==null?void 0:rt.startsWith(":material");return jsxs(Fragment,{children:[rt&&jsx$1(DynamicIcon,{size:et??(nt?"lg":"base"),margin:tt?nt?"0 sm 0 0":"0 md 0 0":"0",color:"inherit",iconValue:rt}),tt&&jsx$1(StreamlitMarkdown$1,{source:tt,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})]})};var BaseButtonKind;(function(rt){rt.PRIMARY="primary",rt.SECONDARY="secondary",rt.TERTIARY="tertiary",rt.GHOST="ghost",rt.LINK="link",rt.ICON="icon",rt.BORDERLESS_ICON="borderlessIcon",rt.BORDERLESS_ICON_ACTIVE="borderlessIconActive",rt.MINIMAL="minimal",rt.PRIMARY_FORM_SUBMIT="primaryFormSubmit",rt.SECONDARY_FORM_SUBMIT="secondaryFormSubmit",rt.TERTIARY_FORM_SUBMIT="tertiaryFormSubmit",rt.HEADER_BUTTON="header",rt.HEADER_NO_PADDING="headerNoPadding",rt.ELEMENT_TOOLBAR="elementToolbar",rt.PILLS="pills",rt.PILLS_ACTIVE="pillsActive",rt.SEGMENTED_CONTROL="segmented_control",rt.SEGMENTED_CONTROL_ACTIVE="segmented_controlActive"})(BaseButtonKind||(BaseButtonKind={}));var BaseButtonSize;(function(rt){rt.XSMALL="xsmall",rt.SMALL="small",rt.MEDIUM="medium",rt.LARGE="large"})(BaseButtonSize||(BaseButtonSize={}));function getSizeStyle(rt,tt){switch(rt){case"xsmall":return{padding:`${tt.spacing.twoXS} ${tt.spacing.sm}`,fontSize:tt.fontSizes.sm};case"small":return{padding:`${tt.spacing.twoXS} ${tt.spacing.md}`};case"large":return{padding:`${tt.spacing.md} ${tt.spacing.md}`};default:return{padding:`${tt.spacing.xs} ${tt.spacing.md}`}}}const StyledBaseButton=newStyled("button",{target:"e1d5ycv50"})(({fluidWidth:rt,size:tt,theme:et})=>{const nt=typeof rt=="number"?`${rt}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:et.fontWeights.normal,padding:`${et.spacing.xs} ${et.spacing.md}`,borderRadius:et.radii.default,minHeight:et.sizes.minElementHeight,margin:et.spacing.none,lineHeight:et.lineHeights.base,textTransform:"none",fontSize:"inherit",fontFamily:"inherit",color:"inherit",width:rt?nt:"auto",cursor:"pointer",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${transparentize(et.colors.primary,.5)}`},...getSizeStyle(tt,et)}}),StyledPrimaryButton=newStyled(StyledBaseButton,{target:"e1d5ycv51"})(({theme:rt})=>({backgroundColor:rt.colors.primary,color:rt.colors.white,border:`${rt.sizes.borderWidth} solid ${rt.colors.primary}`,"&:hover":{backgroundColor:darken(rt.colors.primary,.05)},"&:active":{backgroundColor:"transparent",color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{borderColor:rt.colors.borderColor,backgroundColor:rt.colors.transparent,color:rt.colors.fadedText40,cursor:"not-allowed"}})),StyledSecondaryButton=newStyled(StyledBaseButton,{target:"e1d5ycv52"})(({theme:rt})=>({backgroundColor:rt.colors.lightenedBg05,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,"&:hover":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:active":{color:rt.colors.white,borderColor:rt.colors.primary,backgroundColor:rt.colors.primary},"&:focus:not(:active)":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{borderColor:rt.colors.borderColor,backgroundColor:rt.colors.transparent,color:rt.colors.fadedText40,cursor:"not-allowed"}})),StyledTertiaryButton=newStyled(StyledBaseButton,{target:"e1d5ycv53"})(({theme:rt})=>({padding:rt.spacing.none,backgroundColor:rt.colors.transparent,border:"none","&:active":{color:rt.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:rt.colors.primary,boxShadow:`0 0 0 0.2rem ${transparentize(rt.colors.primary,.5)}`},"&:hover":{color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.transparent,color:rt.colors.fadedText40,cursor:"not-allowed"}})),StyledGhostButton=newStyled(StyledBaseButton,{target:"e1d5ycv54"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:`${rt.sizes.borderWidth} solid ${rt.colors.transparent}`,"&:hover":{borderColor:rt.colors.transparent,color:rt.colors.primary},"&:active":{color:rt.colors.primary,borderColor:rt.colors.transparent,backgroundColor:rt.colors.transparent},"&:focus:not(:active)":{borderColor:rt.colors.transparent,color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}})),StyledLinkButton=newStyled(StyledBaseButton,{target:"e1d5ycv55"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,padding:rt.spacing.none,border:"none",color:rt.colors.primary,"&:hover":{textDecoration:"underline"},"&:active":{backgroundColor:rt.colors.transparent,color:rt.colors.primary,textDecoration:"underline"},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}})),StyledMinimalButton=newStyled(StyledBaseButton,{target:"e1d5ycv56"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:"none",boxShadow:"none",padding:rt.spacing.none,"&:hover, &:active, &:focus-visible":{color:rt.colors.primary}})),StyledPrimaryFormSubmitButton=newStyled(StyledPrimaryButton,{target:"e1d5ycv57"})(),StyledSecondaryFormSubmitButton=newStyled(StyledSecondaryButton,{target:"e1d5ycv58"})(),StyledTertiaryFormSubmitButton=newStyled(StyledTertiaryButton,{target:"e1d5ycv59"})(),StyledIconButton=newStyled(StyledBaseButton,{target:"e1d5ycv510"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,flex:"1 1 0",padding:0,"&:hover":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:active":{backgroundColor:rt.colors.primary,borderColor:rt.colors.primary,color:rt.colors.white},"&:not(:active)":{boxShadow:"none"},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray,cursor:"not-allowed"}})),StyledButtonGroupBaseButton=newStyled(StyledBaseButton,{target:"e1d5ycv512"})(({theme:rt})=>({background:rt.colors.bgColor,color:rt.colors.text,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,fontSize:rt.fontSizes.sm,lineHeight:rt.lineHeights.base,fontWeight:rt.fontWeights.normal,height:rt.sizes.largeLogoHeight,minHeight:rt.sizes.largeLogoHeight,maxWidth:rt.sizes.contentMaxWidth,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","&:hover":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:rt.colors.fadedText20,borderColor:rt.colors.fadedText20,cursor:"not-allowed"},"& div":{textOverflow:"ellipsis",overflow:"hidden"},"& p":{fontSize:rt.fontSizes.sm,textOverflow:"ellipsis",overflow:"hidden"}})),StyledPillsButton=newStyled(StyledButtonGroupBaseButton,{target:"e1d5ycv513"})(({theme:rt})=>({borderRadius:rt.radii.full,padding:`${rt.spacing.twoXS} ${rt.spacing.md}`})),StyledPillsButtonActive=newStyled(StyledPillsButton,{target:"e1d5ycv514"})(({theme:rt})=>({backgroundColor:transparentize(rt.colors.primary,.9),borderColor:rt.colors.primary,color:rt.colors.primary,"&:hover":{backgroundColor:transparentize(rt.colors.primary,.8),borderColor:rt.colors.primary,color:rt.colors.primary}})),StyledSegmentedControlButton=newStyled(StyledButtonGroupBaseButton,{target:"e1d5ycv515"})(({theme:rt})=>({padding:`${rt.spacing.twoXS} ${rt.spacing.lg}`,borderRadius:"0",flex:"1 0 fit-content",maxWidth:"100%",marginRight:`-${rt.sizes.borderWidth}`,"&:first-child":{borderTopLeftRadius:rt.radii.default,borderBottomLeftRadius:rt.radii.default},"&:last-child":{borderTopRightRadius:rt.radii.default,borderBottomRightRadius:rt.radii.default,marginRight:rt.spacing.none},"&:hover":{zIndex:rt.zIndices.priority}})),StyledSegmentedControlButtonActive=newStyled(StyledSegmentedControlButton,{target:"e1d5ycv516"})(({theme:rt})=>({backgroundColor:transparentize(rt.colors.primary,.9),borderColor:rt.colors.primary,color:rt.colors.primary,zIndex:rt.zIndices.priority,"&:hover":{backgroundColor:transparentize(rt.colors.primary,.8)}})),StyledHeaderButton=newStyled(StyledBaseButton,{target:"e1d5ycv517"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:"none",padding:rt.spacing.sm,fontSize:rt.fontSizes.sm,marginLeft:rt.spacing.threeXS,marginRight:rt.spacing.threeXS,lineHeight:rt.lineHeights.none,minWidth:rt.spacing.threeXL,minHeight:rt.spacing.threeXL,"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${transparentize(rt.colors.gray90,.8)}`},"&:hover":{backgroundColor:rt.colors.darkenedBgMix25},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}})),StyledHeaderNoPaddingButton=newStyled(StyledHeaderButton,{target:"e1d5ycv518"})(()=>({padding:0})),StyledBorderlessIconButton=newStyled(StyledBaseButton,{target:"e1d5ycv519"})(({size:rt,theme:tt})=>{const et={xsmall:tt.spacing.threeXS,small:tt.spacing.twoXS,medium:tt.spacing.md,large:tt.spacing.lg};return{backgroundColor:tt.colors.transparent,color:tt.colors.fadedText60,padding:et[rt],marginLeft:tt.spacing.none,marginRight:tt.spacing.none,border:"none",display:"flex",minHeight:"unset","&:focus":{boxShadow:"none",outline:"none"},"&:hover":{color:tt.colors.text},"&:disabled, &:disabled:hover, &:disabled:active":{color:tt.colors.fadedText10,cursor:"not-allowed",img:{opacity:.4}}}}),StyledBorderlessIconButtonActive=newStyled(StyledBorderlessIconButton,{target:"e1d5ycv520"})(({theme:rt})=>({color:rt.colors.bodyText,"&:disabled, &:disabled:hover, &:disabled:active":{color:rt.colors.fadedText40}})),StyledTooltipNormal=newStyled("div",{target:"e1d5ycv521"})(({theme:rt})=>({display:"block",[`@media (max-width: ${rt.breakpoints.sm})`]:{display:"none"}})),StyledTooltipMobile=newStyled("div",{target:"e1d5ycv522"})(({theme:rt})=>({display:"none",[`@media (max-width: ${rt.breakpoints.sm})`]:{display:"block"}})),StyledElementToolbarButton=newStyled(StyledBaseButton,{target:"e1d5ycv523"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:"none",padding:rt.spacing.xs,fontSize:rt.fontSizes.twoSm,marginLeft:rt.spacing.none,marginRight:rt.spacing.none,display:"flex",gap:rt.spacing.xs,alignItems:"center",minHeight:"unset",lineHeight:rt.iconSizes.md,"&:focus":{outline:"none",border:"none",boxShadow:"none"},"&:focus-visible":{outline:"none",border:"none",boxShadow:"none",backgroundColor:rt.colors.darkenedBgMix25},"&:hover":{backgroundColor:rt.colors.darkenedBgMix25},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}}));function BaseButton(rt){const{kind:tt,size:et,disabled:nt,onClick:ot,fluidWidth:at,children:st,autoFocus:ut}=rt;let ct=StyledPrimaryButton;return tt===BaseButtonKind.SECONDARY?ct=StyledSecondaryButton:tt===BaseButtonKind.TERTIARY?ct=StyledTertiaryButton:tt===BaseButtonKind.GHOST?ct=StyledGhostButton:tt===BaseButtonKind.LINK?ct=StyledLinkButton:tt===BaseButtonKind.ICON?ct=StyledIconButton:tt===BaseButtonKind.PILLS?ct=StyledPillsButton:tt===BaseButtonKind.PILLS_ACTIVE?ct=StyledPillsButtonActive:tt===BaseButtonKind.SEGMENTED_CONTROL?ct=StyledSegmentedControlButton:tt===BaseButtonKind.SEGMENTED_CONTROL_ACTIVE?ct=StyledSegmentedControlButtonActive:tt===BaseButtonKind.BORDERLESS_ICON?ct=StyledBorderlessIconButton:tt===BaseButtonKind.BORDERLESS_ICON_ACTIVE?ct=StyledBorderlessIconButtonActive:tt===BaseButtonKind.MINIMAL?ct=StyledMinimalButton:tt===BaseButtonKind.PRIMARY_FORM_SUBMIT?ct=StyledPrimaryFormSubmitButton:tt===BaseButtonKind.SECONDARY_FORM_SUBMIT?ct=StyledSecondaryFormSubmitButton:tt===BaseButtonKind.TERTIARY_FORM_SUBMIT?ct=StyledTertiaryFormSubmitButton:tt===BaseButtonKind.HEADER_BUTTON?ct=StyledHeaderButton:tt===BaseButtonKind.HEADER_NO_PADDING?ct=StyledHeaderNoPaddingButton:tt===BaseButtonKind.ELEMENT_TOOLBAR&&(ct=StyledElementToolbarButton),jsx$1(ct,{kind:tt,size:et??BaseButtonSize.MEDIUM,fluidWidth:at||!1,disabled:nt||!1,onClick:ot||(()=>{}),autoFocus:ut||!1,"data-testid":rt["data-testid"]??`stBaseButton-${tt}`,"aria-label":rt["aria-label"]??"",children:st})}function BaseButtonTooltip({children:rt,help:tt,placement:et}){return tt?jsxs(Fragment,{children:[jsx$1(StyledTooltipNormal,{children:jsx$1(TooltipIcon,{content:tt,placement:et||Placement.TOP,children:rt})}),jsx$1(StyledTooltipMobile,{children:rt})]}):rt}function FormSubmitButton(rt){const{disabled:tt,element:et,widgetMgr:nt,hasInProgressUpload:ot,width:at,fragmentId:st}=rt,{formId:ut}=et,ct={width:at};let pt=BaseButtonKind.SECONDARY_FORM_SUBMIT;et.type==="primary"?pt=BaseButtonKind.PRIMARY_FORM_SUBMIT:et.type==="tertiary"&&(pt=BaseButtonKind.TERTIARY_FORM_SUBMIT),reactExports.useEffect(()=>(nt.addSubmitButton(ut,et),()=>nt.removeSubmitButton(ut,et)),[nt,ut,et]);const dt=et.help?at:!0;return jsx$1("div",{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",style:ct,children:jsx$1(BaseButtonTooltip,{help:et.help,children:jsx$1(BaseButton,{kind:pt,size:BaseButtonSize.SMALL,fluidWidth:et.useContainerWidth?dt:!1,disabled:tt||ot,onClick:()=>{nt.submitForm(et.formId,st,et)},children:jsx$1(DynamicButtonLabel,{icon:et.icon,label:et.label})})})})}const StyledFormSubmitContent=newStyled("div",{target:"e1ttwmlf0"})({display:"flex"}),StyledForm=newStyled("div",{target:"e1ttwmlf1"})(({theme:rt,border:tt})=>({...tt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`}})),StyledErrorContainer=newStyled("div",{target:"e1ttwmlf2"})(({theme:rt})=>({marginTop:rt.spacing.lg}));function FormSubmitContent(rt){const{width:tt}=rt;return jsx$1(StyledFormSubmitContent,{style:{width:tt},children:jsx$1(FormSubmitButton,{...rt})})}const StyledAlertContent=newStyled("div",{target:"e17y69s80"})(({theme:rt})=>({display:"flex",gap:rt.spacing.sm,width:"100%",[`${StyledEmojiIcon}, ${StyledIcon}, ${StyledMaterialIcon}`]:{position:"relative",top:"2px"},[`${StyledCodeBlock} code`]:{paddingRight:rt.spacing.lg}}));function getAlertElementKind(rt){switch(rt){case Alert.Format.ERROR:return Kind.ERROR;case Alert.Format.INFO:return Kind.INFO;case Alert.Format.SUCCESS:return Kind.SUCCESS;case Alert.Format.WARNING:return Kind.WARNING;default:throw new Error(`Unexpected alert type: ${rt}`)}}function AlertElement({icon:rt,body:tt,kind:et,width:nt}){const ot=useTheme(),at={width:rt?`calc(100% - (${ot.iconSizes.lg} + ${ot.spacing.sm}))`:"100%"};return jsx$1("div",{className:"stAlert","data-testid":"stAlert",children:jsx$1(AlertContainer,{width:nt,kind:et,children:jsxs(StyledAlertContent,{children:[rt&&jsx$1(DynamicIcon,{iconValue:rt,size:"lg",testid:"stAlertDynamicIcon"}),jsx$1(StreamlitMarkdown$1,{source:tt,allowHTML:!1,style:at})]})})})}var ScriptRunState;(function(rt){rt.NOT_RUNNING="notRunning",rt.RUNNING="running",rt.RERUN_REQUESTED="rerunRequested",rt.STOP_REQUESTED="stopRequested",rt.COMPILATION_ERROR="compilationError"})(ScriptRunState||(ScriptRunState={}));const MISSING_SUBMIT_BUTTON_WARNING=`**Missing Submit Button**
453
+ ${yt}, ${Mt}, ${At}, ${St}, ${Et}, ${zt}, ${vt});`}));function wt(){return ur=>{visit(ur,"textDirective",(Jt,Dt,Xt)=>{const xt=String(Jt.name);if(Rt.has(xt)){const Ct=Jt.data||(Jt.data={}),Lt=Rt.get(xt);Ct.hName="span",Ct.hProperties=Ct.hProperties||{},Ct.hProperties.style=Lt,Lt&&(/background-color:/.test(Lt)||/background:/.test(Lt))&&(Ct.hProperties.className=(Ct.hProperties.className||"")+" has-background-color")}else Jt.type="text",Jt.value=`:${xt}`,Jt.data={}})}}function It(){return ur=>{function Jt(Dt,Xt){return{type:"text",value:Dt,data:{hName:"span",hProperties:{role:"img",ariaLabel:Xt+" icon",translate:"no",style:{display:"inline-block",fontFamily:st.genericFonts.iconFont,fontWeight:st.fontWeights.normal,userSelect:"none",verticalAlign:"bottom",whiteSpace:"nowrap",wordWrap:"normal"}},hChildren:[{type:"text",value:Xt}]}}}return findAndReplace(ur,[[/:material_(\w+):/g,Jt]]),ur}}function kt(){return ur=>{function Jt(){return{type:"text",value:"",data:{hName:"img",hProperties:{src:streamlitLogo,alt:"Streamlit logo",style:{display:"inline-block",userSelect:"none",height:"0.75em",verticalAlign:"baseline",marginBottom:"-0.05ex"}}}}}return findAndReplace(ur,[[/:streamlit:/g,Jt]]),ur}}function Ft(){return ur=>(visit(ur,(Jt,Dt,Xt)=>{if(!(Xt&&(Xt.type==="link"||Xt.type==="linkReference"))&&Jt.type==="text"&&Jt.value){const xt=[[/(^|\s)<->(\s|$)/g,"$1↔$2"],[/(^|\s)->(\s|$)/g,"$1→$2"],[/(^|\s)<-(\s|$)/g,"$1←$2"],[/(^|\s)--(\s|$)/g,"$1—$2"],[/(^|\s)>=(\s|$)/g,"$1≥$2"],[/(^|\s)<=(\s|$)/g,"$1≤$2"],[/(^|\s)~=(\s|$)/g,"$1≈$2"]];let Ct=Jt.value;for(const[Lt,rr]of xt)Ct=Ct.replace(Lt,rr);Ct!==Jt.value&&(Jt.value=Ct)}}),ur)}const nr=[remarkMath,plugin,remarkGfm,remarkDirective,wt,It,kt,Ft],Ut=[rehypeKatex,...rt?[rehypeRaw]:[]],Yt=tt.replaceAll(":material/",":material_"),gr=["table","thead","tbody","tr","th","td","h1","h2","h3","h4","h5","h6","ul","ol","li","input","hr","blockquote",...ot?["a"]:[]];return jsx$1(ErrorBoundary,{children:jsx$1(ReactMarkdown,{remarkPlugins:nr,rehypePlugins:Ut,components:at,transformLinkUri,disallowedElements:nt?gr:[],unwrapDisallowed:!0,children:Yt})})}const StreamlitMarkdown=({source:rt,allowHTML:tt,style:et,isCaption:nt,isLabel:ot,boldLabel:at,largerLabel:st,disableLinks:ut,isToast:ct})=>{const pt=reactExports.useContext(IsSidebarContext),dt=reactExports.useContext(IsDialogContext);return jsx$1(StyledStreamlitMarkdown,{isCaption:!!nt,isInSidebarOrDialog:pt||dt,isLabel:ot,boldLabel:at,largerLabel:st,isToast:ct,style:et,"data-testid":nt?"stCaptionContainer":"stMarkdownContainer",children:jsx$1(RenderedMarkdown,{source:rt,allowHTML:tt,isLabel:ot,disableLinks:ut})})};function LinkWithTargetBlank(rt){const{href:tt}=rt;if(tt&&tt.startsWith("#")){const{children:ut,...ct}=rt;return jsx$1("a",{...omit$1(ct,"node"),children:ut})}const{title:et,children:nt,target:ot,rel:at,...st}=rt;return jsx$1("a",{href:tt,title:et,target:ot||"_blank",rel:at||"noopener noreferrer",...omit$1(st,"node"),children:nt})}const StreamlitMarkdown$1=reactExports.memo(StreamlitMarkdown),DynamicButtonLabel=({icon:rt,label:tt,iconSize:et,useSmallerFont:nt=!1})=>{const ot=rt==null?void 0:rt.startsWith(":material");return jsxs(Fragment,{children:[rt&&jsx$1(DynamicIcon,{size:et??(ot?"lg":"base"),margin:tt?ot?"0 sm 0 0":"0 md 0 0":"0",color:"inherit",iconValue:rt}),tt&&jsx$1(StreamlitMarkdown$1,{source:tt,allowHTML:!1,isLabel:!0,largerLabel:!nt,disableLinks:!0})]})};var BaseButtonKind;(function(rt){rt.PRIMARY="primary",rt.SECONDARY="secondary",rt.TERTIARY="tertiary",rt.GHOST="ghost",rt.LINK="link",rt.ICON="icon",rt.BORDERLESS_ICON="borderlessIcon",rt.BORDERLESS_ICON_ACTIVE="borderlessIconActive",rt.MINIMAL="minimal",rt.PRIMARY_FORM_SUBMIT="primaryFormSubmit",rt.SECONDARY_FORM_SUBMIT="secondaryFormSubmit",rt.TERTIARY_FORM_SUBMIT="tertiaryFormSubmit",rt.HEADER_BUTTON="header",rt.HEADER_NO_PADDING="headerNoPadding",rt.ELEMENT_TOOLBAR="elementToolbar",rt.PILLS="pills",rt.PILLS_ACTIVE="pillsActive",rt.SEGMENTED_CONTROL="segmented_control",rt.SEGMENTED_CONTROL_ACTIVE="segmented_controlActive"})(BaseButtonKind||(BaseButtonKind={}));var BaseButtonSize;(function(rt){rt.XSMALL="xsmall",rt.SMALL="small",rt.MEDIUM="medium",rt.LARGE="large"})(BaseButtonSize||(BaseButtonSize={}));function getSizeStyle(rt,tt){switch(rt){case"xsmall":return{padding:`${tt.spacing.twoXS} ${tt.spacing.sm}`,fontSize:tt.fontSizes.sm};case"small":return{padding:`${tt.spacing.twoXS} ${tt.spacing.md}`};case"large":return{padding:`${tt.spacing.md} ${tt.spacing.md}`};default:return{padding:`${tt.spacing.xs} ${tt.spacing.md}`}}}const StyledBaseButton=newStyled("button",{target:"et3pgjb0"})(({fluidWidth:rt,size:tt,theme:et})=>{const nt=typeof rt=="number"?`${rt}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:et.fontWeights.normal,padding:`${et.spacing.xs} ${et.spacing.md}`,borderRadius:et.radii.default,minHeight:et.sizes.minElementHeight,margin:et.spacing.none,lineHeight:et.lineHeights.base,textTransform:"none",fontSize:"inherit",fontFamily:"inherit",color:"inherit",width:rt?nt:"auto",cursor:"pointer",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${transparentize(et.colors.primary,.5)}`},...getSizeStyle(tt,et)}}),StyledPrimaryButton=newStyled(StyledBaseButton,{target:"et3pgjb1"})(({theme:rt})=>({backgroundColor:rt.colors.primary,color:rt.colors.white,border:`${rt.sizes.borderWidth} solid ${rt.colors.primary}`,"&:hover":{backgroundColor:darken(rt.colors.primary,.05)},"&:active":{backgroundColor:"transparent",color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{borderColor:rt.colors.borderColor,backgroundColor:rt.colors.transparent,color:rt.colors.fadedText40,cursor:"not-allowed"}})),StyledSecondaryButton=newStyled(StyledBaseButton,{target:"et3pgjb2"})(({theme:rt})=>({backgroundColor:rt.colors.lightenedBg05,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,"&:hover":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:active":{color:rt.colors.white,borderColor:rt.colors.primary,backgroundColor:rt.colors.primary},"&:focus:not(:active)":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{borderColor:rt.colors.borderColor,backgroundColor:rt.colors.transparent,color:rt.colors.fadedText40,cursor:"not-allowed"}})),StyledTertiaryButton=newStyled(StyledBaseButton,{target:"et3pgjb3"})(({theme:rt})=>({padding:rt.spacing.none,backgroundColor:rt.colors.transparent,border:"none","&:active":{color:rt.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:rt.colors.primary,boxShadow:`0 0 0 0.2rem ${transparentize(rt.colors.primary,.5)}`},"&:hover":{color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.transparent,color:rt.colors.fadedText40,cursor:"not-allowed"}})),StyledGhostButton=newStyled(StyledBaseButton,{target:"et3pgjb4"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:`${rt.sizes.borderWidth} solid ${rt.colors.transparent}`,"&:hover":{borderColor:rt.colors.transparent,color:rt.colors.primary},"&:active":{color:rt.colors.primary,borderColor:rt.colors.transparent,backgroundColor:rt.colors.transparent},"&:focus:not(:active)":{borderColor:rt.colors.transparent,color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}})),StyledLinkButton=newStyled(StyledBaseButton,{target:"et3pgjb5"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,padding:rt.spacing.none,border:"none",color:rt.colors.primary,"&:hover":{textDecoration:"underline"},"&:active":{backgroundColor:rt.colors.transparent,color:rt.colors.primary,textDecoration:"underline"},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}})),StyledMinimalButton=newStyled(StyledBaseButton,{target:"et3pgjb6"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:"none",boxShadow:"none",padding:rt.spacing.none,"&:hover, &:active, &:focus-visible":{color:rt.colors.primary}})),StyledPrimaryFormSubmitButton=newStyled(StyledPrimaryButton,{target:"et3pgjb7"})(),StyledSecondaryFormSubmitButton=newStyled(StyledSecondaryButton,{target:"et3pgjb8"})(),StyledTertiaryFormSubmitButton=newStyled(StyledTertiaryButton,{target:"et3pgjb9"})(),StyledIconButton=newStyled(StyledBaseButton,{target:"et3pgjb10"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,flex:"1 1 0",padding:0,"&:hover":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:active":{backgroundColor:rt.colors.primary,borderColor:rt.colors.primary,color:rt.colors.white},"&:not(:active)":{boxShadow:"none"},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray,cursor:"not-allowed"}})),StyledButtonGroupBaseButton=newStyled(StyledBaseButton,{target:"et3pgjb12"})(({theme:rt})=>({background:rt.colors.bgColor,color:rt.colors.text,border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,fontSize:rt.fontSizes.sm,lineHeight:rt.lineHeights.base,fontWeight:rt.fontWeights.normal,height:rt.sizes.largeLogoHeight,minHeight:rt.sizes.largeLogoHeight,maxWidth:rt.sizes.contentMaxWidth,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","&:hover":{borderColor:rt.colors.primary,color:rt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:rt.colors.fadedText20,borderColor:rt.colors.fadedText20,cursor:"not-allowed"},"& div":{textOverflow:"ellipsis",overflow:"hidden"},"& p":{textOverflow:"ellipsis",overflow:"hidden"}})),StyledPillsButton=newStyled(StyledButtonGroupBaseButton,{target:"et3pgjb13"})(({theme:rt})=>({borderRadius:rt.radii.full,padding:`${rt.spacing.twoXS} ${rt.spacing.md}`})),StyledPillsButtonActive=newStyled(StyledPillsButton,{target:"et3pgjb14"})(({theme:rt})=>({backgroundColor:transparentize(rt.colors.primary,.9),borderColor:rt.colors.primary,color:rt.colors.primary,"&:hover":{backgroundColor:transparentize(rt.colors.primary,.8),borderColor:rt.colors.primary,color:rt.colors.primary}})),StyledSegmentedControlButton=newStyled(StyledButtonGroupBaseButton,{target:"et3pgjb15"})(({theme:rt})=>({padding:`${rt.spacing.twoXS} ${rt.spacing.lg}`,borderRadius:"0",flex:"1 0 fit-content",maxWidth:"100%",marginRight:`-${rt.sizes.borderWidth}`,"&:first-child":{borderTopLeftRadius:rt.radii.default,borderBottomLeftRadius:rt.radii.default},"&:last-child":{borderTopRightRadius:rt.radii.default,borderBottomRightRadius:rt.radii.default,marginRight:rt.spacing.none},"&:hover":{zIndex:rt.zIndices.priority}})),StyledSegmentedControlButtonActive=newStyled(StyledSegmentedControlButton,{target:"et3pgjb16"})(({theme:rt})=>({backgroundColor:transparentize(rt.colors.primary,.9),borderColor:rt.colors.primary,color:rt.colors.primary,zIndex:rt.zIndices.priority,"&:hover":{backgroundColor:transparentize(rt.colors.primary,.8)}})),StyledHeaderButton=newStyled(StyledBaseButton,{target:"et3pgjb17"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:"none",padding:rt.spacing.sm,fontSize:rt.fontSizes.sm,marginLeft:rt.spacing.threeXS,marginRight:rt.spacing.threeXS,lineHeight:rt.lineHeights.none,minWidth:rt.spacing.threeXL,minHeight:rt.spacing.threeXL,"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${transparentize(rt.colors.gray90,.8)}`},"&:hover":{backgroundColor:rt.colors.darkenedBgMix25},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}})),StyledHeaderNoPaddingButton=newStyled(StyledHeaderButton,{target:"et3pgjb18"})(()=>({padding:0})),StyledBorderlessIconButton=newStyled(StyledBaseButton,{target:"et3pgjb19"})(({size:rt,theme:tt})=>{const et={xsmall:tt.spacing.threeXS,small:tt.spacing.twoXS,medium:tt.spacing.md,large:tt.spacing.lg};return{backgroundColor:tt.colors.transparent,color:tt.colors.fadedText60,padding:et[rt],marginLeft:tt.spacing.none,marginRight:tt.spacing.none,border:"none",display:"flex",minHeight:"unset","&:focus":{boxShadow:"none",outline:"none"},"&:hover":{color:tt.colors.text},"&:disabled, &:disabled:hover, &:disabled:active":{color:tt.colors.fadedText10,cursor:"not-allowed",img:{opacity:.4}}}}),StyledBorderlessIconButtonActive=newStyled(StyledBorderlessIconButton,{target:"et3pgjb20"})(({theme:rt})=>({color:rt.colors.bodyText,"&:disabled, &:disabled:hover, &:disabled:active":{color:rt.colors.fadedText40}})),StyledTooltipNormal=newStyled("div",{target:"et3pgjb21"})(({theme:rt})=>({display:"block",[`@media (max-width: ${rt.breakpoints.sm})`]:{display:"none"}})),StyledTooltipMobile=newStyled("div",{target:"et3pgjb22"})(({theme:rt})=>({display:"none",[`@media (max-width: ${rt.breakpoints.sm})`]:{display:"block"}})),StyledElementToolbarButton=newStyled(StyledBaseButton,{target:"et3pgjb23"})(({theme:rt})=>({backgroundColor:rt.colors.transparent,border:"none",padding:rt.spacing.xs,fontSize:rt.fontSizes.twoSm,marginLeft:rt.spacing.none,marginRight:rt.spacing.none,display:"flex",gap:rt.spacing.xs,alignItems:"center",minHeight:"unset",lineHeight:rt.iconSizes.md,"&:focus":{outline:"none",border:"none",boxShadow:"none"},"&:focus-visible":{outline:"none",border:"none",boxShadow:"none",backgroundColor:rt.colors.darkenedBgMix25},"&:hover":{backgroundColor:rt.colors.darkenedBgMix25},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:rt.colors.lightGray,borderColor:rt.colors.transparent,color:rt.colors.gray}}));function BaseButton(rt){const{kind:tt,size:et,disabled:nt,onClick:ot,fluidWidth:at,children:st,autoFocus:ut}=rt;let ct=StyledPrimaryButton;return tt===BaseButtonKind.SECONDARY?ct=StyledSecondaryButton:tt===BaseButtonKind.TERTIARY?ct=StyledTertiaryButton:tt===BaseButtonKind.GHOST?ct=StyledGhostButton:tt===BaseButtonKind.LINK?ct=StyledLinkButton:tt===BaseButtonKind.ICON?ct=StyledIconButton:tt===BaseButtonKind.PILLS?ct=StyledPillsButton:tt===BaseButtonKind.PILLS_ACTIVE?ct=StyledPillsButtonActive:tt===BaseButtonKind.SEGMENTED_CONTROL?ct=StyledSegmentedControlButton:tt===BaseButtonKind.SEGMENTED_CONTROL_ACTIVE?ct=StyledSegmentedControlButtonActive:tt===BaseButtonKind.BORDERLESS_ICON?ct=StyledBorderlessIconButton:tt===BaseButtonKind.BORDERLESS_ICON_ACTIVE?ct=StyledBorderlessIconButtonActive:tt===BaseButtonKind.MINIMAL?ct=StyledMinimalButton:tt===BaseButtonKind.PRIMARY_FORM_SUBMIT?ct=StyledPrimaryFormSubmitButton:tt===BaseButtonKind.SECONDARY_FORM_SUBMIT?ct=StyledSecondaryFormSubmitButton:tt===BaseButtonKind.TERTIARY_FORM_SUBMIT?ct=StyledTertiaryFormSubmitButton:tt===BaseButtonKind.HEADER_BUTTON?ct=StyledHeaderButton:tt===BaseButtonKind.HEADER_NO_PADDING?ct=StyledHeaderNoPaddingButton:tt===BaseButtonKind.ELEMENT_TOOLBAR&&(ct=StyledElementToolbarButton),jsx$1(ct,{kind:tt,size:et??BaseButtonSize.MEDIUM,fluidWidth:at||!1,disabled:nt||!1,onClick:ot||(()=>{}),autoFocus:ut||!1,"data-testid":rt["data-testid"]??`stBaseButton-${tt}`,"aria-label":rt["aria-label"]??"",children:st})}function BaseButtonTooltip({children:rt,help:tt,placement:et}){return tt?jsxs(Fragment,{children:[jsx$1(StyledTooltipNormal,{children:jsx$1(TooltipIcon,{content:tt,placement:et||Placement.TOP,children:rt})}),jsx$1(StyledTooltipMobile,{children:rt})]}):rt}function FormSubmitButton(rt){const{disabled:tt,element:et,widgetMgr:nt,hasInProgressUpload:ot,width:at,fragmentId:st}=rt,{formId:ut}=et,ct={width:at};let pt=BaseButtonKind.SECONDARY_FORM_SUBMIT;et.type==="primary"?pt=BaseButtonKind.PRIMARY_FORM_SUBMIT:et.type==="tertiary"&&(pt=BaseButtonKind.TERTIARY_FORM_SUBMIT),reactExports.useEffect(()=>(nt.addSubmitButton(ut,et),()=>nt.removeSubmitButton(ut,et)),[nt,ut,et]);const dt=et.help?at:!0;return jsx$1("div",{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",style:ct,children:jsx$1(BaseButtonTooltip,{help:et.help,children:jsx$1(BaseButton,{kind:pt,size:BaseButtonSize.SMALL,fluidWidth:et.useContainerWidth?dt:!1,disabled:tt||ot,onClick:()=>{nt.submitForm(et.formId,st,et)},children:jsx$1(DynamicButtonLabel,{icon:et.icon,label:et.label})})})})}const StyledFormSubmitContent=newStyled("div",{target:"e1ttwmlf0"})({display:"flex"}),StyledForm=newStyled("div",{target:"e1ttwmlf1"})(({theme:rt,border:tt})=>({...tt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`}})),StyledErrorContainer=newStyled("div",{target:"e1ttwmlf2"})(({theme:rt})=>({marginTop:rt.spacing.lg}));function FormSubmitContent(rt){const{width:tt}=rt;return jsx$1(StyledFormSubmitContent,{style:{width:tt},children:jsx$1(FormSubmitButton,{...rt})})}const StyledAlertContent=newStyled("div",{target:"e17y69s80"})(({theme:rt})=>({display:"flex",gap:rt.spacing.sm,width:"100%",[`${StyledEmojiIcon}, ${StyledIcon}, ${StyledMaterialIcon}`]:{position:"relative",top:"2px"},[`${StyledCodeBlock} code`]:{paddingRight:rt.spacing.lg}}));function getAlertElementKind(rt){switch(rt){case Alert.Format.ERROR:return Kind.ERROR;case Alert.Format.INFO:return Kind.INFO;case Alert.Format.SUCCESS:return Kind.SUCCESS;case Alert.Format.WARNING:return Kind.WARNING;default:throw new Error(`Unexpected alert type: ${rt}`)}}function AlertElement({icon:rt,body:tt,kind:et,width:nt}){const ot=useTheme(),at={width:rt?`calc(100% - (${ot.iconSizes.lg} + ${ot.spacing.sm}))`:"100%"};return jsx$1("div",{className:"stAlert","data-testid":"stAlert",children:jsx$1(AlertContainer,{width:nt,kind:et,children:jsxs(StyledAlertContent,{children:[rt&&jsx$1(DynamicIcon,{iconValue:rt,size:"lg",testid:"stAlertDynamicIcon"}),jsx$1(StreamlitMarkdown$1,{source:tt,allowHTML:!1,style:at})]})})})}var ScriptRunState;(function(rt){rt.NOT_RUNNING="notRunning",rt.RUNNING="running",rt.RERUN_REQUESTED="rerunRequested",rt.STOP_REQUESTED="stopRequested",rt.COMPILATION_ERROR="compilationError"})(ScriptRunState||(ScriptRunState={}));const MISSING_SUBMIT_BUTTON_WARNING=`**Missing Submit Button**
454
454
 
455
455
  This form has no submit button, which means that user interactions will never be sent to your Streamlit app.
456
456
 
@@ -691,7 +691,7 @@ If this is an installed component that works locally, the app may be having trou
691
691
 
692
692
  For more troubleshooting help, please see the [Streamlit Component docs](${COMPONENT_DEVELOPER_URL}) or visit our [forums](${COMMUNITY_URL}).`,et}function tryParseArgs(rt,tt,et,nt){if(!nt)try{return parseArgs(rt,tt)}catch(ot){const at=ensureError(ot);et(at)}return[{},[]]}function compareDataframeArgs(rt,tt){return rt===tt||rt.length===tt.length&&rt.every((et,nt)=>{const ot=tt[nt];return et.key===ot.key&&et.value===ot.value})}function ComponentInstance(rt){const[tt,et]=reactExports.useState(),{disabled:nt,element:ot,registry:at,theme:st,widgetMgr:ut,width:ct,fragmentId:pt}=rt,{componentName:dt,jsonArgs:ft,specialArgs:bt,url:ht}=ot,[mt,Ot]=tryParseArgs(ft,bt,et,tt),yt=reactExports.useRef({args:{},dataframeArgs:[]}),Mt=compareDataframeArgs(yt.current.dataframeArgs,Ot);yt.current.args=mt,yt.current.dataframeArgs=Ot;const[At,St]=reactExports.useState(),[Et,zt]=reactExports.useState(isNaN(mt.height)?void 0:mt.height),vt=reactExports.useRef(!1),Tt=reactExports.useRef(null),$t=reactExports.useRef(),Rt=useTimeout(()=>log$8.warn(getWarnMessage(dt,ht)),COMPONENT_READY_WARNING_TIME_MS/4),wt=useTimeout(()=>St(!0),COMPONENT_READY_WARNING_TIME_MS);if(reactExports.useEffect(()=>{vt.current&&sendRenderMessage(yt.current.args,yt.current.dataframeArgs,nt,st,Tt.current??void 0)},[nt,Et,Mt,ft,st,ct]),reactExports.useEffect(()=>{const Ft=Ut=>{if(Ut===void 0){log$8.warn("handleSetFrameHeight: missing 'height' prop");return}if(Ut!==Et){if(m$4(Tt.current)){log$8.warn("handleSetFrameHeight: missing our iframeRef!");return}Tt.current.height=Ut.toString(),zt(Ut)}},nr=()=>{sendRenderMessage(yt.current.args,yt.current.dataframeArgs,nt,st,Tt.current??void 0),Rt(),wt(),vt.current=!0,St(!1)};$t.current={isReady:()=>vt.current,element:ot,widgetMgr:ut,setComponentError:et,componentReadyCallback:nr,frameHeightCallback:Ft,fragmentId:pt}},[dt,nt,ot,Et,Mt,At,ft,st,ut,wt,Rt,pt]),reactExports.useEffect(()=>{var nr;const Ft=((nr=Tt.current)==null?void 0:nr.contentWindow)??void 0;if(Ft)return at.registerListener(Ft,createIframeMessageHandler($t)),()=>{Ft&&at.deregisterListener(Ft)}},[at,dt]),tt)return jsx$1(ErrorElement,{name:tt.name,message:tt.message});const It=!vt.current&&!At&&Et!==0&&jsx$1(Skeleton,{element:Skeleton$1.create({height:Et,style:Skeleton$1.SkeletonStyle.ELEMENT})}),kt=!vt.current&&At?jsx$1(AlertElement,{width:ct,body:getWarnMessage(dt,ht),kind:Kind.WARNING}):null;return jsxs(Fragment,{children:[It,kt,jsx$1(StyledComponentIframe,{className:"stCustomComponentV1","data-testid":"stCustomComponentV1",allow:DEFAULT_IFRAME_FEATURE_POLICY,ref:Tt,src:getSrc(dt,at,ht),width:ct,height:Et??0,scrolling:"no",sandbox:DEFAULT_IFRAME_SANDBOX_POLICY,title:dt,componentReady:vt.current})]})}const ComponentInstance$1=withTheme(ComponentInstance),log$7=loglevelExports$1.getLogger("ComponentRegistry");class ComponentRegistry{constructor(tt){this.msgListeners=new Map,this.registerListener=(et,nt)=>{this.msgListeners.has(et)&&log$7.warn("MessageEventSource registered multiple times!",et),this.msgListeners.set(et,nt)},this.deregisterListener=et=>{this.msgListeners.delete(et)||log$7.warn("Could not deregister unregistered MessageEventSource!")},this.getComponentURL=(et,nt)=>this.endpoints.buildComponentURL(et,nt),this.onMessageEvent=et=>{if(m$4(et.data)||!et.data.hasOwnProperty("isStreamlitMessage"))return;if(m$4(et.source)){log$7.warn("Received component message with no eventSource!",et.data);return}const nt=this.msgListeners.get(et.source);if(m$4(nt)||typeof nt!="function"){log$7.warn("Received component message for unregistered ComponentInstance!",et.data);return}const{type:ot}=et.data;if(m$4(ot)){log$7.warn("Received Streamlit message with no type!",et.data);return}nt(ot,et.data)},this.endpoints=tt,window.addEventListener("message",this.onMessageEvent)}}const Maybe=reactExports.memo(function rt({children:tt}){return jsx$1(Fragment,{children:tt})},(rt,tt)=>!(rt.enable||tt.enable));function makeMarkdownHeading(rt,tt){switch(rt.toLowerCase()){case Tags.H1:return`# ${tt}`;case Tags.H2:return`## ${tt}`;case Tags.H3:return`### ${tt}`;default:throw new Error(`Unrecognized tag for header: ${rt}`)}}function Heading(rt){const{width:tt,element:et}=rt,{tag:nt,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(`
693
693
  `);return jsxs("div",{style:{width:tt},className:"stHeading","data-testid":"stHeading",children:[jsxs(StyledStreamlitMarkdown,{isCaption:!1,isInSidebarOrDialog:pt||dt,style:{width:tt},"data-testid":"stMarkdownContainer",children:[jsx$1(HeadingWithActionElements,{anchor:ot,help:st,hideAnchor:ut,tag:nt,children:jsx$1(RenderedMarkdown,{allowHTML:!1,source:makeMarkdownHeading(nt,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(`
694
- `),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e6x5rwu0"})(({width:rt,theme:tt})=>({width:rt,display:"flex",alignItems:"center",minHeight:tt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e6x5rwu1"})(({visibility:rt})=>({display:rt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:rt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(rt,tt){let et=tt.spacing.lg;return rt==="medium"?et=tt.spacing.threeXL:rt==="large"&&(et=tt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"e6rk8up0"})(({theme:rt,gap:tt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(tt,rt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e6rk8up1"})(({theme:rt,isStale:tt,width:et,elementType:nt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:rt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${rt.spacing.lg}`,zIndex:rt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${rt.spacing.xs}`,marginBottom:`-${rt.spacing.xs}`},...tt&&nt!=="skeleton"&&STALE_STYLES,...nt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(nt)?{marginBottom:`-${rt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e6rk8up2"})(({theme:rt,weight:tt,gap:et,showBorder:nt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=tt*100,ut=translateGapWidth(et,rt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${rt.breakpoints.columns})`]:{minWidth:`calc(100% - ${rt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:rt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:rt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...nt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e6rk8up3"})(({width:rt,theme:tt})=>({width:rt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:tt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e6rk8up4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e6rk8up5"})(({theme:rt,border:tt,height:et})=>({...tt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.D4SMJhY1.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.CgVoYKAP.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.BPmrb-47.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.CrMtUJsu.js").then(rt=>rt.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.BQEIBi4n.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.Epl2r08f.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CEdHQ1ob.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.DB_dBVfZ.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21,22]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BdVr8Tta.js"),__vite__mapDeps([23,18,17,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.D7BxtE4u.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.BY8YeKF1.js"),__vite__mapDeps([24,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.BiMrOUpK.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.B96fHK2A.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.C8zZSMvD.js"),__vite__mapDeps([25,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.CKOdbWxq.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Bm7Vkuba.js"),__vite__mapDeps([26,4,6,27,9,13]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.BghvoEVe.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.CJ-t5S6T.js"),__vite__mapDeps([28,20,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.DkV6k6Ng.js"),__vite__mapDeps([29,9]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DaoBv396.js"),__vite__mapDeps([30,21,4,31,32]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CX9gqq2L.js"),__vite__mapDeps([33,34,35,36,21,31,37,38]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.BiybRa0I.js"),__vite__mapDeps([39,20,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.ByH1pn5_.js"),__vite__mapDeps([40,20,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DqZZoWyt.js"),__vite__mapDeps([41,20,4,42,11,12,43,38]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.DMKXUbO6.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.BuyK2IsW.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.BPNlEjgz.js"),__vite__mapDeps([45,32]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.CSgG8OVN.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.BUGQmWUV.js"),__vite__mapDeps([46,20,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.BXmBj7MJ.js"),__vite__mapDeps([47,20,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.ndVWhafL.js"),__vite__mapDeps([48,8,20,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.CAuJtYES.js"),__vite__mapDeps([49,21,4,34,32,27,31]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.ChrjN8GY.js"),__vite__mapDeps([50,51,52,36,35,20,4,37,38]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Dr6DSYcq.js"),__vite__mapDeps([53,51,52,36,20,4,35,43,38]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.wW-pPvtW.js"),__vite__mapDeps([54,20,4,42,11,12]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BAFGiIHm.js"),__vite__mapDeps([55,8,51,4,35,43,38]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(rt,tt){return rt?jsx$1(Fragment,{}):tt}const RawElementNodeRenderer=rt=>{const{node:tt}=rt;if(!tt)throw new Error("ElementNode not found.");const et={width:rt.width,disableFullscreenMode:rt.disableFullscreenMode},nt={...et,widgetMgr:rt.widgetMgr,disabled:rt.widgetsDisabled,fragmentId:tt.fragmentId};switch(tt.element.type){case"alert":{const at=tt.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:tt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:tt.element.audio,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"balloons":return hideIfStale(rt.isStale,jsx$1(Balloons,{scriptRunId:rt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:tt.element.bokehChart,...et});case"code":{const at=tt.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:tt.element.deckGlJsonChart,...nt});case"docString":return jsx$1(DocString,{element:tt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement,{element:tt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:tt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:tt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:tt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:tt.element.imgs,endpoints:rt.endpoints,...et});case"json":return jsx$1(Json,{element:tt.element.json,...et});case"markdown":return jsx$1(Markdown,{element:tt.element.markdown,...et});case"metric":return jsx$1(Metric,{element:tt.element.metric});case"html":return jsx$1(Html,{element:tt.element.html,...et});case"pageLink":{const at=tt.element.pageLink,st=nt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:tt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:tt.element.skeleton});case"snow":return hideIfStale(rt.isStale,jsx$1(Snow,{scriptRunId:rt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:tt.element.spinner,...et});case"text":return jsx$1(TextElement,{element:tt.element.text,...et});case"video":return jsx$1(Video,{element:tt.element.video,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"toast":{const at=tt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},tt.scriptRunId)}case"arrowDataFrame":{const at=tt.element.arrowDataFrame;return nt.disabled=nt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:tt.quiverElement,...at.id&&{key:at.id},...nt})}case"arrowVegaLiteChart":const ot=tt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...nt},ot.id||void 0);case"audioInput":{const at=tt.element.audioInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:rt.uploadClient,element:at,...nt},at.id)}case"button":{const at=tt.element.button;if(nt.disabled=nt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=rt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...nt})}return jsx$1(Button,{element:at,...nt})}case"buttonGroup":{const at=tt.element.buttonGroup;return nt.disabled=nt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...nt},at.id)}case"downloadButton":{const at=tt.element.downloadButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:rt.endpoints,element:at,...nt},at.id)}case"cameraInput":{const at=tt.element.cameraInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"chatInput":{const at=tt.element.chatInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(ChatInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"checkbox":{const at=tt.element.checkbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...nt},at.id)}case"colorPicker":{const at=tt.element.colorPicker;return nt.disabled=nt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...nt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:rt.componentRegistry,element:tt.element.componentInstance,...nt});case"dateInput":{const at=tt.element.dateInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(DateInput,{element:at,...nt},at.id)}case"fileUploader":{const at=tt.element.fileUploader;return nt.disabled=nt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"linkButton":{const at=tt.element.linkButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...nt})}case"multiselect":{const at=tt.element.multiselect;return nt.disabled=nt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...nt},at.id)}case"numberInput":{const at=tt.element.numberInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...nt},at.id)}case"plotlyChart":{const at=tt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...nt},at.id)}case"radio":{const at=tt.element.radio;return nt.disabled=nt.disabled||at.disabled,jsx$1(Radio,{element:at,...nt},at.id)}case"selectbox":{const at=tt.element.selectbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...nt},at.id)}case"slider":{const at=tt.element.slider;return nt.disabled=nt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...nt},at.id)}case"textArea":{const at=tt.element.textArea;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextArea,{element:at,...nt},at.id)}case"textInput":{const at=tt.element.textInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextInput,{element:at,...nt},at.id)}case"timeInput":{const at=tt.element.timeInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...nt},at.id)}default:throw new Error(`Unrecognized Element type ${tt.element.type}`)}},ElementNodeRenderer=rt=>{const{isFullScreen:tt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:nt,width:ot}=rt,at=nt.element.type||"",st=shouldComponentBeEnabled(at,rt.scriptRunState),ut=isComponentStale(st,nt,rt.scriptRunState,rt.scriptRunId,et),ct=getElementId(nt.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&&!tt,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,{...rt,isStale:ut})})})})})},BlockNodeRenderer=rt=>{const{node:tt}=rt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(tt.isEmpty&&!tt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const nt=shouldComponentBeEnabled("",rt.scriptRunState),ot=isComponentStale(nt,tt,rt.scriptRunState,rt.scriptRunId,et),at={...rt,node:tt},st=rt.disableFullscreenMode||d$3(tt.deltaBlock.dialog)||d$3(tt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(tt.deltaBlock.dialog)return jsx$1(DialogWithProvider,{element:tt.deltaBlock.dialog,deltaMsgReceivedAt:tt.deltaMsgReceivedAt,children:ut});if(tt.deltaBlock.expandable)return jsx$1(Expander,{empty:tt.isEmpty,isStale:ot,element:tt.deltaBlock.expandable,children:ut});if(tt.deltaBlock.popover)return jsx$1(Popover,{empty:tt.isEmpty,element:tt.deltaBlock.popover,width:rt.width,children:ut});if(tt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=tt.deltaBlock.form,bt=rt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:rt.width,hasSubmitButton:ht,scriptRunState:rt.scriptRunState,widgetMgr:rt.widgetMgr,border:ft,children:ut})}if(tt.deltaBlock.chatMessage)return jsx$1(ChatMessage,{element:tt.deltaBlock.chatMessage,endpoints:rt.endpoints,children:ut});if(tt.deltaBlock.column)return jsx$1(StyledColumn,{weight:tt.deltaBlock.column.weight??0,gap:tt.deltaBlock.column.gap??"",verticalAlignment:tt.deltaBlock.column.verticalAlignment??void 0,showBorder:tt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(tt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs,{...pt})}return ut},ChildRenderer=rt=>{const{libConfig:tt}=reactExports.useContext(LibContext);assignDividerColor(rt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:rt.node.children&&rt.node.children.map((nt,ot)=>{const at=tt.disableFullscreenMode||rt.disableFullscreenMode;if(nt instanceof ElementNode){const st={...rt,disableFullscreenMode:at,node:nt},ut=getElementId(nt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(nt instanceof BlockNode){const st={...rt,disableFullscreenMode:at,node:nt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${nt}`)})})};function ScrollToBottomVerticalBlockWrapper(rt){const{border:tt,height:et,children:nt}=rt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:tt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:nt})}const VerticalBlock=rt=>{var ft,bt;const tt=reactExports.useRef(null),[et,nt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{nt(ht.target.getBoundingClientRect().width||-1)})}),[nt]),at=((ft=rt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=rt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&rt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(tt.current&&ot.observe(tt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...rt,width:et},dt=getKeyFromId(rt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:tt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=rt=>{var et;const tt=((et=rt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:tt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...rt})})};function LayoutBlock(rt){return rt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...rt}):jsx$1(VerticalBlock,{...rt})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:rt})=>({position:"fixed",top:0,left:0,zIndex:rt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:rt})=>{const tt=reactExports.useRef(null),et=reactExports.useCallback(()=>tt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[rt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:tt})]})};function ThemeProvider({theme:rt,baseuiTheme:tt,children:et}){return jsx$1(ThemeProvider$1,{theme:tt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:rt,children:et})})}function toCodePoint(rt,tt){const et=[];let nt=0,ot=0,at=0;for(;at<rt.length;)nt=rt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(nt-56320)).toString(16)),ot=0):55296<=nt&&nt<=56319?ot=nt:et.push(nt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(rt){return toCodePoint(rt.indexOf(U200D)<0?rt.replace(UFE0Fg,""):rt)}function iconToUrl(rt){const tt=/^:(.+)\/(.+):$/,et=rt.match(tt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(rt,tt,et){const nt=extractEmoji(rt);let ot;nt&&!rt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(nt)}.png`:rt.startsWith(":material")?ot=iconToUrl(rt):ot=et.buildMediaURL(rt),overwriteFavicon(ot),tt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(rt){const tt=document.querySelector("link[rel='shortcut icon']");tt&&(tt.href=rt)}function extractEmoji(rt){const tt=rt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(tt))?nodeEmoji$1.get(tt):nodeEmoji$1.hasEmoji(rt)?rt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(rt,tt){return rt&&baseFor$1(rt,tt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(rt){return typeof rt=="function"?rt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(rt,tt){return rt&&baseForOwn$3(rt,castFunction$1(tt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(rt){return this.__data__.set(rt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(rt){return this.__data__.has(rt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(rt){var tt=-1,et=rt==null?0:rt.length;for(this.__data__=new MapCache$1;++tt<et;)this.add(rt[tt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(rt,tt){for(var et=-1,nt=rt==null?0:rt.length;++et<nt;)if(tt(rt[et],et,rt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(rt,tt){return rt.has(tt)}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(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=rt.length,ct=tt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(rt),dt=at.get(tt);if(pt&&dt)return pt==tt&&dt==rt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(rt,tt),at.set(tt,rt);++ft<ut;){var mt=rt[ft],Ot=tt[ft];if(nt)var yt=st?nt(Ot,mt,ft,tt,rt,at):nt(mt,Ot,ft,rt,tt,at);if(yt!==void 0){if(yt)continue;bt=!1;break}if(ht){if(!arraySome$1(tt,function(Mt,At){if(!cacheHas$2(ht,At)&&(mt===Mt||ot(mt,Mt,et,nt,at)))return ht.push(At)})){bt=!1;break}}else if(!(mt===Ot||ot(mt,Ot,et,nt,at))){bt=!1;break}}return at.delete(rt),at.delete(tt),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(rt,tt,et,nt,ot,at,st){switch(et){case dataViewTag$3:if(rt.byteLength!=tt.byteLength||rt.byteOffset!=tt.byteOffset)return!1;rt=rt.buffer,tt=tt.buffer;case arrayBufferTag$2:return!(rt.byteLength!=tt.byteLength||!at(new Uint8Array$2(rt),new Uint8Array$2(tt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+rt,+tt);case errorTag$2:return rt.name==tt.name&&rt.message==tt.message;case regexpTag$2:case stringTag$2:return rt==tt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=nt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),rt.size!=tt.size&&!ct)return!1;var pt=st.get(rt);if(pt)return pt==tt;nt|=COMPARE_UNORDERED_FLAG$6,st.set(rt,tt);var dt=equalArrays$2(ut(rt),ut(tt),nt,ot,at,st);return st.delete(rt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(rt)==symbolValueOf$1.call(tt)}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(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(rt),ct=ut.length,pt=getAllKeys$1(tt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in tt:hasOwnProperty$f.call(tt,bt)))return!1}var ht=at.get(rt),mt=at.get(tt);if(ht&&mt)return ht==tt&&mt==rt;var Ot=!0;at.set(rt,tt),at.set(tt,rt);for(var yt=st;++ft<ct;){bt=ut[ft];var Mt=rt[bt],At=tt[bt];if(nt)var St=st?nt(At,Mt,bt,tt,rt,at):nt(Mt,At,bt,rt,tt,at);if(!(St===void 0?Mt===At||ot(Mt,At,et,nt,at):St)){Ot=!1;break}yt||(yt=bt=="constructor")}if(Ot&&!yt){var Et=rt.constructor,zt=tt.constructor;Et!=zt&&"constructor"in rt&&"constructor"in tt&&!(typeof Et=="function"&&Et instanceof Et&&typeof zt=="function"&&zt instanceof zt)&&(Ot=!1)}return at.delete(rt),at.delete(tt),Ot}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(rt,tt,et,nt,ot,at){var st=isArray$7(rt),ut=isArray$7(tt),ct=st?arrayTag$2:getTag$1(rt),pt=ut?arrayTag$2:getTag$1(tt);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(rt)){if(!isBuffer$2(tt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(rt)?equalArrays$1(rt,tt,et,nt,ot,at):equalByTag$1(rt,tt,ct,et,nt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(rt,"__wrapped__"),mt=ft&&hasOwnProperty$e.call(tt,"__wrapped__");if(ht||mt){var Ot=ht?rt.value():rt,yt=mt?tt.value():tt;return at||(at=new Stack$2),ot(Ot,yt,et,nt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(rt,tt,et,nt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(rt,tt,et,nt,ot){return rt===tt?!0:rt==null||tt==null||!isObjectLike$1(rt)&&!isObjectLike$1(tt)?rt!==rt&&tt!==tt:baseIsEqualDeep$1(rt,tt,et,nt,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(rt,tt,et,nt){var ot=et.length,at=ot,st=!nt;if(rt==null)return!at;for(rt=Object(rt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==rt[ut[0]]:!(ut[0]in rt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=rt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in rt))return!1}else{var ft=new Stack$1;if(nt)var bt=nt(pt,dt,ct,rt,tt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,nt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(rt){return rt===rt&&!isObject$3(rt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(rt){for(var tt=keys$1(rt),et=tt.length;et--;){var nt=tt[et],ot=rt[nt];tt[et]=[nt,ot,isStrictComparable$2(ot)]}return tt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(rt,tt){return function(et){return et==null?!1:et[rt]===tt&&(tt!==void 0||rt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(rt){var tt=getMatchData$1(rt);return tt.length==1&&tt[0][2]?matchesStrictComparable$2(tt[0][0],tt[0][1]):function(et){return et===rt||baseIsMatch$1(et,rt,tt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(rt,tt){return rt!=null&&tt in Object(rt)}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(rt,tt,et){tt=castPath$3(tt,rt);for(var nt=-1,ot=tt.length,at=!1;++nt<ot;){var st=toKey$4(tt[nt]);if(!(at=rt!=null&&et(rt,st)))break;rt=rt[st]}return at||++nt!=ot?at:(ot=rt==null?0:rt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(rt)||isArguments$1(rt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(rt,tt){return rt!=null&&hasPath$1(rt,tt,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(rt,tt){return isKey$2(rt)&&isStrictComparable$1(tt)?matchesStrictComparable$1(toKey$3(rt),tt):function(et){var nt=get$2(et,rt);return nt===void 0&&nt===tt?hasIn$2(et,rt):baseIsEqual$2(tt,nt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(rt){return function(tt){return baseGet$3(tt,rt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(rt){return isKey$1(rt)?baseProperty$1(toKey$2(rt)):basePropertyDeep$1(rt)}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(rt){return typeof rt=="function"?rt:rt==null?identity$2:typeof rt=="object"?isArray$5(rt)?baseMatchesProperty$1(rt[0],rt[1]):baseMatches$1(rt):property$1(rt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(rt,tt){return function(et,nt){if(et==null)return et;if(!isArrayLike$2(et))return rt(et,nt);for(var ot=et.length,at=tt?ot:-1,st=Object(et);(tt?at--:++at<ot)&&nt(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(rt,tt){var et=-1,nt=isArrayLike$1(rt)?Array(rt.length):[];return baseEach$2(rt,function(ot,at,st){nt[++et]=tt(ot,at,st)}),nt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(rt,tt){var et=isArray$4(rt)?arrayMap$3:baseMap$2;return et(rt,baseIteratee$4(tt))}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(rt){return rt&&rt.__esModule?rt:{default:rt}}var flattenNames=flattenNames$1.flattenNames=function rt(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(tt,function(nt){Array.isArray(nt)?rt(nt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(nt)?(0,_forOwn3$2.default)(nt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(nt)&&et.push(nt)}),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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$6(rt){return rt&&rt.__esModule?rt:{default:rt}}var mergeClasses=mergeClasses$1.mergeClasses=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],nt=tt.default&&(0,_cloneDeep3.default)(tt.default)||{};return et.map(function(ot){var at=tt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){nt[ut]||(nt[ut]={}),nt[ut]=_extends$w({},nt[ut],at[ut])}),ot}),nt};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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$5(rt){return rt&&rt.__esModule?rt:{default:rt}}var transforms={borderRadius:function rt(tt){return{msBorderRadius:tt,MozBorderRadius:tt,OBorderRadius:tt,WebkitBorderRadius:tt,borderRadius:tt}},boxShadow:function rt(tt){return{msBoxShadow:tt,MozBoxShadow:tt,OBoxShadow:tt,WebkitBoxShadow:tt,boxShadow:tt}},userSelect:function rt(tt){return{WebkitTouchCallout:tt,KhtmlUserSelect:tt,MozUserSelect:tt,msUserSelect:tt,WebkitUserSelect:tt,userSelect:tt}},flex:function rt(tt){return{WebkitBoxFlex:tt,MozBoxFlex:tt,WebkitFlex:tt,msFlex:tt,flex:tt}},flexBasis:function rt(tt){return{WebkitFlexBasis:tt,flexBasis:tt}},justifyContent:function rt(tt){return{WebkitJustifyContent:tt,justifyContent:tt}},transition:function rt(tt){return{msTransition:tt,MozTransition:tt,OTransition:tt,WebkitTransition:tt,transition:tt}},transform:function rt(tt){return{msTransform:tt,MozTransform:tt,OTransform:tt,WebkitTransform:tt,transform:tt}},absolute:function rt(tt){var et=tt&&tt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function rt(tt,et){var nt=et[tt];return nt||{extend:tt}}},autoprefix=autoprefix$1.autoprefix=function rt(tt){var et={};return(0,_forOwn3.default)(tt,function(nt,ot){var at={};(0,_forOwn3.default)(nt,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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$f(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$f(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var hover=hover$1.hover=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$f(ot,nt);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(tt,_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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$e(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$e(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var active=active$1.active=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$e(ot,nt);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(tt,_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 rt(tt,et){var nt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;nt[st]=ut};return tt===0&&ot("first-child"),tt===et-1&&ot("last-child"),(tt===0||tt%2===0)&&ot("even"),Math.abs(tt%2)===1&&ot("odd"),ot("nth-child",tt),nt};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(rt){return rt&&rt.__esModule?rt:{default:rt}}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 rt(tt){for(var et=arguments.length,nt=Array(et>1?et-1:0),ot=1;ot<et;ot++)nt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(nt),st=(0,_mergeClasses2.default)(tt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function rt(tt,et,nt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof tt.pageX=="number"?tt.pageX:tt.touches[0].pageX,pt=typeof tt.pageY=="number"?tt.pageY:tt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(nt==="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 rt(tt,et,nt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=nt*2,at.height=nt*2;var st=at.getContext("2d");return st?(st.fillStyle=tt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,nt,nt),st.translate(nt,nt),st.fillRect(0,0,nt,nt),at.toDataURL()):null},get$1=function rt(tt,et,nt,ot){var at=tt+"-"+et+"-"+nt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(tt,et,nt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},Checkboard=function rt(tt){var et=tt.white,nt=tt.grey,ot=tt.size,at=tt.renderers,st=tt.borderRadius,ut=tt.boxShadow,ct=tt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,nt,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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_createClass$d=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _classCallCheck$d(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$d(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var Alpha=function(rt){_inherits$d(tt,rt);function tt(){var et,nt,ot,at;_classCallCheck$d(this,tt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(nt=(ot=_possibleConstructorReturn$d(this,(et=tt.__proto__||Object.getPrototypeOf(tt)).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)},nt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(tt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var nt=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%,
694
+ `),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e6x5rwu0"})(({width:rt,theme:tt})=>({width:rt,display:"flex",alignItems:"center",minHeight:tt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e6x5rwu1"})(({visibility:rt})=>({display:rt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:rt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(rt,tt){let et=tt.spacing.lg;return rt==="medium"?et=tt.spacing.threeXL:rt==="large"&&(et=tt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"e6rk8up0"})(({theme:rt,gap:tt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(tt,rt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e6rk8up1"})(({theme:rt,isStale:tt,width:et,elementType:nt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:rt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${rt.spacing.lg}`,zIndex:rt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${rt.spacing.xs}`,marginBottom:`-${rt.spacing.xs}`},...tt&&nt!=="skeleton"&&STALE_STYLES,...nt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(nt)?{marginBottom:`-${rt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e6rk8up2"})(({theme:rt,weight:tt,gap:et,showBorder:nt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=tt*100,ut=translateGapWidth(et,rt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${rt.breakpoints.columns})`]:{minWidth:`calc(100% - ${rt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:rt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:rt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...nt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e6rk8up3"})(({width:rt,theme:tt})=>({width:rt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:tt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e6rk8up4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e6rk8up5"})(({theme:rt,border:tt,height:et})=>({...tt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.Cp60C2LQ.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.CUzW8sZB.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.C73Hi-mL.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.GZ99DH1Q.js").then(rt=>rt.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.C8vyFGOc.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.CoJayF2l.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.D_CViY1G.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.B11A7C7I.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21,22]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CAQGqUJ5.js"),__vite__mapDeps([23,18,17,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.B7aeIxns.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.Cd8_b4vi.js"),__vite__mapDeps([24,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.D7HtU_R4.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.DsOZJLyF.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.2bJmI0Ih.js"),__vite__mapDeps([25,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.DHOnt3Rd.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DdaoJ1WZ.js"),__vite__mapDeps([26,4,6,27,9,13]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.3k422wEU.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.CIkzV9zP.js"),__vite__mapDeps([28,20,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.BW_6EVtw.js"),__vite__mapDeps([29,9]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Bkk4sBLz.js"),__vite__mapDeps([30,21,4,31,32]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BRsob9Jp.js"),__vite__mapDeps([33,34,35,36,21,31,37,38]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.CZFA90VV.js"),__vite__mapDeps([39,20,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.DNKGONSt.js"),__vite__mapDeps([40,20,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BqiT_qyM.js"),__vite__mapDeps([41,20,4,42,11,12,43,38]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.BVkJfCWM.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.D3PlNa4T.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.D-Qsohh0.js"),__vite__mapDeps([45,32]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.CVIsVMt0.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.CC_i5fnL.js"),__vite__mapDeps([46,20,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.C-BkiutF.js"),__vite__mapDeps([47,20,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.OWYUy0bC.js"),__vite__mapDeps([48,8,20,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.D2i6l9uv.js"),__vite__mapDeps([49,21,4,34,32,27,31]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.DdJR-Re7.js"),__vite__mapDeps([50,51,52,36,35,20,4,37,38]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.USVf5VUT.js"),__vite__mapDeps([53,51,52,36,20,4,35,43,38]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.B7AJyWjy.js"),__vite__mapDeps([54,20,4,42,11,12]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CIwUls4J.js"),__vite__mapDeps([55,8,51,4,35,43,38]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(rt,tt){return rt?jsx$1(Fragment,{}):tt}const RawElementNodeRenderer=rt=>{const{node:tt}=rt;if(!tt)throw new Error("ElementNode not found.");const et={width:rt.width,disableFullscreenMode:rt.disableFullscreenMode},nt={...et,widgetMgr:rt.widgetMgr,disabled:rt.widgetsDisabled,fragmentId:tt.fragmentId};switch(tt.element.type){case"alert":{const at=tt.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:tt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:tt.element.audio,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"balloons":return hideIfStale(rt.isStale,jsx$1(Balloons,{scriptRunId:rt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:tt.element.bokehChart,...et});case"code":{const at=tt.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:tt.element.deckGlJsonChart,...nt});case"docString":return jsx$1(DocString,{element:tt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement,{element:tt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:tt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:tt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:tt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:tt.element.imgs,endpoints:rt.endpoints,...et});case"json":return jsx$1(Json,{element:tt.element.json,...et});case"markdown":return jsx$1(Markdown,{element:tt.element.markdown,...et});case"metric":return jsx$1(Metric,{element:tt.element.metric});case"html":return jsx$1(Html,{element:tt.element.html,...et});case"pageLink":{const at=tt.element.pageLink,st=nt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:tt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:tt.element.skeleton});case"snow":return hideIfStale(rt.isStale,jsx$1(Snow,{scriptRunId:rt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:tt.element.spinner,...et});case"text":return jsx$1(TextElement,{element:tt.element.text,...et});case"video":return jsx$1(Video,{element:tt.element.video,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"toast":{const at=tt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},tt.scriptRunId)}case"arrowDataFrame":{const at=tt.element.arrowDataFrame;return nt.disabled=nt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:tt.quiverElement,...at.id&&{key:at.id},...nt})}case"arrowVegaLiteChart":const ot=tt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...nt},ot.id||void 0);case"audioInput":{const at=tt.element.audioInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:rt.uploadClient,element:at,...nt},at.id)}case"button":{const at=tt.element.button;if(nt.disabled=nt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=rt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...nt})}return jsx$1(Button,{element:at,...nt})}case"buttonGroup":{const at=tt.element.buttonGroup;return nt.disabled=nt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...nt},at.id)}case"downloadButton":{const at=tt.element.downloadButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:rt.endpoints,element:at,...nt},at.id)}case"cameraInput":{const at=tt.element.cameraInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"chatInput":{const at=tt.element.chatInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(ChatInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"checkbox":{const at=tt.element.checkbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...nt},at.id)}case"colorPicker":{const at=tt.element.colorPicker;return nt.disabled=nt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...nt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:rt.componentRegistry,element:tt.element.componentInstance,...nt});case"dateInput":{const at=tt.element.dateInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(DateInput,{element:at,...nt},at.id)}case"fileUploader":{const at=tt.element.fileUploader;return nt.disabled=nt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"linkButton":{const at=tt.element.linkButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...nt})}case"multiselect":{const at=tt.element.multiselect;return nt.disabled=nt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...nt},at.id)}case"numberInput":{const at=tt.element.numberInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...nt},at.id)}case"plotlyChart":{const at=tt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...nt},at.id)}case"radio":{const at=tt.element.radio;return nt.disabled=nt.disabled||at.disabled,jsx$1(Radio,{element:at,...nt},at.id)}case"selectbox":{const at=tt.element.selectbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...nt},at.id)}case"slider":{const at=tt.element.slider;return nt.disabled=nt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...nt},at.id)}case"textArea":{const at=tt.element.textArea;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextArea,{element:at,...nt},at.id)}case"textInput":{const at=tt.element.textInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextInput,{element:at,...nt},at.id)}case"timeInput":{const at=tt.element.timeInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...nt},at.id)}default:throw new Error(`Unrecognized Element type ${tt.element.type}`)}},ElementNodeRenderer=rt=>{const{isFullScreen:tt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:nt,width:ot}=rt,at=nt.element.type||"",st=shouldComponentBeEnabled(at,rt.scriptRunState),ut=isComponentStale(st,nt,rt.scriptRunState,rt.scriptRunId,et),ct=getElementId(nt.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&&!tt,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,{...rt,isStale:ut})})})})})},BlockNodeRenderer=rt=>{const{node:tt}=rt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(tt.isEmpty&&!tt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const nt=shouldComponentBeEnabled("",rt.scriptRunState),ot=isComponentStale(nt,tt,rt.scriptRunState,rt.scriptRunId,et),at={...rt,node:tt},st=rt.disableFullscreenMode||d$3(tt.deltaBlock.dialog)||d$3(tt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(tt.deltaBlock.dialog)return jsx$1(DialogWithProvider,{element:tt.deltaBlock.dialog,deltaMsgReceivedAt:tt.deltaMsgReceivedAt,children:ut});if(tt.deltaBlock.expandable)return jsx$1(Expander,{empty:tt.isEmpty,isStale:ot,element:tt.deltaBlock.expandable,children:ut});if(tt.deltaBlock.popover)return jsx$1(Popover,{empty:tt.isEmpty,element:tt.deltaBlock.popover,width:rt.width,children:ut});if(tt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=tt.deltaBlock.form,bt=rt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:rt.width,hasSubmitButton:ht,scriptRunState:rt.scriptRunState,widgetMgr:rt.widgetMgr,border:ft,children:ut})}if(tt.deltaBlock.chatMessage)return jsx$1(ChatMessage,{element:tt.deltaBlock.chatMessage,endpoints:rt.endpoints,children:ut});if(tt.deltaBlock.column)return jsx$1(StyledColumn,{weight:tt.deltaBlock.column.weight??0,gap:tt.deltaBlock.column.gap??"",verticalAlignment:tt.deltaBlock.column.verticalAlignment??void 0,showBorder:tt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(tt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs,{...pt})}return ut},ChildRenderer=rt=>{const{libConfig:tt}=reactExports.useContext(LibContext);assignDividerColor(rt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:rt.node.children&&rt.node.children.map((nt,ot)=>{const at=tt.disableFullscreenMode||rt.disableFullscreenMode;if(nt instanceof ElementNode){const st={...rt,disableFullscreenMode:at,node:nt},ut=getElementId(nt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(nt instanceof BlockNode){const st={...rt,disableFullscreenMode:at,node:nt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${nt}`)})})};function ScrollToBottomVerticalBlockWrapper(rt){const{border:tt,height:et,children:nt}=rt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:tt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:nt})}const VerticalBlock=rt=>{var ft,bt;const tt=reactExports.useRef(null),[et,nt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{nt(ht.target.getBoundingClientRect().width||-1)})}),[nt]),at=((ft=rt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=rt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&rt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(tt.current&&ot.observe(tt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...rt,width:et},dt=getKeyFromId(rt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:tt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=rt=>{var et;const tt=((et=rt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:tt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...rt})})};function LayoutBlock(rt){return rt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...rt}):jsx$1(VerticalBlock,{...rt})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:rt})=>({position:"fixed",top:0,left:0,zIndex:rt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:rt})=>{const tt=reactExports.useRef(null),et=reactExports.useCallback(()=>tt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[rt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:tt})]})};function ThemeProvider({theme:rt,baseuiTheme:tt,children:et}){return jsx$1(ThemeProvider$1,{theme:tt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:rt,children:et})})}function toCodePoint(rt,tt){const et=[];let nt=0,ot=0,at=0;for(;at<rt.length;)nt=rt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(nt-56320)).toString(16)),ot=0):55296<=nt&&nt<=56319?ot=nt:et.push(nt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(rt){return toCodePoint(rt.indexOf(U200D)<0?rt.replace(UFE0Fg,""):rt)}function iconToUrl(rt){const tt=/^:(.+)\/(.+):$/,et=rt.match(tt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(rt,tt,et){const nt=extractEmoji(rt);let ot;nt&&!rt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(nt)}.png`:rt.startsWith(":material")?ot=iconToUrl(rt):ot=et.buildMediaURL(rt),overwriteFavicon(ot),tt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(rt){const tt=document.querySelector("link[rel='shortcut icon']");tt&&(tt.href=rt)}function extractEmoji(rt){const tt=rt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(tt))?nodeEmoji$1.get(tt):nodeEmoji$1.hasEmoji(rt)?rt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(rt,tt){return rt&&baseFor$1(rt,tt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(rt){return typeof rt=="function"?rt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(rt,tt){return rt&&baseForOwn$3(rt,castFunction$1(tt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(rt){return this.__data__.set(rt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(rt){return this.__data__.has(rt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(rt){var tt=-1,et=rt==null?0:rt.length;for(this.__data__=new MapCache$1;++tt<et;)this.add(rt[tt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(rt,tt){for(var et=-1,nt=rt==null?0:rt.length;++et<nt;)if(tt(rt[et],et,rt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(rt,tt){return rt.has(tt)}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(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=rt.length,ct=tt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(rt),dt=at.get(tt);if(pt&&dt)return pt==tt&&dt==rt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(rt,tt),at.set(tt,rt);++ft<ut;){var mt=rt[ft],Ot=tt[ft];if(nt)var yt=st?nt(Ot,mt,ft,tt,rt,at):nt(mt,Ot,ft,rt,tt,at);if(yt!==void 0){if(yt)continue;bt=!1;break}if(ht){if(!arraySome$1(tt,function(Mt,At){if(!cacheHas$2(ht,At)&&(mt===Mt||ot(mt,Mt,et,nt,at)))return ht.push(At)})){bt=!1;break}}else if(!(mt===Ot||ot(mt,Ot,et,nt,at))){bt=!1;break}}return at.delete(rt),at.delete(tt),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(rt,tt,et,nt,ot,at,st){switch(et){case dataViewTag$3:if(rt.byteLength!=tt.byteLength||rt.byteOffset!=tt.byteOffset)return!1;rt=rt.buffer,tt=tt.buffer;case arrayBufferTag$2:return!(rt.byteLength!=tt.byteLength||!at(new Uint8Array$2(rt),new Uint8Array$2(tt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+rt,+tt);case errorTag$2:return rt.name==tt.name&&rt.message==tt.message;case regexpTag$2:case stringTag$2:return rt==tt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=nt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),rt.size!=tt.size&&!ct)return!1;var pt=st.get(rt);if(pt)return pt==tt;nt|=COMPARE_UNORDERED_FLAG$6,st.set(rt,tt);var dt=equalArrays$2(ut(rt),ut(tt),nt,ot,at,st);return st.delete(rt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(rt)==symbolValueOf$1.call(tt)}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(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(rt),ct=ut.length,pt=getAllKeys$1(tt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in tt:hasOwnProperty$f.call(tt,bt)))return!1}var ht=at.get(rt),mt=at.get(tt);if(ht&&mt)return ht==tt&&mt==rt;var Ot=!0;at.set(rt,tt),at.set(tt,rt);for(var yt=st;++ft<ct;){bt=ut[ft];var Mt=rt[bt],At=tt[bt];if(nt)var St=st?nt(At,Mt,bt,tt,rt,at):nt(Mt,At,bt,rt,tt,at);if(!(St===void 0?Mt===At||ot(Mt,At,et,nt,at):St)){Ot=!1;break}yt||(yt=bt=="constructor")}if(Ot&&!yt){var Et=rt.constructor,zt=tt.constructor;Et!=zt&&"constructor"in rt&&"constructor"in tt&&!(typeof Et=="function"&&Et instanceof Et&&typeof zt=="function"&&zt instanceof zt)&&(Ot=!1)}return at.delete(rt),at.delete(tt),Ot}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(rt,tt,et,nt,ot,at){var st=isArray$7(rt),ut=isArray$7(tt),ct=st?arrayTag$2:getTag$1(rt),pt=ut?arrayTag$2:getTag$1(tt);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(rt)){if(!isBuffer$2(tt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(rt)?equalArrays$1(rt,tt,et,nt,ot,at):equalByTag$1(rt,tt,ct,et,nt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(rt,"__wrapped__"),mt=ft&&hasOwnProperty$e.call(tt,"__wrapped__");if(ht||mt){var Ot=ht?rt.value():rt,yt=mt?tt.value():tt;return at||(at=new Stack$2),ot(Ot,yt,et,nt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(rt,tt,et,nt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(rt,tt,et,nt,ot){return rt===tt?!0:rt==null||tt==null||!isObjectLike$1(rt)&&!isObjectLike$1(tt)?rt!==rt&&tt!==tt:baseIsEqualDeep$1(rt,tt,et,nt,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(rt,tt,et,nt){var ot=et.length,at=ot,st=!nt;if(rt==null)return!at;for(rt=Object(rt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==rt[ut[0]]:!(ut[0]in rt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=rt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in rt))return!1}else{var ft=new Stack$1;if(nt)var bt=nt(pt,dt,ct,rt,tt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,nt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(rt){return rt===rt&&!isObject$3(rt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(rt){for(var tt=keys$1(rt),et=tt.length;et--;){var nt=tt[et],ot=rt[nt];tt[et]=[nt,ot,isStrictComparable$2(ot)]}return tt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(rt,tt){return function(et){return et==null?!1:et[rt]===tt&&(tt!==void 0||rt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(rt){var tt=getMatchData$1(rt);return tt.length==1&&tt[0][2]?matchesStrictComparable$2(tt[0][0],tt[0][1]):function(et){return et===rt||baseIsMatch$1(et,rt,tt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(rt,tt){return rt!=null&&tt in Object(rt)}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(rt,tt,et){tt=castPath$3(tt,rt);for(var nt=-1,ot=tt.length,at=!1;++nt<ot;){var st=toKey$4(tt[nt]);if(!(at=rt!=null&&et(rt,st)))break;rt=rt[st]}return at||++nt!=ot?at:(ot=rt==null?0:rt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(rt)||isArguments$1(rt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(rt,tt){return rt!=null&&hasPath$1(rt,tt,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(rt,tt){return isKey$2(rt)&&isStrictComparable$1(tt)?matchesStrictComparable$1(toKey$3(rt),tt):function(et){var nt=get$2(et,rt);return nt===void 0&&nt===tt?hasIn$2(et,rt):baseIsEqual$2(tt,nt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(rt){return function(tt){return baseGet$3(tt,rt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(rt){return isKey$1(rt)?baseProperty$1(toKey$2(rt)):basePropertyDeep$1(rt)}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(rt){return typeof rt=="function"?rt:rt==null?identity$2:typeof rt=="object"?isArray$5(rt)?baseMatchesProperty$1(rt[0],rt[1]):baseMatches$1(rt):property$1(rt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(rt,tt){return function(et,nt){if(et==null)return et;if(!isArrayLike$2(et))return rt(et,nt);for(var ot=et.length,at=tt?ot:-1,st=Object(et);(tt?at--:++at<ot)&&nt(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(rt,tt){var et=-1,nt=isArrayLike$1(rt)?Array(rt.length):[];return baseEach$2(rt,function(ot,at,st){nt[++et]=tt(ot,at,st)}),nt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(rt,tt){var et=isArray$4(rt)?arrayMap$3:baseMap$2;return et(rt,baseIteratee$4(tt))}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(rt){return rt&&rt.__esModule?rt:{default:rt}}var flattenNames=flattenNames$1.flattenNames=function rt(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(tt,function(nt){Array.isArray(nt)?rt(nt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(nt)?(0,_forOwn3$2.default)(nt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(nt)&&et.push(nt)}),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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$6(rt){return rt&&rt.__esModule?rt:{default:rt}}var mergeClasses=mergeClasses$1.mergeClasses=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],nt=tt.default&&(0,_cloneDeep3.default)(tt.default)||{};return et.map(function(ot){var at=tt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){nt[ut]||(nt[ut]={}),nt[ut]=_extends$w({},nt[ut],at[ut])}),ot}),nt};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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$5(rt){return rt&&rt.__esModule?rt:{default:rt}}var transforms={borderRadius:function rt(tt){return{msBorderRadius:tt,MozBorderRadius:tt,OBorderRadius:tt,WebkitBorderRadius:tt,borderRadius:tt}},boxShadow:function rt(tt){return{msBoxShadow:tt,MozBoxShadow:tt,OBoxShadow:tt,WebkitBoxShadow:tt,boxShadow:tt}},userSelect:function rt(tt){return{WebkitTouchCallout:tt,KhtmlUserSelect:tt,MozUserSelect:tt,msUserSelect:tt,WebkitUserSelect:tt,userSelect:tt}},flex:function rt(tt){return{WebkitBoxFlex:tt,MozBoxFlex:tt,WebkitFlex:tt,msFlex:tt,flex:tt}},flexBasis:function rt(tt){return{WebkitFlexBasis:tt,flexBasis:tt}},justifyContent:function rt(tt){return{WebkitJustifyContent:tt,justifyContent:tt}},transition:function rt(tt){return{msTransition:tt,MozTransition:tt,OTransition:tt,WebkitTransition:tt,transition:tt}},transform:function rt(tt){return{msTransform:tt,MozTransform:tt,OTransform:tt,WebkitTransform:tt,transform:tt}},absolute:function rt(tt){var et=tt&&tt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function rt(tt,et){var nt=et[tt];return nt||{extend:tt}}},autoprefix=autoprefix$1.autoprefix=function rt(tt){var et={};return(0,_forOwn3.default)(tt,function(nt,ot){var at={};(0,_forOwn3.default)(nt,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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$f(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$f(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var hover=hover$1.hover=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$f(ot,nt);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(tt,_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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$e(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$e(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var active=active$1.active=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$e(ot,nt);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(tt,_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 rt(tt,et){var nt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;nt[st]=ut};return tt===0&&ot("first-child"),tt===et-1&&ot("last-child"),(tt===0||tt%2===0)&&ot("even"),Math.abs(tt%2)===1&&ot("odd"),ot("nth-child",tt),nt};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(rt){return rt&&rt.__esModule?rt:{default:rt}}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 rt(tt){for(var et=arguments.length,nt=Array(et>1?et-1:0),ot=1;ot<et;ot++)nt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(nt),st=(0,_mergeClasses2.default)(tt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function rt(tt,et,nt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof tt.pageX=="number"?tt.pageX:tt.touches[0].pageX,pt=typeof tt.pageY=="number"?tt.pageY:tt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(nt==="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 rt(tt,et,nt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=nt*2,at.height=nt*2;var st=at.getContext("2d");return st?(st.fillStyle=tt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,nt,nt),st.translate(nt,nt),st.fillRect(0,0,nt,nt),at.toDataURL()):null},get$1=function rt(tt,et,nt,ot){var at=tt+"-"+et+"-"+nt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(tt,et,nt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},Checkboard=function rt(tt){var et=tt.white,nt=tt.grey,ot=tt.size,at=tt.renderers,st=tt.borderRadius,ut=tt.boxShadow,ct=tt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,nt,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(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_createClass$d=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _classCallCheck$d(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$d(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var Alpha=function(rt){_inherits$d(tt,rt);function tt(){var et,nt,ot,at;_classCallCheck$d(this,tt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(nt=(ot=_possibleConstructorReturn$d(this,(et=tt.__proto__||Object.getPrototypeOf(tt)).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)},nt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(tt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var nt=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%,
695
695
  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%,
696
696
  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 nt.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}))))}}]),tt}(reactExports.PureComponent||reactExports.Component),_createClass$c=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _defineProperty$d(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}function _classCallCheck$c(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$c(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var DEFAULT_ARROW_OFFSET=1,UP_KEY_CODE=38,DOWN_KEY_CODE=40,VALID_KEY_CODES=[UP_KEY_CODE,DOWN_KEY_CODE],isValidKeyCode=function rt(tt){return VALID_KEY_CODES.indexOf(tt)>-1},getNumberValue=function rt(tt){return Number(String(tt).replace(/%/g,""))},idCounter=1,EditableInput=function(rt){_inherits$c(tt,rt);function tt(et){_classCallCheck$c(this,tt);var nt=_possibleConstructorReturn$c(this,(tt.__proto__||Object.getPrototypeOf(tt)).call(this));return nt.handleBlur=function(){nt.state.blurValue&&nt.setState({value:nt.state.blurValue,blurValue:null})},nt.handleChange=function(ot){nt.setUpdatedValue(ot.target.value,ot)},nt.handleKeyDown=function(ot){var at=getNumberValue(ot.target.value);if(!isNaN(at)&&isValidKeyCode(ot.keyCode)){var st=nt.getArrowOffset(),ut=ot.keyCode===UP_KEY_CODE?at+st:at-st;nt.setUpdatedValue(ut,ot)}},nt.handleDrag=function(ot){if(nt.props.dragLabel){var at=Math.round(nt.props.value+ot.movementX);at>=0&&at<=nt.props.dragMax&&nt.props.onChange&&nt.props.onChange(nt.getValueObjectWithLabel(at),ot)}},nt.handleMouseDown=function(ot){nt.props.dragLabel&&(ot.preventDefault(),nt.handleDrag(ot),window.addEventListener("mousemove",nt.handleDrag),window.addEventListener("mouseup",nt.handleMouseUp))},nt.handleMouseUp=function(){nt.unbindEventListeners()},nt.unbindEventListeners=function(){window.removeEventListener("mousemove",nt.handleDrag),window.removeEventListener("mouseup",nt.handleMouseUp)},nt.state={value:String(et.value).toUpperCase(),blurValue:String(et.value).toUpperCase()},nt.inputId="rc-editable-input-"+idCounter++,nt}return _createClass$c(tt,[{key:"componentDidUpdate",value:function(nt,ot){this.props.value!==this.state.value&&(nt.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(nt){return _defineProperty$d({},this.props.label,nt)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||DEFAULT_ARROW_OFFSET}},{key:"setUpdatedValue",value:function(nt,ot){var at=this.props.label?this.getValueObjectWithLabel(nt):nt;this.props.onChange&&this.props.onChange(at,ot),this.setState({value:nt})}},{key:"render",value:function(){var nt=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 nt.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)}}]),tt}(reactExports.PureComponent||reactExports.Component),calculateChange$1=function rt(tt,et,nt,ot){var at=ot.clientWidth,st=ot.clientHeight,ut=typeof tt.pageX=="number"?tt.pageX:tt.touches[0].pageX,ct=typeof tt.pageY=="number"?tt.pageY:tt.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(nt.h!==ft)return{h:ft,s:nt.s,l:nt.l,a:nt.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(nt.h!==ht)return{h:ht,s:nt.s,l:nt.l,a:nt.a,source:"hsl"}}return null},_createClass$b=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _classCallCheck$b(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$b(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$b(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var Hue=function(rt){_inherits$b(tt,rt);function tt(){var et,nt,ot,at;_classCallCheck$b(this,tt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(nt=(ot=_possibleConstructorReturn$b(this,(et=tt.__proto__||Object.getPrototypeOf(tt)).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()},nt),_possibleConstructorReturn$b(ot,at)}return _createClass$b(tt,[{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 nt=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 nt.container=ct},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React$1.createElement("style",null,`
697
697
  .hue-horizontal {
@@ -808,4 +808,4 @@ The app's main file \`${rt}\` has
808
808
  not been pushed to GitHub. Please add it to continue.
809
809
  `,allowHTML:!1})}}const StyledParagraph=newStyled("p",{target:"edgwnvj0"})({textAlign:"justify"});function NoRepositoryDetected(){return{title:"Unable to deploy",body:jsxs(StyledParagraph,{children:["The app’s code is not connected to a remote GitHub repository. To deploy on Streamlit Community Cloud, please put your code in a GitHub repository and publish the current branch. Read more in"," ",jsx$1("a",{href:STREAMLIT_COMMUNITY_CLOUD_DOCS_URL,rel:"noopener noreferrer",target:"_blank",children:"our documentation"}),"."]})}}function ModalBody({children:rt}){const{colors:tt,fontSizes:et,spacing:nt}=useTheme();return jsx$1(ModalBody$2,{style:{marginTop:nt.none,marginLeft:nt.none,marginRight:nt.none,marginBottom:nt.none,paddingTop:nt.md,paddingRight:nt.none,paddingBottom:nt.none,paddingLeft:nt.none,color:tt.bodyText,fontSize:et.md,overflowY:"auto"},children:rt})}function DeployModal(rt){const{children:tt,onClose:et}=rt;return jsxs(Modal,{isOpen:!0,closeable:!0,onClose:et,size:"auto",children:[jsx$1(ModalHeader,{children:"Deploy this app using..."}),jsx$1(ModalBody,{children:tt})]})}function DeployCard(rt){const{colors:tt,spacing:et,radii:nt,breakpoints:ot,sizes:at}=useTheme(),{children:st}=rt;return jsx$1(Card,{overrides:{Root:{style:{borderTopWidth:at.borderWidth,borderBottomWidth:at.borderWidth,borderLeftWidth:at.borderWidth,borderRightWidth:at.borderWidth,borderTopStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"solid",borderTopColor:tt.borderColor,borderBottomColor:tt.borderColor,borderLeftColor:tt.borderColor,borderRightColor:tt.borderColor,borderTopLeftRadius:"none",borderTopRightRadius:"none",borderBottomLeftRadius:"none",borderBottomRightRadius:"none",":last-child":{borderRightStyle:"none",borderBottomRightRadius:nt.xl},":first-child":{borderBottomLeftRadius:nt.xl},[`@media (max-width: ${ot.md})`]:{":last-child":{borderBottomLeftRadius:nt.xl}}}},Contents:{style:{marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%"}},Body:{style:{padding:et.twoXL,marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%",display:"flex",flexDirection:"column",[`@media (max-width: ${ot.md})`]:{padding:et.xl}}}},children:st})}const Checkmark="data:image/svg+xml,%3csvg%20width='12'%20height='9'%20viewBox='0%200%2012%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.00009%206.78L1.68676%204.46667C1.42676%204.20667%201.00676%204.20667%200.746758%204.46667C0.486758%204.72667%200.486758%205.14667%200.746758%205.40667L3.53342%208.19334C3.79342%208.45334%204.21342%208.45334%204.47342%208.19334L11.5268%201.14C11.7868%200.880005%2011.7868%200.460005%2011.5268%200.200005C11.2668%20-0.0599951%2010.8468%20-0.0599951%2010.5868%200.200005L4.00009%206.78Z'%20fill='%23808495'/%3e%3c/svg%3e",StyledHeader=newStyled("div",{target:"edlp5wu0"})(({theme:rt})=>({fontFamily:rt.fonts.sansSerif,fontWeight:rt.fontWeights.bold,fontSize:rt.fontSizes.lg,color:rt.colors.grey90,marginTop:rt.spacing.twoXL,marginBottom:rt.spacing.twoXS,[`@media (max-width: ${rt.breakpoints.md})`]:{marginTop:rt.spacing.md}})),StyledSubheader=newStyled("div",{target:"edlp5wu1"})(({theme:rt})=>({fontFamily:rt.fonts.sansSerif,fontWeight:rt.fontWeights.normal,fontSize:rt.fontSizes.md,color:rt.colors.grey90,marginTop:rt.spacing.twoXS,marginBottom:rt.spacing.md,[`@media (max-width: ${rt.breakpoints.md})`]:{marginTop:rt.spacing.md}})),StyledCardContainer=newStyled("div",{target:"edlp5wu2"})(({theme:rt})=>({display:"grid",maxWidth:`calc(1.25 * ${rt.sizes.contentMaxWidth})`,gridTemplateColumns:"1fr 1fr 1fr",gridGap:rt.spacing.none,[`@media (max-width: ${rt.breakpoints.md})`]:{gridTemplateColumns:"1fr"}})),StyledElement=newStyled("div",{target:"edlp5wu3"})(({theme:rt})=>({display:"inline-flex",marginTop:rt.spacing.sm,"& > span":{fontFamily:rt.fonts.sansSerif,fontWeight:rt.fontWeights.normal,fontSize:rt.fontSizes.md,marginLeft:rt.spacing.twoXL,color:rt.colors.gray70},"& > img":{position:"absolute",marginTop:rt.spacing.sm}})),StyledActionsWrapper=newStyled("div",{target:"edlp5wu4"})(({theme:rt})=>({display:"flex",marginTop:rt.spacing.threeXL,"& > button":{marginRight:rt.spacing.twoXL},[`@media (max-width: ${rt.breakpoints.md})`]:{marginTop:rt.spacing.xl}}));function DeployListElement(rt){const{children:tt}=rt;return jsxs(StyledElement,{children:[jsx$1("img",{src:Checkmark,alt:"Checkmark"}),jsx$1("span",{children:tt})]})}const{GitStates}=GitInfo,openUrl=rt=>{window.open(rt,"_blank")},getDeployAppUrl=rt=>{if(rt){const tt=new URL(DEPLOY_URL);return tt.searchParams.set("repository",rt.repository??""),tt.searchParams.set("branch",rt.branch??""),tt.searchParams.set("mainModule",rt.module??""),tt.toString()}return STREAMLIT_CLOUD_URL};function DeployDialog(rt){const{gitInfo:tt}=reactExports.useContext(AppContext),{onClose:et,metricsMgr:nt}=rt,ot=reactExports.useCallback(()=>{const{showDeployError:at,isDeployErrorModalOpen:st,metricsMgr:ut}=rt;if(ut.enqueue("menuClick",{label:"deployButtonInDialog"}),!tt){const mt=NoRepositoryDetected();at(mt.title,mt.body);return}const{repository:ct,branch:pt,module:dt,untrackedFiles:ft,state:bt}=tt;if((!ct||!pt||!dt)&&bt===GitStates.DEFAULT){const mt=NoRepositoryDetected();at(mt.title,mt.body);return}if(bt===GitStates.HEAD_DETACHED){const mt=DetachedHead();at(mt.title,mt.body);return}if(dt&&(ft!=null&&ft.includes(dt))){const mt=ModuleIsNotAdded(dt);at(mt.title,mt.body);return}st&&et(),openUrl(getDeployAppUrl(tt))},[rt,et,tt]);return jsx$1(DeployModal,{onClose:et,children:jsxs(StyledCardContainer,{children:[jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:1},children:[jsx$1("img",{src:StreamlitLogo,alt:"Streamlit Logo","data-testid":"stDeployDialogCommunityCloudIcon"}),jsx$1(StyledHeader,{children:"Streamlit Community Cloud"}),jsx$1(StyledSubheader,{children:"For community, always free"}),jsx$1(DeployListElement,{children:"For personal hobbies and learning"}),jsx$1(DeployListElement,{children:"Deploy unlimited public apps"}),jsx$1(DeployListElement,{children:"Explore and learn from Streamlit’s community and popular apps"})]}),jsx$1(Action,{children:jsxs(StyledActionsWrapper,{children:[jsx$1(BaseButton,{kind:BaseButtonKind.PRIMARY,onClick:ot,children:"Deploy now"}),jsx$1(BaseButton,{onClick:()=>{nt.enqueue("menuClick",{label:"readMoreCommunityCloudInDeployDialog"}),openUrl(STREAMLIT_COMMUNITY_CLOUD_DOCS_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})]})})]}),jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:1},children:[jsx$1("img",{src:Snowflake,alt:"Snowflake","data-testid":"stDeployDialogSnowflakeDeploymentIcon"}),jsx$1(StyledHeader,{children:"Snowflake"}),jsx$1(StyledSubheader,{children:"For enterprise"}),jsx$1(DeployListElement,{children:"Enterprise-level security, support, and fully managed infrastructure"}),jsx$1(DeployListElement,{children:"Deploy unlimited private apps with role-based sharing"}),jsx$1(DeployListElement,{children:"Integrate with Snowflake’s full data stack"})]}),jsx$1(Action,{children:jsxs(StyledActionsWrapper,{children:[jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:()=>{nt.enqueue("menuClick",{label:"startTrialInDeployDialog"}),openUrl(SNOWFLAKE_TRIAL_URL)},children:"Start trial"}),jsx$1(BaseButton,{onClick:()=>{nt.enqueue("menuClick",{label:"learnMoreSnowflakeInDeployDialog"}),openUrl(SNOWFLAKE_LEARN_MORE_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})]})})]}),jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:2},children:[jsx$1("img",{src:Rocket,alt:"Rocket","data-testid":"stDeployDialogCustomDeploymentIcon"}),jsx$1(StyledHeader,{children:"Other platforms"}),jsx$1(StyledSubheader,{children:"For custom deployment "}),jsx$1(DeployListElement,{children:"Deploy on your own hardware or cloud service"}),jsx$1(DeployListElement,{children:"Set up and maintain your own authentication, resources, and costs"})]}),jsx$1(Action,{children:jsx$1(StyledActionsWrapper,{children:jsx$1(BaseButton,{onClick:()=>{nt.enqueue("menuClick",{label:"readMoreDeployTutorialInDeployDialog"}),openUrl(STREAMLIT_DEPLOY_TUTORIAL_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})})})]})]})})}function StreamlitDialog(rt){switch(rt.type){case DialogType.ABOUT:return aboutDialog(rt);case DialogType.CLEAR_CACHE:return clearCacheDialog(rt);case DialogType.SETTINGS:return settingsDialog(rt);case DialogType.SCRIPT_COMPILE_ERROR:return scriptCompileErrorDialog(rt);case DialogType.THEME_CREATOR:return jsx$1(ThemeCreatorDialog,{...rt});case DialogType.WARNING:return warningDialog(rt);case DialogType.DEPLOY_DIALOG:return jsx$1(DeployDialog,{...rt});case DialogType.DEPLOY_ERROR:return deployErrorDialog(rt);case void 0:return noDialog(rt);default:return typeNotRecognizedDialog(rt)}}function aboutDialog(rt){if(rt.aboutSectionMd){const tt={overflowY:"auto",overflowX:"hidden",maxHeight:"35vh"},et=`
810
810
  `,nt=[`Made with Streamlit v${rt.sessionInfo.current.streamlitVersion}`,STREAMLIT_HOME_URL,`Copyright ${new Date().getFullYear()} Snowflake Inc. All rights reserved.`].join(et),ot=`${rt.aboutSectionMd} ${et} ${et} ${nt}`;return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:"About"}),jsx$1(ModalBody$1,{children:jsx$1(StyledAboutInfo,{children:jsx$1(StreamlitMarkdown$1,{source:ot,allowHTML:!1,style:tt})})})]})}return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:"Made with"}),jsx$1(ModalBody$1,{children:jsxs("div",{children:[rt.sessionInfo.isSet&&jsxs(Fragment,{children:["Streamlit v",rt.sessionInfo.current.streamlitVersion,jsx$1("br",{})]}),jsx$1(StyledAboutLink,{href:STREAMLIT_HOME_URL,children:STREAMLIT_HOME_URL}),jsx$1("br",{}),"Copyright ",new Date().getFullYear()," Snowflake Inc. All rights reserved."]})})]})}function clearCacheDialog(rt){const et=["**Are you sure you want to clear the app's function caches?**","This will remove all cached entries from functions using","`@st.cache_data` and `@st.cache_resource`."].join(`
811
- `);return jsx$1("div",{"data-testid":"stClearCacheDialog",children:jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:rt.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:rt.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(rt){var tt;return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,size:"auto",autoFocus:!1,children:[jsx$1(ModalHeader,{children:"Script execution error"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitSyntaxHighlighter$1,{showLineNumbers:!1,wrapLines:!1,children:(tt=rt.exception)!=null&&tt.message?rt.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:rt.onClose,children:"Close"})})]})}function settingsDialog(rt){return jsx$1(SettingsDialog,{...rt})}function warningDialog(rt){return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:rt.title}),jsx$1(ModalBody$1,{children:rt.msg})]})}function deployErrorDialog({title:rt,msg:tt,onClose:et,onContinue:nt,onTryAgain:ot}){const at=()=>{et(),nt&&nt()};return jsxs(Modal,{isOpen:!0,onClose:et,children:[jsx$1(ModalHeader,{children:rt}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:tt})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ot,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:at,children:nt?"Continue anyway":"Close"})]})]})}function noDialog({onClose:rt}){return jsx$1(Modal,{isOpen:!1,onClose:rt})}function typeNotRecognizedDialog(rt){return jsx$1(Modal,{isOpen:!0,onClose:rt.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${rt.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(tt){this.onSessionEvent.emit(tt)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(rt,tt,et,nt){if(!isObject(rt))return rt;tt=castPath$1(tt,rt);for(var ot=-1,at=tt.length,st=at-1,ut=rt;ut!=null&&++ot<at;){var ct=toKey(tt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return rt;if(ot!=st){var dt=ut[ct];pt=nt?nt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(tt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return rt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(rt,tt,et){for(var nt=-1,ot=tt.length,at={};++nt<ot;){var st=tt[nt],ut=baseGet(rt,st);et(ut,st)&&baseSet(at,castPath(st,rt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(rt,tt){return basePickBy(rt,tt,function(et,nt){return hasIn(rt,nt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(rt,tt){return rt==null?{}:basePick(rt,tt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",log$2=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor(tt){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=tt}async initialize({gatherUsageStats:tt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=tt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(log$2.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),log$2.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(tt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([tt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(tt,et))}setMetadata(tt){this.metadata=tt}async requestDefaultMetricsConfig(){const tt=p$4();if(tt){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,log$2.error("Failed to fetch metrics config: ",et.status);else{const nt=await et.json();this.metricsUrl=nt.url??void 0,tt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){log$2.error("Failed to fetch metrics config:",et)}}send(tt,et={}){const nt=this.buildEventProto(tt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(tt,nt):this.track(nt)}sendPendingEvents(){this.pendingEvents.forEach(([tt,et])=>{this.send(tt,et)}),this.pendingEvents=[]}async track(tt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tt.toJSON())});await fetch(et)}postMessageEvent(tt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:tt,data:et})}buildEventProto(tt,et){const nt=new MetricsEvent({event:tt,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(tt==="menuClick")nt.label=et.label;else if(tt==="pageProfile")return new MetricsEvent({...nt,...et});return nt}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 tt="ajs_anonymous_id",et=p$4(),nt=f$3(tt),ot=et?window.localStorage.getItem(tt):null,at=new Date;if(at.setFullYear(new Date().getFullYear()+1),nt)this.anonymousId=nt,et&&window.localStorage.setItem(tt,nt);else if(ot){try{this.anonymousId=JSON.parse(ot)}catch{this.anonymousId=ot}setCookie(tt,this.anonymousId,at)}else this.anonymousId=v4(),setCookie(tt,this.anonymousId,at),et&&window.localStorage.setItem(tt,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:rt})=>{const tt=hasLightBackgroundColor(rt);return{position:"absolute",background:rt.colors.bgColor,color:rt.colors.bodyText,top:rt.spacing.none,left:rt.spacing.none,right:rt.spacing.none,bottom:rt.spacing.none,colorScheme:tt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:rt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:rt,toggleRecordAudio:tt,recordAudio:et,startRecording:nt})=>{const[ot,at]=reactExports.useState(et),st=reactExports.useCallback(ct=>{const{checked:pt}=ct.target;pt!==ot&&(at(pt),tt())},[ot,tt]),ut=reactExports.useCallback(()=>{nt(),rt()},[nt,rt]);return jsxs(Modal,{isOpen:!0,onClose:rt,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:rt})=>({width:rt.sizes.full,borderRadius:rt.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:rt})=>({display:"flex",flexDirection:"column",width:rt.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:rt})=>({display:"flex",flexDirection:"row",paddingTop:rt.spacing.md,paddingBottom:rt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:rt})=>({paddingRight:rt.spacing.lg,textAlign:"right",color:rt.colors.gray,fontWeight:rt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:rt})=>({flex:1,paddingRight:rt.spacing.lg,marginRight:"6em",[`@media (max-width: ${rt.breakpoints.sm})`]:{marginRight:rt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:rt})=>({marginTop:rt.spacing.sm,marginBottom:rt.spacing.none,fontSize:rt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:rt})=>({marginTop:rt.spacing.twoXS})),VideoRecordedDialog=({onClose:rt,videoBlob:tt,fileName:et})=>{const nt=URL.createObjectURL(tt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",nt),at.setAttribute("download",`${et}.webm`),at.click(),rt()};return jsxs(Modal,{isOpen:!0,onClose:rt,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:nt,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:rt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:rt.spacing.twoXL,marginLeft:rt.spacing.sm,fontSize:rt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:rt})=>({margin:rt.spacing.none})),UnsupportedBrowserDialog=({onClose:rt})=>jsxs(Modal,{isOpen:!0,onClose:rt,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:rt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:rt.sizes.full,height:rt.sizes.full,fontSize:"40vh",color:rt.colors.red,fontWeight:rt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${rt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:rt,endCallback:tt})=>{const[et,nt]=reactExports.useState(rt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&nt(at),at===0&&tt()},children:jsx$1("span",{children:et})},`frame${et}`)},log$1=loglevelExports$1.getLogger("withScreencast");function withScreencast(rt){const tt=et=>{const{testOverride:nt}=et,ot=reactExports.useRef(null),[at,st]=reactExports.useState("streamlit-screencast"),[ut,ct]=reactExports.useState(!1),[pt,dt]=reactExports.useState(void 0),[ft,bt]=reactExports.useState(nt||"OFF"),ht=reactExports.useCallback(()=>{ct(Et=>!Et)},[]),mt=reactExports.useCallback(async()=>{if(!(ft==="OFF"||m$4(ot.current))){if(ft==="COUNTDOWN"){bt("OFF");return}if(ft==="RECORDING"){const Et=ot.current;if(!Et||Et.getState()==="inactive")bt("OFF");else{const zt=await Et.stop();dt(zt),bt("PREVIEW_FILE")}}}},[ft]),Ot=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}ot.current=new ScreenCastRecorder({recordAudio:ut,onErrorOrStop:()=>{mt().catch(Et=>log$1.warn(`withScreencast.stopRecording threw an error: ${Et}`))}});try{await ot.current.initialize()}catch(Et){log$1.warn(`ScreenCastRecorder.initialize error: ${Et}`),bt("UNSUPPORTED");return}bt("COUNTDOWN")},[ut,mt]),yt=reactExports.useCallback(Et=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}if(ft==="OFF"){st(Et),bt("SETUP");return}mt().catch(zt=>log$1.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[ft,mt]),Mt=reactExports.useCallback(async()=>{if(m$4(ot.current))throw new Error("Countdown finished but recorder is null");ot.current.start()?bt("RECORDING"):mt().catch(zt=>log$1.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[mt]),At=reactExports.useCallback(()=>{bt("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(rt,{...et,screenCast:{currentState:ft,toggleRecordAudio:ht,startRecording:yt,stopRecording:mt}}),ft==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:At}),ft==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ut,onClose:At,startRecording:Ot,toggleRecordAudio:ht}),ft==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Mt}),ft==="PREVIEW_FILE"&&pt&&jsx$1(VideoRecordedDialog,{onClose:At,videoBlob:pt,fileName:at})]})};return tt.displayName=`withScreencast(${rt.displayName||rt.name||"Component"})`,hoistNonReactStatics$2(tt,rt)}const showDevelopmentOptions=(rt,tt)=>tt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==tt||Config.ToolbarMode.MINIMAL==tt?!1:rt||isLocalhost();function getTitle(rt){return rt||"Streamlit"}class StrategyV1{constructor(tt){this.appNav=tt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(tt){var st,ut;this.appPages=tt.appPages,this.currentPageScriptHash=tt.pageScriptHash,this.hideSidebarNav=((st=tt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],nt=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(nt,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(tt){const{appPages:et}=tt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(tt){var ot;const{pageName:et}=tt;this.appNav.onPageNotFound(et);const nt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=nt,[{currentPageScriptHash:nt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:nt})}]}handleNavigation(tt){}findPageByUrlPath(tt){return this.appPages.length===0?null:this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(tt,et,nt){return AppRoot.empty(et,!1,nt,tt.logo)}}class StrategyV2{constructor(tt){this.appNav=tt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(tt){var et;return this.mainScriptHash=tt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=tt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(tt){}handlePageNotFound(tt){const{pageName:et}=tt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(tt){const{sections:et,position:nt,appPages:ot}=tt;this.appPages=ot,this.hideSidebarNav=nt===Navigation.Position.HIDDEN;const at=tt.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:tt.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(tt){return this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(tt,et,nt){return tt.filterMainScriptElements(et)}}class AppNavigation{constructor(tt,et,nt,ot){this.hostCommunicationMgr=tt,this.onUpdatePageUrl=et,this.onPageNotFound=nt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(tt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(tt)}handleNavigation(tt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(tt)}handlePagesChanged(tt){return this.strategy.handlePagesChanged(tt)}handlePageNotFound(tt){return this.strategy.handlePageNotFound(tt)}findPageByUrlPath(tt){return this.strategy.findPageByUrlPath(tt)}handlePageConfigChanged(tt){this.isPageIconSet=!!tt.favicon,this.isPageTitleSet=!!tt.title}clearPageElements(tt,et,nt){return this.strategy.clearPageElements(tt,et,nt)}}var define_PACKAGE_METADATA_default={version:"1.42.0"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",log=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor(tt){super(tt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(nt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:nt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(nt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);nt===at.name&&ut?this.props.theme.setTheme(at):nt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=nt=>{if(log.info(`Connection state changed from ${this.state.connectionState} to ${nt}`),nt===ConnectionState.CONNECTED){log.info("Reconnected to server.");const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(log.info("Requesting a script run."),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:nt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:nt})},this.handleGitInfoChanged=nt=>{this.setState({gitInfo:nt})},this.handleCustomParentMessage=nt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:nt.message}):log.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=nt=>{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(nt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,nt.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,nt.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);log.error(st),this.showError("Bad message format",st.message)}},this.handleLogo=(nt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(nt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=nt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=nt;this.appNavigation.handlePageConfigChanged(nt),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=nt=>{const{queryString:ot}=nt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=nt=>{const ot=nt?`You have requested page /${nt}, 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=nt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(nt))},this.onPageIconChanged=nt=>{handleFavicon(nt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=nt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(nt))},this.handleNavigation=nt=>{this.maybeSetState(this.appNavigation.handleNavigation(nt))},this.handlePageProfileMsg=nt=>{var st,ut,ct;const ot=PageProfile.toObject(nt),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=nt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(nt.fragmentId,!0)},nt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=nt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,d$3(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!nt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=nt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(nt),nt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:nt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(nt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{pathname:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?nt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",mt=`${ut==="/"?"":ut}/${dt}${bt}`;window.history.pushState({},"",mt)}}},this.handleNewSession=nt=>{const ot=nt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(nt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=nt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const mt=nt.config,Ot=nt.customTheme;this.processThemeInput(Ot),this.setState({allowRunOnSave:mt.allowRunOnSave,hideTopBar:mt.hideTopBar,toolbarMode:mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(nt)),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=nt=>{const ot=nt.initialize,at=nt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(nt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:nt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===nt;m$4(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=nt=>{this.props.theme.setTheme(nt),this.setState({hideColoredLine:!isPresetTheme(nt)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(nt.emotion)})},this.createThemeHash=nt=>{if(!nt)return"hash_for_undefined_custom_theme";const ot=Object.entries(nt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=nt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=nt;if(this.setState({userSettings:nt}),ot!==at&&this.isServerConnected()){const st=new BackMsg$1({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(nt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,nt,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 nt=new BackMsg$1({debugShutdownRuntime:!0});nt.type="debugShutdownRuntime",this.sendBackMsg(nt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({debugDisconnectWebsocket:!0});nt.type="debugDisconnectWebsocket",this.sendBackMsg(nt)}},this.debugClearForwardMsgCache=()=>{var nt,ot;isLocalhost()&&((ot=(nt=this.connectionManager)==null?void 0:nt.websocketConnection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(nt=>{clearInterval(nt)}),this.setState({autoReruns:[]})},this.rerunScript=(nt=!1)=>{if(this.closeDialog(),!this.isServerConnected()){log.error("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}),nt===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){log.error("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg$1({loadGitInfo:!0}))},this.onPageChange=nt=>{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,nt)},this.isAppInReadyState=nt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&nt.scriptRunState===ScriptRunState.RUNNING&&nt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(nt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){log.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{pathname: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$1({rerunScript:{queryString:dt,widgetStates:nt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}}))},this.stopScript=()=>{if(!this.isServerConnected()){log.error("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const nt=new BackMsg$1({stopScript:!0});nt.type="stopScript",this.sendBackMsg(nt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const nt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(nt)}else log.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const nt={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(nt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const nt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(nt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const nt=new BackMsg$1({clearCache:!0});nt.type="clearCache",this.sendBackMsg(nt)}else log.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({appHeartbeat:!0});nt.type="appHeartbeat",this.sendBackMsg(nt)}else log.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=nt=>{this.connectionManager?(log.info(nt),this.connectionManager.sendMessage(nt)):log.error(`Not connected. Cannot send back message: ${nt}`)},this.handleConnectionError=nt=>{this.showError("Connection error",nt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(nt=!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:nt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:nt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:nt==null?void 0:nt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:nt}=this.state;if(nt!==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:nt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${nt}-${at}`)},this.handleFullScreen=nt=>{this.setState({isFullScreen:nt})},this.setLibConfig=nt=>{this.setState({libConfig:nt})},this.setAppConfig=nt=>{this.setState({appConfig:nt})},this.addScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(nt)}))},this.removeScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,nt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:nt}=this.state,ot=nt&&nt.length>0?nt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:nt}=this.state;return nt&&(nt==null?void 0:nt.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=(nt,ot)=>{if(this.isServerConnected()){const at=new BackMsg$1({fileUrlsRequest:{requestId:nt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=nt=>{switch(nt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=nt=>{nt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(tt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(tt.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,hideColoredLine:!1,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:nt=>this.setState({formsData:nt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:tt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:nt=>{this.setState({inputsDisabled:nt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:nt=>this.setState({isOwner:nt}),fileUploadClientConfigChanged:nt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(nt)},hostMenuItemsChanged:nt=>{this.setState({hostMenuItems:nt})},hostToolbarItemsChanged:nt=>{this.setState({hostToolbarItems:nt})},hostHideSidebarNavChanged:nt=>{this.setState({hostHideSidebarNav:nt})},sidebarChevronDownshiftChanged:nt=>{this.setState({sidebarChevronDownshift:nt})},pageLinkBaseUrlChanged:nt=>{this.setState({pageLinkBaseUrl:nt})},queryParamsChanged:nt=>{this.setState({queryParams:nt})},deployedAppMetadataChanged:nt=>{this.setState({deployedAppMetadata:nt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var nt;(nt=this.connectionManager)==null||nt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:nt=>this.widgetMgr.setFormsWithUploadsInProgress(nt),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({getLastSessionId:()=>{var tt;return(tt=this.sessionInfo.last)==null?void 0:tt.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:tt=>{const{allowedOrigins:et,useExternalAuthToken:nt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=tt,pt={allowedOrigins:et,useExternalAuthToken:nt,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 tt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(tt).map(nt=>Math.ceil(nt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.DQ-TFrBp.js").then(tt=>tt.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(tt,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 tt;(tt=this.connectionManager)==null||tt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(tt,et){log.error(et);const nt={type:DialogType.WARNING,title:tt,msg:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1}),onClose:()=>{}};this.openDialog(nt)}hasStreamlitVersionChanged(tt){var nt;let et;if(((nt=window.__streamlit)==null?void 0:nt.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?et=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(et=this.sessionInfo.current.streamlitVersion),et){const{environmentInfo:ot}=tt;if(d$3(ot)&&d$3(ot.streamlitVersion))return et!=ot.streamlitVersion}return!1}maybeSetState(tt){if(tt){const[et,nt]=tt;this.setState(et,nt)}}processThemeInput(tt){const et=this.createThemeHash(tt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const nt=!isPresetTheme(this.props.theme.activeTheme);if(tt){const ot=createTheme(CUSTOM_THEME_NAME,tt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||nt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),nt&&this.setAndSendTheme(getHostSpecifiedTheme())}handleScriptFinished(tt){if(tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:nt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(nt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(nt=>getElementId(nt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&tt!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(tt,et,nt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:nt,appHash:tt,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(tt){this.setState({dialog:tt})}render(){const{allowRunOnSave:tt,connectionState:et,dialog:nt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,hideColoredLine:ht,expandSidebarNav:mt,currentPageScriptHash:Ot,hostHideSidebarNav:yt,pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,hostMenuItems:St,hostToolbarItems:Et,libConfig:zt,appConfig:vt,inputsDisabled:Tt,appPages:$t,navSections:Rt}=this.state,wt=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),It=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),kt=nt?StreamlitDialog({...nt,onClose:this.closeDialog}):null,Ft=Tt||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:!ht&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,gitInfo:this.state.gitInfo,appConfig:vt},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:Ot,libConfig:zt,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:It,"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:tt}),jsx$1(ToolbarActions,{hostToolbarItems:Et,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:St,developmentMode:wt,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:Ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:$t,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Ot,hideSidebarNav:bt||yt,expandSidebarNav:mt}),kt]})})})})}}const AppWithScreencast=withScreencast(App);function useThemeManager(){const rt=getDefaultTheme(),[tt,et]=reactExports.useState(rt),[nt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(rt)?[]:[rt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==tt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,tt]),pt=reactExports.useCallback(()=>{tt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[tt.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)}},[tt,at,pt]),[{setTheme:ct,activeTheme:tt,addThemes:ut,availableThemes:at,setImportedTheme:dt},nt]}const ThemedApp=({streamlitExecutionStartedAt:rt})=>{const[tt,et]=useThemeManager(),{activeTheme:nt}=tt,ot=nt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:nt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreencast,{theme:tt,streamlitExecutionStartedAt:rt})]})})})},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{isArguments_1 as $,PLACEMENT as A,ACCESSIBILITY_TYPE as B,hasLightBackgroundColor as C,DynamicIcon as D,EmotionIconBase as E,Fragment as F,Popover$1 as G,require$$0 as H,toString$7 as I,m$4 as J,merge$4 as K,numbro$1 as L,d$3 as M,hooks as N,getTimezone as O,PortalContext as P,moment$1 as Q,React$1 as R,isIntegerType as S,isUnsignedIntegerType as T,isDurationType as U,isPeriodType as V,format as W,isBooleanType as X,_baseKeys as Y,_getTag as Z,_extends$Q as _,range$1 as a,ensureError as a$,isArray_1 as a0,isArrayLike_1 as a1,isBufferExports as a2,_isPrototype as a3,isTypedArray_1 as a4,DataFrameCellType as a5,Field$1 as a6,Null as a7,isTimeType as a8,convertTimeToDate as a9,mix$1 as aA,getStyledCell as aB,isEqual$1 as aC,StyledTooltipContentWrapper as aD,StreamlitMarkdown$1 as aE,LibContext as aF,Resizable as aG,getGray70 as aH,getGray30 as aI,getCategoricalColorsArray as aJ,getDivergingColorsArray as aK,getSequentialColorsArray as aL,getBlue80 as aM,debounce$4 as aN,Global as aO,_baseMerge as aP,_createAssigner as aQ,withTheme as aR,toaster as aS,Kind as aT,AlertElement as aU,_assertThisInitialized as aV,StyledInlineCode as aW,ErrorElement as aX,Skeleton$1 as aY,Skeleton as aZ,hoistNonReactStatics$2 as a_,isDecimalType as aa,isStringType as ab,isEmptyType as ac,isDatetimeType as ad,isDateType as ae,isObjectType as af,isBytesType as ag,isNumericType as ah,isCategoricalType as ai,isListType as aj,isRangeIndexType as ak,loglevelExports$1 as al,Arrow$2 as am,isArray$k as an,_defineProperty$p as ao,_objectWithoutPropertiesLoose$j as ap,_typeof$c as aq,jsx as ar,css as as,requireClassCallCheck as at,requireCreateClass as au,requireInherits as av,requireToConsumableArray as aw,require_typeof as ax,transparentize as ay,convertRemToPx as az,reactDomExports as b,Select as b$,lib$3 as b0,parseToRgba as b1,assertNever as b2,DeckGlJsonChart$1 as b3,DEFAULT_IFRAME_FEATURE_POLICY as b4,DEFAULT_IFRAME_SANDBOX_POLICY as b5,darken as b6,BaseButtonSize as b7,BaseButtonKind as b8,BaseButtonTooltip as b9,LabelVisibilityMessage as bA,StyledWidgetLabelHelpInline as bB,themeColors as bC,isMobile_1 as bD,CAMERA_PERMISSION_URL as bE,StyledWidgetLabelHelp as bF,StyledSpinnerIcon as bG,AcceptFileValue as bH,chatInputAcceptFileProtoValueToEnum as bI,isFocusVisible as bJ,getOverride as bK,getOverrideProps as bL,Checkbox$1 as bM,StyledContent as bN,StyledCheckbox$1 as bO,BaseColorPicker$1 as bP,useStyletron as bQ,mergeOverride as bR,toObjectOverride as bS,Icon$1 as bT,UIDConsumer as bU,StatefulMenu as bV,mergeOverrides as bW,ChevronDown$1 as bX,ThemeContext as bY,forkFocus as bZ,forkBlur as b_,DynamicButtonLabel as ba,IsSidebarContext as bb,Placement as bc,getGray90 as bd,getIncreasingGreen as be,getDecreasingRed as bf,PlotlyChart$1 as bg,keysToSnakeCase as bh,WindowDimensionsContext as bi,Video$1 as bj,zip$1 as bk,FileUploaderState as bl,UploadedFileInfo as bm,StyledSpinner as bn,ENABLE_PERIPHERALS_DOCS_URL as bo,Icon$2 as bp,BaseButton as bq,blend as br,labelVisibilityProtoValueToEnum as bs,TooltipIcon as bt,WidgetLabel as bu,Tooltip as bv,styled as bw,getOverrides as bx,LocaleContext as by,ButtonGroup$1 as bz,_hasPath as c,without$1 as c0,fuzzyFilterSelectOptions as c1,TYPE as c2,VirtualDropdown as c3,classNames as c4,UISelectbox as c5,isValidFormId as c6,toPropertyKey as c7,_setPrototypeOf$a as c8,hexToRgb as c9,reactIsExports$1 as cA,NumberInput$1 as cB,withWrapper as ca,__awaiter as cb,PropTypes as cc,isFromWindows as cd,StyledWidgetInstructions as ce,isFromMac as cf,CUSTOM_INPUT_TYPE as cg,SIZE$1 as ch,DeleteAlt$1 as ci,ADJOINED as cj,filterOptions as ck,ENHANCER_POSITION as cl,pick$1 as cm,Slider$2 as cn,ChevronLeft as co,ChevronRight as cp,isInForm as cq,toString_1 as cr,TextInput$1 as cs,ThemeProvider$1 as ct,createThemedStyled as cu,createThemedUseStyletron as cv,createThemedWithStyle as cw,expandBorderStyles as cx,withStyle as cy,getAugmentedNamespace as cz,commonjsGlobal$2 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,useTheme as y,jsxs as z};
811
+ `);return jsx$1("div",{"data-testid":"stClearCacheDialog",children:jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:rt.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:rt.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(rt){var tt;return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,size:"auto",autoFocus:!1,children:[jsx$1(ModalHeader,{children:"Script execution error"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitSyntaxHighlighter$1,{showLineNumbers:!1,wrapLines:!1,children:(tt=rt.exception)!=null&&tt.message?rt.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:rt.onClose,children:"Close"})})]})}function settingsDialog(rt){return jsx$1(SettingsDialog,{...rt})}function warningDialog(rt){return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:rt.title}),jsx$1(ModalBody$1,{children:rt.msg})]})}function deployErrorDialog({title:rt,msg:tt,onClose:et,onContinue:nt,onTryAgain:ot}){const at=()=>{et(),nt&&nt()};return jsxs(Modal,{isOpen:!0,onClose:et,children:[jsx$1(ModalHeader,{children:rt}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:tt})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ot,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:at,children:nt?"Continue anyway":"Close"})]})]})}function noDialog({onClose:rt}){return jsx$1(Modal,{isOpen:!1,onClose:rt})}function typeNotRecognizedDialog(rt){return jsx$1(Modal,{isOpen:!0,onClose:rt.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${rt.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(tt){this.onSessionEvent.emit(tt)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(rt,tt,et,nt){if(!isObject(rt))return rt;tt=castPath$1(tt,rt);for(var ot=-1,at=tt.length,st=at-1,ut=rt;ut!=null&&++ot<at;){var ct=toKey(tt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return rt;if(ot!=st){var dt=ut[ct];pt=nt?nt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(tt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return rt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(rt,tt,et){for(var nt=-1,ot=tt.length,at={};++nt<ot;){var st=tt[nt],ut=baseGet(rt,st);et(ut,st)&&baseSet(at,castPath(st,rt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(rt,tt){return basePickBy(rt,tt,function(et,nt){return hasIn(rt,nt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(rt,tt){return rt==null?{}:basePick(rt,tt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",log$2=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor(tt){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=tt}async initialize({gatherUsageStats:tt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=tt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(log$2.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),log$2.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(tt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([tt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(tt,et))}setMetadata(tt){this.metadata=tt}async requestDefaultMetricsConfig(){const tt=p$4();if(tt){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,log$2.error("Failed to fetch metrics config: ",et.status);else{const nt=await et.json();this.metricsUrl=nt.url??void 0,tt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){log$2.error("Failed to fetch metrics config:",et)}}send(tt,et={}){const nt=this.buildEventProto(tt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(tt,nt):this.track(nt)}sendPendingEvents(){this.pendingEvents.forEach(([tt,et])=>{this.send(tt,et)}),this.pendingEvents=[]}async track(tt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tt.toJSON())});await fetch(et)}postMessageEvent(tt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:tt,data:et})}buildEventProto(tt,et){const nt=new MetricsEvent({event:tt,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(tt==="menuClick")nt.label=et.label;else if(tt==="pageProfile")return new MetricsEvent({...nt,...et});return nt}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 tt="ajs_anonymous_id",et=p$4(),nt=f$3(tt),ot=et?window.localStorage.getItem(tt):null,at=new Date;if(at.setFullYear(new Date().getFullYear()+1),nt)this.anonymousId=nt,et&&window.localStorage.setItem(tt,nt);else if(ot){try{this.anonymousId=JSON.parse(ot)}catch{this.anonymousId=ot}setCookie(tt,this.anonymousId,at)}else this.anonymousId=v4(),setCookie(tt,this.anonymousId,at),et&&window.localStorage.setItem(tt,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:rt})=>{const tt=hasLightBackgroundColor(rt);return{position:"absolute",background:rt.colors.bgColor,color:rt.colors.bodyText,top:rt.spacing.none,left:rt.spacing.none,right:rt.spacing.none,bottom:rt.spacing.none,colorScheme:tt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:rt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:rt,toggleRecordAudio:tt,recordAudio:et,startRecording:nt})=>{const[ot,at]=reactExports.useState(et),st=reactExports.useCallback(ct=>{const{checked:pt}=ct.target;pt!==ot&&(at(pt),tt())},[ot,tt]),ut=reactExports.useCallback(()=>{nt(),rt()},[nt,rt]);return jsxs(Modal,{isOpen:!0,onClose:rt,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:rt})=>({width:rt.sizes.full,borderRadius:rt.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:rt})=>({display:"flex",flexDirection:"column",width:rt.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:rt})=>({display:"flex",flexDirection:"row",paddingTop:rt.spacing.md,paddingBottom:rt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:rt})=>({paddingRight:rt.spacing.lg,textAlign:"right",color:rt.colors.gray,fontWeight:rt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:rt})=>({flex:1,paddingRight:rt.spacing.lg,marginRight:"6em",[`@media (max-width: ${rt.breakpoints.sm})`]:{marginRight:rt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:rt})=>({marginTop:rt.spacing.sm,marginBottom:rt.spacing.none,fontSize:rt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:rt})=>({marginTop:rt.spacing.twoXS})),VideoRecordedDialog=({onClose:rt,videoBlob:tt,fileName:et})=>{const nt=URL.createObjectURL(tt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",nt),at.setAttribute("download",`${et}.webm`),at.click(),rt()};return jsxs(Modal,{isOpen:!0,onClose:rt,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:nt,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:rt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:rt.spacing.twoXL,marginLeft:rt.spacing.sm,fontSize:rt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:rt})=>({margin:rt.spacing.none})),UnsupportedBrowserDialog=({onClose:rt})=>jsxs(Modal,{isOpen:!0,onClose:rt,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:rt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:rt.sizes.full,height:rt.sizes.full,fontSize:"40vh",color:rt.colors.red,fontWeight:rt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${rt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:rt,endCallback:tt})=>{const[et,nt]=reactExports.useState(rt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&nt(at),at===0&&tt()},children:jsx$1("span",{children:et})},`frame${et}`)},log$1=loglevelExports$1.getLogger("withScreencast");function withScreencast(rt){const tt=et=>{const{testOverride:nt}=et,ot=reactExports.useRef(null),[at,st]=reactExports.useState("streamlit-screencast"),[ut,ct]=reactExports.useState(!1),[pt,dt]=reactExports.useState(void 0),[ft,bt]=reactExports.useState(nt||"OFF"),ht=reactExports.useCallback(()=>{ct(Et=>!Et)},[]),mt=reactExports.useCallback(async()=>{if(!(ft==="OFF"||m$4(ot.current))){if(ft==="COUNTDOWN"){bt("OFF");return}if(ft==="RECORDING"){const Et=ot.current;if(!Et||Et.getState()==="inactive")bt("OFF");else{const zt=await Et.stop();dt(zt),bt("PREVIEW_FILE")}}}},[ft]),Ot=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}ot.current=new ScreenCastRecorder({recordAudio:ut,onErrorOrStop:()=>{mt().catch(Et=>log$1.warn(`withScreencast.stopRecording threw an error: ${Et}`))}});try{await ot.current.initialize()}catch(Et){log$1.warn(`ScreenCastRecorder.initialize error: ${Et}`),bt("UNSUPPORTED");return}bt("COUNTDOWN")},[ut,mt]),yt=reactExports.useCallback(Et=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}if(ft==="OFF"){st(Et),bt("SETUP");return}mt().catch(zt=>log$1.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[ft,mt]),Mt=reactExports.useCallback(async()=>{if(m$4(ot.current))throw new Error("Countdown finished but recorder is null");ot.current.start()?bt("RECORDING"):mt().catch(zt=>log$1.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[mt]),At=reactExports.useCallback(()=>{bt("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(rt,{...et,screenCast:{currentState:ft,toggleRecordAudio:ht,startRecording:yt,stopRecording:mt}}),ft==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:At}),ft==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ut,onClose:At,startRecording:Ot,toggleRecordAudio:ht}),ft==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Mt}),ft==="PREVIEW_FILE"&&pt&&jsx$1(VideoRecordedDialog,{onClose:At,videoBlob:pt,fileName:at})]})};return tt.displayName=`withScreencast(${rt.displayName||rt.name||"Component"})`,hoistNonReactStatics$2(tt,rt)}const showDevelopmentOptions=(rt,tt)=>tt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==tt||Config.ToolbarMode.MINIMAL==tt?!1:rt||isLocalhost();function getTitle(rt){return rt||"Streamlit"}class StrategyV1{constructor(tt){this.appNav=tt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(tt){var st,ut;this.appPages=tt.appPages,this.currentPageScriptHash=tt.pageScriptHash,this.hideSidebarNav=((st=tt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],nt=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(nt,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(tt){const{appPages:et}=tt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(tt){var ot;const{pageName:et}=tt;this.appNav.onPageNotFound(et);const nt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=nt,[{currentPageScriptHash:nt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:nt})}]}handleNavigation(tt){}findPageByUrlPath(tt){return this.appPages.length===0?null:this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(tt,et,nt){return AppRoot.empty(et,!1,nt,tt.logo)}}class StrategyV2{constructor(tt){this.appNav=tt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(tt){var et;return this.mainScriptHash=tt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=tt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(tt){}handlePageNotFound(tt){const{pageName:et}=tt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(tt){const{sections:et,position:nt,appPages:ot}=tt;this.appPages=ot,this.hideSidebarNav=nt===Navigation.Position.HIDDEN;const at=tt.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:tt.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(tt){return this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(tt,et,nt){return tt.filterMainScriptElements(et)}}class AppNavigation{constructor(tt,et,nt,ot){this.hostCommunicationMgr=tt,this.onUpdatePageUrl=et,this.onPageNotFound=nt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(tt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(tt)}handleNavigation(tt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(tt)}handlePagesChanged(tt){return this.strategy.handlePagesChanged(tt)}handlePageNotFound(tt){return this.strategy.handlePageNotFound(tt)}findPageByUrlPath(tt){return this.strategy.findPageByUrlPath(tt)}handlePageConfigChanged(tt){this.isPageIconSet=!!tt.favicon,this.isPageTitleSet=!!tt.title}clearPageElements(tt,et,nt){return this.strategy.clearPageElements(tt,et,nt)}}var define_PACKAGE_METADATA_default={version:"1.42.0"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",log=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor(tt){super(tt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(nt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:nt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(nt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);nt===at.name&&ut?this.props.theme.setTheme(at):nt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=nt=>{if(log.info(`Connection state changed from ${this.state.connectionState} to ${nt}`),nt===ConnectionState.CONNECTED){log.info("Reconnected to server.");const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(log.info("Requesting a script run."),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:nt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:nt})},this.handleGitInfoChanged=nt=>{this.setState({gitInfo:nt})},this.handleCustomParentMessage=nt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:nt.message}):log.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=nt=>{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(nt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,nt.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,nt.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);log.error(st),this.showError("Bad message format",st.message)}},this.handleLogo=(nt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(nt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=nt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=nt;this.appNavigation.handlePageConfigChanged(nt),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=nt=>{const{queryString:ot}=nt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=nt=>{const ot=nt?`You have requested page /${nt}, 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=nt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(nt))},this.onPageIconChanged=nt=>{handleFavicon(nt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=nt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(nt))},this.handleNavigation=nt=>{this.maybeSetState(this.appNavigation.handleNavigation(nt))},this.handlePageProfileMsg=nt=>{var st,ut,ct;const ot=PageProfile.toObject(nt),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=nt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(nt.fragmentId,!0)},nt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=nt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,d$3(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!nt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=nt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(nt),nt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:nt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(nt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{pathname:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?nt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",mt=`${ut==="/"?"":ut}/${dt}${bt}`;window.history.pushState({},"",mt)}}},this.handleNewSession=nt=>{const ot=nt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(nt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=nt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const mt=nt.config,Ot=nt.customTheme;this.processThemeInput(Ot),this.setState({allowRunOnSave:mt.allowRunOnSave,hideTopBar:mt.hideTopBar,toolbarMode:mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(nt)),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=nt=>{const ot=nt.initialize,at=nt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(nt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:nt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===nt;m$4(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=nt=>{this.props.theme.setTheme(nt),this.setState({hideColoredLine:!isPresetTheme(nt)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(nt.emotion)})},this.createThemeHash=nt=>{if(!nt)return"hash_for_undefined_custom_theme";const ot=Object.entries(nt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=nt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=nt;if(this.setState({userSettings:nt}),ot!==at&&this.isServerConnected()){const st=new BackMsg$1({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(nt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,nt,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 nt=new BackMsg$1({debugShutdownRuntime:!0});nt.type="debugShutdownRuntime",this.sendBackMsg(nt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({debugDisconnectWebsocket:!0});nt.type="debugDisconnectWebsocket",this.sendBackMsg(nt)}},this.debugClearForwardMsgCache=()=>{var nt,ot;isLocalhost()&&((ot=(nt=this.connectionManager)==null?void 0:nt.websocketConnection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(nt=>{clearInterval(nt)}),this.setState({autoReruns:[]})},this.rerunScript=(nt=!1)=>{if(this.closeDialog(),!this.isServerConnected()){log.error("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}),nt===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){log.error("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg$1({loadGitInfo:!0}))},this.onPageChange=nt=>{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,nt)},this.isAppInReadyState=nt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&nt.scriptRunState===ScriptRunState.RUNNING&&nt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(nt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){log.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{pathname: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$1({rerunScript:{queryString:dt,widgetStates:nt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}}))},this.stopScript=()=>{if(!this.isServerConnected()){log.error("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const nt=new BackMsg$1({stopScript:!0});nt.type="stopScript",this.sendBackMsg(nt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const nt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(nt)}else log.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const nt={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(nt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const nt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(nt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const nt=new BackMsg$1({clearCache:!0});nt.type="clearCache",this.sendBackMsg(nt)}else log.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({appHeartbeat:!0});nt.type="appHeartbeat",this.sendBackMsg(nt)}else log.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=nt=>{this.connectionManager?(log.info(nt),this.connectionManager.sendMessage(nt)):log.error(`Not connected. Cannot send back message: ${nt}`)},this.handleConnectionError=nt=>{this.showError("Connection error",nt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(nt=!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:nt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:nt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:nt==null?void 0:nt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:nt}=this.state;if(nt!==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:nt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${nt}-${at}`)},this.handleFullScreen=nt=>{this.setState({isFullScreen:nt})},this.setLibConfig=nt=>{this.setState({libConfig:nt})},this.setAppConfig=nt=>{this.setState({appConfig:nt})},this.addScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(nt)}))},this.removeScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,nt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:nt}=this.state,ot=nt&&nt.length>0?nt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:nt}=this.state;return nt&&(nt==null?void 0:nt.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=(nt,ot)=>{if(this.isServerConnected()){const at=new BackMsg$1({fileUrlsRequest:{requestId:nt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=nt=>{switch(nt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=nt=>{nt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(tt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(tt.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,hideColoredLine:!1,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:nt=>this.setState({formsData:nt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:tt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:nt=>{this.setState({inputsDisabled:nt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:nt=>this.setState({isOwner:nt}),fileUploadClientConfigChanged:nt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(nt)},hostMenuItemsChanged:nt=>{this.setState({hostMenuItems:nt})},hostToolbarItemsChanged:nt=>{this.setState({hostToolbarItems:nt})},hostHideSidebarNavChanged:nt=>{this.setState({hostHideSidebarNav:nt})},sidebarChevronDownshiftChanged:nt=>{this.setState({sidebarChevronDownshift:nt})},pageLinkBaseUrlChanged:nt=>{this.setState({pageLinkBaseUrl:nt})},queryParamsChanged:nt=>{this.setState({queryParams:nt})},deployedAppMetadataChanged:nt=>{this.setState({deployedAppMetadata:nt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var nt;(nt=this.connectionManager)==null||nt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:nt=>this.widgetMgr.setFormsWithUploadsInProgress(nt),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({getLastSessionId:()=>{var tt;return(tt=this.sessionInfo.last)==null?void 0:tt.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:tt=>{const{allowedOrigins:et,useExternalAuthToken:nt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=tt,pt={allowedOrigins:et,useExternalAuthToken:nt,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 tt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(tt).map(nt=>Math.ceil(nt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.BBjdpeP0.js").then(tt=>tt.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(tt,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 tt;(tt=this.connectionManager)==null||tt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(tt,et){log.error(et);const nt={type:DialogType.WARNING,title:tt,msg:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1}),onClose:()=>{}};this.openDialog(nt)}hasStreamlitVersionChanged(tt){var nt;let et;if(((nt=window.__streamlit)==null?void 0:nt.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?et=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(et=this.sessionInfo.current.streamlitVersion),et){const{environmentInfo:ot}=tt;if(d$3(ot)&&d$3(ot.streamlitVersion))return et!=ot.streamlitVersion}return!1}maybeSetState(tt){if(tt){const[et,nt]=tt;this.setState(et,nt)}}processThemeInput(tt){const et=this.createThemeHash(tt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const nt=!isPresetTheme(this.props.theme.activeTheme);if(tt){const ot=createTheme(CUSTOM_THEME_NAME,tt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||nt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),nt&&this.setAndSendTheme(getHostSpecifiedTheme())}handleScriptFinished(tt){if(tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:nt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(nt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(nt=>getElementId(nt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&tt!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(tt,et,nt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:nt,appHash:tt,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(tt){this.setState({dialog:tt})}render(){const{allowRunOnSave:tt,connectionState:et,dialog:nt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,hideColoredLine:ht,expandSidebarNav:mt,currentPageScriptHash:Ot,hostHideSidebarNav:yt,pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,hostMenuItems:St,hostToolbarItems:Et,libConfig:zt,appConfig:vt,inputsDisabled:Tt,appPages:$t,navSections:Rt}=this.state,wt=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),It=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),kt=nt?StreamlitDialog({...nt,onClose:this.closeDialog}):null,Ft=Tt||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:!ht&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,gitInfo:this.state.gitInfo,appConfig:vt},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:Ot,libConfig:zt,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:It,"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:tt}),jsx$1(ToolbarActions,{hostToolbarItems:Et,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:St,developmentMode:wt,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:Ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:$t,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Ot,hideSidebarNav:bt||yt,expandSidebarNav:mt}),kt]})})})})}}const AppWithScreencast=withScreencast(App);function useThemeManager(){const rt=getDefaultTheme(),[tt,et]=reactExports.useState(rt),[nt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(rt)?[]:[rt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==tt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,tt]),pt=reactExports.useCallback(()=>{tt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[tt.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)}},[tt,at,pt]),[{setTheme:ct,activeTheme:tt,addThemes:ut,availableThemes:at,setImportedTheme:dt},nt]}const ThemedApp=({streamlitExecutionStartedAt:rt})=>{const[tt,et]=useThemeManager(),{activeTheme:nt}=tt,ot=nt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:nt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreencast,{theme:tt,streamlitExecutionStartedAt:rt})]})})})},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{isArguments_1 as $,PLACEMENT as A,ACCESSIBILITY_TYPE as B,hasLightBackgroundColor as C,DynamicIcon as D,EmotionIconBase as E,Fragment as F,Popover$1 as G,require$$0 as H,toString$7 as I,m$4 as J,merge$4 as K,numbro$1 as L,d$3 as M,hooks as N,getTimezone as O,PortalContext as P,moment$1 as Q,React$1 as R,isIntegerType as S,isUnsignedIntegerType as T,isDurationType as U,isPeriodType as V,format as W,isBooleanType as X,_baseKeys as Y,_getTag as Z,_extends$Q as _,range$1 as a,ensureError as a$,isArray_1 as a0,isArrayLike_1 as a1,isBufferExports as a2,_isPrototype as a3,isTypedArray_1 as a4,DataFrameCellType as a5,Field$1 as a6,Null as a7,isTimeType as a8,convertTimeToDate as a9,mix$1 as aA,getStyledCell as aB,isEqual$1 as aC,StyledTooltipContentWrapper as aD,StreamlitMarkdown$1 as aE,LibContext as aF,Resizable as aG,getGray70 as aH,getGray30 as aI,getCategoricalColorsArray as aJ,getDivergingColorsArray as aK,getSequentialColorsArray as aL,getBlue80 as aM,debounce$4 as aN,Global as aO,_baseMerge as aP,_createAssigner as aQ,withTheme as aR,toaster as aS,Kind as aT,AlertElement as aU,_assertThisInitialized as aV,StyledInlineCode as aW,ErrorElement as aX,Skeleton$1 as aY,Skeleton as aZ,hoistNonReactStatics$2 as a_,isDecimalType as aa,isStringType as ab,isEmptyType as ac,isDatetimeType as ad,isDateType as ae,isObjectType as af,isBytesType as ag,isNumericType as ah,isCategoricalType as ai,isListType as aj,isRangeIndexType as ak,loglevelExports$1 as al,Arrow$2 as am,isArray$k as an,_defineProperty$p as ao,_objectWithoutPropertiesLoose$j as ap,_typeof$c as aq,jsx as ar,css as as,requireClassCallCheck as at,requireCreateClass as au,requireInherits as av,requireToConsumableArray as aw,require_typeof as ax,transparentize as ay,convertRemToPx as az,reactDomExports as b,Select as b$,lib$3 as b0,parseToRgba as b1,assertNever as b2,DeckGlJsonChart$1 as b3,DEFAULT_IFRAME_FEATURE_POLICY as b4,DEFAULT_IFRAME_SANDBOX_POLICY as b5,darken as b6,BaseButtonSize as b7,BaseButtonKind as b8,BaseButtonTooltip as b9,LabelVisibilityMessage as bA,StyledWidgetLabelHelpInline as bB,themeColors as bC,isMobile_1 as bD,CAMERA_PERMISSION_URL as bE,StyledWidgetLabelHelp as bF,StyledSpinnerIcon as bG,AcceptFileValue as bH,chatInputAcceptFileProtoValueToEnum as bI,isFocusVisible as bJ,getOverride as bK,getOverrideProps as bL,Checkbox$1 as bM,StyledContent as bN,StyledCheckbox$1 as bO,BaseColorPicker$1 as bP,useStyletron as bQ,mergeOverride as bR,toObjectOverride as bS,Icon$1 as bT,UIDConsumer as bU,StatefulMenu as bV,mergeOverrides as bW,ChevronDown$1 as bX,ThemeContext as bY,forkFocus as bZ,forkBlur as b_,DynamicButtonLabel as ba,IsSidebarContext as bb,Placement as bc,getGray90 as bd,getIncreasingGreen as be,getDecreasingRed as bf,PlotlyChart$1 as bg,keysToSnakeCase as bh,WindowDimensionsContext as bi,Video$1 as bj,zip$1 as bk,FileUploaderState as bl,UploadedFileInfo as bm,StyledSpinner as bn,ENABLE_PERIPHERALS_DOCS_URL as bo,Icon$2 as bp,BaseButton as bq,blend as br,labelVisibilityProtoValueToEnum as bs,TooltipIcon as bt,WidgetLabel as bu,Tooltip as bv,styled as bw,getOverrides as bx,LocaleContext as by,ButtonGroup$1 as bz,_hasPath as c,without$1 as c0,fuzzyFilterSelectOptions as c1,TYPE as c2,VirtualDropdown as c3,classNames as c4,UISelectbox as c5,isValidFormId as c6,toPropertyKey as c7,_setPrototypeOf$a as c8,hexToRgb as c9,reactIsExports$1 as cA,NumberInput$1 as cB,withWrapper as ca,__awaiter as cb,PropTypes as cc,isFromWindows as cd,StyledWidgetInstructions as ce,isFromMac as cf,CUSTOM_INPUT_TYPE as cg,SIZE$1 as ch,DeleteAlt$1 as ci,ADJOINED as cj,filterOptions as ck,ENHANCER_POSITION as cl,pick$1 as cm,Slider$2 as cn,ChevronLeft as co,ChevronRight as cp,isInForm as cq,toString_1 as cr,TextInput$1 as cs,ThemeProvider$1 as ct,createThemedStyled as cu,createThemedUseStyletron as cv,createThemedWithStyle as cw,expandBorderStyles as cx,withStyle as cy,getAugmentedNamespace as cz,commonjsGlobal$2 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,useTheme as y,jsxs as z};